/*
 * Arcade cabinet: chunky panels, hard offset shadows, no soft blur, and a
 * scoreboard for numbers. The game is a joke about naked attention-seeking, so
 * the styling commits rather than staying polite.
 */

:root {
  color-scheme: dark;

  --bg: #0d0d12;
  --panel: #171720;
  --panel-lit: #1f1f2b;
  --sunken: #101017;
  --line: #33334a;
  --line-soft: #26263a;

  --text: #eceaf5;
  --muted: #8b8ba5;

  --accent: #ffd23f;
  --accent-deep: #c9971c;
  --accent-dim: #6b5a1a;
  --live: #3fd68c;
  --danger: #ff6b52;

  --gold: #ffd24a;
  --silver: #cfd6e0;
  --bronze: #d9884a;

  /* Hard, offset, un-blurred — the whole shadow language of the cabinet. */
  --drop: 3px 3px 0 #05050a;
  --drop-lg: 5px 5px 0 #05050a;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --display: "Departure Mono", var(--mono);
}

@font-face {
  font-family: "Departure Mono";
  src: url("/fonts/DepartureMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  /*
   * 100vh on mobile is the viewport with the browser chrome *hidden*, so the
   * layout is taller than what is actually on screen — the deck falls off the
   * bottom and `overflow: hidden` leaves nothing to scroll to it. dvh tracks
   * the viewport as the chrome slides. The vh line stays first as the fallback.
   */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr;
  font: 15px/1.4 ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 50% -10%, #1b1b2a 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------------------------------------------------------- header - */

/* Standalone page headers (history, admin) — not the scorecard cap. */
header:not(.panel-header) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.6rem 1.1rem;
  background: var(--panel);
  border-bottom: 2px solid var(--line);
}

header:not(.panel-header) .nav {
  margin-left: auto;
}

/*
 * The domain is the name. Set as one solid block so it reads like a stamp,
 * with the .com as a small flourish rather than part of the word.
 */
h1 {
  margin: 0;
  display: flex;
  align-items: baseline;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-shadow: 2px 2px 0 #05050a;
  white-space: nowrap;
}

h1 .tld {
  font-size: 0.6em;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-deep);
  text-shadow: none;
  margin-left: 0.15em;
}

/* Live room state, so it never looks empty when it is not. */
.badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.55rem;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: var(--sunken);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.badge b {
  font-family: var(--mono);
  color: var(--text);
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
}

#live.on .pulse {
  background: var(--live);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

header:not(.panel-header) .nav {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border: 2px solid var(--line);
  border-radius: 4px;
}

header:not(.panel-header) .nav:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

#countdown {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

#countdown b {
  color: var(--text);
  font-weight: 700;
}

/* -------------------------------------------------------- scorecard header - */

.panel-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
  padding: 0.6rem 1rem;
  background: linear-gradient(180deg, #252532 0%, var(--panel-lit) 100%);
}

/* ----------------------------------------------------------------- board - */

#board {
  position: relative;
  display: flex;
  justify-content: center;
  align-content: stretch;
  width: 100%;
  height: 100%;
  padding: 0 1.25rem;
  min-height: 0;
  overflow: visible;
}

.cabinet {
  display: grid;
  grid-template-columns: minmax(0, 680px);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  width: 100%;
  max-width: 680px;
  height: 100%;
  min-height: 0;
}

.cabinet-rail,
.deck-edge {
  display: none;
}

.cabinet-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
}

