/* Orbitron (SIL Open Font License 1.1, https://fonts.google.com/specimen/Orbitron), served
   from here so pages make no outside requests. One variable font file for every weight. */
@font-face {
  font-family: Orbitron; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("orbitron.woff2") format("woff2");
}
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --good: #006300;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --zerg: #7b3fa0; --terran: #2a78d6; --protoss: #c98500;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --good: #0ca30c;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --zerg: #a77bd0; --terran: #3987e5; --protoss: #e0a526;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, 0.10); --accent: #3987e5;
  --good: #0ca30c;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --zerg: #a77bd0; --terran: #3987e5; --protoss: #e0a526;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* class rules like .controls must not override it */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
a { color: inherit; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.3; }
h1 { font-size: 1.3rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; }

.topbar {
  position: sticky; top: 0; z-index: 2;
  display: flex; gap: 12px; align-items: center;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; text-decoration: none; white-space: nowrap; }


.page { max-width: 960px; margin: 0 auto; padding: 16px; }
.meta, .sub, .note { color: var(--ink-2); }
.sub { font-size: 0.85rem; font-weight: 400; }
.note { font-size: 0.85rem; }
.warn { color: var(--ink-2); }
.empty { color: var(--ink-2); padding: 32px 0; text-align: center; }

.games { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.game {
  display: block; padding: 12px 14px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.game:hover, .game:focus-visible { border-color: var(--accent); }
.game-head { display: flex; gap: 10px; align-items: baseline; font-size: 0.85rem; color: var(--ink-2); }
.game-head .length { margin-left: auto; font-variant-numeric: tabular-nums; }
.matchup { font-weight: 700; color: var(--ink); }
.players { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: 4px 0 2px; font-size: 1rem; }
.player.loser { color: var(--ink-2); }
.player.winner { font-weight: 700; }
.vs { color: var(--muted); font-size: 0.8rem; }
.map { font-size: 0.85rem; color: var(--ink-2); }

.race {
  display: inline-grid; place-items: center;
  width: 1.4em; height: 1.4em; margin-right: 4px;
  border-radius: 4px; font-size: 0.75em; font-weight: 700; color: #fff;
  background: var(--muted); vertical-align: 0.1em;
}
.race-zerg { background: var(--zerg); }
.race-terran { background: var(--terran); }
.race-protoss { background: var(--protoss); }

.badge {
  display: inline-block; margin-left: 4px; padding: 0 6px;
  border-radius: 999px; font-size: 0.75rem; font-weight: 700;
  color: var(--good); border: 1px solid currentColor;
}
.badge.muted { color: var(--muted); }

.pager { display: flex; gap: 16px; justify-content: center; padding: 16px 0; }

.card {
  margin-bottom: 12px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.roster { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 6px; }
.roster li { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.roster li.loser strong { color: var(--ink-2); }
.button {
  display: inline-block; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border); text-decoration: none; font-size: 0.9rem;
}
.button:hover { border-color: var(--accent); }

.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.s1 { --c: var(--s1); } .s2 { --c: var(--s2); } .s3 { --c: var(--s3); } .s4 { --c: var(--s4); }
.s5 { --c: var(--s5); } .s6 { --c: var(--s6); } .s7 { --c: var(--s7); } .s8 { --c: var(--s8); }
.swatch { background: var(--c); }

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; padding: 0; font-size: 0.85rem; color: var(--ink-2); }
.chart { padding: 4px 0 24px 34px; }
.chart.with-labels { padding-right: 84px; }
.plot { position: relative; height: 200px; touch-action: pan-y; cursor: crosshair; }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.gridline { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grid); }
.gridline.base { border-top-color: var(--axis); }
.ytick, .xtick {
  position: absolute; color: var(--muted); font-size: 11px; line-height: 1;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ytick { right: 100%; margin-right: 6px; transform: translateY(-50%); }
.xtick { top: 100%; margin-top: 8px; transform: translateX(-50%); }
.end-label {
  position: absolute; left: 100%; margin-left: 8px; max-width: 76px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-2); font-size: 12px; transform: translateY(-50%);
}
@media (max-width: 480px) {
  .chart.with-labels { padding-right: 8px; }
  .end-label { display: none; }  /* the legend above names every series */
}
.line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.crosshair { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--axis); pointer-events: none; }
.dot {
  position: absolute; width: 10px; height: 10px; border-radius: 50%; pointer-events: none;
  background: var(--c); box-shadow: 0 0 0 2px var(--surface); transform: translate(-50%, -50%);
}
.tooltip {
  position: absolute; top: 0; z-index: 1; pointer-events: none;
  padding: 6px 10px; font-size: 0.8rem; white-space: nowrap;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.tooltip .row { display: flex; align-items: center; gap: 6px; }
.tooltip .row b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }

