/* Clone Army public hub: a Republic deployment board. Navy hull, armour
   white, legion blue for what can be used, Republic red only for "live". */
:root {
  color-scheme: dark;
  --night: #0b1524;
  --hull: #132238;
  --hull-2: #1a2c47;
  --seam: #26395a;
  --white: #e9ebe4;
  --steel: #8a9ab2;
  --blue: #4d8bff;
  --blue-dim: #2c5fc4;
  --red: #d8424a;
  --green: #4fbf7a;
  --yellow: #f2c14e;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --wrap: 1280px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--night);
  color: var(--white);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--blue); color: #fff; padding: 8px 14px; z-index: 10; }
.skip:focus { left: 16px; }

/* Top bar */
.bar {
  max-width: var(--wrap); margin: 0 auto; padding: 18px 32px;
  display: flex; align-items: center; gap: 36px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; border-radius: 8px; display: block; }
.brand-name { font: 800 26px/0.9 var(--display); letter-spacing: 0.02em; text-transform: uppercase; }
.brand-name small { display: block; font: 500 13px/1.3 var(--body); letter-spacing: 0.04em; color: var(--steel); text-transform: none; margin-top: 3px; }
.bar nav { display: flex; gap: 26px; font-weight: 600; font-size: 15px; }
.bar nav a { text-decoration: none; color: var(--steel); }
.bar nav a:hover { color: var(--white); }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.regions { display: flex; background: var(--hull); border: 1px solid var(--seam); border-radius: 6px; padding: 3px; }
.region { background: none; border: 0; padding: 6px 12px; border-radius: 4px; font-weight: 600; font-size: 14px; color: var(--steel); }
.region.on { background: var(--blue); color: #fff; }
.region-one { font-weight: 600; color: var(--steel); font-size: 14px; }
.staff { font-size: 14px; color: var(--steel); text-decoration: none; }
.staff:hover { color: var(--white); }

main { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }

/* Hero: the busiest battle, on its own map */
.hero {
  position: relative; min-height: 480px; border-radius: 10px; overflow: hidden;
  display: flex; align-items: flex-end; background: var(--hull); isolation: isolate;
}
.hero-art {
  position: absolute; inset: 0; z-index: -2;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 0.8s ease;
}
.hero-art.ready { opacity: 1; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(11, 21, 36, 0.96) 0%, rgba(11, 21, 36, 0.82) 38%, rgba(11, 21, 36, 0.25) 75%, rgba(11, 21, 36, 0.1) 100%),
    linear-gradient(0deg, rgba(11, 21, 36, 0.9) 0%, rgba(11, 21, 36, 0) 45%);
}
/* A faint scan pattern, as on a holo display */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(233, 235, 228, 0.025) 0 1px, transparent 1px 3px);
}
.hero-body { padding: 56px 56px 52px; max-width: 760px; }
.hero-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-weight: 600; color: var(--white); font-size: 16px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--steel); flex: none; }
.hero.live .pulse { background: var(--red); box-shadow: 0 0 0 0 rgba(216, 66, 74, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(216, 66, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(216, 66, 74, 0); } }
h1 {
  font: 900 clamp(48px, 7.4vw, 104px)/0.88 var(--display);
  text-transform: uppercase; letter-spacing: 0.005em; margin: 0 0 20px;
  text-wrap: balance;
}
.hero-sub { margin: 0 0 30px; font-size: 19px; color: #c9cfda; max-width: 54ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--seam); background: rgba(19, 34, 56, 0.85); color: var(--white);
  padding: 12px 18px; border-radius: 6px; font-weight: 600; font-size: 15px; text-decoration: none;
}
.btn:hover { border-color: var(--steel); }
.btn-go { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-go:hover { background: #6a9eff; border-color: #6a9eff; }
.btn code { font: 500 14px/1 ui-monospace, "SFMono-Regular", Menlo, monospace; opacity: 0.85; }
.btn.done { background: var(--green); border-color: var(--green); color: #08210f; }
/* The players in it: one pip a slot */
.hero-roster {
  position: absolute; right: 40px; bottom: 44px; display: grid; grid-template-columns: repeat(8, 12px); gap: 6px;
}
.hero-roster i { width: 12px; height: 22px; border-radius: 2px; background: rgba(233, 235, 228, 0.14); }
.hero-roster i.in { background: var(--white); }

.notice { margin: 20px 0 0; padding: 14px 18px; border-radius: 6px; background: rgba(216, 66, 74, 0.1); border: 1px solid rgba(216, 66, 74, 0.4); color: #f1c7ca; }

/* Sections */
.block { margin-top: 72px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; border-bottom: 1px solid var(--seam); padding-bottom: 14px; }
h2 { font: 800 44px/1 var(--display); text-transform: uppercase; margin: 0; letter-spacing: 0.01em; }
h3 { font: 700 22px/1.1 var(--display); text-transform: uppercase; margin: 0 0 12px; letter-spacing: 0.02em; }
.block-note { margin: 0; color: var(--steel); font-weight: 500; }
.hint { color: var(--steel); font-size: 14px; margin: 16px 0 0; max-width: 80ch; }
kbd { font: 600 13px/1 ui-monospace, monospace; border: 1px solid var(--seam); border-bottom-width: 2px; border-radius: 4px; padding: 2px 6px; background: var(--hull); color: var(--white); }

/* Server cards */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.server { background: var(--hull); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--seam); }
.server.full-up { border-color: var(--blue-dim); }
.server-art { position: relative; aspect-ratio: 16 / 8; background: var(--hull-2) center / cover no-repeat; }
.server-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--hull) 0%, rgba(19, 34, 56, 0) 60%); }
.server-state { position: absolute; left: 14px; top: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 7px; background: rgba(11, 21, 36, 0.78); padding: 4px 10px; border-radius: 4px; font-size: 13px; font-weight: 600; }
.server-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--steel); }
.server-state.live::before { background: var(--red); }
.server-state.ready::before { background: var(--green); }
.server-body { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.server-name { font: 800 30px/0.95 var(--display); text-transform: uppercase; margin: 0; }
.server-map { color: var(--steel); font-weight: 500; margin: -6px 0 0; }
.slots { display: flex; align-items: center; gap: 12px; }
.slot-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(233, 235, 228, 0.1); overflow: hidden; }
.slot-bar span { display: block; height: 100%; background: var(--white); border-radius: 4px; }
.slot-count { font: 700 20px/1 var(--display); min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.server .btn { margin-top: auto; width: 100%; }
.btn-card { flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; }
.btn-card code { font-size: 13px; color: var(--steel); }
.server.down { opacity: 0.6; }

/* Service record */
.record-summary { margin: 0; color: #c9cfda; font-size: 18px; max-width: 60ch; }
.record-summary b { font: 800 26px/1 var(--display); color: var(--white); }
.ranks { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; color: var(--steel); font-size: 14px; margin-bottom: 26px; }
.ranks-title { color: var(--white); font-weight: 600; margin-right: 4px; }
.rank-key { display: inline-flex; align-items: center; gap: 7px; }
.rank-key small { color: #6c7b93; }
/* Rank markings, coloured as the Republic marked its clone officers' armour */
.insignia { display: inline-block; width: 22px; height: 12px; border-radius: 2px; flex: none; background: rgba(233, 235, 228, 0.12); position: relative; }
.insignia::after { content: ""; position: absolute; inset: 3px 4px; border-radius: 1px; background: currentColor; }
.r-cadet { color: rgba(233, 235, 228, 0.25); }
.r-trooper { color: var(--white); }
.r-sergeant { color: var(--green); }
.r-lieutenant { color: var(--blue); }
.r-captain { color: var(--red); }
.r-commander { color: var(--yellow); }

.board-tools { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs { display: flex; gap: 4px; background: var(--hull); border: 1px solid var(--seam); border-radius: 6px; padding: 3px; }
.tab { background: none; border: 0; padding: 8px 16px; border-radius: 4px; font-weight: 600; color: var(--steel); }
.tab.on { background: var(--blue); color: #fff; }
.find input { background: var(--hull); border: 1px solid var(--seam); border-radius: 6px; padding: 9px 14px; width: 260px; max-width: 100%; }
.find input::placeholder { color: #6c7b93; }

.podium { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 18px; }
.podium li { background: var(--hull); border: 1px solid var(--seam); border-radius: 8px; padding: 22px 24px; position: relative; overflow: hidden; min-width: 0; }
.podium li:first-child { background: linear-gradient(135deg, #1d3460 0%, var(--hull) 70%); border-color: var(--blue-dim); }
.podium .place { position: absolute; right: 14px; top: -6px; font: 900 110px/1 var(--display); color: rgba(233, 235, 228, 0.06); }
.podium .who { font: 800 34px/1 var(--display); text-transform: uppercase; margin: 10px 0 6px; overflow-wrap: anywhere; }
.podium li:first-child .who { font-size: 44px; }
.podium .stat { font: 800 52px/1 var(--display); font-variant-numeric: tabular-nums; }
.podium .stat small { font: 500 15px/1 var(--body); color: var(--steel); margin-left: 6px; }
.podium .rank-line { display: flex; align-items: center; gap: 8px; color: var(--steel); font-weight: 600; font-size: 14px; }

.board, .panel { background: var(--hull); border: 1px solid var(--seam); border-radius: 8px; overflow: hidden; }
.panel { padding: 20px 22px; }
.panel table { margin: 0 -22px; width: calc(100% + 44px); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h3 { margin: 0; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 600; font-size: 14px; color: var(--steel); padding: 12px 18px; border-bottom: 1px solid var(--seam); }
td { padding: 11px 18px; border-bottom: 1px solid rgba(38, 57, 90, 0.6); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(77, 139, 255, 0.06); }
.c-num { text-align: right; }
.c-pos { width: 56px; color: var(--steel); }
td.c-pos { font: 700 18px/1 var(--display); }
.trooper { display: flex; align-items: center; gap: 12px; min-width: 0; }
.trooper-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.account { font-size: 12px; font-weight: 600; color: var(--blue); border: 1px solid var(--blue-dim); border-radius: 3px; padding: 0 5px; }
.kd-hi { color: var(--white); font-weight: 600; }
.kd-lo { color: var(--steel); }
.board-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--seam); color: var(--steel); font-size: 14px; }
.pager { display: flex; gap: 8px; }
.pager button { background: var(--hull-2); border: 1px solid var(--seam); border-radius: 5px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.pager button:disabled { opacity: 0.35; cursor: default; }
.empty { text-align: center; color: var(--steel); padding: 28px; }
/* Quake colour codes in names */
.q0 { color: #8a9ab2; } .q1 { color: #ff5a5f; } .q2 { color: #6fdc8c; } .q3 { color: #ffd65c; } .q4 { color: #6fa1ff; }
.q5 { color: #5fe0ea; } .q6 { color: #e57bff; } .q7 { color: inherit; } .q8 { color: #ff9b45; } .q9 { color: #9aa3b5; }

/* Cantina */
.cantina { border: 1px solid var(--seam); border-radius: 8px; background: var(--hull); }
.cantina summary { padding: 16px 22px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.cantina summary::-webkit-details-marker { display: none; }
.cantina summary::after { content: "Show"; color: var(--blue); }
.cantina[open] summary::after { content: "Hide"; }
.cantina[open] summary { border-bottom: 1px solid var(--seam); }
.cantina-body { padding: 18px; display: grid; gap: 18px; }
.cantina-body .panel { background: var(--night); }
.cantina-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
.chart { height: 150px; display: flex; gap: 4px; align-items: flex-end; }
.chart span { flex: 1; background: var(--blue); border-radius: 2px 2px 0 0; min-height: 2px; }
.chart span.zero { background: var(--seam); }
.chart-ends { display: flex; justify-content: space-between; color: var(--steel); font-size: 13px; margin-top: 8px; }
.games { display: grid; gap: 2px; }
.game { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--seam); }
.game:last-child { border: 0; }
.game small { color: var(--steel); display: block; font-size: 13px; }
.game b { font: 700 22px/1 var(--display); }
.recent { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.recent li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--seam); font-size: 15px; }
.recent small { display: block; color: var(--steel); font-size: 13px; }
.up { color: var(--green); } .down-c { color: #ff8a90; } .flat { color: var(--steel); }

.foot { max-width: var(--wrap); margin: 80px auto 0; padding: 26px 32px 40px; border-top: 1px solid var(--seam); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--steel); font-size: 14px; }

@media (max-width: 900px) {
  .bar { flex-wrap: wrap; gap: 14px 24px; padding: 16px 20px; }
  .bar nav { order: 3; width: 100%; }
  main { padding: 0 20px; }
  .hero { min-height: 0; }
  .hero-body { padding: 36px 26px 34px; }
  .hero-roster { display: none; }
  .podium { grid-template-columns: 1fr; }
  .cantina-grid { grid-template-columns: 1fr; }
  .recent { grid-template-columns: 1fr; }
  .c-hide { display: none; }
}
@media (max-width: 560px) {
  .bar { padding: 14px 16px; }
  main { padding: 0 16px; }
  .staff { display: none; }
  h2 { font-size: 36px; }
  .hero-sub { font-size: 17px; }
  .btn code { display: none; }
  th, td { padding: 10px 10px; }
  .trooper-name { max-width: 150px; }
  .foot { padding: 22px 16px 32px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero.live .pulse { animation: none; }
  .hero-art { transition: none; }
}