@media (min-width: 901px) {
  .cabinet {
    --cabinet-rail-w: 1.85rem;
    grid-template-columns: var(--cabinet-rail-w) minmax(0, 680px) var(--cabinet-rail-w);
    max-width: calc(680px + 2 * var(--cabinet-rail-w));
    width: fit-content;
    filter: drop-shadow(5px 5px 0 #05050a);
  }

  /*
   * One texture for both the scoreboard rails and the deck-floor edges, so the
   * border that wraps the board is visibly the same piece of cabinet as the
   * one that wraps the list above it.
   */
  .cabinet-rail,
  .deck-edge::before {
    /* The vertical fade differs per piece; the texture on top of it does not. */
    --rail-fade: linear-gradient(
      180deg,
      #7a62b8 0%,
      #5a4890 6%,
      #3d3160 22%,
      #2a2240 48%,
      #221c34 72%,
      #14101f 100%
    );
    background-color: #1a1528;
    background-image:
      repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 5px,
        rgba(255, 210, 63, 0.09) 5px,
        rgba(255, 210, 63, 0.09) 6px
      ),
      repeating-linear-gradient(
        135deg,
        #221c34 0,
        #221c34 7px,
        #342a52 7px,
        #342a52 14px,
        #28213c 14px,
        #28213c 21px
      ),
      var(--rail-fade);
  }

  .cabinet-rail {
    display: block;
    min-height: 0;
    pointer-events: none;
    position: relative;
    z-index: 2;
  }

  .cabinet-rail--left {
    border-radius: 10px 0 0 10px;
    border: 2px solid #0d0a14;
    border-right: 3px solid #08060e;
    box-shadow:
      inset 3px 0 0 rgba(255, 210, 63, 0.22),
      inset -6px 0 14px rgba(0, 0, 0, 0.55),
      4px 0 0 rgba(90, 72, 144, 0.35);
  }

  .cabinet-rail--right {
    border-radius: 0 10px 10px 0;
    border: 2px solid #0d0a14;
    border-left: 3px solid #08060e;
    box-shadow:
      inset -3px 0 0 rgba(255, 210, 63, 0.14),
      inset 6px 0 14px rgba(0, 0, 0, 0.55),
      -4px 0 0 rgba(90, 72, 144, 0.35);
  }

  .cabinet-body {
    border-left: 2px solid var(--line);
    border-right: 2px solid var(--line);
  }

  /*
   * The deck paints over the rails, which run the full height of the cabinet
   * grid. Below the scoreboard the border is no longer vertical — it follows
   * the floor out to the corners — so the rails have to end here for the two
   * to read as one continuous piece rather than a fork.
   */
  .deck-visual {
    z-index: 3;
    background: var(--bg);
  }

  /*
   * The arcade border wrapped around the floor.
   *
   * Same width and texture as the scoreboard rails, picking up exactly where
   * they stop, but tracking the floor's splayed edge instead of dropping
   * straight down — a band, not a filled wall, so the deck stays open.
   *
   * The element is the rim; its ::before is the same band inset by 3px and
   * carries the texture, which is how a clipped shape gets a border at all.
   */
  .deck-edge {
    --edge-w: var(--cabinet-rail-w, 1.85rem);
    --edge-rim: 3px;
    --floor-left: calc(50% - 340px);
    --floor-right: calc(50% + 340px);
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: #0d0a14;
  }

  .deck-edge::before {
    content: "";
    position: absolute;
    inset: 0;
    /* Continues the rail's fade from where it left off, mid-cabinet. */
    --rail-fade: linear-gradient(180deg, #241d38 0%, #191430 45%, #0f0c1a 100%);
  }

  .deck-edge--left {
    clip-path: polygon(
      var(--floor-left) 0,
      0 100%,
      calc(0px - var(--edge-w)) 100%,
      calc(var(--floor-left) - var(--edge-w)) 0
    );
  }

  .deck-edge--left::before {
    clip-path: polygon(
      calc(var(--floor-left) - var(--edge-rim)) 0,
      calc(0px - var(--edge-rim)) 100%,
      calc(var(--edge-rim) - var(--edge-w)) 100%,
      calc(var(--floor-left) - var(--edge-w) + var(--edge-rim)) 0
    );
  }

  .deck-edge--right {
    clip-path: polygon(
      var(--floor-right) 0,
      100% 100%,
      calc(100% + var(--edge-w)) 100%,
      calc(var(--floor-right) + var(--edge-w)) 0
    );
  }

  .deck-edge--right::before {
    clip-path: polygon(
      calc(var(--floor-right) + var(--edge-rim)) 0,
      calc(100% + var(--edge-rim)) 100%,
      calc(100% + var(--edge-w) - var(--edge-rim)) 100%,
      calc(var(--floor-right) + var(--edge-w) - var(--edge-rim)) 0
    );
  }

  #wall-panel.panel {
    border: none;
    border-top: 2px solid var(--line);
    border-radius: 0;
    box-shadow: none;
  }
}