.table-view { margin-top: 8px; font-size: 0.85rem; }
.table-view summary { cursor: pointer; color: var(--ink-2); }
.scroll { overflow-x: auto; }
.table-view table { border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { padding: 2px 10px; text-align: right; border-bottom: 1px solid var(--grid); }

.builds { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.build ol, .chat { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.build li, .chat li { display: flex; gap: 10px; padding: 2px 0; border-bottom: 1px solid var(--grid); }
.build time, .chat time { flex: none; width: 3.2em; color: var(--muted); font-variant-numeric: tabular-nums; }
.build .kind-building { font-weight: 600; }
.build .kind-tech, .build .kind-upgrade { color: var(--accent); }
.chat li { display: block; }
.chat time { display: inline-block; }
.chat strong { margin-right: 6px; }

/* --- detail page actions ------------------------------------------------------- */
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.button.primary:hover { filter: brightness(1.08); }

/* --- web replay player ----------------------------------------------------------- */
.player-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.player-head .back { text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.player-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage {
  position: relative; width: 100%; height: min(70vh, 640px);
  background: #000; border-radius: 10px; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.stage canvas { display: block; width: 100% !important; height: 100% !important; image-rendering: pixelated; }
.loading {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 8px;
  padding: 16px; text-align: center; color: #eee; background: rgba(0, 0, 0, 0.85);
}
.loading progress { width: min(320px, 70vw); }
.loading .sub { color: #bbb; }
.controls { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.controls.secondary { flex-wrap: wrap; font-size: 0.9rem; }
.controls #play {
  min-width: 48px; min-height: 44px; font-size: 1.1rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
}
.controls #seek { flex: 1; min-width: 0; height: 32px; }
.controls .clock { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.controls .label { color: var(--ink-2); }
/* A label and its buttons wrap to the next line together. */
.controls .control-group { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.speeds { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.speeds button {
  min-height: 36px; padding: 0 12px; border: 0; background: var(--surface); color: var(--ink); font: inherit;
}
.speeds button + button { border-left: 1px solid var(--border); }
.speeds button.active { background: var(--accent); color: #fff; }
/* Player names in their colors with live stats, over the top-right of the game screen. */
.scoreboard {
  position: absolute; top: 6px; right: 6px; max-width: calc(100% - 12px);
  list-style: none; margin: 0; padding: 4px 8px; display: grid; grid-template-columns: auto auto; gap: 3px 8px;
  font-size: 0.8rem; line-height: 1.25; color: #eee; background: rgba(0, 0, 0, 0.55);
  border-radius: 6px; pointer-events: none; text-shadow: 0 1px 2px #000;
}
.scoreboard:empty { display: none; }
.scoreboard li { display: contents; }
.scoreboard strong {
  /* Lighten the darker player colors (blue, brown) so they stay readable on the map. */
  color: color-mix(in srgb, var(--pcolor) 75%, #fff);
  border-left: 3px solid var(--pcolor); padding-left: 5px;
  max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.scoreboard .stats { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 600px) {
  .scoreboard { font-size: 0.7rem; padding: 3px 6px; }
}
/* Recent chat, bottom left right above the minimap (play.js sets `bottom`), as in the game. */
.chat-overlay {
  position: absolute; bottom: var(--chat-bottom, 140px); left: 6px; max-width: 60%; margin: 0; padding: 0;
  list-style: none; display: grid; gap: 2px; font-size: 0.85rem; line-height: 1.3;
  color: #fff; pointer-events: none; text-shadow: 0 1px 2px #000, 0 0 3px #000;
}
.chat-overlay li { padding: 1px 6px; background: rgba(0, 0, 0, 0.45); border-radius: 4px; overflow-wrap: anywhere; }
.viewer.show-bar .chat-overlay { bottom: max(var(--chat-bottom, 140px), var(--bar-height, 0px)); }
.chat-overlay strong { color: color-mix(in srgb, var(--pcolor, #ccc) 75%, #fff); }
@media (max-width: 600px) {
  .chat-overlay { font-size: 0.72rem; max-width: 70%; }
}
/* The viewer is the game screen with the play/seek bar over its bottom: a tap shows the
   bar, another tap (or a few seconds) hides it. Full screen: the viewer fills the screen;
   without the Fullscreen API (iPhone Safari) the same layout fills the page instead. */
.viewer { position: relative; }
.fullscreen-toggle {
  position: absolute; right: 6px; bottom: 6px; width: 40px; height: 40px; padding: 8px;
  border: 0; border-radius: 8px; background: rgba(0, 0, 0, 0.55); color: #fff; cursor: pointer;
}
.fullscreen-toggle svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fullscreen-toggle .icon-exit, .viewer.is-full .fullscreen-toggle .icon-enter { display: none; }
.viewer.is-full .fullscreen-toggle .icon-exit { display: block; }
.viewer.is-full {
  position: fixed; inset: 0; z-index: 1000; background: #000;
  display: flex; flex-direction: column; width: 100vw; height: 100dvh;
}
.viewer.is-full .stage { flex: 1; height: auto; border-radius: 0; }
.viewer .controls {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px 12px; flex-wrap: wrap; row-gap: 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8) 40%); color: #fff;
  border-radius: 0 0 10px 10px; transition: opacity 0.2s; opacity: 0; pointer-events: none;
}
.viewer.show-bar .controls { opacity: 1; }
/* The bar leaves the minimap (bottom left) uncovered; play.js sets --minimap-right. */
.viewer .controls#controls { left: var(--minimap-right, 0px); border-bottom-left-radius: 0; }
/* Only the bar's controls take taps; the rest goes through to the game screen. */
.viewer.show-bar .controls button, .viewer.show-bar .controls input, .viewer.show-bar .controls .clock { pointer-events: auto; }
.viewer .controls .clock { color: #eee; }
/* Speed buttons: their own row on top of the bar. */
.viewer .controls .bar-row { flex-basis: 100%; display: flex; align-items: center; }
/* While the bar is shown, the full screen button sits at the end of the speed row. */
.viewer .fullscreen-toggle.in-bar { position: static; margin-left: auto; width: 36px; height: 34px; padding: 6px; }
.viewer.show-bar .stage .fullscreen-toggle { opacity: 0; pointer-events: none; }
.viewer .controls .bar-speeds { border-color: rgba(255, 255, 255, 0.35); }
.viewer .controls .bar-speeds button { min-height: 32px; background: rgba(0, 0, 0, 0.35); color: #fff; }
.viewer .controls .bar-speeds button + button { border-left-color: rgba(255, 255, 255, 0.35); }
.viewer .controls .bar-speeds button.active { background: var(--accent); }
.viewer .stage .fullscreen-toggle { transition: opacity 0.2s; }
.viewer.show-bar .unit-info { bottom: 158px; }
.viewer.is-full .controls { border-radius: 0; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.viewer.is-full .stage .fullscreen-toggle { bottom: 12px; right: 12px; }
.viewer.is-full .unit-info { bottom: 60px; }
.viewer.is-full.show-bar .unit-info { bottom: 164px; }
body.has-full-viewer { overflow: hidden; }
/* Press-and-hold double speed, top center. */
.hold-badge {
  position: absolute; top: 56px; left: 50%; transform: translateX(-50%);
  padding: 4px 12px; border-radius: 999px; font-size: 0.9rem; font-weight: 600; color: #fff;
  background: rgba(0, 0, 0, 0.6); pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.hold-badge.show { opacity: 1; }
/* Double-tap skip feedback, in the middle of the tapped half. */
.skip-badge {
  position: absolute; top: 50%; width: 96px; height: 96px; margin-top: -48px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.9rem; font-weight: 600; color: #fff;
  background: rgba(0, 0, 0, 0.45); text-shadow: 0 1px 2px #000; pointer-events: none;
  opacity: 0; transition: opacity 0.2s;
}
.skip-badge.left { left: 25%; transform: translateX(-50%); }
.skip-badge.right { left: 75%; transform: translateX(-50%); }
.skip-badge.show { opacity: 1; }
/* Selected unit, bottom right (the minimap is bottom left), above the full screen button. */
.unit-info {
  position: absolute; right: 6px; bottom: 52px; width: min(300px, 55%);
  padding: 6px 8px; display: grid; gap: 3px; font-size: 0.8rem; line-height: 1.3;
  color: #eee; background: rgba(0, 0, 0, 0.65); border-radius: 6px; pointer-events: none;
  text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums;
}
.unit-info .unit-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.unit-info .unit-head strong { font-size: 0.95rem; }
.unit-info .unit-owner {
  color: color-mix(in srgb, var(--pcolor, #ccc) 75%, #fff);
  border-left: 3px solid var(--pcolor, #ccc); padding-left: 5px;
}
.unit-info .unit-stats { color: #ccc; }
.unit-info .unit-upgrades { color: #ffd479; }
.unit-info .unit-progress { position: relative; padding-bottom: 5px; }
.unit-info .unit-progress .bar {
  position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 2px; background: #6cf;
}
@media (max-width: 600px) {
  .unit-info { font-size: 0.7rem; padding: 4px 6px; width: min(240px, 58%); }
}
.controls .sound-toggle {
  min-width: 44px; min-height: 44px; font-size: 1.1rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
}
.controls .sound-toggle.off { opacity: 0.45; text-decoration: line-through; }
/* Next to the game title; looks like the sound toggles (faded and struck through when off). */
.player-head .auto-camera {
  margin-left: auto; flex: none; min-height: 36px; padding: 0 8px; border-radius: 8px;
  font: inherit; font-size: 0.8rem; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
}
.player-head .auto-camera.off { opacity: 0.45; text-decoration: line-through; }
@media (max-width: 380px) {
  .player-head .wide-only { display: none; }  /* just "자동이동" on narrow phones */
}

/* --- accounts ---------------------------------------------------------------------- */
.account { display: flex; align-items: center; gap: 8px; margin-left: 8px; white-space: nowrap; }
.account-name { color: var(--ink-2); font-size: 0.85rem; max-width: 8em; overflow: hidden; text-overflow: ellipsis; }
.account button {
  font: inherit; font-size: 0.85rem; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--page); color: var(--ink);
}
.login { max-width: 360px; margin: 32px auto; }
.login form { display: grid; gap: 12px; margin-top: 12px; }
.login label { display: grid; gap: 4px; font-size: 0.9rem; color: var(--ink-2); }
.login input {
  font: inherit; font-size: 1rem; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--page); color: var(--ink);
}
.login .error { color: #d03b3b; }
.login button { min-height: 44px; font-size: 1rem; cursor: pointer; }
.controls.sound { margin-top: 6px; }
.controls.sound #volume { flex: 1; max-width: 220px; height: 32px; }
.controls .volume-value { min-width: 2.5ch; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* --- members: top bar, sign up, account, upload, administration ------------------------ */
.topbar { flex-wrap: wrap; row-gap: 8px; }
.upload-button {
  padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 0.85rem; white-space: nowrap;
  text-decoration: none; color: #fff; background: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.upload-button:hover { filter: brightness(1.08); }
.account { margin-left: auto; }
.account a { font-size: 0.85rem; color: var(--ink); white-space: nowrap; }
@media (max-width: 600px) {
  .account-name { display: none; }
}
.signup-link { margin-top: 16px; color: var(--ink-2); font-size: 0.9rem; }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.notice.error { color: #d03b3b; }
.id-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.id-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
form.inline { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
form.inline button, .add-id input {
  font: inherit; font-size: 0.85rem; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--page); color: var(--ink);
}
form.inline button { cursor: pointer; }
form.inline button:disabled { cursor: not-allowed; opacity: 0.4; }
form.inline button.danger { color: #d03b3b; }
.member { display: grid; gap: 6px; }
.member-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.member.has-pending { border-color: #e0a100; }
.warn-badge { background: #e0a100; color: #000; }
.upload-pick { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.upload-pick .button { cursor: pointer; }
.upload-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 0.9rem; }
.upload-list li { overflow-wrap: anywhere; }
.result-tag { display: inline-block; min-width: 4.5em; font-weight: 600; }
.result-added .result-tag { color: #1a8f3c; }
.result-exists .result-tag, .result-skipped .result-tag { color: var(--ink-2); }
.result-invalid .result-tag { color: #d03b3b; }

.req { color: #d03b3b; font-weight: 700; }
.optional { color: var(--muted); font-weight: 400; font-size: .85em; }
.field-title { color: var(--ink); }
.login form > label[for] { margin-bottom: -8px; }
.id-check { display: flex; gap: 8px; }
.id-check input { flex: 1; min-width: 0; }
.id-check .button { white-space: nowrap; cursor: pointer; font: inherit; background: var(--surface); color: var(--ink); }
.check-result { margin: -6px 0 0; font-size: 0.85rem; }
.check-result:empty { display: none; }
.check-result.ok { color: #1a8f3c; }
.check-result.fail { color: #d03b3b; }

/* Site address badge next to the brand: invites sharing the address (tap = copy). */
.site-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 8px;
  border: 1px solid transparent; border-radius: 999px; cursor: pointer; font: inherit;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap;
  color: #fff; background: linear-gradient(120deg, #7b2ff7 0%, #2a78d6 55%, #00c2a8 100%);
  background-origin: border-box;  /* paint under the transparent border too (no stray edge) */
  box-shadow: 0 1px 4px rgba(42, 120, 214, 0.35);
}
.site-badge:hover { filter: brightness(1.08); }
.site-star { color: #ffd84d; text-shadow: 0 0 6px rgba(255, 216, 77, 0.8); }
@media (max-width: 420px) {
  .site-badge { font-size: 0.7rem; padding: 3px 8px 3px 6px; }
}
@media (max-width: 600px) {
  .topbar { position: static; }  /* several rows on phones: do not keep it over the content */
  .account { gap: 6px; }
  .account a, .account button { font-size: 0.8rem; }
}

/* List page: the member's profile IDs next to the game count (tap: edit them). */
.my-ids-row { margin: -4px 0 12px; }
.my-ids { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; text-decoration: none; color: var(--ink-2); }
.my-ids-label { font-size: 0.8rem; }
.id-chip {
  padding: 1px 8px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  color: var(--accent); border: 1px solid var(--accent); background: transparent;
}
.id-chip.pending { color: var(--ink-2); border-style: dashed; border-color: var(--border); }
.id-chip.pending::after { content: " (정지됨)"; font-weight: 400; }
.suspended-badge { color: #d03b3b; border-color: #d03b3b; }
form.inline button.activate { color: #1a8f3c; border-color: #1a8f3c; }
.id-chip.none { color: #d03b3b; border-color: #d03b3b; }
.danger-button { background: transparent; color: #d03b3b; border: 1px solid #d03b3b; font-weight: 600; }
.danger-button:hover { background: #d03b3b; color: #fff; }
.withdraw > .danger-button { width: 100%; min-height: 44px; margin-top: 8px; cursor: pointer; font: inherit; font-weight: 600; }
.confirm-dialog {
  width: min(340px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--ink); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.confirm-dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
.confirm-dialog form { display: grid; gap: 12px; }
.confirm-dialog h3 { margin: 0; font-size: 1.05rem; }
.confirm-dialog input {
  font: inherit; font-size: 1rem; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--page); color: var(--ink);
}
.dialog-buttons { display: flex; gap: 8px; justify-content: flex-end; }
.dialog-buttons .button { min-height: 40px; cursor: pointer; font: inherit; background: var(--page); color: var(--ink); }
.dialog-buttons .danger-button { background: #d03b3b; border-color: #d03b3b; color: #fff; }
.edit-row { display: flex; gap: 6px; }
.edit-row input[type="text"], .edit-row input[type="email"] {
  flex: 1; min-width: 0; font: inherit; font-size: 0.85rem; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--page); color: var(--ink);
}
.before-after { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: baseline; }
.confirm-dialog .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.edit-info input[type="text"] { flex: 0 1 8em; }
.edit-label { font-size: 0.75rem; color: var(--ink-2); margin-bottom: -2px; }
.upload-pick .button { min-height: 44px; font: inherit; font-weight: 600; }
.upload-pick .button:not(.primary) { background: var(--surface); color: var(--ink); }
.upload-progress { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.upload-progress progress { flex: 1; height: 14px; }
.upload-progress span { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 0.85rem; }
.upload-hint:empty { display: none; }
.first-time { margin: 10px 0; padding: 12px 14px; border-radius: 8px; background: var(--page); border: 1px solid var(--border); }
.first-time .steps { margin: 8px 0; padding-left: 1.3em; display: grid; gap: 4px; }
.remembered { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.remembered[hidden] { display: none; }
.link-button { border: 0; padding: 0; background: none; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.85rem; }

/* List page: count and profile IDs on the left, search on the right (below on phones). */
.list-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.list-head .meta, .list-head .my-ids-row { margin: 0 0 4px; }
.search { display: flex; flex: 0 1 340px; min-width: 0; }
.search input {
  flex: 1; min-width: 0; padding: 8px 12px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-right: 0; border-radius: 8px 0 0 8px;
}
.search button {
  display: grid; place-items: center; width: 42px; padding: 0; cursor: pointer;
  color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: 0 8px 8px 0;
}
.search button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
/* The chevron that opens the advanced search sits inside the box, left of the search button. */
.search .adv-toggle { width: 36px; color: var(--ink-2); background: var(--surface); border-color: var(--border); border-width: 1px 0; border-radius: 0; }
.search .adv-toggle svg { stroke-linejoin: round; transition: transform 0.15s; }
.search .adv-toggle[aria-expanded="true"] { color: var(--accent); }
.search .adv-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.adv-search { display: grid; gap: 8px; }
.adv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.adv-label { flex: 0 0 3.5em; font-size: 0.85rem; color: var(--ink-2); }
.adv-row input, .adv-row select {
  min-height: 38px; padding: 6px 10px; font: inherit; color: var(--ink);
  background: var(--page); border: 1px solid var(--border); border-radius: 8px;
}
.adv-row input[type="text"] { flex: 1 1 12em; min-width: 0; }
.adv-row input[type="date"] { flex: 1 1 9em; min-width: 0; }
.adv-vs { padding-left: calc(3.5em + 8px); font-size: 0.8rem; color: var(--muted); }
.adv-quick { display: flex; flex-wrap: wrap; gap: 6px; padding-left: calc(3.5em + 8px); }
.adv-quick button {
  padding: 4px 10px; font: inherit; font-size: 0.8rem; cursor: pointer; color: var(--ink-2);
  background: var(--page); border: 1px solid var(--border); border-radius: 999px;
}
.adv-quick button:hover { border-color: var(--accent); color: var(--ink); }
.adv-search .note { margin: 0; }
.adv-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.adv-buttons .button { min-height: 40px; min-width: 5em; text-align: center; cursor: pointer; font: inherit; }
@media (max-width: 600px) {
  .adv-label { flex-basis: 100%; }
  .adv-vs, .adv-quick { padding-left: 0; }
}
.adv-search:not([hidden]) + .chips { display: none; }  /* the open form shows them */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: 0.85rem;
  text-decoration: none; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px;
}
.chip span { color: var(--ink-2); font-size: 0.75rem; }
.chip:hover { background: var(--accent); color: #fff; }
.chip:hover span { color: #fff; }

/* The record of the games found, above the list. */
.record .note { margin: 4px 0 0; }
.h2h-names { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.h2h-names span { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; }
.h2h-names strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h2h-wins { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.h2h-a .h2h-wins { color: var(--s1); }
.h2h-b .h2h-wins { color: var(--s2); }
.h2h-bar { display: flex; gap: 2px; height: 26px; border-radius: 6px; overflow: hidden; }
.h2h-bar span {
  display: flex; align-items: center; padding: 0 8px; min-width: 3em; flex-basis: 0;
  background: var(--c); color: #fff; font-size: 0.8rem; font-weight: 700;
}
.h2h-bar .s2 { justify-content: flex-end; }
.focus-head { display: flex; align-items: center; gap: 12px; font-size: 1.1rem; }
.focus-head .rate { flex: 0 1 220px; }
.record-title { margin: 14px 0 4px; font-size: 0.85rem; color: var(--ink-2); font-weight: 600; }
.tallies { list-style: none; margin: 0; padding: 0; }
.t-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 4.5em 6.5em minmax(90px, 160px);
  align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--grid); font-size: 0.9rem;
}
.tallies li:first-child .t-row { border-top: 0; }
.tallies a { text-decoration: none; }
.tallies a:hover .t-name { color: var(--accent); text-decoration: underline; }
.t-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-games, .t-score { color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.rate { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-weight: 600; }
.rate-bar {
  flex: 1; height: 8px; border-radius: 4px;
  background: linear-gradient(to right, var(--accent) var(--rate), var(--grid) var(--rate));
}
.record-more { margin-top: 10px; }
.record-more summary { cursor: pointer; color: var(--accent); font-size: 0.85rem; }
@media (max-width: 480px) {
  .t-row { grid-template-columns: minmax(0, 1fr) 6em 80px; }
  .t-games { display: none; }
}
@media (max-width: 600px) {
  .search { flex-basis: 100%; }
}
.found-ids ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; max-height: 40vh; overflow: auto; }
.found-ids li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.found-ids .button { min-height: 32px; padding: 2px 12px; cursor: pointer; font: inherit; background: var(--accent); color: #fff; border-color: var(--accent); }

/* Chip editor (account page profile IDs). */
.tag-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; min-height: 46px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--page); cursor: text;
}
.tag-input input { flex: 1; min-width: 8em; border: 0 !important; padding: 4px !important; background: transparent !important; font: inherit; color: var(--ink); outline: none; }
.tag-input:focus-within { border-color: var(--accent); }
.tag {
  position: relative; display: inline-flex; align-items: center; padding: 4px 22px 4px 10px; border-radius: 999px;
  font-size: 0.9rem; font-weight: 600; color: var(--accent); background: transparent; border: 1px solid var(--accent);
}
.tag-input .tag button {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; min-height: 0; padding: 0; border-radius: 50%;
  border: 0; background: #888; color: #fff; font-size: 13px; line-height: 20px; cursor: pointer;
}
.tag-input .tag button:hover { background: #d03b3b; }
.unsaved { color: #b26a00; margin: 0; }

/* --- login / sign-up: StarCraft-like space theme (always dark) ----------------------------- */
body.auth {
  --page: #05070d; --surface: rgba(14, 20, 34, 0.78); --ink: #e8eefc; --ink-2: #9fb0cf; --muted: #7d8db0;
  --border: rgba(120, 160, 255, 0.22); --accent: #3b8cff;
  min-height: 100vh; color: var(--ink);
  background: radial-gradient(1200px 700px at 50% -10%, #1b2b5a 0%, rgba(11, 18, 40, 0.6) 45%, transparent 70%),
              radial-gradient(900px 600px at 85% 110%, rgba(110, 40, 140, 0.35), transparent 60%),
              radial-gradient(800px 500px at 10% 100%, rgba(200, 150, 40, 0.18), transparent 60%),
              #05070d;
}
body.auth .topbar { display: none; }
body.auth .page { position: relative; z-index: 1; max-width: 720px; }
.space { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.stars { position: absolute; inset: -50%; background-repeat: repeat; }
.stars.s1 { background-image: radial-gradient(1px 1px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 140px 80px, #cfe0ff, transparent), radial-gradient(1px 1px at 90px 150px, #fff, transparent), radial-gradient(1px 1px at 200px 190px, #ffe9c2, transparent); background-size: 240px 220px; opacity: .55; animation: drift 240s linear infinite; }
.stars.s2 { background-image: radial-gradient(1.5px 1.5px at 60px 110px, #fff, transparent), radial-gradient(1.5px 1.5px at 260px 40px, #bcd4ff, transparent), radial-gradient(1.5px 1.5px at 330px 260px, #fff, transparent); background-size: 380px 320px; opacity: .7; animation: drift 160s linear infinite, twinkle 4s ease-in-out infinite alternate; }
.stars.s3 { background-image: radial-gradient(2px 2px at 120px 60px, #fff, transparent), radial-gradient(2px 2px at 420px 300px, #d8c6ff, transparent); background-size: 520px 420px; opacity: .8; animation: drift 110s linear infinite, twinkle 6s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-25%); } }
@keyframes twinkle { from { opacity: .35; } to { opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .stars { animation: none !important; } }

.hero { text-align: center; margin: 40px 0 22px; }
.hero-small { margin: 20px 0 14px; }
.hero-kicker { margin: 0 0 6px; font: 600 0.78rem/1 Orbitron, system-ui, sans-serif; letter-spacing: 0.45em; color: #8fb4ff; }
.hero-title {
  margin: 0; font: 900 clamp(1.6rem, 7.4vw, 3.7rem)/1.05 Orbitron; white-space: nowrap; font-family: Orbitron, system-ui, sans-serif; letter-spacing: 0.06em;
  background: linear-gradient(180deg, #ffffff 0%, #cfdcff 38%, #7e94c8 52%, #e9f0ff 70%, #9fb3e6 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(59, 140, 255, 0.55)) drop-shadow(0 2px 0 rgba(0, 0, 0, 0.6));
}
.hero-small .hero-title { font-size: clamp(1.4rem, 6.4vw, 2.6rem); }
.hero-tagline { margin: 12px 0 10px; color: var(--ink-2); letter-spacing: 0.02em; }
.hero-races { display: flex; justify-content: center; gap: 16px; margin: 0; font: 600 0.72rem/1 Orbitron, system-ui, sans-serif; letter-spacing: 0.12em; }
.hero-race::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.hero-race.t { color: #6fa8ff; } .hero-race.t::before { background: #3b8cff; box-shadow: 0 0 8px #3b8cff; }
.hero-race.z { color: #c49bff; } .hero-race.z::before { background: #9a5cff; box-shadow: 0 0 8px #9a5cff; }
.hero-race.p { color: #ffd479; } .hero-race.p::before { background: #f2b52c; box-shadow: 0 0 8px #f2b52c; }

body.auth .auth-card {
  margin: 0 auto; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
body.auth .auth-card h2 { font: 600 1rem/1.2 Orbitron, system-ui, sans-serif; letter-spacing: 0.1em; color: #cfe0ff; }
body.auth .login input { background: rgba(5, 9, 18, 0.7); border-color: var(--border); color: var(--ink); }
body.auth .login input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 140, 255, 0.25); }
body.auth .button.primary {
  background: linear-gradient(180deg, #4d9bff, #2a6fe0); border-color: #4d9bff;
  box-shadow: 0 0 18px rgba(59, 140, 255, 0.45);
}
body.auth .button { color: var(--ink); background: transparent; border-color: var(--border); }
body.auth .signup-link, body.auth .sub { color: var(--ink-2); }
body.auth a { color: #8fb4ff; }

.highlight { margin: 28px auto 24px; max-width: 720px; text-align: center; }
.highlight video {
  display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; background: #000; object-fit: cover;
  border: 1px solid var(--border); box-shadow: 0 0 30px rgba(59, 140, 255, 0.25), 0 12px 40px rgba(0, 0, 0, 0.6);
}
.highlight-caption { margin: 10px 0 0; font: 600 0.7rem/1.4 Orbitron, system-ui, sans-serif; letter-spacing: 0.18em; color: var(--muted); }

/* Compact login card (about 2/3 of the form height). */
body.auth .auth-card.login { padding: 14px 18px; }
body.auth .auth-card h2 { margin: 0 0 4px; font-size: 0.9rem; }
body.auth .auth-card form { gap: 8px; margin-top: 6px; }
body.auth .auth-card label { gap: 2px; font-size: 0.8rem; }
body.auth .auth-card input { padding: 7px 10px; font-size: 0.95rem; }
body.auth .auth-card button[type="submit"] { min-height: 36px; font-size: 0.95rem; margin-top: 2px; }
body.auth .auth-card .signup-link { margin: 10px 0 0; font-size: 0.82rem; }
body.auth .auth-card .signup-link .button { padding: 4px 10px; font-size: 0.82rem; }
body.auth .auth-card .error, body.auth .auth-card .notice { margin: 4px 0; font-size: 0.85rem; }

/* Replay page: the hottest 20 s of the game at 2x, looping, in place of the chat. */
.match-highlight video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; background: #000; }
.match-highlight .sub { margin: 8px 0 0; }

/* Popups on the space theme: opaque, the translucent card colour shows the form through. */
body.auth .confirm-dialog { background: #0e1422; }
.match-highlight .clip-stage { position: relative; }

/* --- top bar: the login page's starry night, title in its font ----------------------------- */
.topbar {
  --ink: #e8eefc; --ink-2: #a9b8d6; --border: rgba(120, 160, 255, 0.28);
  color: var(--ink); border-bottom: 1px solid rgba(120, 160, 255, 0.25);
  background:
    radial-gradient(1px 1px at 8% 30%, #fff, transparent), radial-gradient(1px 1px at 23% 70%, #cfe0ff, transparent),
    radial-gradient(1.5px 1.5px at 41% 25%, #fff, transparent), radial-gradient(1px 1px at 57% 65%, #ffe9c2, transparent),
    radial-gradient(1px 1px at 68% 20%, #fff, transparent), radial-gradient(1.5px 1.5px at 83% 75%, #d8c6ff, transparent),
    radial-gradient(1px 1px at 94% 35%, #fff, transparent), radial-gradient(1px 1px at 33% 50%, #bcd4ff, transparent),
    radial-gradient(600px 120px at 50% -40%, #1b2b5a, transparent 70%),
    linear-gradient(180deg, #070b16, #0b1224);
}
.topbar .brand {
  font: 900 1.25rem/1 Orbitron, system-ui, sans-serif; letter-spacing: 0.06em;
  background: linear-gradient(180deg, #ffffff 0%, #cfdcff 40%, #7e94c8 55%, #e9f0ff 75%, #9fb3e6 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 8px rgba(59, 140, 255, 0.55));
}
.topbar .account a { color: var(--ink); }
.topbar .account button { background: rgba(255, 255, 255, 0.06); color: var(--ink); border-color: var(--border); }
.topbar .account-name { color: var(--ink-2); }
.inquiry-link { position: relative; }
.inquiry-link .badge {
  display: inline-block; min-width: 1.2em; margin-left: 4px; padding: 0 5px; border-radius: 999px;
  background: #e5484d; color: #fff; font-size: 0.72rem; font-weight: 700; line-height: 1.5; text-align: center;
}
@media (max-width: 600px) {
  .topbar .brand { font-size: 1.05rem; }
}

/* --- 1:1 inquiries ------------------------------------------------------------------------ */
.inquiry-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.inquiry-head h1 { margin-bottom: 4px; overflow-wrap: anywhere; }
.inquiry-head .button { white-space: nowrap; }
.inquiry-tabs { display: flex; gap: 4px; margin: 12px 0 4px; border-bottom: 1px solid var(--border); }
.inquiry-tabs a { padding: 6px 12px; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; }
.inquiry-tabs a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.inquiries { list-style: none; margin: 8px 0 0; padding: 0; }
.inquiry-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center;
  padding: 10px 4px; border-bottom: 1px solid var(--grid); text-decoration: none; color: var(--ink);
}
.inquiry-row:hover .inquiry-title { text-decoration: underline; }
.inquiry-row.unread .inquiry-title { font-weight: 700; }
.inquiry-title { overflow-wrap: anywhere; }
.inquiry-meta { white-space: nowrap; }
@media (max-width: 600px) {
  .inquiry-row { grid-template-columns: auto 1fr; }
  .inquiry-meta { grid-column: 2; }
}
.status { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid; }
.status.open { color: #b4590a; border-color: #e7a35f; background: rgba(231, 163, 95, 0.12); }
.status.answered { color: #1d7a3a; border-color: #6cc08a; background: rgba(108, 192, 138, 0.12); }
.new-tag { margin-left: 6px; font-size: 0.7rem; padding: 1px 6px; border-radius: 999px; background: #e5484d; color: #fff; font-weight: 700; }
.inquiry-form { display: grid; gap: 12px; margin-top: 12px; }
.inquiry-form label { display: grid; gap: 4px; font-size: 0.85rem; color: var(--ink-2); }
.inquiry-form input[type="text"], .inquiry-form textarea {
  font: inherit; font-size: 1rem; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--page); color: var(--ink); resize: vertical;
}
.inquiry-form .button { justify-self: start; min-height: 40px; cursor: pointer; font: inherit; }
.attach { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.attach-button { cursor: pointer; }
.thumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs:empty { display: none; }
.thumbs li { position: relative; }
.thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.thumb-remove {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: #333; color: #fff; font-size: 0.9rem; line-height: 1; cursor: pointer;
}
.inquiry-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; margin-top: 8px; }
.inquiry-images { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.inquiry-images img { max-width: min(100%, 320px); max-height: 240px; border-radius: 8px; border: 1px solid var(--border); display: block; }
.reply.from-admin { border-left: 4px solid var(--accent); }
.reply-actions { display: flex; justify-content: flex-end; }
.delete-form { margin-top: 12px; text-align: right; }
.link-button.danger { color: #d03b3b; }
.notify-row { display: flex; align-items: center; gap: 12px; }
.notify-row p { margin: 2px 0 0; }
/* A switch instead of a checkbox: one tap turns the mail on or off. */
.switch {
  position: relative; flex: none; width: 52px; height: 30px; border-radius: 999px; border: 0; cursor: pointer;
  background: #b9c0cc; transition: background 0.15s;
}
.switch.on { background: #2fa84f; }
.switch:disabled { opacity: 0.5; cursor: not-allowed; }
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s;
}
.switch.on .switch-knob { transform: translateX(22px); }

/* --- admin dashboard ---------------------------------------------------------------------- */
.kpis { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.kpi { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--page); }
.kpi.alert { border-color: #e5484d; box-shadow: inset 3px 0 0 #e5484d; }
.kpi-label { font-size: 0.8rem; color: var(--ink-2); }
.kpi-value { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 0.75rem; color: var(--ink-2); }
.disk-bar { height: 14px; border-radius: 999px; background: var(--grid); overflow: hidden; margin: 8px 0; }
.disk-bar span { display: block; height: 100%; background: var(--accent); }
.disk-bar span.full { background: #e5484d; }
table.plain { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.9rem; }
table.plain th, table.plain td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--grid); }
table.plain th { color: var(--ink-2); font-weight: 500; }

/* Privacy consent on the sign-up form. */
.consent { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px 12px; margin: 0; display: grid; gap: 8px; }
.consent legend { padding: 0 6px; font-weight: 600; font-size: 0.9rem; }
.consent ul { margin: 0; padding-left: 18px; font-size: 0.8rem; color: var(--ink-2); line-height: 1.6; }
.consent .check { display: flex; gap: 8px; align-items: center; font-size: 0.9rem; color: var(--ink); }
.consent .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.consent a { font-size: 0.8rem; }
.privacy h2 { margin-top: 18px; }
.privacy p, .privacy li { line-height: 1.7; }

/* Login and sign-up: the site address under the title, so people remember where to come back. */
.hero-address { margin: 12px 0 0; }
.hero-badge { font-size: 0.95rem; padding: 6px 16px 6px 12px; box-shadow: 0 0 18px rgba(120, 90, 255, 0.45); }

/* Login and sign-up: a small credit at the very end, like the end credits of a game. */
.credit {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px auto 28px; max-width: 420px;
  font: 600 0.62rem/1 Orbitron, system-ui, sans-serif; letter-spacing: 0.32em; text-transform: uppercase;
  color: rgba(159, 176, 207, 0.45); transition: color 0.3s, text-shadow 0.3s;
}
.credit::before, .credit::after {
  content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(143, 180, 255, 0.35));
  transition: opacity 0.3s; opacity: 0.6;
}
.credit::after { background: linear-gradient(90deg, rgba(143, 180, 255, 0.35), transparent); }
.credit:hover { color: #cfe0ff; text-shadow: 0 0 10px rgba(59, 140, 255, 0.7); }
.credit:hover::before, .credit:hover::after { opacity: 1; }

/* Replay page: a short APM chart (half the usual height) under the highlight. */
.apm-card .plot { height: 100px; }
/* Chat times past an hour (1:01:02) need more room than 3.2em. */
.chat time { width: auto; min-width: 3.2em; white-space: nowrap; }

/* Player: sound and view size in a column at the right edge of the game screen, shown and
   hidden with the play bar (a tap on the screen), in the page and in full screen. */
.side-panel {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 6px;
  border-radius: 12px; background: rgba(0, 0, 0, 0.6); color: #fff;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.viewer.show-bar .side-panel { opacity: 1; pointer-events: auto; }
.panel-group { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.panel-group[hidden] { display: none; }
.side-panel .sound-toggle {
  width: 38px; height: 38px; padding: 0; font-size: 1.05rem; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.08); color: #fff;
}
.side-panel .sound-toggle.off { opacity: 0.45; text-decoration: line-through; }
/* Vertical volume: drag up for louder. */
.side-panel #volume {
  writing-mode: vertical-lr; direction: rtl; -webkit-appearance: slider-vertical;
  width: 28px; height: 104px; margin: 0; accent-color: var(--accent); cursor: pointer;
}
.side-panel .volume-value { font-size: 0.7rem; color: #ddd; font-variant-numeric: tabular-nums; }
.panel-label { font-size: 0.65rem; color: #ccc; }
.panel-zoom { display: flex; flex-direction: column; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 8px; overflow: hidden; }
.panel-zoom button {
  width: 46px; padding: 6px 0; border: 0; font: inherit; font-size: 0.7rem; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); color: #fff;
}
.panel-zoom button + button { border-top: 1px solid rgba(255, 255, 255, 0.3); }
.panel-zoom button.active { background: var(--accent); }
/* Short screens (a phone held sideways in full screen): a lower play bar and a smaller
   panel just under the scoreboard, so the two never meet. */
@media (max-height: 460px) {
  .side-panel { top: 52px; transform: none; gap: 5px; padding: 5px 4px; }
  .side-panel .sound-toggle { width: 30px; height: 30px; font-size: 0.85rem; }
  .side-panel #volume { height: 56px; width: 24px; }
  .side-panel .volume-value, .panel-label { font-size: 0.6rem; }
  .panel-zoom button { width: 42px; padding: 3px 0; font-size: 0.65rem; }
  .viewer .controls#controls { padding: 4px 10px; row-gap: 4px; }
  .viewer .controls #play { min-width: 40px; min-height: 32px; font-size: 0.95rem; }
  .viewer .controls #seek { height: 24px; }
  .viewer .controls .bar-speeds button { min-height: 26px; padding: 0 10px; font-size: 0.8rem; }
  .viewer .fullscreen-toggle.in-bar { width: 30px; height: 28px; padding: 5px; }
  .viewer.is-full .controls { padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
}
/* Sign-up: the title goes back to the first page; it keeps the title's look. */
.hero-home { color: inherit; text-decoration: none; -webkit-text-fill-color: transparent; }

/* Sign-up: where to find the battle.net profile (a screenshot of the game's user screen). */
.profile-guide { margin-top: -4px; font-size: 0.85rem; }
.profile-guide .guide-title { margin: 0; color: #8fb4ff; font-weight: 600; }
.profile-guide img { display: block; width: 100%; height: auto; margin: 6px 0 6px; border-radius: 8px; border: 1px solid var(--border); }
.profile-guide p { margin: 0; line-height: 1.6; }
.profile-guide ol { margin: 0; padding-left: 18px; line-height: 1.7; }
/* Looks like the game's small red-framed button. */
.game-button {
  display: inline-block; padding: 0 6px; border: 1px solid #c0282d; border-radius: 2px;
  background: #1a0d0d; color: #5fd35f; font-size: 0.78rem; line-height: 1.5; white-space: nowrap;
}
/* Sign-up: a little wider than the login box, so the four example profiles fit on one line. */
body.auth .signup-card { max-width: 440px; }
.signup-card code.examples { white-space: nowrap; font-size: 0.78rem; }
@media (max-width: 420px) { .signup-card code.examples { font-size: 0.72rem; } }
/* Replay page: the highlight opens the game screen; a play mark shows it can be tapped. */
.clip-link { display: block; color: inherit; text-decoration: none; cursor: pointer; }
.clip-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; padding-left: 4px;
  font-size: 1.6rem; color: #fff; background: rgba(0, 0, 0, 0.45); border: 2px solid rgba(255, 255, 255, 0.7);
  opacity: 0.55; transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.clip-link:hover .clip-play, .clip-link:focus-visible .clip-play { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }

/* Player: play/pause in the middle of the game screen, like video players. Shown with the
   bar (a tap) and always while paused or ended; the bar keeps speed, seek and time. */
.center-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3;
  width: 72px; height: 72px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.75); background: rgba(0, 0, 0, 0.5); color: #fff;
  display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.center-play[hidden] { display: none; }
.center-play svg { width: 36px; height: 36px; fill: currentColor; }
.center-play .icon-play { margin-left: 4px; }
.center-play .icon-play, .center-play.is-paused .icon-pause { display: none; }
.center-play.is-paused .icon-play { display: block; }
.viewer.show-bar .center-play, .viewer.is-paused .center-play { opacity: 1; pointer-events: auto; }
@media (max-height: 460px) {
  .center-play { width: 56px; height: 56px; }
  .center-play svg { width: 28px; height: 28px; }
}
/* Phones draw a square tap highlight (and a focus outline after the tap) around buttons,
   which looked like a box around the round play button. Keyboard focus still shows a ring. */
.viewer button, .viewer input, .clip-link { -webkit-tap-highlight-color: transparent; }
.viewer button:focus:not(:focus-visible) { outline: none; }
.center-play:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(59, 140, 255, 0.9); }

/* Sharing a game: the button in the player's title row, its dialog, and the guest view. */
.share-button {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 0.85rem; font-weight: 600; color: #fff; border: 0;
  background: linear-gradient(120deg, #7b2ff7 0%, #2a78d6 55%, #00c2a8 100%); background-origin: border-box;
  -webkit-tap-highlight-color: transparent;
}
.share-button[hidden] { display: none; }
.share-button svg { width: 16px; height: 16px; fill: currentColor; }
.share-choices { display: grid; gap: 8px; }
.share-choices[hidden], .share-link[hidden] { display: none; }
.share-choices .button { min-height: 44px; font: inherit; font-weight: 600; cursor: pointer; }
.share-link { display: flex; gap: 6px; }
.share-link input { flex: 1; min-width: 0; font: inherit; font-size: 0.85rem; padding: 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--page); color: var(--ink); }
.guest-banner {
  margin: 0 0 10px; padding: 10px 14px; border-radius: 10px; font-size: 0.9rem; line-height: 1.5;
  background: linear-gradient(120deg, rgba(123, 47, 247, 0.12), rgba(0, 194, 168, 0.12)); border: 1px solid var(--border);
}
.guest-banner a { font-weight: 700; }
.start-button { margin-top: 12px; min-height: 44px; padding: 0 22px; font: inherit; font-weight: 700; cursor: pointer; }
.start-button[hidden] { display: none; }
.player-head .share-button { flex: none; white-space: nowrap; }
.player-head .player-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* While a unit's info is shown, nothing else covers the screen (not even the paused play button). */
.viewer.unit-focus .center-play { opacity: 0; pointer-events: none; }
/* Share: the first button of the side panel (top right of the game screen). */
.side-panel .share-toggle {
  width: 38px; height: 38px; padding: 0; border-radius: 8px; border: 0; cursor: pointer; color: #fff;
  display: grid; place-items: center;
  background: linear-gradient(120deg, #7b2ff7 0%, #2a78d6 55%, #00c2a8 100%); background-origin: border-box;
}
.side-panel .share-toggle[hidden] { display: none; }
.side-panel .share-toggle svg { width: 20px; height: 20px; fill: currentColor; }
@media (max-height: 460px) {
  .side-panel .share-toggle { width: 30px; height: 30px; }
  .side-panel .share-toggle svg { width: 16px; height: 16px; }
}
/* The panel starts under the scoreboard on every screen (the share button made it taller). */
.side-panel { top: 56px; transform: none; }
@media (max-height: 460px) {
  .side-panel { top: 52px; gap: 4px; }
  .side-panel .volume-value, .side-panel .panel-label { display: none; }
  .side-panel #volume { height: 48px; }
}
/* Dashboard lists: about ten rows high, the rest by scrolling inside; the header stays. */
.table-scroll { max-height: 440px; overflow-y: auto; margin-top: 10px; border-bottom: 1px solid var(--grid); }
.table-scroll table.plain { margin-top: 0; }
.table-scroll thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
/* The upload button: gold like the site's star, so it stands out on the dark top bar. */
.topbar .upload-button {
  padding: 7px 16px; font-size: 0.9rem; color: #2a1a00; border: 1px solid #ffe9a0;
  background: linear-gradient(180deg, #ffe680 0%, #ffc93a 55%, #f5a623 100%);
  box-shadow: 0 0 14px rgba(255, 201, 58, 0.55), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}
.topbar .upload-button:hover { filter: brightness(1.06); box-shadow: 0 0 20px rgba(255, 201, 58, 0.8); }
/* Portrait phones: a compact panel, and the bar drawn above it, so the panel never covers
   the full screen button (the share button made the panel taller). */
.viewer .controls#controls { z-index: 4; }
@media (max-width: 600px) {
  .side-panel { gap: 5px; padding: 5px 4px; }
  .side-panel .share-toggle, .side-panel .sound-toggle { width: 32px; height: 32px; font-size: 0.9rem; }
  .side-panel .share-toggle svg { width: 17px; height: 17px; }
  .side-panel #volume { height: 64px; width: 24px; }
  .side-panel .volume-value, .side-panel .panel-label { display: none; }
  .panel-zoom button { width: 42px; padding: 4px 0; font-size: 0.68rem; }
}
/* Scoreboard: a small gold crown before the winner's name. */
/* It sits on the player's colour bar (the name's left border), the name stays in line. */
.scoreboard strong.winner { position: relative; overflow: visible; }
/* (now left of the bar: every name moves right by the crown's width so the bars line up) */
.scoreboard:has(.winner-mark) strong { margin-left: 18px; }
.scoreboard .winner-mark {
  position: absolute; left: -21px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; fill: #ffd84d; stroke: rgba(0, 0, 0, 0.75); stroke-width: 1.5px;
  paint-order: stroke; filter: drop-shadow(0 0 3px rgba(255, 216, 77, 0.85));
}

/* Kakao Login (Kakao design guide: container #FEE500, symbol #000, label 85% black, radius 12px). */
a.kakao-button, body.auth a.kakao-button {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 4px 0;
  border-radius: 12px; background: #fee500; color: rgba(0, 0, 0, 0.85); font-weight: 600; font-size: 0.95rem;
  text-decoration: none;
}
a.kakao-button:hover { filter: brightness(0.96); }
a.kakao-button:focus-visible { outline: 3px solid #8fb4ff; outline-offset: 2px; }
.card.login a.kakao-button { max-width: 420px; }
.or-divider { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; color: var(--muted); font-size: 0.78rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.kakao-note { margin: 2px 0 0; font-size: 0.78rem; text-align: center; }
.kakao-linked { display: inline-block; padding: 1px 8px; margin-right: 6px; border-radius: 999px; background: #fee500; color: #191600; font-size: 0.78rem; font-weight: 600; }