/* ------------------------------------------------------------------ wall - */

#wall-panel {
  --deck-tilt: 28deg;
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
  font-family: var(--display);
  letter-spacing: 0.04em;
}

.heads-up {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(13, 13, 18, 0.88);
  cursor: pointer;
}

.heads-up[hidden] {
  display: none;
}

.heads-up-body {
  max-width: 480px;
  text-align: center;
  cursor: default;
}

.heads-up h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--danger);
}

.heads-up p {
  margin: 0 0 0.85rem;
  font-size: 1.12rem;
  line-height: 1.55;
  color: var(--muted);
}

.heads-up p:last-of-type {
  margin-bottom: 1.5rem;
}

.heads-up b {
  color: var(--text);
  font-weight: 600;
}

#heads-up-ok {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 5px;
  background: #24f070;
  color: #064a22;
  font: 800 0.95rem/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.14em;
  cursor: pointer;
  box-shadow: 0 5px 0 #0a9e42;
  transition: transform 60ms ease, box-shadow 60ms ease;
}

#heads-up-ok:active {
  transform: translateY(5px);
  box-shadow: 0 0 0 #0a9e42;
}

#wall-add {
  padding: 0.55rem 0.6rem;
  background: var(--panel-lit);
  border-top: 2px solid var(--line);
}

.panel {
  background: var(--panel);
  border-radius: 6px;
  min-height: 0;
}

#wall-panel.panel {
  border: 2px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--drop-lg);
}

.panel-head {
  display: grid;
  grid-template-columns: 2rem 1fr 4.4rem 1.3rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem 0.45rem 0.6rem;
  background: var(--panel-lit);
  border-top: 2px solid var(--line);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.panel-head span:nth-child(1),
.panel-head span:nth-child(4) {
  text-align: right;
}

.panel-head span:nth-child(3) {
  text-align: center;
}

/* ----------------------------------------------------------- arcade deck - */

.deck {
  position: relative;
  flex-shrink: 0;
  margin-top: auto;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0;
  /*
   * .deck-stage is scaled 1.04 to sit with the tilted plate, which on a
   * full-bleed element hangs a couple of percent past both edges and gives the
   * page a horizontal scrollbar. `clip` rather than `hidden`: it must not
   * become a scroll container, or the fixed-position press chips would anchor
   * to it instead of the viewport.
   */
  overflow-x: clip;
}

.deck-visual {
  position: absolute;
  inset: 0;
  perspective: 760px;
  perspective-origin: 50% 0%;
  pointer-events: none;
}

.deck-plate {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  min-height: 200px;
  height: 100%;
  transform: rotateX(var(--deck-tilt));
  transform-origin: top center;
  background: linear-gradient(180deg, var(--panel-lit) 0%, var(--panel) 55%, #101018 100%);
  border: none;
  clip-path: polygon(
    max(0px, calc(50% - 340px)) 0,
    min(100%, calc(50% + 340px)) 0,
    100% 100%,
    0 100%
  );
  border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.deck-stage {
  position: relative;
  /* Above .deck-visual, which is opaque so it can end the cabinet rails. */
  z-index: 4;
  pointer-events: auto;
  padding: 1.35rem 0 0.25rem;
  /* Match the tilted plate visually without 3D on the click target. */
  transform: scale(1.04, 0.94);
  transform-origin: top center;
}

#button-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: fit-content;
  pointer-events: auto;
}

.vote-btn {
  border: none;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: transform 60ms ease, box-shadow 60ms ease;
}

/* --------------------------------------------------------------- control - */

#control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  margin: 0;
  padding: 0;
  pointer-events: auto;
}

/* ---------------------------------------------------------------- button - */

.vote-btn svg {
  display: block;
  flex: 0 0 auto;
}

.vote-up svg {
  width: 46%;
  height: 46%;
}

.vote-down svg {
  width: 48%;
  height: 48%;
}

.vote-up {
  --size: min(200px, 24vw, 24vh);
  --size: min(200px, 24vw, 24dvh);
  --depth-offset: 10px;
  --face: #24f070;
  --depth: #0a9e42;
  width: var(--size);
  height: var(--size);
  background: var(--face);
  color: #064a22;
  box-shadow: 0 var(--depth-offset) 0 var(--depth);
}

.vote-down {
  --size: min(140px, 17vw, 17vh);
  --size: min(140px, 17vw, 17dvh);
  --depth-offset: 8px;
  --face: #ff4731;
  --depth: #c41e12;
  width: var(--size);
  height: var(--size);
  background: var(--face);
  color: #4a0800;
  box-shadow: 0 var(--depth-offset) 0 var(--depth);
}

.vote-btn:active,
.vote-btn.down {
  transform: translateY(var(--depth-offset));
  box-shadow: 0 2px 0 var(--depth);
}

.vote-btn:disabled {
  --face: #3d3d4f;
  --depth: #282833;
  --depth-offset: 8px;
  background: var(--face);
  color: #6a6a7e;
  box-shadow: 0 var(--depth-offset) 0 var(--depth);
  cursor: default;
}

#combo {
  position: absolute;
  top: -8%;
  right: -12%;
  padding: 0.2em 0.5em;
  border: 2px solid var(--accent);
  border-radius: 4px;
  background: #14141f;
  box-shadow: var(--drop);
  font: 900 1.15rem/1.1 var(--mono);
  color: var(--accent);
  opacity: 0;
  transform: scale(0.5) rotate(-8deg);
  transition: opacity 140ms ease, transform 140ms cubic-bezier(0.34, 1.7, 0.64, 1);
  pointer-events: none;
  white-space: nowrap;
}

#combo.on {
  opacity: 1;
  transform: scale(1) rotate(-8deg);
}

#combo.max {
  color: #ff8c42;
  border-color: #ff8c42;
}

/* -------------------------------------------------------------- messages - */

#messages {
  display: grid;
  gap: 0.1rem;
  justify-items: center;
  text-align: center;
}

#challenge {
  align-self: center;
}

#add-thing {
  width: 100%;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 5px;
  background: #c4a8ff;
  color: #2a1848;
  font: 800 0.85rem/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.14em;
  cursor: pointer;
  box-shadow: 0 5px 0 #7a58c4;
  transition: transform 60ms ease, box-shadow 60ms ease, background 120ms ease;
}

#add-thing:hover {
  background: #d4bcff;
}

#add-thing:active {
  transform: translateY(5px);
  box-shadow: 0 0 0 #7a58c4;
}

#wall {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding: 0.5rem 0.55rem 0;
  background: var(--panel);
}

#stack {
  position: relative;
}

.panel-foot {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.6rem 0.45rem;
  background: var(--panel-lit);
  border-top: 2px solid var(--line);
}

#wall-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  margin: 0;
  padding: 0;
}

#wall-footer:empty {
  display: none;
  padding: 0;
}

#wall-footer .scroll-hint-arrow {
  display: inline-block;
  margin-right: 0.25rem;
  color: var(--live);
  font-size: 0.85rem;
  line-height: 1;
  animation: scroll-hint-bob 1.4s ease-in-out infinite;
}

@keyframes scroll-hint-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

.entry {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  display: grid;
  grid-template-columns: 2rem 1fr 4.4rem 1.3rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.55rem;
  font-size: 0.86rem;
  border-radius: 4px;
  background: var(--panel-lit);
  cursor: pointer;
  overflow: hidden;
  transition: transform 420ms cubic-bezier(0.34, 1.42, 0.64, 1),
    background 150ms ease;
  will-change: transform;
}

.entry:hover {
  background: #252532;
}

.entry.mine {
  background: #2a2830;
}

/* The top three carry metal; everyone else is plain, so the podium reads. */
.entry.rank-1 .rank {
  color: var(--gold);
}
.entry.rank-2 .rank {
  color: var(--silver);
}
.entry.rank-3 .rank {
  color: var(--bronze);
}

/*
 * The charge bar (§4 press feedback). Fills as presses land, drains when they
 * stop. Deliberately a continuous value rather than a per-press flash: at ~11
 * presses/sec a flashing background would be a strobe, well past the 3/sec
 * photosensitivity threshold.
 *
 * scaleX on a pseudo-element stays on the compositor, so 50 rows animating at
 * once cost no layout and no paint.
 */
.entry::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 210, 63, 0.28), rgba(255, 210, 63, 0.06));
  transform: scaleX(var(--charge, 0));
  transform-origin: left center;
  pointer-events: none;
  will-change: transform;
}

.entry.mine::before {
  background: linear-gradient(90deg, rgba(255, 210, 63, 0.52), rgba(255, 210, 63, 0.12));
}

/* Keep the text and controls above the fill. */
.entry > * {
  position: relative;
  z-index: 1;
}

.entry .rank {
  font-family: var(--display);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

/*
 * The domain leads every row. §7 wants the destination visible before the
 * click, and a fetched title is whatever the page decided to call itself —
 * only the domain says where you are actually going.
 */
.entry .domain,
.winners .domain {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82em;
  margin-right: 0.45rem;
  white-space: nowrap;
}

/*
 * A URL path is not a title. When no page title could be fetched, the path
 * trails behind the domain as a quiet detail rather than being dressed up as
 * one — raw slashes reading as a headline is just noise.
 */
.entry .path,
.winners .path {
  color: var(--muted);
  font-size: 0.82em;
}

/* The whole caption is the link, so hover should light all of it. */
.entry .label a:hover .domain,
.winners .label a:hover .domain {
  text-decoration: underline;
}

.entry .label a:hover .title,
.entry .label a:hover .path {
  color: var(--text);
}

.entry.rank-1 .domain {
  color: var(--gold);
}

.entry .label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry .label a {
  font-size: 1.1rem;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.entry .label a:hover {
  border-bottom-color: var(--muted);
}

.entry .host {
  color: var(--muted);
  font-size: 0.7rem;
  margin-left: 0.35rem;
}

.entry .score {
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: right;
}

.entry .score.ticked {
  animation: score-tick 220ms ease-out;
}

@keyframes score-tick {
  0% {
    transform: scale(1.25);
    color: var(--accent);
  }
  100% {
    transform: scale(1);
    color: inherit;
  }
}

/*
 * Always red, never a hover discovery. Reporting is the safety valve on an
 * anonymous link wall — it has to be obvious that it is there.
 */
.entry .report {
  border: none;
  background: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
  line-height: 1;
  opacity: 0.75;
  transition: opacity 120ms ease, transform 120ms ease;
}

.entry .report:hover {
  opacity: 1;
  transform: scale(1.2);
}

.entry .report:disabled {
  color: var(--muted);
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}

/* ----------------------------------------------------------------- coins - */

/*
 * A press throws a coin, not a square. The spin comes from the rotation in the
 * WAAPI keyframes; the gradient and the rim give it an edge to catch the light.
 */
.chip {
  position: fixed;
  top: 0;
  left: 0;
  width: 15px;
  height: 15px;
  margin: -7.5px 0 0 -7.5px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #fff6c9 0%, var(--accent) 45%, #d59f1d 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.45),
    0 0 10px rgba(255, 210, 63, 0.7);
  pointer-events: none;
  z-index: 50;
}

/* Someone else's burst: smaller, cooler, and it does not glow. */
.pop.ghost {
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-color: var(--live);
  border-width: 2px;
}

.chip.ghost {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: radial-gradient(circle at 35% 30%, #b9b9d2 0%, #6f6f8c 70%);
  box-shadow: none;
  opacity: 0.6;
}

.chip.pull {
  background:
    radial-gradient(circle at 35% 28%, #ffd0c8 0%, var(--danger) 45%, #b83828 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.35),
    0 0 10px rgba(255, 107, 82, 0.65);
}

/* The ring a coin leaves where it lands. */
.pop {
  position: fixed;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 49;
}

.pop.pull {
  border-color: var(--danger);
}

/* ------------------------------------------------------ forms and notices - */

#status:empty,
#submit-note:empty,
#submit-modal-note:empty {
  display: none;
}

/* An id rule beats the UA [hidden] style, so say it again louder. */
#challenge[hidden] {
  display: none;
}

#challenge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border: 2px solid var(--accent);
  border-radius: 5px;
  background: var(--panel-lit);
  box-shadow: var(--drop);
  font-size: 0.8rem;
}

#challenge form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

#challenge-question {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent);
}

#submit-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(400px, 88vw);
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}

#add-modal,
#report-modal {
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--drop-lg);
  color: var(--text);
  max-width: calc(100vw - 2rem);
}

#add-modal::backdrop,
#report-modal::backdrop {
  background: rgba(5, 5, 10, 0.75);
}

#add-modal h2 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--live);
}

#report-modal h2 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--danger);
}

#add-modal p,
#report-modal p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

#add-modal form,
#report-modal form {
  padding: 1.25rem 1.35rem 1.1rem;
}

#report-modal p {
  margin-top: 0.65rem;
}

#add-cancel,
#add-submit,
#report-cancel,
#report-confirm {
  padding: 0.45rem 0.8rem;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: var(--panel-lit);
  color: var(--text);
  font: 800 0.72rem/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: var(--drop);
  transition: transform 60ms ease, box-shadow 60ms ease, color 120ms ease;
}

#add-submit {
  border-color: var(--live);
  color: var(--live);
}

#add-cancel:hover,
#add-submit:hover:not(:disabled),
#report-cancel:hover,
#report-confirm:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent-dim);
}

#add-submit:hover:not(:disabled) {
  color: #b8ffd9;
  border-color: var(--live);
}

#report-confirm {
  border-color: var(--danger);
  color: var(--danger);
}

#report-confirm:hover:not(:disabled) {
  color: #ffb8a8;
  border-color: var(--danger);
}

#add-cancel:active,
#add-submit:active:not(:disabled),
#report-cancel:active,
#report-confirm:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #05050a;
}

#add-submit:disabled {
  color: var(--muted);
  cursor: default;
}

input[type="text"],
input[type="number"],
input[type="password"] {
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: var(--sunken);
  color: var(--text);
  font: inherit;
}

input:focus {
  outline: none;
  border-color: var(--accent-dim);
}

#submit-url {
  flex: 1;
  font-size: 0.85rem;
}

#challenge input {
  width: 4rem;
  font-family: var(--mono);
  padding: 0.25rem 0.4rem;
}

#challenge button {
  padding: 0.45rem 0.8rem;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: var(--panel-lit);
  color: var(--text);
  font: 800 0.72rem/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: var(--drop);
  transition: transform 60ms ease, box-shadow 60ms ease, color 120ms ease;
}

#challenge button:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

#challenge button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #05050a;
}

#submit-note,
#submit-modal-note {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.4;
}

#submit-modal-note.bad,
#submit-note.bad {
  color: var(--danger);
}

#submit-modal-note.good,
#submit-note.good {
  color: var(--live);
}
#status {
  font-size: 0.74rem;
  text-align: center;
  color: var(--muted);
}

#status.offline {
  color: var(--danger);
}

/* ---------------------------------------------------------- hall of fame - */

body.page {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: auto;
  grid-template-rows: auto 1fr;
}

header h1 a {
  color: inherit;
  text-decoration: none;
}

#history,
#admin {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
  width: 100%;
}

.day {
  margin-bottom: 2.25rem;
}

.day h2 {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 0.7rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--line);
}

.winners {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.winners li {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.7rem;
  border: 2px solid var(--line-soft);
  border-radius: 4px;
  background: var(--panel);
}

.winners li.won {
  background: var(--panel-lit);
  padding: 0.6rem 0.7rem;
  box-shadow: var(--drop);
}

.winners li:nth-child(1) {
  border-color: var(--gold);
}
.winners li:nth-child(2) {
  border-color: var(--silver);
}
.winners li:nth-child(3) {
  border-color: var(--bronze);
}

.winners li.won .label a {
  font-weight: 700;
}

.winners .rank {
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.winners li.won .rank {
  font-size: 1.1rem;
}

.winners .label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.winners .label a {
  font-size: 1.05rem;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.winners .label a:hover {
  color: var(--accent);
}

.winners .host {
  color: var(--muted);
  font-size: 0.74rem;
  margin-left: 0.4rem;
}

.winners .score {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--muted);
}

.winners li.won .score {
  color: var(--text);
}

/* ----------------------------------------------------------------- admin - */

#admin h2 {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2rem 0 0.7rem;
}

#admin form {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

#admin input {
  flex: 1;
  min-width: 12ch;
}

#admin button {
  padding: 0.45rem 0.8rem;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: var(--panel-lit);
  color: var(--text);
  font: 800 0.72rem/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: var(--drop);
}

/*
 * The reset sits at the top of the panel, not the bottom: the wall list above
 * it can run to a hundred rows, and a control nobody scrolls to is a control
 * nobody knows exists.
 */
.danger-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

#wipe-what {
  flex: 1;
  min-width: 14rem;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
}

#admin button.danger {
  border-color: #6b2b22;
  color: var(--danger);
}

#admin button.danger:hover:not(:disabled) {
  background: #2a1512;
}

#admin button.small {
  padding: 0.3rem 0.6rem;
  font-size: 0.66rem;
  box-shadow: none;
}

#admin-note {
  min-height: 1.2em;
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--muted);
}

#admin-note.bad {
  color: var(--danger);
}

#admin-note.good {
  color: var(--live);
}

/* Loud on purpose: while this is showing, the public numbers are not real. */
#ghost-note {
  margin: 0.9rem 0 0;
  padding: 0.55rem 0.7rem;
  border: 2px solid var(--accent-deep);
  background: rgba(255, 210, 63, 0.07);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--accent);
}

#admin .winners li {
  grid-template-columns: 3.2rem 1fr auto auto;
}

/* ------------------------------------------------------------ responsive - */

@media (prefers-reduced-motion: reduce) {
  .entry {
    transition: none;
  }

  #live.on .pulse {
    animation: none;
  }

  #wall-footer .scroll-hint-arrow {
    animation: none;
  }

  .deck {
    padding: 0;
  }

  .deck-visual {
    position: relative;
    inset: auto;
    perspective: none;
  }

  .deck-plate {
    position: relative;
    left: auto;
    width: 100%;
    min-height: 0;
    height: auto;
    transform: none;
    clip-path: none;
    margin-bottom: -2px;
  }

  .deck-stage {
    transform: none;
    padding-top: 0.75rem;
  }

  .vote-btn:active,
  .vote-btn.down {
    transform: translateY(var(--depth-offset));
  }
}

/* Narrow screens: the control column stacks above the wall. */
/*
 * Below this there is no margin left to sit in, so the caveat rejoins the flow
 * underneath the wall rather than sliding off the side of the screen.
 */
@media (max-width: 1220px) {
  #board {
    gap: 0;
  }
}

@media (max-width: 900px) {
  header:not(.panel-header) {
    gap: 0.45rem 0.7rem;
    padding: 0.5rem 0.7rem;
  }

  header:not(.panel-header) .nav {
    margin-left: 0;
  }

  .panel-header {
    gap: 0.45rem 0.75rem;
    padding-inline: 0.75rem;
  }

  #board {
    padding: 0;
  }

  .cabinet {
    width: 100%;
    max-width: none;
  }

  #wall-panel.panel {
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .cabinet-body {
    border: none;
  }

  .deck {
    width: 100%;
    margin-left: 0;
    padding: 0;
    background: var(--panel);
  }

  .deck-visual {
    position: relative;
    inset: auto;
    perspective: none;
  }

  .deck-plate {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    min-height: 0;
    height: auto;
    transform: none;
    clip-path: none;
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    background: var(--panel);
    box-shadow: none;
  }

  .deck-stage {
    transform: none;
    padding-top: 1rem;
  }

  #control {
    gap: 0.45rem;
  }

  .vote-up {
    --size: min(130px, 34vw, 17vh);
    --size: min(130px, 34vw, 17dvh);
  }

  .vote-down {
    --size: min(95px, 24vw, 12vh);
    --size: min(95px, 24vw, 12dvh);
  }

  #combo {
    font-size: 1rem;
  }
}
