/*
 * ASOC ENGINE - Visual Skin V1
 * 
 * Dark cinematic metallic aesthetic.
 * Translucent panels with background visible through the board.
 * 
 * CSS VARIABLES:
 * --asoc-silver, --asoc-dark, --asoc-panel, --asoc-gold, --asoc-red, --asoc-magenta, --asoc-purple
 * 
 * GEOMETRY: 1900 × 1267 canonical canvas
 * PROTOCOL: Unchanged - this is a VISUAL-ONLY pass
 */

/* ASOC VARIABLES */
:root {
  --canvas-width: 1900px;
  --canvas-height: 1267px;
  --board-aspect: 1900 / 1267;
  
  /* ASOC Color Palette */
  --asoc-silver: #b8bcc8;
  --asoc-dark: #0a0c10;
  --asoc-panel: rgba(15, 17, 22, 0.95);
  --asoc-gold: #d4a843;
  --asoc-red: #c86a6a;
  --asoc-magenta: #9a4a8a;
  --asoc-purple: #7a4a9a;
  
  /* Board */
  --board-bg: rgba(20, 22, 28, 0.85);
  --board-border: #8a8f9e;
  --board-border-dim: #4a4f5e;
  
  /* Cells */
  --cell-bg: rgba(12, 14, 18, 0.7);
  --cell-border: #5a5f6e;
  --text-primary: #e8eaff;
  --text-dim: #a6adbf;
  --text-solution: #c8d0e0;
  --text-final: #ffd700;
  
  /* Accents */
  --accent-silver: #b8bcc8;
  --accent-gold: #d4a843;
  --accent-red: #c86a6a;
  --accent-magenta: #9a4a8a;
  --accent-purple: #7a4a9a;
  
  /* State */
  --revealed-bg: rgba(30, 35, 45, 0.9);
  --hidden-bg: rgba(8, 10, 14, 0.85);
  
  /* Buttons */
  --button-bg: rgba(25, 28, 35, 0.9);
  --button-hover: rgba(40, 45, 55, 0.95);
  --button-border: #6a6f7e;
  --button-active: #d4a843;
  
  /* Panels */
  --panel-bg: rgba(15, 17, 22, 0.95);
  --panel-border: #4a4f5e;
  
  /* Scrollbar */
  --scrollbar-track: rgba(10, 12, 16, 0.5);
  --scrollbar-thumb: #5a5f6e;

  /* Typography */
  --font-system: 'Barlow Condensed', 'Segoe UI', system-ui, sans-serif;
  --font-human: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-machine: Consolas, 'Courier New', ui-monospace, monospace;
}

/* Primary ASOC interface font -- technical/condensed industrial sans,
   self-hosted locally so GM and player devices render the same machinery.
   Human chat/prose is explicitly returned to --font-human where readability
   matters more than command-terminal character. */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/barlow-condensed-semibold.woff2') format('woff2');
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-system);
  background: var(--asoc-dark);
  color: var(--text-primary);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* LAYOUT */
#app-layout {
  display: flex;
  flex-direction: row;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

#main-content {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2vh 2vw;
  background: var(--asoc-dark);
  z-index: 0;
}

/* BACKGROUND LAYER
   Scoped to the board frame ONLY -- this is the "game/play area" background,
   never the application shell. It lives inside #board-layer (which is never
   wiped by Board's innerHTML re-renders -- only #asoc-board's contents are),
   sized to fill exactly that frame's bounds and clipped by its own
   overflow:hidden below. The app shell around it stays neutral gunmetal via
   html/body and #main-content's own opaque background (see above). */
#background-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  filter: brightness(0.7) contrast(1.1);
  transition: opacity 0.5s ease, filter 0.5s ease;
  z-index: 0;
}

#background-layer.loaded {
  opacity: 0.55;
}

/* BOARD FRAME
   The containing block for the game background above -- position:relative +
   overflow:hidden guarantee the selected background can never bleed past
   the board's own rectangle, regardless of image size, aspect mismatch, or
   letterboxing. */
#board-layer {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  width: 100%;
  max-width: var(--canvas-width);
  max-height: var(--canvas-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.asoc-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 1fr) auto;
  gap: 4px;
  background: var(--board-bg);
  border: 2px solid var(--board-border);
  border-radius: 8px;
  padding: 8px;
  box-shadow:
    0 0 40px rgba(0, 0, 0, 0.6),
    inset 0 0 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(138, 143, 158, 0.15);
  backdrop-filter: blur(2px);
  width: 100%;
  max-width: var(--canvas-width);
  max-height: var(--canvas-height);
  aspect-ratio: var(--board-aspect);
}

/* Skeleton poster - fallback path (no CSS container-query support):
   the poster becomes a cover layer filling the classic grid. */
.asoc-board .skeleton-img {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* CLUE CELLS -- text-only overlay, same treatment the FINAL cell already
   used (see below): the skeleton PNG's own chrome pill art is the visual
   container (per skeleton.js: "the silver/chrome pill slots ARE the text
   containers"), so no separate rectangle, border, or glow is drawn on top
   of it here. Position/size are untouched (still set by cellStyle()/the
   grid) -- only the painted chrome is gone. The hidden/revealed mechanic
   now lives purely in .cell-content's opacity/visibility below, not in a
   visible box. */
.board-cell {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Keep the word geometrically centered inside the poster pill.
     Slot geometry is untouched; only internal padding is symmetric. */
  padding: 6px 4px;
  text-align: center;
  min-height: 0;
  position: relative;
}

.board-cell::before {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.7;
  pointer-events: none;
}

/* HIDDEN STATE -- the word itself is what's hidden; the pill graphic
   underneath (part of the skeleton poster) is unaffected either way. */
.board-cell.hidden .cell-content {
  opacity: 0;
  visibility: hidden;
}

/* SOLUTION CELLS A5-D5 -- corner label stays gold to mark the slot as a
   column solution; no separate rectangle/border/glow drawn over the pill. */
.board-cell.solution-cell::before {
  color: var(--accent-gold);
  opacity: 1;
}

/* FINAL SOLUTION — text-only overlay; the skeleton PNG carries the full
   visual treatment (inner dark pill), so no decorative chrome is needed. */
.board-cell.final-solution {
  grid-column: 1 / -1;
  grid-row: 6;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 6px 12px;
  box-shadow: none;
}

.board-cell.final-solution.hidden .cell-content {
  opacity: 0;
  visibility: hidden;
}

/* CELL CONTENT */
.cell-content {
  font-family: var(--font-system);
  font-size: clamp(1.1rem, 2.7vw, 1.5rem);
  letter-spacing: 0.72px;
  line-height: 1;
  /* Optical text correction only: keep every canonical pill/slot fixed.
     The visible glyphs stay ~3 mm right; vertical placement is tuned by eye.
     The 20% horizontal stretch is presentation-only: no pill geometry or
     hit area moves. */
  translate: 0.60cqw calc(0.10em - 0.15cqh);
  scale: 1.20 1;
  color: var(--text-primary);
  word-wrap: break-word;
  max-width: 100%;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Revealed column solutions (A5-D5) default to green -- red only when
   WOMF-tagged 'failed' via the .outcome-failed override further down
   this file (kept at equal selector specificity so source order wins). */
.board-cell.solution-cell .cell-content {
  color: #2ecc71;
  font-weight: 700;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  letter-spacing: 1.08px;
}

/* Final solution ("K") -- same green-default/red-on-fail model as the
   column solutions; gold is no longer used here. */
.board-cell.final-solution .cell-content {
  color: #35d57a;
  font-weight: 900;
  font-size: clamp(1.8rem, 4.4vw, 2.8rem);
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 0 5px rgba(53, 213, 122, 0.32);
}

/* FINAL SOLUTION REVEAL FLOURISH -- Public View / join.html only (see
   updatePublicView()/renderBoard()'s _finalFlourishPlayed flag, which
   ensures this class is only ever present on the FIRST render after the
   reveal, never on an incidental re-render while it stays revealed, so
   the animation plays exactly once and never loops). currentColor picks
   up whichever color the reveal actually resolved to (green success /
   red WOMF-failed via .outcome-failed below), so the flourish is correct
   either way with no extra color logic needed. Pure transform/filter/
   text-shadow -- no change to any box's size, so this can never shift
   board geometry or trigger a reflow of neighboring cells. */
.board-cell.final-solution.final-flourish .cell-content {
  animation: final-solution-flourish 1.1s ease-out;
}

@keyframes final-solution-flourish {
  0% { transform: scale(0.82); opacity: 0; text-shadow: 0 0 0 currentColor; filter: brightness(1); }
  35% { transform: scale(1.14); opacity: 1; text-shadow: 0 0 22px currentColor; filter: brightness(1.6); }
  65% { transform: scale(1.02); text-shadow: 0 0 14px currentColor; filter: brightness(1.25); }
  100% { transform: scale(1); text-shadow: 0 0 0 currentColor; filter: brightness(1); }
}

/* =========================================================
   SKELETON STAGE — canonical 1900 x 1267 poster overlay
   Cells are absolutely positioned with container-size units
   (cqw/cqh: Skeleton.cellStyle in js/skeleton.js) so every
   slot tracks the wrapped poster image at any board size.
   Fans out when the container queries are unsupported.
   ========================================================= */
@supports (container-type: size) {
  .asoc-board,
  .asoc-board .asoc-board {
    container-type: size;
    display: block;
    position: relative;
    background: rgba(10, 12, 16, 0.18);
    border-color: rgba(138, 143, 158, 0.45);
    border-radius: 8px;
    padding: 0;
    backdrop-filter: none;
    overflow: hidden;
    box-shadow:
      0 0 50px rgba(0, 0, 0, 0.6),
      inset 0 1px 0 rgba(138, 143, 158, 0.15);
  }

  .asoc-board .skeleton-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
  }

  .asoc-board.skeleton-ready .skeleton-img.loaded {
    opacity: 1;
  }

  /* Difficulty theatre belongs ONLY to the ASOC logo eye. The canonical
     skeleton poster never fades or moves; transparent eye overlays crossfade
     in-place so the machinery stays perfectly still while the eye changes. */
  .asoc-board .difficulty-eye {
    position: absolute;
    left: 47.368421%;
    top: 78.137332%;
    width: 12.368421%;
    height: 11.444357%;
    z-index: 3;
    pointer-events: none;
    object-fit: fill;
    opacity: 1;
    transition:
      opacity 900ms cubic-bezier(.22,.61,.36,1),
      filter 900ms ease;
    filter: brightness(1) saturate(1);
  }

  .asoc-board .difficulty-eye.eye-transition-in {
    opacity: 0;
    filter: brightness(1.42) saturate(1.38);
  }

  .asoc-board .difficulty-eye.eye-transition-in.eye-transition-active {
    opacity: 1;
    filter: brightness(1) saturate(1);
  }

  .asoc-board .difficulty-eye.eye-transition-out {
    opacity: 0;
    filter: brightness(1.24) saturate(1.18);
  }

  .asoc-board .board-cell {
    position: absolute;
    z-index: 2;
    margin: 0;
    /* Symmetric padding keeps the word in the visual center of
       the pill without touching any canonical slot position or size. */
    padding: 7px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
  }

  .asoc-board .board-cell::before {
    top: 4px;
    left: 6px;
  }

  .asoc-board .board-cell.final-solution {
    padding: 6px 12px;
    border-width: 0;
    background: transparent;
    box-shadow: none;
  }

  .asoc-board .cell-content {
    display: inline-block;
    font-family: var(--font-system);
    font-size: var(--asoc-font, 2.1cqh);
    font-weight: 600;
    letter-spacing: 0.72px;
    line-height: 1;
    white-space: nowrap;
    overflow-wrap: normal;
    /* No max-width/overflow/text-overflow here on purpose: this box must be
       allowed to lay out at its FULL natural (unclipped) size so Skeleton.fit()
       can measure the true scrollWidth/scrollHeight and shrink it with
       transform:scale(). Clipping here would cut text off at layout time,
       before the JS ever gets a chance to shrink it — the pill itself
       (.board-cell, overflow: visible) is what keeps the scaled-down result
       visually contained. */
  }

  .asoc-board .board-cell.solution-cell .cell-content {
    color: #2ecc71;
    font-weight: 700;
    letter-spacing: 1.08px;
  }

  .asoc-board .board-cell.final-solution .cell-content {
    color: #35d57a;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 5px rgba(53, 213, 122, 0.32);
  }

  /* SHADOW BROKER BOARD LINE -- positioned via Skeleton.shadowBrokerLineStyle(),
     same cqw/cqh technique as every board-cell slot. The outer slot is only
     positioning; the text span itself carries the compact gunmetal command
     plaque so its width follows the actual transmission. z-index matches
     .board-cell so it layers above the skeleton art the same way. */
  .asoc-board .shadow-broker-board-line {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    pointer-events: none;
    text-align: center;
  }

  /* Shadow Broker transmission plate: compact gunmetal command plaque.
     Uses the self-hosted ASOC system font so every device renders identically. */
  .asoc-board .shadow-broker-board-line-text {
    font-family: var(--font-system);
    font-size: var(--asoc-font, 1.6cqh);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #e7e9ef;
    text-shadow: 0 0 5px rgba(167, 92, 224, 0.34);
    background:
      linear-gradient(180deg,
        rgba(63, 68, 78, 0.97) 0%,
        rgba(31, 34, 41, 0.97) 48%,
        rgba(13, 15, 19, 0.98) 100%);
    padding: 0.18em 0.68em 0.22em;
    border-radius: 5px;
    border: 1px solid rgba(194, 199, 210, 0.9);
    box-shadow:
      inset 0 0 0 1px rgba(155, 93, 224, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      inset 0 -1px 0 rgba(0, 0, 0, 0.65),
      0 0 10px rgba(155, 93, 224, 0.28),
      0 3px 8px rgba(0, 0, 0, 0.45);
    white-space: nowrap;
  }

  @keyframes shadow-broker-board-interrupt {
    0% { transform: translateX(-3px); filter: contrast(1.6) brightness(1.35); clip-path: inset(0 0 58% 0); }
    35% { transform: translateX(4px); clip-path: inset(35% 0 12% 0); }
    70% { transform: translateX(-2px); filter: contrast(1.25) brightness(1.12); clip-path: inset(8% 0 25% 0); }
    100% { transform: translateX(0); filter: none; clip-path: inset(0); }
  }

  .asoc-board .shadow-broker-board-line.sb-interrupted .shadow-broker-board-line-text {
    animation: shadow-broker-board-interrupt 220ms steps(2, end);
  }

  .asoc-board.skeleton-fallback {
    background: rgba(10, 12, 16, 0.82);
  }
}

/* GM SIDEBAR */
#gm-panel {
  width: 380px;
  flex-shrink: 0;
  height: 100vh;
  background: var(--panel-bg);
  border-left: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10;
}

.gm-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.gm-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-silver);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.gm-subtitle {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gm-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.gm-section {
  margin-bottom: 24px;
}

.gm-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--panel-border);
}

/* GM GRID */
.gm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.gm-cell-btn {
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 4px;
  padding: 8px 6px;
  color: var(--text-primary);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.gm-cell-btn:hover {
  background: var(--button-hover);
  border-color: var(--accent-silver);
}

.gm-cell-btn.revealed {
  background: rgba(46, 204, 113, 0.2);
  border-color: #2ecc71;
  color: #2ecc71;
}

.gm-cell-btn.solution-btn {
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.15), var(--button-bg));
  border-color: var(--accent-gold);
}

.gm-cell-btn.solution-btn.revealed {
  background: rgba(46, 204, 113, 0.25);
  border-color: #2ecc71;
  color: #2ecc71;
}

.gm-cell-btn.final-btn {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.15), var(--button-bg));
  border-color: var(--accent-gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px;
}

.gm-cell-btn.final-btn.revealed {
  background: rgba(46, 204, 113, 0.3);
  border-color: #2ecc71;
  color: #2ecc71;
}

/* WOMF-failed override -- a revealed solution/final slot that was force-
   revealed via a declared column/Final failure reads red instead of the
   normal green-when-revealed color. Three classes here out-specifies the
   two-class ".revealed" rules above regardless of source order. */
.gm-cell-btn.revealed.outcome-failed {
  background: rgba(231, 76, 60, 0.2);
  border-color: #e74c3c;
  color: #e74c3c;
}

.gm-cell-btn.solution-btn.revealed.outcome-failed {
  background: rgba(231, 76, 60, 0.25);
  border-color: #e74c3c;
  color: #e74c3c;
}

.gm-cell-btn.final-btn.revealed.outcome-failed {
  background: rgba(231, 76, 60, 0.3);
  border-color: #e74c3c;
  color: #e74c3c;
}

.gm-cell-btn:active {
  transform: scale(0.98);
}

.gm-cell-btn:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: -2px;
}

/* GM COLUMN CONTROLS */
.gm-column-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

/* WOMF fail-declare row: FAIL A/B/C/D keep the inherited 4-column grid,
   FAIL K (the Final) gets its own full-width row underneath rather than
   wrapping awkwardly into a 5th narrow column. */
.womf-fail-grid {
  margin-bottom: 8px;
}

.womf-fail-grid #womf-fail-final-btn {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.gm-col-btn {
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 4px;
  padding: 8px;
  color: var(--text-primary);
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gm-col-btn:hover {
  background: var(--button-hover);
  border-color: var(--accent-silver);
}

.gm-col-btn:active {
  transform: scale(0.97);
}

.gm-col-btn.revealed {
  background: rgba(212, 168, 67, 0.2);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* GM GLOBAL CONTROLS */
.gm-global-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gm-global-btn {
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 4px;
  padding: 10px;
  color: var(--text-primary);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gm-global-btn:hover {
  background: var(--button-hover);
  border-color: var(--accent-silver);
}

.gm-global-btn.reset-btn {
  grid-column: 1 / -1;
  border-color: #8a4a4a;
  color: #e8a0a0;
}

.gm-global-btn.reset-btn:hover {
  background: rgba(138, 74, 74, 0.2);
  border-color: #c86a6a;
  color: #ffb0b0;
}

.gm-global-btn.undo-btn {
  border-color: #4a6a8a;
  color: #a0c8e8;
}

.gm-global-btn.undo-btn:hover {
  background: rgba(74, 106, 138, 0.2);
  border-color: #6a9acc;
  color: #c0e0ff;
}

.gm-global-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gm-global-btn.revealed {
  background: rgba(212, 168, 67, 0.2);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* GM FOOTER */
.gm-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.background-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bg-label {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.bg-select {
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 4px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.75rem;
  cursor: pointer;
  width: 100%;
}

.bg-select:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: -2px;
}

/* MULTIPLAYER STATUS */
.multiplayer-status {
  font-size: 0.65rem;
}

.mp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--panel-border);
}

.mp-row:last-child {
  border-bottom: none;
}

.mp-label {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mp-value {
  color: var(--text-primary);
  font-weight: 500;
  font-family: var(--font-machine);
}

.mp-code {
  letter-spacing: 2px;
}

#mp-player-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.6rem;
}

.mp-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 4px;
}

.mp-player-name {
  color: #eef0f5;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mp-player-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.55rem;
}

.mp-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.mp-status-dot.connected {
  background: #2ecc71;
  box-shadow: 0 0 6px #2ecc71;
}

.mp-status-dot.disconnected {
  background: #e74c3c;
  box-shadow: 0 0 6px #e74c3c;
}

.mp-status-text {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}


/* =========================================================
   GM COMMAND CONSOLE POLISH
   Visual hierarchy only. No gameplay/state behavior changes.
   ========================================================= */
#gm-panel {
  background:
    linear-gradient(180deg, rgba(18, 21, 28, 0.985), rgba(9, 11, 15, 0.995));
  border-left: 1px solid rgba(174, 182, 198, 0.28);
  box-shadow:
    -18px 0 48px rgba(0, 0, 0, 0.56),
    inset 1px 0 0 rgba(255, 255, 255, 0.025);
}

.gm-header {
  position: relative;
  padding: 18px 20px 16px;
  background:
    linear-gradient(180deg, rgba(34, 38, 47, 0.82), rgba(15, 18, 24, 0.92));
  border-bottom: 1px solid rgba(184, 188, 200, 0.34);
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    0 8px 24px rgba(0, 0, 0, 0.24);
}

.gm-header::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-gold), rgba(212,168,67,0.08) 58%, transparent);
}

.gm-title {
  font-size: 1.34rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #eef1f7;
  text-shadow: 0 1px 0 #000, 0 0 12px rgba(184,188,200,0.10);
}

.gm-subtitle {
  margin-top: 2px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #8f98aa;
}

.gm-content {
  padding: 14px;
}

.gm-module {
  position: relative;
  margin-bottom: 14px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(29, 33, 41, 0.72), rgba(16, 19, 25, 0.82));
  border: 1px solid rgba(100, 108, 124, 0.48);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.035),
    inset 0 -1px 0 rgba(0,0,0,0.55),
    0 8px 18px rgba(0,0,0,0.18);
}

.gm-module::before {
  content: "";
  position: absolute;
  left: 10px;
  top: -1px;
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, rgba(212,168,67,0.85), transparent);
}

.gm-section-title {
  display: flex;
  align-items: center;
  min-height: 18px;
  margin-bottom: 10px;
  padding: 0 0 7px;
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  border-bottom-color: rgba(112, 120, 136, 0.48);
}

.gm-module-clues {
  border-color: rgba(138, 146, 162, 0.58);
  background:
    linear-gradient(180deg, rgba(33, 38, 47, 0.78), rgba(15, 18, 23, 0.88));
}

.gm-grid {
  gap: 8px;
  margin-bottom: 0;
}

.gm-cell-btn {
  min-height: 50px;
  padding: 8px 6px 9px;
  background:
    linear-gradient(180deg, rgba(43, 48, 59, 0.94), rgba(22, 25, 32, 0.98));
  border-color: rgba(128, 137, 154, 0.62);
  border-radius: 6px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.62),
    0 2px 5px rgba(0,0,0,0.32);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.gm-cell-btn > span:first-child {
  margin-bottom: 2px;
  opacity: 0.74;
  letter-spacing: 0.08em;
}

.gm-cell-btn > span:last-child {
  color: #eef1f7;
  font-size: 0.78rem;
  line-height: 1;
}

.gm-cell-btn:hover:not(:disabled):not(.revealed) {
  transform: translateY(-1px);
  border-color: #aeb6c7;
  background:
    linear-gradient(180deg, rgba(54, 60, 72, 0.98), rgba(27, 31, 39, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.09),
    0 4px 10px rgba(0,0,0,0.35);
}

.gm-cell-btn.solution-btn {
  background:
    linear-gradient(180deg, rgba(61, 51, 27, 0.44), rgba(26, 27, 29, 0.96));
  border-color: rgba(212,168,67,0.72);
}

.gm-cell-btn.final-btn {
  min-height: 58px;
  background:
    linear-gradient(90deg, rgba(110,26,30,0.28), rgba(68,31,87,0.40), rgba(35,31,75,0.30));
  border-color: rgba(212,168,67,0.82);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 0 20px rgba(122,74,154,0.08),
    0 3px 8px rgba(0,0,0,0.38);
}

.gm-cell-btn.final-btn > span:last-child {
  font-size: 0.92rem;
  letter-spacing: 0.07em;
}

/* COMPACT GM CLUE GRID — this is a tactical control matrix, not twenty
   miniature billboards. Keep every control readable while reclaiming the
   vertical space the GM actually needs for chat and live controls. */
.gm-module-clues {
  padding: 10px;
}
.gm-module-clues .gm-section-title {
  margin-bottom: 8px;
  padding-bottom: 6px;
}
.gm-module-clues .gm-grid {
  gap: 4px;
}
.gm-module-clues .gm-cell-btn {
  min-height: 40px;
  padding: 4px 3px 5px;
  border-radius: 4px;
  font-size: .58rem;
}
.gm-module-clues .gm-cell-btn > span:first-child {
  margin-bottom: 1px;
  font-size: .48rem;
  line-height: 1;
}
.gm-module-clues .gm-cell-btn > span:last-child {
  font-size: .64rem;
  line-height: .98;
  letter-spacing: 0;
}
.gm-module-clues .gm-cell-btn.solution-btn {
  min-height: 38px;
}
.gm-module-clues .gm-cell-btn.final-btn {
  min-height: 44px;
  padding: 5px 6px;
  margin-top: 1px;
}
.gm-module-clues .gm-cell-btn.final-btn > span:first-child {
  font-size: .48rem;
}
.gm-module-clues .gm-cell-btn.final-btn > span:last-child {
  font-size: .76rem;
  line-height: 1;
  letter-spacing: .045em;
}

.gm-module-columns .gm-column-controls {
  margin-bottom: 0;
}

.gm-col-btn,
.gm-global-btn {
  background:
    linear-gradient(180deg, rgba(39,44,54,0.95), rgba(20,23,29,0.98));
  border-color: rgba(118,127,144,0.62);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.045),
    inset 0 -1px 0 rgba(0,0,0,0.58);
}

.gm-col-btn {
  min-height: 40px;
  font-weight: 700;
  letter-spacing: 0.055em;
}

.gm-col-btn:hover:not(:disabled),
.gm-global-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    0 4px 10px rgba(0,0,0,0.28);
}

.gm-module-womf {
  border-color: rgba(154, 70, 74, 0.55);
  background:
    linear-gradient(180deg, rgba(48, 25, 29, 0.50), rgba(18, 18, 23, 0.90));
}

.gm-module-womf::before {
  background: linear-gradient(90deg, rgba(231,76,60,0.9), transparent);
}

.womf-fail-btn {
  background:
    linear-gradient(180deg, rgba(75,31,35,0.88), rgba(31,20,23,0.96));
  border-color: rgba(200, 84, 84, 0.75) !important;
  color: #efaaaa !important;
  font-weight: 700;
}

#womf-fail-final-btn {
  min-height: 44px;
  border-color: rgba(231,76,60,0.92) !important;
  box-shadow:
    inset 0 0 16px rgba(231,76,60,0.08),
    0 0 10px rgba(231,76,60,0.08);
}

#reset-board-btn {
  border-color: rgba(201,74,74,0.86);
  color: #ffaaaa;
  background:
    linear-gradient(180deg, rgba(79,29,32,0.86), rgba(34,19,22,0.96));
}

#reveal-hide-all-btn {
  border-color: rgba(212,168,67,0.68);
  color: #ead18c;
}

.gm-module-background .background-selector {
  padding: 2px;
}

.bg-select {
  min-height: 40px;
  background:
    linear-gradient(180deg, rgba(38,43,52,0.96), rgba(21,24,30,0.98));
  border-color: rgba(118,127,144,0.70);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  color: #e7edf5;
  color-scheme: dark;
}

/* Native select menus otherwise fall back to Windows' white dropdown while
   keeping ASOC's pale text. Humanity did not need another unreadable menu. */
.bg-select option,
.bg-select optgroup {
  background: #10141b;
  color: #e7edf5;
}
.bg-select option:checked {
  background: #245da8;
  color: #ffffff;
}

.upload-zone {
  padding-top: 4px;
  border-top: 1px solid rgba(100,108,124,0.28);
}

.upload-label {
  background:
    linear-gradient(180deg, rgba(36,40,49,0.92), rgba(20,23,29,0.96));
}

.gm-module-multiplayer {
  border-color: rgba(122,74,154,0.50);
  background:
    linear-gradient(180deg, rgba(35,26,43,0.46), rgba(16,18,23,0.90));
}

.gm-module-multiplayer::before {
  background: linear-gradient(90deg, rgba(155,93,224,0.85), transparent);
}

.mp-row {
  min-height: 29px;
  padding: 5px 2px;
}

.gm-footer {
  padding: 14px 20px 16px;
  background:
    linear-gradient(180deg, rgba(18,21,27,0.98), rgba(9,11,15,1));
  border-top-color: rgba(135,143,158,0.44);
  box-shadow: 0 -10px 28px rgba(0,0,0,0.24);
}

#public-view-btn {
  min-height: 44px;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow:
    inset 0 0 18px rgba(212,168,67,0.07),
    0 0 12px rgba(212,168,67,0.06);
}

#library-btn-footer {
  min-height: 42px;
  font-weight: 700;
  letter-spacing: 0.065em;
}

.gm-logout-btn {
  position: relative;
  width: 100%;
  min-height: 40px;
  margin-top: 10px;
  border-color: rgba(154,58,63,.72) !important;
  background: linear-gradient(180deg,rgba(58,22,26,.92),rgba(18,10,12,.98)) !important;
  color: #e79ca0 !important;
  font-size: .66rem !important;
  font-weight: 800;
  letter-spacing: .105em !important;
  box-shadow: inset 0 0 0 1px rgba(8,4,5,.85),0 0 14px rgba(154,34,42,.08);
}
.gm-logout-btn::before {
  content: "×";
  display: inline-block;
  margin-right: 8px;
  color: #f06469;
  font-size: .9rem;
  line-height: 1;
  text-shadow: 0 0 8px rgba(214,47,56,.48);
  vertical-align: -1px;
}
.gm-logout-btn:hover,
.gm-logout-btn:focus-visible {
  border-color: #e15b61 !important;
  color: #fff !important;
  background: linear-gradient(180deg,rgba(91,28,34,.98),rgba(27,10,13,1)) !important;
  box-shadow: 0 0 0 1px rgba(225,91,97,.32),0 0 18px rgba(185,37,46,.18),inset 0 0 0 1px rgba(8,4,5,.9) !important;
  outline: none;
}
.gm-logout-btn:disabled {
  opacity: .58;
  cursor: wait;
}

/* NEMA ASOC button // toxic hazard face.
   Layers, back to front: acid base -> staggered trefoil field (.nema-pattern)
   -> giant watermark trefoil -> hazard-stripe rails (::before/::after) ->
   label flanked by two spinning trefoils. Presentation only. */
.nema-asoc-btn {
  --nema-lit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cg transform='translate(6 6) scale(.14)'%3E%3Cpath fill='%23c6ff2e' fill-opacity='.34' d='M59.00 65.59L72.50 88.97A45 45 0 0 1 27.50 88.97L41.00 65.59A18 18 0 0 0 59.00 65.59ZM32.00 50.00L5.00 50.00A45 45 0 0 1 27.50 11.03L41.00 34.41A18 18 0 0 0 32.00 50.00ZM59.00 34.41L72.50 11.03A45 45 0 0 1 95.00 50.00L68.00 50.00A18 18 0 0 0 59.00 34.41ZM50 41.5a8.5 8.5 0 1 0 .01 0Z'/%3E%3C/g%3E%3C/svg%3E");
  --nema-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cg transform='translate(6 6) scale(.14)'%3E%3Cpath fill='%23020a00' fill-opacity='.5' d='M59.00 65.59L72.50 88.97A45 45 0 0 1 27.50 88.97L41.00 65.59A18 18 0 0 0 59.00 65.59ZM32.00 50.00L5.00 50.00A45 45 0 0 1 27.50 11.03L41.00 34.41A18 18 0 0 0 32.00 50.00ZM59.00 34.41L72.50 11.03A45 45 0 0 1 95.00 50.00L68.00 50.00A18 18 0 0 0 59.00 34.41ZM50 41.5a8.5 8.5 0 1 0 .01 0Z'/%3E%3C/g%3E%3C/svg%3E");
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  margin-top: 8px;
  min-height: 44px;
  border-color: #b6ff1a !important;
  border-width: 2px !important;
  color: #f6ffb8 !important;
  font-weight: 900;
  letter-spacing: 0.16em;
  background:
    radial-gradient(ellipse at 50% 135%, rgba(208,255,36,.62), transparent 62%),
    radial-gradient(circle at 8% 0, rgba(120,255,0,.32), transparent 45%),
    radial-gradient(circle at 92% 0, rgba(120,255,0,.32), transparent 45%),
    linear-gradient(180deg, #3a7a08 0%, #1b4404 55%, #0a1c02 100%) !important;
  box-shadow:
    inset 0 0 0 1px rgba(3,10,0,.9),
    inset 0 0 22px rgba(160,255,30,.38),
    0 0 14px rgba(140,255,20,.42),
    0 0 34px rgba(90,220,10,.2);
  text-shadow: 0 0 5px #b6ff00, 0 0 13px rgba(130,255,0,.95), 1px 1px 0 #041000, -1px -1px 0 #041000;
  animation: nema-btn-toxic-pulse 2.6s ease-in-out infinite;
}
.nema-asoc-btn > * { position: relative; z-index: 2; }
.nema-asoc-btn .nema-sprite {
  position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none;
}
.nema-asoc-btn .nema-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--nema-dark), var(--nema-lit);
  background-size: 26px 26px, 26px 26px;
  background-position: 13px 13px, 0 0;
  animation: nema-pattern-drift 7s linear infinite;
}
.nema-asoc-btn .nema-mark-bg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  fill: #d8ff3a;
  opacity: .2;
  filter: drop-shadow(0 0 6px #9dff00);
  animation: nema-mark-spin 14s linear infinite;
}
.nema-asoc-btn .nema-label { position: relative; z-index: 3; white-space: nowrap; }
.nema-asoc-btn .nema-nuclear-mark {
  flex: none;
  width: 1.9em;
  height: 1.9em;
  fill: #e4ff4a;
  filter: drop-shadow(0 0 3px #041000) drop-shadow(0 0 7px #a4ff00);
  animation: nema-mark-spin 5.5s linear infinite;
}
.nema-asoc-btn .nema-mark-r { animation-direction: reverse; }
/* hazard-stripe rails */
.nema-asoc-btn::before,
.nema-asoc-btn::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(-45deg, #dcff1f 0 7px, #0b1503 7px 14px);
  background-size: 19.8px 100%;
  box-shadow: 0 0 8px rgba(190,255,20,.7);
  animation: nema-stripes-march 1.1s linear infinite;
}
.nema-asoc-btn::before { top: 0; }
.nema-asoc-btn::after { bottom: 0; animation-direction: reverse; }

.nema-asoc-btn:hover,
.nema-asoc-btn:focus-visible {
  border-color: #eaff5a !important;
  color: #ffffff !important;
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(3,10,0,.9),
    inset 0 0 30px rgba(190,255,40,.55),
    0 0 20px rgba(170,255,30,.7),
    0 0 48px rgba(110,255,10,.4);
}
.nema-asoc-btn:hover .nema-nuclear-mark,
.nema-asoc-btn:focus-visible .nema-nuclear-mark { animation-duration: 1.2s; }
.nema-asoc-btn:hover .nema-pattern,
.nema-asoc-btn:focus-visible .nema-pattern { animation-duration: 2s; }
.nema-asoc-btn:active { transform: translateY(1px); }

@keyframes nema-btn-toxic-pulse {
  0%, 100% { filter: saturate(1) brightness(1); }
  50% { filter: saturate(1.35) brightness(1.16); }
}
@keyframes nema-pattern-drift {
  to { background-position: 39px 39px, 26px 26px; }
}
@keyframes nema-mark-spin { to { transform: rotate(360deg); } }
@keyframes nema-stripes-march { to { background-position: 19.8px 0; } }
@media (prefers-reduced-motion: reduce) {
  .nema-asoc-btn,
  .nema-asoc-btn::before,
  .nema-asoc-btn::after,
  .nema-asoc-btn .nema-pattern,
  .nema-asoc-btn .nema-nuclear-mark { animation: none !important; }
}

/* NEMA ASOC threat effect: five seconds of deliberate audiovisual-style
   visual chaos. No game state changes; this is pure presentation. */
.nema-asoc-overlay {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 35, 35, 0.12), transparent 52%),
    rgba(120, 0, 0, 0.70);
  animation:
    nema-asoc-overlay-flicker 160ms steps(2, end) infinite,
    nema-asoc-overlay-pulse 760ms ease-in-out infinite;
}

.nema-asoc-overlay::before,
.nema-asoc-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.nema-asoc-overlay::before {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0.035) 0,
      rgba(255,255,255,0.035) 1px,
      rgba(0,0,0,0.065) 2px,
      rgba(0,0,0,0.065) 4px
    );
  mix-blend-mode: screen;
  opacity: 0.78;
  animation: nema-asoc-scan 450ms linear infinite;
}

.nema-asoc-overlay::after {
  background:
    linear-gradient(90deg,
      transparent 0 18%,
      rgba(255,255,255,0.07) 18% 22%,
      transparent 22% 67%,
      rgba(0,0,0,0.14) 67% 72%,
      transparent 72% 100%);
  animation: nema-asoc-slice 230ms steps(2, end) infinite;
}

.nema-asoc-text {
  position: relative;
  z-index: 2;
  font-family: var(--font-system);
  font-size: clamp(5rem, 16vw, 15rem);
  font-weight: 900;
  line-height: 0.84;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  color: transparent;
  background:
    linear-gradient(180deg,
      #eef1f5 0%,
      #a2a8b1 28%,
      #505761 52%,
      #1c2027 68%,
      #7e858f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 2px rgba(12, 14, 18, 0.9);
  text-shadow:
    0 2px 0 rgba(255,255,255,0.10),
    0 7px 0 rgba(0,0,0,0.62),
    0 0 18px rgba(0,0,0,0.82);
  filter: contrast(1.18);
  animation: nema-asoc-text-glitch 105ms steps(2, end) infinite;
}

.nema-asoc-text::before,
.nema-asoc-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: #cfd3da;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-stroke: 1px rgba(20,20,24,0.86);
  opacity: 0.78;
  pointer-events: none;
}

.nema-asoc-text::before {
  transform: translate(-5px, -1px);
  color: rgba(255, 45, 55, 0.82);
  clip-path: inset(7% 0 58% 0);
  animation: nema-asoc-text-slice-a 190ms steps(2, end) infinite;
}

.nema-asoc-text::after {
  transform: translate(6px, 2px);
  color: rgba(184, 190, 201, 0.78);
  clip-path: inset(60% 0 8% 0);
  animation: nema-asoc-text-slice-b 240ms steps(2, end) infinite;
}

body.nema-asoc-active > *:not(.nema-asoc-overlay) {
  animation:
    nema-asoc-screen-shake 95ms steps(2, end) infinite,
    nema-asoc-screen-flicker 170ms steps(2, end) infinite;
  transform-origin: center center;
}

@keyframes nema-asoc-screen-shake {
  0%   { transform: translate(0, 0) rotate(0deg); }
  20%  { transform: translate(-7px, 3px) rotate(-0.12deg); }
  40%  { transform: translate(6px, -4px) rotate(0.10deg); }
  60%  { transform: translate(-4px, -2px) rotate(-0.08deg); }
  80%  { transform: translate(7px, 4px) rotate(0.13deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes nema-asoc-screen-flicker {
  0%, 100% { filter: brightness(1) contrast(1); opacity: 1; }
  35% { filter: brightness(0.76) contrast(1.38); opacity: 0.91; }
  48% { filter: brightness(1.25) contrast(1.18); opacity: 0.98; }
  71% { filter: brightness(0.86) contrast(1.28); opacity: 0.94; }
}

@keyframes nema-asoc-overlay-flicker {
  0%, 100% { opacity: 1; }
  33% { opacity: 0.88; }
  36% { opacity: 0.98; }
  73% { opacity: 0.91; }
}

@keyframes nema-asoc-overlay-pulse {
  0%, 100% { filter: saturate(1) contrast(1); }
  50% { filter: saturate(1.22) contrast(1.14); }
}

@keyframes nema-asoc-scan {
  from { transform: translateY(-8px); }
  to { transform: translateY(8px); }
}

@keyframes nema-asoc-slice {
  0%, 100% { transform: translateX(0); opacity: 0.28; }
  40% { transform: translateX(-3%); opacity: 0.62; }
  70% { transform: translateX(4%); opacity: 0.42; }
}

@keyframes nema-asoc-text-glitch {
  0%, 100% { transform: translate(0, 0) skewX(0); }
  25% { transform: translate(-3px, 1px) skewX(-1deg); }
  50% { transform: translate(4px, -2px) skewX(1deg); }
  75% { transform: translate(-2px, 2px) skewX(-0.5deg); }
}

@keyframes nema-asoc-text-slice-a {
  0%, 100% { clip-path: inset(7% 0 58% 0); transform: translate(-5px, -1px); }
  50% { clip-path: inset(28% 0 46% 0); transform: translate(8px, 0); }
}

@keyframes nema-asoc-text-slice-b {
  0%, 100% { clip-path: inset(60% 0 8% 0); transform: translate(6px, 2px); }
  50% { clip-path: inset(43% 0 31% 0); transform: translate(-7px, -1px); }
}

/* NEMA ASOC V2 // staged five-second display takeover. */
.nema-asoc-overlay {
  isolation: isolate;
  grid-template-rows: 1fr auto 1fr;
  padding: clamp(20px, 4vw, 56px);
  background:
    radial-gradient(circle at 50% 50%, rgba(205, 28, 36, 0.22), transparent 34%),
    linear-gradient(115deg, rgba(42, 0, 4, 0.74), rgba(8, 9, 12, 0.9) 46%, rgba(67, 0, 5, 0.76));
  animation: nema-asoc-takeover 5s linear both;
}

.nema-asoc-overlay::before {
  z-index: -1;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, transparent 0 12%, rgba(255,48,56,.04) 12% 12.4%, transparent 12.4% 87%, rgba(255,48,56,.04) 87% 87.4%, transparent 87.4%);
  opacity: .72;
  animation: nema-asoc-scan 1.4s linear infinite;
}

.nema-asoc-overlay::after {
  z-index: 6;
  inset: 10px;
  border: 1px solid rgba(255, 75, 82, .42);
  box-shadow: inset 0 0 0 5px rgba(0,0,0,.34), inset 0 0 80px rgba(190,0,12,.15);
  background: none;
  animation: nema-asoc-frame-acquire .62s steps(3,end) both;
}

.nema-asoc-corruption {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: .45;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(255,56,62,.13) 7% 21%, transparent 21% 58%, rgba(0,0,0,.25) 58% 72%, transparent 72%),
    repeating-linear-gradient(180deg, transparent 0 42px, rgba(255,62,68,.08) 42px 44px, transparent 44px 89px);
  animation: nema-asoc-corruption 1.05s steps(8,end) infinite;
}

.nema-asoc-lock {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(56vmin, 520px);
  aspect-ratio: 1;
  border: 1px solid rgba(255,72,78,.3);
  border-radius: 50%;
  transform: translate(-50%,-50%);
  opacity: .7;
  box-shadow: inset 0 0 48px rgba(220,0,14,.1), 0 0 42px rgba(160,0,10,.08);
  animation: nema-asoc-lock-in .8s cubic-bezier(.2,.8,.2,1) both;
}

.nema-asoc-lock::before,
.nema-asoc-lock::after {
  content: "";
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(255,90,96,.22);
  border-radius: 50%;
}
.nema-asoc-lock::after { inset: 31%; border-style: dashed; animation: nema-asoc-reticle-spin 8s linear infinite; }
.nema-asoc-lock i { position:absolute; background:rgba(255,92,98,.58); box-shadow:0 0 9px rgba(255,30,40,.45); }
.nema-asoc-lock i:nth-child(1),.nema-asoc-lock i:nth-child(2){left:50%;width:1px;height:22%;transform:translateX(-50%)}
.nema-asoc-lock i:nth-child(1){top:-5%}.nema-asoc-lock i:nth-child(2){bottom:-5%}
.nema-asoc-lock i:nth-child(3),.nema-asoc-lock i:nth-child(4){top:50%;height:1px;width:22%;transform:translateY(-50%)}
.nema-asoc-lock i:nth-child(3){left:-5%}.nema-asoc-lock i:nth-child(4){right:-5%}

.nema-asoc-terminal {
  position: relative;
  z-index: 4;
  grid-row: 2;
  min-width: min(92vw, 980px);
  text-align: center;
  animation: nema-asoc-terminal-instability .58s steps(2,end) infinite;
}

.nema-asoc-kicker,
.nema-asoc-phase,
.nema-asoc-counter {
  font-family: var(--font-machine);
  color: rgba(255,190,193,.82);
  font-size: clamp(.58rem, 1.1vw, .78rem);
  font-weight: 800;
  letter-spacing: .28em;
  text-transform: uppercase;
}
.nema-asoc-kicker { margin-bottom: clamp(14px,2.5vh,26px); animation:nema-asoc-label-in .45s steps(3,end) both; }
.nema-asoc-phase { margin-top:clamp(16px,3vh,30px); color:#ff696f; text-shadow:0 0 12px rgba(255,40,48,.4); }
.nema-asoc-phase::before { content:"[ "; }.nema-asoc-phase::after { content:" ]"; }

.nema-asoc-text {
  font-size: clamp(4rem, 13vw, 12rem);
  letter-spacing: .035em;
  color: #c9cdd2;
  background: linear-gradient(180deg,#f0f1f3 0%,#858b93 36%,#292e35 62%,#b4b9c0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 2px rgba(8,10,13,.94);
  text-shadow: 0 6px 0 rgba(0,0,0,.64),0 0 28px rgba(255,28,38,.18);
  filter: contrast(1.12);
  animation: nema-asoc-title-in .9s cubic-bezier(.15,.8,.2,1) both, nema-asoc-title-impact .74s 1.05s steps(2,end) infinite;
}
.nema-asoc-text::before { opacity:.42; animation:nema-asoc-text-slice-a .72s steps(3,end) infinite; }
.nema-asoc-text::after { opacity:.34; animation:nema-asoc-text-slice-b .88s steps(3,end) infinite; }

.nema-asoc-progress {
  position: absolute;
  left: clamp(24px,5vw,76px);
  right: clamp(24px,5vw,76px);
  bottom: clamp(34px,6vh,70px);
  z-index: 5;
  height: 3px;
  background: rgba(255,255,255,.09);
  overflow: hidden;
}
.nema-asoc-progress span { display:block;width:100%;height:100%;transform-origin:left;background:linear-gradient(90deg,#8f111b,#ff5860,#c7cbd0);box-shadow:0 0 14px #f32934;animation:nema-asoc-progress 5s linear both; }
.nema-asoc-counter { position:absolute;right:clamp(24px,5vw,76px);bottom:clamp(13px,2.7vh,34px);z-index:5;font-size:.55rem;color:rgba(210,215,221,.64); }

body.nema-asoc-active > *:not(.nema-asoc-overlay) {
  animation: nema-asoc-world-seize 5s steps(2,end) both;
  transform-origin:center;
}
.nema-asoc-overlay[data-phase="release"] .nema-asoc-terminal { animation:nema-asoc-terminal-release .8s ease-in both; }
.nema-asoc-overlay[data-phase="release"] .nema-asoc-lock { animation:nema-asoc-lock-release .8s ease-in both; }

@keyframes nema-asoc-takeover {0%{opacity:0;clip-path:inset(48% 0)}4%{opacity:1;clip-path:inset(0)}8%{opacity:.78}11%,82%{opacity:1}88%{filter:brightness(1.15)}94%{opacity:1;clip-path:inset(0)}100%{opacity:0;clip-path:inset(49.5% 0)}}
@keyframes nema-asoc-world-seize {0%,2%{transform:none;filter:none}3%{transform:translate(-9px,4px) rotate(-.16deg);filter:brightness(.42) contrast(1.7)}5%{transform:translate(8px,-5px) rotate(.13deg);filter:brightness(1.18) contrast(1.35)}7%{transform:translate(-4px,-2px);filter:brightness(.68) contrast(1.3) saturate(.62)}10%{transform:translate(6px,3px) skewX(.3deg)}13%{transform:translate(-7px,1px) rotate(-.1deg);filter:brightness(.55) contrast(1.55)}17%{transform:translate(3px,-4px);filter:brightness(.8) contrast(1.22)}21%{transform:translate(-2px,2px)}25%{transform:translate(7px,-1px) skewX(-.4deg);filter:brightness(.62) contrast(1.48)}29%{transform:translate(-6px,-3px)}34%{transform:translate(4px,4px);filter:brightness(.9) contrast(1.15)}39%{transform:translate(-8px,0) rotate(-.12deg);filter:brightness(.5) contrast(1.62)}44%{transform:translate(5px,-4px)}49%{transform:translate(-3px,3px) skewX(.35deg);filter:brightness(.72) contrast(1.34)}54%{transform:translate(8px,2px);filter:brightness(.58) contrast(1.52)}59%{transform:translate(-7px,-4px) rotate(.1deg)}64%{transform:translate(3px,1px);filter:brightness(.82) contrast(1.25)}69%{transform:translate(-5px,4px) skewX(-.3deg)}74%{transform:translate(7px,-3px);filter:brightness(.48) contrast(1.68)}79%{transform:translate(-4px,-1px)}83%{transform:translate(9px,3px) rotate(.14deg);filter:brightness(1.06) contrast(1.42)}86%{transform:translate(-8px,-3px);filter:brightness(.55) contrast(1.58)}89%{transform:translate(5px,1px)}92%{transform:translate(-3px,2px);filter:brightness(.75) contrast(1.3)}95%{transform:translate(7px,-2px)}97%{transform:translate(-5px,1px);filter:brightness(.92) contrast(1.12)}100%{transform:none;filter:none}}
@keyframes nema-asoc-corruption {0%,100%{transform:translateX(0);clip-path:inset(0)}7%{transform:translateX(4%);clip-path:inset(6% 0 78%)}13%{transform:translateX(-3%);clip-path:inset(48% 0 31%)}18%{transform:translateX(1%);clip-path:inset(72% 0 9%)}24%{transform:none;clip-path:inset(0)}37%{transform:translateX(-4%);clip-path:inset(19% 0 62%)}43%{transform:translateX(3%);clip-path:inset(58% 0 24%)}49%{transform:none;clip-path:inset(0)}61%{transform:translateX(-5%);clip-path:inset(68% 0 14%)}67%{transform:translateX(4%);clip-path:inset(34% 0 47%)}74%{transform:none;clip-path:inset(0)}86%{transform:translateX(3%);clip-path:inset(11% 0 73%)}92%{transform:translateX(-2%);clip-path:inset(76% 0 8%)}}
@keyframes nema-asoc-frame-acquire {from{opacity:0;transform:scale(1.04)}to{opacity:1;transform:none}}
@keyframes nema-asoc-lock-in {from{opacity:0;transform:translate(-50%,-50%) scale(1.3) rotate(-8deg)}to{opacity:.7;transform:translate(-50%,-50%) scale(1) rotate(0)}}
@keyframes nema-asoc-reticle-spin {to{transform:rotate(360deg)}}
@keyframes nema-asoc-label-in {from{opacity:0;letter-spacing:.7em}to{opacity:1;letter-spacing:.28em}}
@keyframes nema-asoc-title-in {0%{opacity:0;transform:scaleX(1.35) scaleY(.08);filter:blur(8px)}42%{opacity:1;transform:scaleX(.98) scaleY(1.06);filter:blur(0)}62%{transform:scaleX(1.015) scaleY(.99)}100%{transform:none}}
@keyframes nema-asoc-title-impact {0%,54%,100%{transform:none;clip-path:inset(0)}58%{transform:translateX(-9px) skewX(-1deg);clip-path:inset(8% 0 58%)}66%{transform:translateX(11px) skewX(1deg);clip-path:inset(55% 0 12%)}72%{transform:translateX(-4px);clip-path:inset(31% 0 43%)}78%{transform:none;clip-path:inset(0)}}
@keyframes nema-asoc-terminal-instability {0%,100%{transform:translate(0)}18%{transform:translate(-2px,1px)}24%{transform:translate(3px,-1px)}31%,69%{transform:translate(0)}74%{transform:translate(2px,1px)}82%{transform:translate(-3px,-1px)}88%{transform:translate(1px,0)}}
@keyframes nema-asoc-progress {from{transform:scaleX(1)}to{transform:scaleX(0)}}
@keyframes nema-asoc-terminal-release {to{opacity:0;transform:scaleY(.04);filter:blur(4px)}}
@keyframes nema-asoc-lock-release {to{opacity:0;transform:translate(-50%,-50%) scale(.75) rotate(12deg)}}

@media (prefers-reduced-motion: reduce) {
  .nema-asoc-overlay,
  .nema-asoc-overlay *,
  .nema-asoc-overlay::before,
  .nema-asoc-overlay::after,
  body.nema-asoc-active > *:not(.nema-asoc-overlay) { animation:none!important; }
  .nema-asoc-overlay { opacity:1;clip-path:none;background:rgba(92,0,7,.88); }
  .nema-asoc-lock { transform:translate(-50%,-50%);opacity:.55; }
}

/* GAME LOST // server-authoritative terminal ceremony and reconnect state. */
:root { --asoc-defeat:#a91f2d; --asoc-defeat-bright:#e14b55; }
body.game-lost .board-cell.final-solution.revealed {
  box-shadow:0 0 0 1px rgba(190,35,48,.48),0 0 18px rgba(120,10,20,.25);
}
.defeat-overlay {
  position:fixed;inset:0;z-index:200100;overflow:auto;display:grid;place-items:center;
  padding:clamp(18px,4vw,54px);isolation:isolate;color:#d7c8ca;
  background:radial-gradient(circle at 50% 42%,rgba(68,8,14,.34),rgba(3,4,7,.97) 72%);
}
.defeat-noise {position:fixed;inset:0;pointer-events:none;opacity:.16;background:repeating-linear-gradient(0deg,transparent 0 3px,rgba(255,45,58,.13) 4px);mix-blend-mode:screen}
.defeat-frame {position:fixed;inset:12px;border:1px solid rgba(181,38,49,.42);box-shadow:inset 0 0 90px rgba(105,8,18,.16);pointer-events:none}
.defeat-ceremony {width:min(940px,94vw);text-align:center;font-family:var(--font-machine);position:relative;z-index:2}
.defeat-message {max-width:820px;margin:0 auto 32px;font-size:clamp(.78rem,1.6vw,1.1rem);line-height:1.7;letter-spacing:.08em;color:#c4aeb1}
.defeat-ceremony h1 {margin:0;font:900 clamp(3.8rem,11vw,9.5rem)/.9 var(--font-system);letter-spacing:.035em;color:#c7b5b7;text-shadow:0 4px #090305,0 0 26px rgba(189,30,43,.28)}
.defeat-subline {margin:22px 0 0;font-size:clamp(.72rem,1.5vw,1rem);font-style:italic;color:#9b7c80;letter-spacing:.04em}
.defeat-solution {margin:42px auto 0;padding:24px;border:1px solid rgba(185,42,53,.42);background:rgba(12,5,8,.78)}
.defeat-solution>span,.defeat-recount>span {display:block;color:#9a5960;font-size:.62rem;letter-spacing:.24em}
.defeat-solution>strong {display:block;margin:10px 0 20px;color:#eedbdd;font:900 clamp(1.7rem,5vw,3.5rem) var(--font-system);letter-spacing:.08em}
.defeat-columns {display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.defeat-columns span {padding:9px;background:rgba(255,255,255,.025);color:#9f8c8e;font-size:.72rem}.defeat-columns b{color:#c54a55;margin-right:8px}
.defeat-recount {margin:18px auto 0;padding:24px;border-top:1px solid rgba(185,42,53,.28);background:rgba(5,5,8,.86)}
.defeat-recount h2 {margin:18px 0 7px;color:#b68085;font-size:.72rem;letter-spacing:.3em}.defeat-recount>strong,.defeat-recount>b{display:block}.defeat-recount>strong{font-size:1.65rem;color:#e2d5d6}.defeat-recount>b{margin-top:5px;color:#b85d65;font-size:.8rem}
.defeat-awards {display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:18px}.defeat-awards p{margin:0;padding:8px 10px;border:1px solid rgba(135,58,65,.3);font-size:.58rem;color:#9d888a}.defeat-awards small{display:block;margin-top:4px;color:#725f62;font-style:italic}
.defeat-overlay.is-live .defeat-message{animation:defeat-step 2.8s both}.defeat-overlay.is-live h1{animation:defeat-step .8s 2.6s both}.defeat-overlay.is-live .defeat-subline{animation:defeat-step .9s 3.6s both}.defeat-overlay.is-live .defeat-solution{animation:defeat-step .9s 5.1s both}.defeat-overlay.is-live .defeat-recount{animation:defeat-step .9s 8s both}
.defeat-overlay.is-live{animation:defeat-jolt 8s steps(1,end)}
@keyframes defeat-step{from{opacity:0;transform:translateY(8px);filter:blur(4px)}to{opacity:1;transform:none;filter:none}}
@keyframes defeat-jolt{6%,42%{transform:translateX(-2px)}7%,43%{transform:translateX(2px)}8%,44%{transform:none}}
@media(max-width:700px){.defeat-columns{grid-template-columns:repeat(2,1fr)}}
@media(prefers-reduced-motion:reduce){.defeat-overlay *{animation:none!important}.defeat-overlay.is-live .defeat-message,.defeat-overlay.is-live h1,.defeat-overlay.is-live .defeat-subline,.defeat-overlay.is-live .defeat-solution,.defeat-overlay.is-live .defeat-recount{opacity:1}}

/* GAME WON PARITY // the approved loss protocol's exact staged hierarchy,
   translated into the steadier emerald victory language. */
.victory-overlay {
  position:fixed;inset:0;z-index:200000;overflow:auto;display:grid;place-items:center;
  padding:clamp(18px,4vw,54px);isolation:isolate;color:#c8ded3;pointer-events:auto;
  background:radial-gradient(circle at 50% 42%,rgba(8,62,42,.30),rgba(2,7,6,.97) 72%);
  animation:none;
}
.victory-overlay .victory-dim {position:fixed;inset:0;background:radial-gradient(circle at 50% 42%,rgba(12,83,55,.16),transparent 65%)}
.victory-overlay .victory-grid {position:fixed;inset:0;opacity:.32;background:linear-gradient(90deg,rgba(34,230,154,.045) 1px,transparent 1px) 0 0/64px 64px,linear-gradient(rgba(34,230,154,.045) 1px,transparent 1px) 0 0/64px 64px}
.victory-overlay .victory-scan {position:fixed;inset:0;opacity:.18;background:repeating-linear-gradient(0deg,transparent 0 3px,rgba(78,225,161,.11) 4px);animation:victory-scan 2.2s linear infinite}
.victory-overlay .victory-frame {position:fixed;inset:12px;border:1px solid rgba(34,199,132,.42);box-shadow:inset 0 0 90px rgba(8,92,60,.13)}
.victory-ceremony {width:min(940px,94vw);text-align:center;font-family:var(--font-machine);position:relative;z-index:2}
.victory-message {max-width:820px;margin:0 auto 32px;font-size:clamp(.78rem,1.6vw,1.1rem);line-height:1.7;letter-spacing:.08em;color:#adc9bb}
.victory-ceremony .victory-title {margin:0;font:900 clamp(3.8rem,11vw,9.5rem)/.9 var(--font-system);letter-spacing:.035em;color:#cbe2d7;background:none;-webkit-text-stroke:0;text-shadow:0 4px #020807,0 0 26px rgba(34,199,132,.28)}
.victory-ceremony .victory-subline {margin:22px 0 0;font-size:clamp(.72rem,1.5vw,1rem);font-style:italic;color:#79998a;letter-spacing:.04em}
.victory-solution {margin:42px auto 0;padding:24px;border:1px solid rgba(34,199,132,.38);background:rgba(4,14,10,.8)}
.victory-solution>span,.victory-recount>span {display:block;color:#529677;font-size:.62rem;letter-spacing:.24em}
.victory-solution>strong {display:block;margin:10px 0 20px;color:#dff8ec;font:900 clamp(1.7rem,5vw,3.5rem) var(--font-system);letter-spacing:.08em}
.victory-columns {display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.victory-columns span{padding:9px;background:rgba(255,255,255,.025);color:#88a99a;font-size:.72rem}.victory-columns b{color:#36bd82;margin-right:8px}
.victory-recount {margin:18px auto 0;padding:24px;border-top:1px solid rgba(34,199,132,.25);background:rgba(3,10,8,.86)}
.victory-recount h2 {margin:18px 0 7px;color:#76ac93;font-size:.72rem;letter-spacing:.3em}.victory-recount>strong,.victory-recount>b{display:block}.victory-recount>strong{font-size:1.65rem;color:#d9ece3}.victory-recount>b{margin-top:5px;color:#61ad8b;font-size:.8rem}
.victory-overlay.is-live .victory-message{animation:defeat-step 2.8s both}.victory-overlay.is-live .victory-title{animation:defeat-step .8s 2.6s both}.victory-overlay.is-live .victory-subline{animation:defeat-step .9s 3.6s both}.victory-overlay.is-live .victory-solution{animation:defeat-step .9s 5.1s both}.victory-overlay.is-live .victory-recount{animation:defeat-step .9s 8s both}
.victory-overlay.is-live {cursor:pointer}
.victory-overlay.is-settled::after {content:'CLICK TO CONFIRM';position:fixed;right:24px;bottom:18px;color:#6fa58c;font:700 .54rem var(--font-machine);letter-spacing:.18em;animation:defeat-step .5s both}
@media(max-width:700px){.victory-columns{grid-template-columns:repeat(2,1fr)}}
@media(prefers-reduced-motion:reduce){.victory-overlay *{animation:none!important}.victory-overlay.is-live .victory-message,.victory-overlay.is-live .victory-title,.victory-overlay.is-live .victory-subline,.victory-overlay.is-live .victory-solution,.victory-overlay.is-live .victory-recount{opacity:1}}

/* GAME WON // authoritative victory state. Two layers:
   1. LIVE  -- .victory-overlay, played exactly once at the moment of victory
      by Skeleton.playGameWon() (cold, clinical, no confetti).
   2. PERSISTENT -- body.game-won, applied from server state on every load
      and reconnect with NO animation.
   Presentation only: no score, clue, timer, chat or WOMF logic lives here. */
:root {
  --asoc-victory: #16c784;
  --asoc-victory-bright: #22e69a;
}

/* -- GM button: inactive until victory, then a permanent emerald state -- */
.game-won-btn {
  margin-top: 8px;
  min-height: 44px;
  border-color: rgba(76, 112, 96, 0.55) !important;
  color: #8fb8a3 !important;
  font-weight: 900;
  letter-spacing: 0.12em;
  background:
    linear-gradient(180deg, rgba(24, 34, 30, 0.96), rgba(12, 17, 15, 0.98)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color .25s ease, color .25s ease, box-shadow .35s ease;
}

.game-won-btn:hover {
  border-color: rgba(34, 230, 154, 0.55) !important;
  color: #c9ffe9 !important;
}

.game-won-btn.is-cycling {
  border-color: rgba(34, 230, 154, 0.7) !important;
  color: #b8f5d9 !important;
  animation: game-won-cycle .7s ease-in-out infinite;
}

.game-won-btn.is-won {
  border-color: var(--asoc-victory) !important;
  color: #d2fff0 !important;
  background:
    linear-gradient(180deg, rgba(8, 72, 52, 0.96), rgba(3, 32, 24, 0.99)) !important;
  box-shadow:
    inset 0 1px 0 rgba(180,255,225,0.10),
    inset 0 0 18px rgba(22, 199, 132, 0.16),
    0 0 14px rgba(22, 199, 132, 0.18);
  text-shadow: 0 0 8px rgba(34, 230, 154, 0.35);
}

.game-won-btn.is-won-pop { animation: game-won-pop .55s cubic-bezier(.2,.8,.2,1); }

@keyframes game-won-cycle { 50% { box-shadow: 0 0 12px rgba(34,230,154,.35); } }
@keyframes game-won-pop { 0% { transform: scale(1); } 45% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* -- PERSISTENT completed state (no animation; survives every re-render) -- */
body.game-won .board-cell.final-solution.revealed {
  box-shadow: 0 0 0 1px rgba(34, 230, 154, 0.5), 0 0 18px rgba(22, 199, 132, 0.28);
}
body.game-won .board-cell.final-solution.revealed .cell-content {
  text-shadow: 0 0 12px rgba(34, 230, 154, 0.55);
}
body.game-won #board-layer {
  box-shadow: inset 0 0 0 1px rgba(22, 199, 132, 0.16), inset 0 0 60px rgba(22, 199, 132, 0.05);
}
/* Game over = ALL FIVE fields resolved, solved or failed (body.game-complete,
   from the server's gameComplete) -- NOT merely the Final being solved: an
   early Final leaves columns that still need the clue grid and FAIL A-D.
   Chat, judging, RESET BOARD and NEXT GAME deliberately stay live. */
body.game-complete .gm-cell-btn,
body.game-complete #reveal-hide-all-btn,
body.game-complete #undo-btn,
body.game-complete .fail-final-btn {
  pointer-events: none;
  opacity: .4;
  filter: saturate(.5);
}

/* -- LIVE sequence -- */
.victory-overlay {
  --title-size: clamp(3.4rem, 11.5vw, 10rem);
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  pointer-events: auto; /* brief freeze: swallows board interaction */
  cursor: default;
  animation: victory-root 7.2s linear both;
}
.victory-dim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(3, 30, 22, .45), rgba(1, 8, 7, .78) 78%);
}
.victory-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(190,255,225,.035) 0 1px, transparent 1px 4px);
  animation: victory-scan 1.8s linear infinite;
}
.victory-grid {
  position: absolute;
  inset: 0;
  opacity: .5;
  background:
    linear-gradient(90deg, rgba(34,230,154,.05) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(180deg, rgba(34,230,154,.05) 1px, transparent 1px) 0 0 / 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 70%);
  mask-image: radial-gradient(circle at 50% 50%, #000, transparent 70%);
}
.victory-frame {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(34, 230, 154, .3);
  box-shadow: inset 0 0 0 5px rgba(0,0,0,.34), inset 0 0 80px rgba(22,199,132,.10);
}
.victory-fx { position: absolute; inset: 0; pointer-events: none; }

/* board reaction: drawn ON the overlay from measured cell rects, so board
   re-renders (timer ticks) can never wipe it */
.victory-ring {
  position: fixed;
  border: 2px solid var(--asoc-victory-bright);
  border-radius: 6px;
  box-shadow: 0 0 16px rgba(34,230,154,.55), inset 0 0 12px rgba(34,230,154,.25);
  opacity: 0;
  animation: victory-ring .95s ease-out both;
  animation-delay: var(--d, 0ms);
}
.victory-ring.is-final {
  border-width: 3px;
  box-shadow: 0 0 34px rgba(34,230,154,.8), inset 0 0 24px rgba(34,230,154,.4);
  animation-name: victory-ring-final;
  animation-duration: 1.7s;
}
.victory-spark {
  position: fixed;
  left: 0; top: 0;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #b9ffe2;
  box-shadow: 0 0 12px 3px rgba(34,230,154,.75);
  opacity: 0;
}
.victory-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(120, 240, 190, .9);
  box-shadow: 0 0 6px rgba(34,230,154,.7);
  opacity: 0;
  animation: victory-rise var(--dur, 3s) ease-out both;
  animation-delay: var(--d, 0s);
}
.victory-frag {
  position: absolute;
  border: 1px solid rgba(34,230,154,.45);
  background: rgba(34,230,154,.05);
  opacity: 0;
  animation: victory-frag 1.4s steps(4,end) both;
  animation-delay: var(--d, 3.4s);
}

/* system acknowledgement lines: one at a time, cross-fading */
.victory-lines { position: absolute; inset: 0; }
.victory-line {
  position: absolute;
  left: 50%;
  top: 63%; /* below the FINAL pill, which sits on the board's centre line */
  width: min(90vw, 900px);
  text-align: center;
  font-family: var(--font-machine);
  font-size: clamp(.85rem, 1.9vw, 1.35rem);
  font-weight: 700;
  letter-spacing: .16em;
  color: rgba(196, 246, 224, .9);
  text-shadow: 0 0 14px rgba(34,230,154,.35);
  opacity: 0;
  animation: victory-line .7s ease both;
  animation-delay: calc(.2s + var(--i) * .65s);
}
.victory-line:first-child { letter-spacing: .3em; color: var(--asoc-victory-bright); }

.victory-reveal {
  position: relative;
  z-index: 4;
  text-align: center;
}
.victory-title {
  font-size: var(--title-size);
  font-weight: 900;
  line-height: 1;
  letter-spacing: .035em;
  color: #cfe9dc;
  background: linear-gradient(180deg,#f2fff7 0%,#7fe0ad 36%,#14694a 62%,#a9efcb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 2px rgba(3,14,10,.94);
  text-shadow: 0 6px 0 rgba(0,0,0,.6), 0 0 34px rgba(34,230,154,.28);
  opacity: 0;
  animation: victory-title-in .85s cubic-bezier(.15,.8,.2,1) both, victory-title-pulse 1.5s ease-in-out 4.4s infinite;
  animation-delay: 3.55s, 4.4s;
}
.victory-subline {
  margin-top: calc(var(--title-size) * .14);
  font-size: calc(var(--title-size) * .4);
  font-style: italic;
  font-weight: 400;
  letter-spacing: .01em;
  color: rgba(170, 208, 191, .78);
  opacity: 0;
  animation: victory-sub-in 1.1s ease both;
  animation-delay: 4.75s;
}
.victory-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(214,255,236,.6), transparent 62%);
  opacity: 0;
  animation: victory-flash .55s ease-out both;
  animation-delay: 3.55s;
}

@keyframes victory-root { 0% { opacity: 0; } 5% { opacity: 1; } 91% { opacity: 1; } 100% { opacity: 0; } }
@keyframes victory-scan { from { background-position: 0 0; } to { background-position: 0 16px; } }
@keyframes victory-ring {
  0% { opacity: 0; transform: scale(1.35); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: scale(1); }
}
@keyframes victory-ring-final {
  0% { opacity: 0; transform: scale(1.5); }
  20% { opacity: 1; transform: scale(1); }
  55% { opacity: .9; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.12); }
}
@keyframes victory-line {
  0% { opacity: 0; transform: translate(-50%, -42%); filter: blur(3px); }
  22% { opacity: 1; transform: translate(-50%, -50%); filter: blur(0); }
  78% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, -58%); filter: blur(2px); }
}
@keyframes victory-title-in {
  0% { opacity: 0; transform: scale(1.22); filter: blur(9px); }
  55% { opacity: 1; transform: scale(.985); filter: blur(0); }
  100% { opacity: 1; transform: none; }
}
@keyframes victory-title-pulse { 50% { filter: drop-shadow(0 0 18px rgba(34,230,154,.45)); } }
@keyframes victory-sub-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes victory-flash { 0% { opacity: 0; } 14% { opacity: .75; } 100% { opacity: 0; } }
@keyframes victory-rise {
  0% { opacity: 0; transform: translateY(0); }
  20% { opacity: .9; }
  100% { opacity: 0; transform: translateY(-90px); }
}
@keyframes victory-frag { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .victory-overlay,
  .victory-overlay * { animation: none !important; }
  .victory-overlay { opacity: 1; }
  .victory-line, .victory-ring, .victory-particle, .victory-frag, .victory-flash { display: none; }
  .victory-title, .victory-subline { opacity: 1; }
}

/* PUBLIC VIEW
   #public-view is a fixed-fullscreen flex COLUMN: the WOMF/Timer trackers,
   the header (title/theme/difficulty), and the back button are all
   fixed-height siblings (flex-shrink: 0) OUTSIDE the board frame.

   LOCKED geometry rule: the board is canonically 1900x1267 and that ratio
   is sacred everywhere it's shown -- it may scale uniformly but must never
   stretch independently on X or Y. Getting this right needs TWO separate
   boxes, not one:

     .public-board-frame -- the AVAILABLE SPACE. It just takes whatever
       room is left in the flex column (flex: 1 1 auto + min-height: 0) and
       carries NO ratio of its own -- it can legitimately end up any shape
       (wide, tall, whatever fits the viewport).
     .public-board -- the actual RATIO-LOCKED box. It's absolutely
       positioned with inset: 0 + margin: auto inside .public-board-frame,
       with NO explicit width or height of its own -- only
       aspect-ratio + max-width: 100% + max-height: 100%. That combination
       is what lets the browser compute the largest 1900:1267 box that
       fits inside the available frame and center it there (a JS-free
       "contain" -- CSS's object-fit doesn't apply to plain divs, only
       replaced elements like <img>).

   Why not just put aspect-ratio directly on .public-board-frame (one box,
   like the GM's own #board-layer > .asoc-board pattern)? Because here the
   frame ALSO needs flex: 1 1 auto to fill the leftover vertical space
   after the trackers/header/button -- and once flex-grow/shrink resolves
   a definite height for a flex item that ALSO has an explicit
   width: 100% (definite), aspect-ratio has nothing left to derive: both
   axes are already definite, so the ratio is silently ignored and the box
   just stretches to whatever rectangle flex handed it. (The GM's own
   #board-layer avoids this because it does NOT flex-grow its board --
   #main-content just centers a naturally-sized box instead.) Splitting
   into an unconstrained "available space" outer box and a
   width/height-auto "ratio" inner box sidesteps that entirely: the inner
   box never has two independently-definite axes, so aspect-ratio always
   wins.

   Earlier revisions also put the .public-header title/theme text INSIDE
   this frame, which added the header's own height on top of a box whose
   overall shape was meant to be fixed -- the header must render OUTSIDE
   .public-board-frame entirely (see #public-header-bar in index.html /
   player-side equivalent in join.html) so nothing but the board itself
   ever influences the frame's shape. join.html has its own inline copy of
   this same two-box pattern (plus a further .public-board-ratio wrapper,
   since it also has a persistent background image sibling) -- keep both
   in sync. */
#public-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--asoc-dark);
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 2vh 2vw;
  overflow-y: auto;
  overflow-x: hidden;
}

#public-view.active {
  display: flex;
}

.public-board-frame {
  position: relative;
  width: 100%;
  max-width: var(--canvas-width);
  aspect-ratio: var(--board-aspect);
  flex: 0 0 auto;
  min-width: 0;
}

.public-board {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.public-header {
  text-align: center;
  margin-bottom: 16px;
  padding: 0 20px;
  flex-shrink: 0;
}

.public-title {
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 300;
  color: var(--accent-silver);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.public-theme {
  font-size: clamp(0.7rem, 1.5vw, 1rem);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.public-board .asoc-board {
  /* .public-board (the absolutely-positioned box above) already IS the
     exact 1900:1267 rectangle -- the actual .asoc-board content just
     fills it at 100%/100%, no ratio math of its own needed here. */
  position: relative;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  box-shadow:
    0 0 60px rgba(0, 0, 0, 0.8),
    inset 0 0 80px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(138, 143, 158, 0.1);
}

/* TOOLBAR */
.toolbar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 15;
  padding: 0 20px;
}

.toolbar-btn {
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 6px;
  padding: 10px 20px;
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  backdrop-filter: blur(4px);
}

.toolbar-btn:hover {
  background: var(--button-hover);
  border-color: var(--accent-silver);
}

.toolbar-btn.primary {
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.2), rgba(25, 28, 35, 0.9));
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.toolbar-btn.primary:hover {
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.3), rgba(40, 45, 55, 0.95));
}

.toolbar-btn:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* LOADING OVERLAY */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 12, 16, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--panel-border);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* SCROLLBARS */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--button-border);
}

/* GM CHAT PANEL */
.gm-chat-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 220px;
  min-height: 110px;
  max-height: none;
  resize: vertical;
  overflow: hidden;
  box-sizing: border-box;
}

.gm-chat-messages:empty {
  min-height: 34px;
}

.gm-chat-messages:not(:empty) {
  max-height: none;
}

.gm-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--panel-border);
}

.gm-chat-title {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.gm-chat-solved {
  font-size: 0.55rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gm-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 4px 8px 10px;
  min-height: 0;
}

/* Vertical-only GM chat resize. Drag the bottom edge/handle to make the
   Battle Chat taller or shorter; width stays locked to the sidebar. */
.gm-module-chat {
  min-width: 0;
}
.gm-module-chat .gm-chat-panel {
  max-width: 100%;
}
.gm-module-chat .gm-chat-panel::after {
  content: "↕ DRAG";
  flex: 0 0 auto;
  align-self: flex-end;
  margin: 1px 6px 3px 0;
  color: rgba(122,132,145,.55);
  font: 700 .36rem var(--font-machine);
  letter-spacing: .7px;
  pointer-events: none;
}

/* SHADOW BROKER broadcast box -- a compact operator control under the
   GUESSES panel, not another full section. Sends a freestanding
   transmission to players (gm:broadcast); does not touch judging. */
/* Sits directly under the board (#board-layer's sibling in #main-content),
   not in the GM sidebar -- always visible while looking at the board, no
   scrolling needed to fire off a transmission mid-game. Matches the
   board's own width so it reads as part of the same console. */
.gm-broker-bar {
  width: 100%;
  max-width: var(--canvas-width);
  margin-top: 10px;
  flex-shrink: 0;
}

/* LIVE BATTLE CONTROLS
   Deliberately lives under the Shadow Broker transmit bar, directly in the
   operator's eyeline. The sidebar keeps status/adjudication; these are the
   buttons the GM actually hits during play. */
.battle-controls-panel {
  width: 100%;
  max-width: var(--canvas-width);
  margin-top: 8px;
  padding: 10px 12px 12px;
  flex-shrink: 0;
  border: 1px solid #3f4853;
  border-top-color: #66717c;
  border-radius: 5px;
  background:
    linear-gradient(90deg,rgba(212,168,67,.035),transparent 30%,transparent 70%,rgba(187,43,50,.035)),
    linear-gradient(180deg,#181d23,#0b0e12);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.018),
    inset 0 -1px rgba(0,0,0,.75),
    0 8px 20px rgba(0,0,0,.18);
}

.battle-controls-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 0 2px 8px;
  margin-bottom: 9px;
  border-bottom: 1px solid #313842;
}

.battle-controls-header > span {
  color: #d7b458;
  font: 900 .61rem var(--font-system);
  letter-spacing: .16em;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(212,168,67,.14);
}

.battle-controls-header > small {
  color: #737f8c;
  font: 700 .40rem var(--font-machine);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.battle-controls-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
  align-items: stretch;
}

.battle-controls-host-slot {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
  min-width: 0;
}

.battle-controls-panel .gm-global-btn {
  min-height: 46px;
  margin: 0 !important;
  border-radius: 3px;
  font-weight: 900;
  letter-spacing: .10em;
}

.battle-host-btn {
  grid-column: 1 / -1;
  border-color: rgba(212,168,67,.88) !important;
  color: #f0c65d !important;
  background:
    linear-gradient(90deg,rgba(212,168,67,.07),rgba(212,168,67,.18),rgba(212,168,67,.07)),
    linear-gradient(180deg,#211d13,#100f0c) !important;
  box-shadow: inset 0 0 0 1px rgba(255,220,126,.035),0 0 14px rgba(212,168,67,.05);
}

.battle-host-btn:hover {
  border-color: #f1c653 !important;
  color: #ffe49b !important;
  box-shadow: inset 0 0 16px rgba(212,168,67,.08),0 0 18px rgba(212,168,67,.12) !important;
}

.battle-next-btn {
  border-color: rgba(74,116,151,.72) !important;
  color: #9fc8e9 !important;
}


.battle-nema-btn,
.battle-won-btn,
.battle-lost-btn {
  min-height: 46px !important;
  height: 100%;
  margin: 0 !important;
}

.game-lost-btn {
  border-color:rgba(139,42,49,.68)!important;
  color:#b9757b!important;
  background:linear-gradient(180deg,rgba(58,18,23,.96),rgba(24,8,11,.99))!important;
  box-shadow:inset 0 0 14px rgba(190,35,48,.08);
}
.game-lost-btn:disabled {opacity:.78;cursor:not-allowed}
.game-lost-btn.is-testable {opacity:1;cursor:pointer;border-color:rgba(176,47,58,.88)!important;color:#dc8f95!important}
.game-lost-btn.is-testable:hover {border-color:#dc3948!important;color:#ffe1e3!important;box-shadow:inset 0 0 20px rgba(196,35,49,.16),0 0 15px rgba(176,24,38,.18)}
.defeat-overlay.is-test-preview::after {content:'LOCAL PREVIEW // CLICK OR ESC TO CLOSE';position:fixed;right:24px;bottom:18px;color:#8d6266;font:700 .52rem var(--font-machine);letter-spacing:.14em}
.game-lost-btn.is-lost {
  opacity:1;border-color:#c52b39!important;color:#ffd7da!important;
  box-shadow:inset 0 0 20px rgba(196,35,49,.17),0 0 16px rgba(176,24,38,.2);
  text-shadow:0 0 8px rgba(225,55,67,.4);
}

@media (max-width: 900px) {
  .battle-controls-grid { grid-template-columns: 1fr; }
  .battle-controls-header > small { display: none; }
}

.shadow-broker-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(20, 12, 30, 0.55);
}

.shadow-broker-form-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #b78fe0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.shadow-broker-input {
  flex: 1;
  min-width: 0;
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 4px;
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.shadow-broker-input:focus {
  outline: none;
  border-color: #9b5de0;
}

/* Enter pressed while not hosting a room -- cosmetic-only feedback so
   this doesn't silently look broken (see flashShadowBrokerNoRoom in
   app.js). Reuses the same red already used for a wrong-guess verdict
   elsewhere in the GM console, rather than introducing a new color. */
.shadow-broker-form.shadow-broker-no-room .shadow-broker-input {
  border-color: #e74c3c;
  animation: womf-critical-shake 0.4s ease-in-out;
}

.shadow-broker-form.shadow-broker-no-room .shadow-broker-input::placeholder {
  color: #e74c3c;
}

.gm-chat-message {
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
  animation: fadeIn 0.2s ease;
}

.gm-chat-message.has-verdict {
  border-color: var(--accent-gold);
  background: rgba(212, 168, 67, 0.05);
}

.gm-chat-message.wrong {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

.gm-chat-message.correct {
  border-color: #1a1a2e;
  background: rgba(26, 26, 46, 0.3);
}

/* SHADOW BROKER transmission bubble -- shared by both the GM console
   (index.html, via createGMChatMessageHTML) and the player screen
   (join.html, via createChatMessageHTML), built from the ONE markup
   source (Skeleton.shadowBrokerTransmissionHTML in js/skeleton.js) so
   the two views never drift into different-looking implementations.
   Two contexts share it: a standalone broadcast (its own full-width
   chat entry) and a verdict response (a smaller instance nested under
   a judged guess, added alongside -- never replacing -- that guess's
   existing correct/wrong treatment). */
.shadow-broker-transmission {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: 6px;
  background: rgba(139, 74, 200, 0.08);
  border: 1px solid rgba(155, 93, 224, 0.35);
}

.shadow-broker-transmission.shadow-broker-broadcast {
  padding: 8px 10px;
  margin-bottom: 8px;
}

.shadow-broker-transmission.shadow-broker-verdict-response {
  padding: 6px 8px;
  margin-top: 6px;
}

.shadow-broker-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #000;
  border: 1px solid rgba(155, 93, 224, 0.5);
}

.shadow-broker-verdict-response .shadow-broker-avatar {
  width: 26px;
  height: 26px;
}

.shadow-broker-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.shadow-broker-name {
  font-size: 0.55rem;
  font-weight: 700;
  color: #b78fe0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}

/* Command-terminal feel for the Broker's actual words -- condensed,
   authoritative, sharp, but still plainly readable at normal game size.
   Falls back gracefully to Arial Narrow / sans-serif where Bahnschrift
   isn't installed (it ships with Windows; the fallbacks keep this from
   looking broken elsewhere). The message text itself is never forced
   uppercase -- only the SHADOW BROKER name/header above is. */
.shadow-broker-text {
  font-family: var(--font-system);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.4;
  word-wrap: break-word;
}

/* Reuses the exact same muted-red/green already established for the
   player's own guess treatment above -- this is an additional label,
   not a new color language. */
.shadow-broker-verdict-response.sb-wrong .shadow-broker-text {
  color: #b5544a;
}

.shadow-broker-verdict-response.sb-correct .shadow-broker-text {
  color: #5cb87a;
}

/* One-shot arrival effect only -- "a corrupted transmission briefly
   materializes, then stabilizes." Applied via the .sb-glitch-in class,
   which app.js/player.js add only the first time a given transmission
   is ever rendered (see _seenShadowBrokerKeys), so re-rendering the
   same already-displayed message on an unrelated chat update never
   replays it. Pure transform/filter/box-shadow -- no layout shift. */
@keyframes shadow-broker-glitch-in {
  0% {
    opacity: 0;
    transform: translateX(-3px);
    filter: brightness(1.9) saturate(1.6);
  }
  20% {
    opacity: 1;
    transform: translateX(3px);
    filter: brightness(2.2) saturate(1.8);
    box-shadow: 0 0 12px rgba(155, 93, 224, 0.55);
  }
  40% {
    transform: translateX(-2px);
  }
  60% {
    transform: translateX(1px);
    box-shadow: 0 0 10px rgba(155, 93, 224, 0.4);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
    filter: brightness(1) saturate(1);
    box-shadow: none;
  }
}

.shadow-broker-transmission.sb-glitch-in {
  animation: shadow-broker-glitch-in 240ms ease-out;
}

/* LITTLE HERO identity shell: the picture is player-controlled,
   the circular gunmetal structure is ASOC-controlled, and the outer accent
   is intentionally unrestricted HEX chaos. */
.little-hero-avatar {
  --lh-frame: #9B5DE0;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #343944, #0b0d11 72%);
  border: 2px solid #8e96a3;
  box-shadow:
    inset 0 0 0 1px rgba(10, 12, 16, 0.9),
    0 0 0 2px var(--lh-frame),
    0 0 9px var(--lh-frame);
  vertical-align: middle;
}

.little-hero-avatar.little-hero-avatar-compact {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
  border-width: 1px;
  box-shadow:
    inset 0 0 0 1px rgba(10, 12, 16, 0.9),
    0 0 0 1px var(--lh-frame),
    0 0 3px color-mix(in srgb, var(--lh-frame) 65%, transparent);
}

.mp-little-hero .little-hero-avatar-compact {
  width: 23px;
  height: 23px;
  flex-basis: 23px;
}

.little-hero-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.little-hero-avatar-fallback {
  color: #d9dde5;
  font-family: var(--font-system);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.little-hero-avatar-compact .little-hero-avatar-fallback {
  font-size: 0.42rem;
}

.gm-chat-little-hero,
.chat-little-hero,
.lb-little-hero,
.mp-little-hero,
.pl-entry {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.lb-little-hero > span:last-child,
.mp-little-hero > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gm-chat-message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.gm-chat-player-name {
  font-size: 0.74rem;
  font-weight: 700;
  color: #eef0f5;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gm-chat-time {
  font-family: var(--font-machine);
  font-size: 0.55rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.gm-chat-message-text {
  font-family: var(--font-human);
  font-size: 0.85rem;
  color: var(--text-primary);
  word-wrap: break-word;
  line-height: 1.4;
}

/* Verdict-state text treatment: presentation only, driven by the
   authoritative msg.verdict already on the message element -- no
   extra state is introduced. Green = accepted, muted red + faint
   strike = rejected. Unjudged messages are untouched above. */
.gm-chat-message.wrong .gm-chat-message-text {
  color: #d86157;
  text-decoration: line-through;
  text-decoration-color: rgba(255, 72, 72, 0.9);
  text-decoration-thickness: 2px;
}

.gm-chat-message.correct .gm-chat-message-text {
  color: #5cb87a;
}

.gm-chat-verdict {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-size: 1.1rem;
  margin-top: 6px;
  font-weight: 600;
}

.gm-chat-verdict.wrong {
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid #e74c3c;
  color: #e74c3c;
}

.gm-chat-verdict.correct {
  background: rgba(26, 26, 46, 0.5);
  border: 1px solid #1a1a2e;
  color: #fff;
}

.gm-chat-controls {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--panel-border);
}

.gm-verdict-btn {
  flex: 1;
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 4px;
  padding: 8px;
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gm-verdict-btn:hover {
  border-color: var(--accent-silver);
}

.gm-verdict-btn.wrong:hover {
  background: rgba(231, 76, 60, 0.2);
  border-color: #e74c3c;
  color: #e74c3c;
}

.gm-verdict-btn.correct:hover {
  background: rgba(26, 26, 46, 0.5);
  border-color: #1a1a2e;
  color: #fff;
}

/* GM BATTLE CHAT — every player transmission is neutral chat until the GM
   decides it was actually an answer. Ignore it = nothing happens; tap the
   tiny × or black heart only when adjudication is needed. */
.gm-chat-message-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}
.gm-chat-quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.gm-chat-quick-actions .gm-verdict-btn {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 2px;
  font-size: .86rem;
  line-height: 1;
  background: #0b0e12;
  box-shadow: inset 0 1px rgba(255,255,255,.04);
}
.gm-chat-quick-actions .gm-verdict-btn.wrong {
  color: #d86157;
  border-color: rgba(216,97,87,.55);
  font-size: 1.05rem;
  font-weight: 700;
}
.gm-chat-quick-actions .gm-verdict-btn.correct {
  color: #0a0a0d;
  border-color: rgba(111,84,139,.72);
  background: linear-gradient(180deg,#8a6aa7,#4f3d62);
  text-shadow: 0 0 3px rgba(255,255,255,.25);
}
.gm-chat-quick-actions .gm-verdict-btn.wrong:hover {
  color: #ff8278;
  background: rgba(116,34,34,.32);
  border-color: #d86157;
}
.gm-chat-quick-actions .gm-verdict-btn.correct:hover {
  color: #000;
  background: linear-gradient(180deg,#ad8bc9,#6e5287);
  border-color: #9b72bd;
}

/* DISCORD-DENSITY GM CHAT — no card-per-message chrome. The feed uses
   compact grouped rows: avatar/name only start a speaker group, follow-up
   messages tuck directly underneath, and GM verdict controls stay tiny. */
.gm-module-chat .gm-chat-message.discord-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 6px;
  padding: 2px 4px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
}
.gm-module-chat .gm-chat-message.discord-row.group-start {
  margin-top: 5px;
  padding-top: 4px;
}
.gm-module-chat .gm-chat-message.discord-row:first-child {
  margin-top: 0;
}
.gm-module-chat .gm-chat-message.discord-row:hover {
  background: rgba(255,255,255,.035);
}
.gm-module-chat .gm-chat-message.discord-row.wrong {
  background: rgba(112,31,31,.07);
  box-shadow: inset 2px 0 rgba(216,97,87,.62);
}
.gm-module-chat .gm-chat-message.discord-row.correct {
  background: rgba(83,58,104,.08);
  box-shadow: inset 2px 0 rgba(126,92,154,.68);
}
.gm-chat-leading {
  width: 20px;
  min-width: 20px;
  min-height: 18px;
  display: grid;
  place-items: start center;
}
.gm-module-chat .gm-chat-leading .little-hero-avatar-compact {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}
.gm-chat-hover-time {
  visibility: hidden;
  margin-top: 3px;
  color: #69727f;
  font: 700 .34rem var(--font-machine);
  letter-spacing: -.2px;
  white-space: nowrap;
}
.gm-chat-message.discord-row.grouped:hover .gm-chat-hover-time {
  visibility: visible;
}
.gm-chat-inline-content {
  min-width: 0;
  color: #dfe3e9;
  font-family: var(--font-human);
  font-size: .72rem;
  line-height: 1.24;
  overflow-wrap: anywhere;
}
.gm-chat-inline-content .gm-chat-player-name {
  margin-right: 5px;
  color: #eef1f6;
  font-family: var(--font-system);
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.gm-chat-inline-content .gm-chat-time {
  margin-right: 6px;
  color: #727b87;
  font-size: .41rem;
  vertical-align: 1px;
}
.gm-module-chat .gm-chat-message-text {
  display: inline;
  color: #dfe3e9;
  font-size: inherit;
  line-height: inherit;
  text-decoration: none;
}

.gm-module-chat .gm-chat-message.wrong .gm-chat-message-text {
  color: #d86157;
  text-decoration: line-through;
  text-decoration-color: rgba(255, 72, 72, 0.9);
  text-decoration-thickness: 2px;
}

.gm-module-chat .gm-chat-message.correct .gm-chat-message-text {
  color: #5cb87a;
  text-decoration: none;
}
.gm-module-chat .gm-chat-quick-actions {
  align-self: start;
  display: inline-flex;
  gap: 2px;
  margin-left: 3px;
  min-width: 36px;
}
.gm-module-chat .gm-chat-quick-actions.adjudicated {
  visibility: hidden;
}
.gm-module-chat .gm-chat-quick-actions .gm-verdict-btn {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  border-radius: 3px;
  font-size: .58rem;
  opacity: .78;
}
.gm-module-chat .gm-chat-quick-actions .gm-verdict-btn:hover {
  opacity: 1;
}
.gm-module-chat .gm-chat-quick-actions .gm-verdict-btn.wrong {
  font-size: .82rem;
}
.gm-chat-mini-verdict {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 0 3px;
  border: 1px solid rgba(118,127,144,.26);
  border-radius: 2px;
  background: rgba(7,9,12,.58);
  color: #818a96;
  font: 800 .36rem var(--font-machine);
  letter-spacing: .45px;
  line-height: 1.35;
  vertical-align: 1px;
  white-space: nowrap;
}
.gm-chat-mini-verdict.wrong {
  color: #d86157;
  border-color: rgba(216,97,87,.3);
}
.gm-chat-mini-verdict.correct {
  color: #a98bc4;
  border-color: rgba(111,84,139,.4);
}

/* TEAMS-LIKE MESSAGE SEPARATION — compact, but every transmission remains
   its own readable object with sender, time, text and verdict actions. */
.gm-module-chat .gm-chat-message.discord-row {
  margin: 0 0 5px;
  padding: 5px 6px;
  border: 1px solid rgba(95,104,118,.46);
  border-left: 2px solid var(--little-hero-accent,#6f7885);
  border-radius: 5px;
  background: linear-gradient(100deg, var(--theme-message-top,#151A20), var(--theme-message-bottom,#0C0F13) 72%);
  box-shadow: inset 0 1px rgba(255,255,255,.025);
}
.gm-module-chat .gm-chat-message.discord-row:hover {
  background: linear-gradient(100deg, color-mix(in srgb,var(--theme-message-top,#151A20) 90%,#fff 10%), color-mix(in srgb,var(--theme-message-bottom,#0C0F13) 92%,#fff 8%) 72%);
}

/* SKYNET MATERIAL 05 // ADJUDICATION STRIP.
   Neural watermark stays at the far edge and remains weaker than player chat. */
.gm-module-chat .gm-chat-message.discord-row[data-theme-id="gunmetal"] {
  background:
    url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20150%2048'%3E%3Cg%20fill%3D'none'%20stroke%3D'%23C2CAD2'%20stroke-width%3D'1'%3E%3Cpath%20opacity%3D'.065'%20d%3D'M8%2038%20L34%2038%20L46%2026%20L82%2026%20L94%2014%20L140%2014'%2F%3E%3C%2Fg%3E%3Cg%20fill%3D'%23D0D6DC'%3E%3Ccircle%20opacity%3D'.08'%20cx%3D'34'%20cy%3D'38'%20r%3D'1.3'%2F%3E%3Ccircle%20opacity%3D'.075'%20cx%3D'82'%20cy%3D'26'%20r%3D'1.3'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") right 5px center / 138px 44px no-repeat,
    linear-gradient(116deg,rgba(0,0,0,.07) 0%,rgba(229,234,239,.042) 43%,rgba(0,0,0,.065) 100%),
    linear-gradient(180deg,rgba(226,232,238,.030),transparent 31%),
    linear-gradient(100deg,#171c22,#0b0e12 76%);
  box-shadow:inset 0 1px rgba(220,226,232,.045),inset 0 -1px rgba(0,0,0,.60);
}
.gm-module-chat .gm-chat-message.discord-row[data-theme-id="gunmetal"]:hover {
  background:
    url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20150%2048'%3E%3Cg%20fill%3D'none'%20stroke%3D'%23C2CAD2'%20stroke-width%3D'1'%3E%3Cpath%20opacity%3D'.075'%20d%3D'M8%2038%20L34%2038%20L46%2026%20L82%2026%20L94%2014%20L140%2014'%2F%3E%3C%2Fg%3E%3Cg%20fill%3D'%23D0D6DC'%3E%3Ccircle%20opacity%3D'.09'%20cx%3D'34'%20cy%3D'38'%20r%3D'1.3'%2F%3E%3Ccircle%20opacity%3D'.08'%20cx%3D'82'%20cy%3D'26'%20r%3D'1.3'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") right 5px center / 138px 44px no-repeat,
    linear-gradient(116deg,rgba(0,0,0,.065) 0%,rgba(234,238,242,.050) 43%,rgba(0,0,0,.06) 100%),
    linear-gradient(180deg,rgba(232,237,242,.042),transparent 31%),
    linear-gradient(100deg,#1a2027,#0d1115 76%);
}

/* SUGARCOAT MATERIAL 05 // FAIRY CANDY ADJUDICATION STRIP.
   Same resin family as player chat, flattened so GM controls remain dominant. */
.gm-module-chat .gm-chat-message.discord-row[data-theme-id="pink-protocol"] {
  background:
    radial-gradient(circle at 91% 24%,rgba(255,244,250,.12) 0 1px,transparent 1.5px) 0 0 / 21px 21px,
    linear-gradient(116deg,rgba(0,0,0,.05) 0%,rgba(255,227,241,.052) 42%,rgba(0,0,0,.05) 100%),
    linear-gradient(180deg,rgba(255,241,247,.035),transparent 31%),
    linear-gradient(100deg,#442036,#23111d 76%);
  box-shadow:inset 0 1px rgba(255,241,247,.04),inset 0 -1px rgba(0,0,0,.42);
}
.gm-module-chat .gm-chat-message.discord-row[data-theme-id="pink-protocol"]:hover {
  background:
    radial-gradient(circle at 91% 24%,rgba(255,247,251,.14) 0 1px,transparent 1.5px) 0 0 / 21px 21px,
    linear-gradient(116deg,rgba(0,0,0,.045) 0%,rgba(255,233,244,.067) 42%,rgba(0,0,0,.045) 100%),
    linear-gradient(180deg,rgba(255,245,249,.045),transparent 31%),
    linear-gradient(100deg,#4b2440,#26131f 76%);
}

/* VERDANTIS MATERIAL 05 // NEUTRAL ADJUDICATION STRIP.
   Organic scenery stays behind the messages. GM rows are deliberately
   charcoal/bark-neutral so foreground and background never share a skin. */
.gm-module-chat .gm-chat-message.discord-row[data-theme-id="verdantis"] {
  background:
    linear-gradient(180deg,rgba(255,255,255,.025),transparent 24%),
    repeating-linear-gradient(145deg,rgba(126,112,88,.008) 0 1px,transparent 1px 12px),
    linear-gradient(100deg,#191915 0%,#10110f 78%);
  border-color:rgba(119,113,97,.34);
  box-shadow:inset 0 1px rgba(221,212,193,.032),inset 0 -1px rgba(0,0,0,.58);
}
.gm-module-chat .gm-chat-message.discord-row[data-theme-id="verdantis"]:hover {
  background:
    linear-gradient(180deg,rgba(255,255,255,.035),transparent 24%),
    repeating-linear-gradient(145deg,rgba(136,121,94,.010) 0 1px,transparent 1px 12px),
    linear-gradient(100deg,#1e1d19 0%,#121310 78%);
}

/* MY SINDRAGOSA 05 // FROZEN GM ADJUDICATION STRIP. */
.gm-module-chat .gm-chat-message.discord-row[data-theme-id="my-sindragosa"] {
  background:
    linear-gradient(136deg,transparent 0 87%,rgba(128,207,246,.075) 87.4% 87.8%,transparent 88.2% 100%),
    linear-gradient(180deg,rgba(195,235,255,.028),transparent 28%),
    linear-gradient(100deg,#111b23 0%,#091219 78%);
  border-color:rgba(91,145,174,.38);
  box-shadow:inset 0 1px rgba(185,228,249,.04),inset 0 -1px rgba(0,0,0,.60);
}
.gm-module-chat .gm-chat-message.discord-row[data-theme-id="my-sindragosa"]:hover {
  background:
    linear-gradient(136deg,transparent 0 87%,rgba(139,216,253,.10) 87.4% 87.8%,transparent 88.2% 100%),
    linear-gradient(180deg,rgba(205,240,255,.038),transparent 28%),
    linear-gradient(100deg,#14212b 0%,#0b151d 78%);
}
.gm-module-chat .gm-chat-message.discord-row.wrong {
  border-color: rgba(216,97,87,.44);
  border-left-color: #d86157;
  box-shadow: none;
}
.gm-module-chat .gm-chat-message.discord-row.correct {
  border-color: rgba(126,92,154,.5);
  border-left-color: #7e5c9a;
  box-shadow: none;
}
.gm-module-chat .gm-chat-inline-content {
  padding-top: 1px;
}
.gm-module-chat .gm-chat-inline-content .gm-chat-player-name {
  display: inline;
}
.gm-module-chat .gm-chat-inline-content .gm-chat-time {
  display: inline;
}
.gm-module-chat .gm-chat-message-text {
  display: block;
  margin-top: 1px;
}
.gm-module-chat .gm-chat-leading {
  padding-top: 1px;
}
.gm-module-chat .gm-chat-hover-time {
  display:none;
}

.gm-module-chat .gm-chat-reactions {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 3px;
}

.gm-module-chat .gm-chat-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 16px;
  padding: 0 4px;
  border: 1px solid rgba(108,118,132,.38);
  background: rgba(6,8,11,.72);
  color: #aeb6c0;
  font: 700 .42rem var(--font-machine);
}

.gm-module-chat .gm-chat-reaction-chip > span {
  font-family: "Segoe UI Emoji","Apple Color Emoji",sans-serif;
  font-size: .62rem;
}

.gm-module-chat .gm-chat-reaction-chip b {
  color: #d6a843;
  font-size: .39rem;
}

.gm-module-chat .gm-shadow-broker-entry .gm-chat-reactions {
  margin-left: 34px;
  margin-bottom: 4px;
}

/* GM TARGET SELECTOR */
.gm-module-chat .gm-chat-target-controls,
.gm-module-chat .gm-chat-verdict-response {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 5px;
}

.gm-module-chat .gm-chat-target-controls .gm-target-selector {
  width: 100%;
  box-sizing: border-box;
}

.gm-target-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid var(--accent-gold);
  border-radius: 6px;
}

.gm-target-label {
  font-size: 0.55rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: center;
}

.gm-target-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.gm-target-btn {
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 4px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  min-width: 44px;
}

.gm-target-btn:hover {
  background: var(--button-hover);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.gm-target-btn.final {
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.15), var(--button-bg));
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.gm-target-btn.final:hover {
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.3), var(--button-hover));
}

.gm-verdict-clear {
  align-self: center;
  background: transparent;
  border: 1px solid var(--button-border);
  border-radius: 4px;
  padding: 4px 10px;
  color: var(--text-dim);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gm-verdict-clear:hover {
  border-color: #c86a6a;
  color: #e8a0a0;
}

/* PLAYER CHAT (join.html) styles are inline in the HTML file */

/* =========================================================
   FORGE — Game Library + Game Creator
   ========================================================= */

.forge-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.97);
  z-index: 50;
  overflow-y: auto;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px;
}

.forge-overlay.active {
  display: flex;
}

.forge-shell {
  width: 100%;
  max-width: 1520px;
  background: #0e1016;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.forge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--panel-border);
  background: #0c0e14;
}

.forge-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-silver);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.forge-close {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.forge-close:hover {
  border-color: var(--accent-silver);
  color: var(--text-primary);
}

/* FORGE BUTTONS */
.forge-btn {
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 5px;
  padding: 7px 14px;
  color: var(--text-primary);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.forge-btn:hover:not(:disabled) {
  background: var(--button-hover);
  border-color: var(--accent-silver);
}

.forge-btn.primary {
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.22), rgba(25, 28, 35, 0.9));
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.forge-btn.primary:hover {
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.35), rgba(40, 45, 55, 0.95));
}

.forge-btn.danger {
  border-color: var(--asoc-red);
  color: var(--asoc-red);
}

.forge-btn.danger:hover:not(:disabled) {
  background: rgba(200, 106, 106, 0.12);
  border-color: #d08080;
  color: #e8a0a0;
}

.forge-btn.danger:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.forge-btn.ghost {
  background: transparent;
  border-color: var(--panel-border);
  color: var(--text-dim);
}

.forge-btn.ghost:hover {
  border-color: var(--accent-silver);
  color: var(--text-primary);
}

.forge-toolbar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--panel-border);
  background: #0c0e14;
  flex-wrap: wrap;
  align-items: center;
}

.forge-toolbar-row {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--panel-border);
  background: #0c0e14;
  flex-wrap: wrap;
  align-items: center;
}

.forge-input,
.forge-select,
.forge-textarea {
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 5px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.78rem;
  outline: none;
  transition: border-color 0.15s ease;
  width: 100%;
  font-family: inherit;
}

.forge-input:focus,
.forge-select:focus,
.forge-textarea:focus {
  border-color: var(--accent-gold);
}

.forge-textarea {
  resize: vertical;
  min-height: 42px;
}

.forge-toolbar .forge-input {
  max-width: 260px;
}

.forge-toolbar .forge-select {
  max-width: 160px;
  padding: 7px 10px;
  cursor: pointer;
}

/* FORGE LIBRARY */
.forge-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
  padding: 18px 20px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}

.game-card {
  background: #12141a;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.game-card:hover {
  border-color: var(--accent-silver);
}

.game-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.game-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.game-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  word-break: break-word;
}

.game-card-sample {
  font-size: 0.5rem;
  color: var(--text-dim);
  background: rgba(100,100,120,0.25);
  border: 1px solid rgba(100,100,120,0.35);
  border-radius: 4px;
  padding: 1px 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-card-theme {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.game-card-final {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-card-final span {
  color: var(--text-primary);
  font-weight: 600;
}

.game-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.58rem;
  color: var(--text-dim);
  opacity: 0.7;
}

.game-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.difficulty-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  flex-shrink: 0;
}

.diff-green  { background: rgba(46, 204, 113, 0.18); color: #2ecc71; border: 1px solid rgba(46,204,113,0.35); }
.diff-yellow { background: rgba(241, 196, 15, 0.18); color: #f1c40f; border: 1px solid rgba(241,196,15,0.35); }
.diff-amber  { background: rgba(230, 126, 34, 0.18); color: #e67e22; border: 1px solid rgba(230,126,34,0.35); }
.diff-red    { background: rgba(231, 76, 60, 0.18); color: #e74c3c; border: 1px solid rgba(231,76,60,0.35); }
.diff-purple { background: rgba(155, 89, 182, 0.18); color: #9b59b6; border: 1px solid rgba(155,89,182,0.35); }
.diff-black  { background: rgba(26, 26, 46, 0.45); color: #8080a0; border: 1px solid rgba(80,80,100,0.5); }

/* Public-facing badge (Public View + player join page) sits under the
   theme line, a touch larger since it's read from across the room. */
.public-difficulty {
  margin-top: 8px;
  font-size: 0.7rem;
  padding: 3px 10px;
}

/* Live decorative difficulty picker (GM sidebar, current-game-info).
   Solid color swatches -- clicking one is a session-only visual change,
   same as picking a background; it doesn't touch the saved game file. */
.difficulty-picker {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.diff-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.diff-swatch:hover {
  transform: scale(1.12);
}

.diff-swatch.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.diff-swatch-green  { background: #2ecc71; }
.diff-swatch-yellow { background: #f1c40f; }
.diff-swatch-amber  { background: #e67e22; }
.diff-swatch-red    { background: #e74c3c; }
.diff-swatch-purple { background: #9b59b6; }
.diff-swatch-black  { background: #1a1a2e; border-color: #4a4a6a; }
.diff-swatch-black.active { border-color: var(--text-primary); }

/* CURRENT GAME INFO (GM Sidebar) */
.current-game {
  margin-bottom: 10px;
}

.cg-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.cg-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cg-theme {
  font-size: 0.62rem;
  color: var(--text-dim);
}

/* FORGE EMPTY STATE */
.forge-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
}

.forge-empty-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.forge-empty-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
  opacity: 0.6;
}

/* CREATOR */
.creator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 110px);
}

.creator-form {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 110px);
}

.creator-preview {
  display: flex;
  flex-direction: column;
  background: #08090d;
  border-left: 1px solid var(--panel-border);
  overflow: hidden;
}

.creator-preview-header {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--panel-border);
  background: #0a0c10;
}

.creator-preview-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  min-height: 400px;
}

/* The actual framed play area within the preview -- hugs exactly the
   title+board group's own canonical-aspect box, same pattern as
   .public-board-frame in join.html. .creator-preview-stage above fills
   the whole sidebar height and centers this frame within it, which left
   real letterbox space above/below the board; the background image was
   previously sized to that whole stage (bleeding into the letterbox),
   not to this frame. */
.creator-preview-frame {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  width: 100%;
  max-width: var(--canvas-width);
  max-height: var(--canvas-height);
  aspect-ratio: var(--board-aspect);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.creator-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: brightness(0.7) contrast(1.1);
  z-index: 0;
}

.creator-preview-title {
  z-index: 1;
  text-align: center;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.creator-preview-stage .asoc-board {
  z-index: 1;
  max-width: 100%;
}

.creator-section {
  margin-bottom: 20px;
}

.creator-label {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--panel-border);
}

.creator-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.creator-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.creator-col-header {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--accent-silver);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 2px;
}

.cell-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}

.cell-field-label {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cell-field.solution .cell-field-label,
.cell-field.final .cell-field-label {
  color: var(--accent-gold);
}

.cell-field.solution,
.cell-field.final {
  margin-top: 4px;
}

.cell-field.final {
  margin-top: 10px;
}

.upload-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.upload-label {
  display: inline-flex;
  align-items: center;
  background: var(--button-bg);
  border: 1px dashed var(--button-border);
  border-radius: 5px;
  padding: 6px 12px;
  color: var(--text-dim);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.upload-label:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.upload-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upload-note {
  font-size: 0.55rem;
  color: var(--text-dim);
  opacity: 0.6;
}

.upload-status {
  font-size: 0.6rem;
  color: var(--accent-gold);
}

/* FORGE ERRORS / STATUS */
.forge-errors {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--asoc-red);
  background: rgba(200, 106, 106, 0.08);
  border-radius: 6px;
  display: none;
}

.forge-errors:not(:empty) {
  display: block;
}

.forge-errors-title {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--asoc-red);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.forge-error {
  font-size: 0.65rem;
  color: #e8a0a0;
  padding: 2px 0;
}

.forge-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-border);
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  #gm-panel {
    width: 320px;
  }
  
  .gm-cell-btn {
    min-height: 40px;
    padding: 6px 4px;
    font-size: 0.65rem;
  }
}

@media (max-height: 800px) {
  .gm-cell-btn {
    min-height: 36px;
    padding: 5px 4px;
  }
  
  .gm-section {
    margin-bottom: 16px;
  }
}

/* ANIMATIONS */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* =========================================================
   SCORING / PLAYER PROFILES
   ========================================================= */

/* --- GM console: session + all-time leaderboards --- */
.session-leaderboard,
.alltime-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 5px 8px;
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 4px;
  font-size: 0.68rem;
}

.leaderboard-row.leaderboard-lead {
  border-color: var(--accent-gold);
}

.lb-rank {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.lb-name {
  color: #eef0f5;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-score {
  color: var(--accent-gold);
  font-family: var(--font-machine);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.leaderboard-empty {
  color: var(--text-dim);
  font-size: 0.65rem;
  text-align: center;
  padding: 6px;
}

.gm-global-btn.fail-final-btn {
  border-color: #8a4a4a;
  color: #e8a0a0;
}

.gm-global-btn.fail-final-btn:hover {
  background: rgba(138, 74, 74, 0.2);
  border-color: #c86a6a;
  color: #ffb0b0;
}

/* --- Player-facing compact leaderboard strip (join.html) --- */
.player-leaderboard-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--panel-border);
  overflow-x: auto;
  white-space: nowrap;
}

.player-leaderboard-list {
  display: flex;
  gap: 12px;
  flex: 1;
  overflow-x: auto;
}

.pl-entry {
  color: var(--text-dim);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.pl-entry b {
  color: var(--accent-gold);
  font-weight: 600;
  margin-left: 3px;
}

.pl-entry.pl-entry-me {
  color: var(--text-primary);
}

.player-alltime-toggle-btn {
  flex-shrink: 0;
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 3px;
  color: var(--text-dim);
  font-size: 0.58rem;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  cursor: pointer;
}

.player-alltime-toggle-btn:hover {
  border-color: var(--accent-silver);
  color: var(--text-primary);
}

.player-alltime-panel {
  padding: 8px 10px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--panel-border);
  max-height: 160px;
  overflow-y: auto;
}

/* --- Score toasts (column/final award announcements) --- */
#score-announcement-layer {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

/* Multiplayer match ignition: shown once when the GM's START GAME
   countdown completes and the server accepts the timer start. */
.battle-controls-online {
  position: fixed;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  z-index: 10050;
  min-width: min(620px, 88vw);
  padding: 18px 30px 20px;
  text-align: center;
  pointer-events: none;
  font-family: var(--font-system);
  text-transform: uppercase;
  background: linear-gradient(180deg, rgba(42, 45, 51, 0.97), rgba(12, 13, 16, 0.98));
  border: 1px solid rgba(201, 205, 214, 0.9);
  border-radius: 5px;
  box-shadow:
    inset 0 0 0 1px rgba(178, 24, 36, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 28px rgba(210, 22, 36, 0.38),
    0 10px 35px rgba(0, 0, 0, 0.72);
  animation: battle-controls-in 320ms steps(2, end);
}

.battle-controls-title {
  margin: 5px 0;
  color: #f1f2f5;
  font-size: clamp(2rem, 7vw, 4.4rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.08em;
  text-shadow: 0 0 8px rgba(231, 37, 50, 0.72), 2px 0 0 rgba(154, 18, 29, 0.42);
}

.battle-controls-link,
.battle-controls-channel {
  color: #b91f2d;
  font-size: clamp(0.72rem, 2.2vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-shadow: 0 0 7px rgba(210, 22, 36, 0.48);
}

.battle-controls-online-out {
  opacity: 0;
  filter: blur(2px);
  transform: translate(-50%, -50%) scale(1.02);
  transition: opacity 420ms ease, filter 420ms ease, transform 420ms ease;
}

@keyframes battle-controls-in {
  0%   { opacity: 0; transform: translate(-50%, -50%) scaleX(1.08); filter: contrast(1.8); }
  28%  { opacity: 1; transform: translate(-51%, -50%) scaleX(0.98); }
  52%  { opacity: 0.45; transform: translate(-49%, -50%) scaleX(1.03); }
  100% { opacity: 1; transform: translate(-50%, -50%) scaleX(1); filter: contrast(1); }
}

.score-toast {
  pointer-events: auto;
  background: var(--panel-bg);
  border: 1px solid var(--accent-gold);
  border-radius: 6px;
  padding: 10px 14px;
  min-width: 180px;
  text-align: right;
  animation: slideIn 0.25s ease;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.score-toast.score-toast-out {
  opacity: 0;
  transform: translateX(20px);
}

.score-toast-name {
  color: var(--text-primary);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-toast-detail {
  color: var(--text-dim);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.score-toast-points {
  color: var(--accent-gold);
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 4px;
}

.score-toast.score-toast-warning {
  border-color: var(--accent-red);
  text-align: left;
}

.score-toast.score-toast-warning .score-toast-detail {
  color: #e8a0a0;
}

.score-toast.score-toast-compact {
  min-width: 140px;
  padding: 7px 10px;
}

.score-toast.score-toast-compact .score-toast-points {
  font-size: 0.8rem;
}

/* --- Column streak milestone banner --- */
.streak-banner {
  pointer-events: auto;
  background: linear-gradient(135deg, rgba(122, 74, 154, 0.25), var(--panel-bg));
  border: 1px solid var(--accent-purple);
  border-radius: 6px;
  padding: 10px 16px;
  text-align: right;
  animation: slideIn 0.25s ease;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.streak-banner.streak-banner-out {
  opacity: 0;
  transform: translateX(20px);
}

.streak-banner-name {
  color: var(--text-primary);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.streak-banner-label {
  color: #c89ae0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 2px;
}

.streak-banner.streak-banner-compact {
  padding: 7px 10px;
}

.streak-banner.streak-banner-compact .streak-banner-label {
  font-size: 0.7rem;
}

/* --- Final success / failure sequence --- */
.final-outcome-banner {
  pointer-events: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 600;
  min-width: 280px;
  max-width: 420px;
  text-align: center;
  padding: 24px 28px;
  border-radius: 8px;
  background: var(--panel-bg);
  animation: fadeIn 0.35s ease;
  transition: opacity 0.5s ease;
}

.final-outcome-banner.final-outcome-out {
  opacity: 0;
}

.final-outcome-banner.final-outcome-success {
  border: 2px solid #3ecf6e;
  box-shadow: 0 0 24px rgba(62, 207, 110, 0.35);
}

.final-outcome-banner.final-outcome-failed {
  border: 2px solid #1a1a2e;
  box-shadow: 0 0 28px rgba(200, 30, 30, 0.55);
  background: #0c0c14;
}

.fo-headline {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 2px;
}

.final-outcome-success .fo-headline {
  color: #3ecf6e;
}

.final-outcome-failed .fo-headline {
  color: #1a1a2e;
  text-shadow: 0 0 10px #c81e1e, 0 0 22px #c81e1e;
}

.fo-story {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 12px;
  line-height: 1.4;
}

.fo-continue-btn {
  margin-top: 18px;
}

.fo-results {
  margin-top: 16px;
}

.fo-columns-known {
  color: var(--text-solution);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.fo-points {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 6px;
}

.fo-points-positive {
  color: var(--accent-gold);
}

.fo-points-negative {
  color: #ff6a6a;
}

/* =========================================================
   TIMER + BORROWED TIME TRACKER
   Server-authoritative countdown HUD -- lives in the same upper
   pressure-HUD strip as the WOMF tracker (directly above it), as a
   SIBLING of #board-layer / .public-board, never inside it, so it can
   never affect board geometry, pill positions, or clue layout. The same
   markup (js/timer.js) renders on the GM's main view, the GM's Public
   View preview, and the player's join.html; only the GM's main view copy
   shows the START GAME/PAUSE/RESUME controls.

   Visual states, driven purely by [data-phase]/[data-mode]/[data-level]
   (set by timer.js from the server's phase + remaining/duration ratio):
     data-phase="ready"        -- full bar, calm, START GAME enabled
     data-level="calm"         -- >25% of normal duration remaining
     data-level="warning"      -- 10-25% remaining -- warm amber glow
     data-level="danger"       -- <=10% remaining -- red, more urgent
     .timer-critical           -- <=60s remaining -- restrained pulse
     data-mode="borrowed"      -- normal bar hidden, distinct red/purple
                                   Borrowed Time bar shown instead (NOT a
                                   refill of the normal bar)
     .timer-borrowed-critical  -- <=30s of Borrowed Time -- faster pulse
     data-phase="expired"      -- TIME EXPIRED, flickering label
     data-phase="stopped"      -- Final resolved, frozen + muted
   ========================================================= */
.timer-tracker {
  width: 100%;
  max-width: var(--canvas-width);
  margin-bottom: 14px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(180deg, rgba(15, 17, 22, 0.9), rgba(10, 12, 16, 0.95));
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(138, 143, 158, 0.08), 0 0 16px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  position: relative;
}

.timer-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-dim);
  text-transform: uppercase;
  flex-shrink: 0;
}

.timer-bars {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 14px;
}

.timer-bar-track {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: rgba(60, 64, 76, 0.35);
  border: 1px solid rgba(90, 95, 110, 0.4);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timer-tracker[data-mode="normal"] .timer-bar-track-normal { opacity: 1; }
.timer-tracker[data-mode="borrowed"] .timer-bar-track-borrowed { opacity: 1; }

.timer-bar {
  height: 100%;
  width: 100%;
  border-radius: 2px;
  transition: width 1s linear, background 0.4s ease;
}

.timer-bar-normal {
  background: linear-gradient(90deg, #8a8fa0, #c8d0e0);
}

.timer-tracker[data-level="warning"] .timer-bar-normal {
  background: linear-gradient(90deg, #c8963a, #e0b458);
}

.timer-tracker[data-level="danger"] .timer-bar-normal {
  background: linear-gradient(90deg, var(--asoc-red), #e05a5a);
}

.timer-tracker.timer-critical .timer-bar-track-normal {
  animation: timer-critical-pulse 1s ease-in-out infinite;
}

@keyframes timer-critical-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(200, 90, 90, 0); }
  50% { box-shadow: 0 0 12px rgba(224, 90, 90, 0.85); }
}

.timer-bar-borrowed {
  background: linear-gradient(90deg, var(--asoc-purple), var(--asoc-red));
}

.timer-tracker[data-mode="borrowed"] .timer-bar-track-borrowed {
  animation: timer-borrowed-pulse 1.6s ease-in-out infinite;
}

@keyframes timer-borrowed-pulse {
  0%, 100% { box-shadow: inset 0 0 0 rgba(122, 74, 154, 0); }
  50% { box-shadow: inset 0 0 10px rgba(200, 90, 200, 0.5), 0 0 10px rgba(122, 74, 154, 0.6); }
}

.timer-tracker.timer-borrowed-critical .timer-bar-track-borrowed {
  animation: timer-borrowed-critical-pulse 0.5s ease-in-out infinite;
}

@keyframes timer-borrowed-critical-pulse {
  0%, 100% { filter: brightness(1); box-shadow: 0 0 6px rgba(224, 90, 90, 0.4); }
  50% { filter: brightness(1.4); box-shadow: 0 0 18px rgba(224, 90, 224, 0.9); }
}

.timer-count {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
  flex-shrink: 0;
  min-width: 3.6em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.timer-tracker[data-level="warning"] .timer-count { color: #e0b458; }
.timer-tracker[data-level="danger"] .timer-count,
.timer-tracker[data-mode="borrowed"] .timer-count { color: #e05a5a; }

.timer-status {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  flex-shrink: 0;
  min-width: 9em;
  text-align: right;
  transition: color 0.4s ease;
}

.timer-tracker[data-phase="borrowed"] .timer-status,
.timer-tracker[data-phase="borrowed_paused"] .timer-status {
  color: var(--asoc-purple);
  text-shadow: 0 0 8px rgba(122, 74, 154, 0.6);
}

.timer-tracker[data-phase="expired"] .timer-status {
  color: var(--asoc-red);
  text-shadow: 0 0 8px rgba(200, 90, 90, 0.7);
  animation: timer-expired-flicker 1.2s ease-in-out infinite;
}

@keyframes timer-expired-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.timer-tracker[data-phase="stopped"] {
  opacity: 0.6;
}

.timer-tracker[data-phase="paused"] .timer-bar-normal,
.timer-tracker[data-phase="borrowed_paused"] .timer-bar-borrowed {
  filter: saturate(0.5);
}

.timer-controls {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.timer-controls .toolbar-btn {
  padding: 6px 12px;
  font-size: 0.6rem;
}

/* GM manual +/-30s correction -- kept visually compact (a small grouped
   pair, same toolbar-btn sizing as START/PAUSE/RESUME) rather than a
   separate control row. Purely client convenience: click sends
   gm:timerAdjust and the server nudges whichever clock (normal or
   Borrowed Time) is actually active -- see server.js's handleTimerAdjust
   for why this never resets phase or restarts any animation. */
.timer-adjust-group {
  display: flex;
  gap: 4px;
}

.timer-adjust-btn {
  min-width: 2.6em;
  opacity: 0.85;
}

.timer-adjust-btn:hover {
  opacity: 1;
}

/* START GAME 3-2-1 LAUNCH FLASH -- purely client-local (see
   Timer.runStartCountdown()). The server's timer is still sitting in
   'ready' for the whole ~1.5s this plays; nothing broadcasts until it
   completes and the real gm:timerStart goes out. */
.timer-countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  border-radius: 6px;
  background: rgba(8, 9, 13, 0.92);
  color: var(--asoc-gold, #d4a843);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 2px;
  pointer-events: none;
}

.timer-countdown-overlay.timer-countdown-pulse {
  animation: timer-countdown-pulse 0.5s ease-out;
}

@keyframes timer-countdown-pulse {
  0% { transform: scale(0.5); opacity: 0; }
  35% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* BORROWED TIME CALLOUT -- fires once, exactly on the fresh transition
   into Borrowed Time (see the phase-transition check in Timer.update()).
   Confined to the Timer HUD area itself, same as the countdown flash
   above -- it never touches or covers the board, and removes itself
   automatically after ~2s with no looping. */
.timer-borrowed-banner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--asoc-purple), var(--asoc-red));
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 24px rgba(200, 90, 200, 0.7);
  pointer-events: none;
  animation: timer-borrowed-banner-flash 2s ease-in-out forwards;
}

@keyframes timer-borrowed-banner-flash {
  0% { opacity: 0; transform: scale(0.92); }
  12% { opacity: 1; transform: scale(1.03); }
  20% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

@media (max-width: 720px) {
  .timer-tracker {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }
  .timer-bars {
    order: 3;
    flex-basis: 100%;
  }
  .timer-status {
    min-width: 0;
  }
}

/* =========================================================
   WOMF (WHEEL OF MISFORTUNE) TRACKER
   Persistent system-level charge meter. Lives in the HUD strip ABOVE the
   board -- as a SIBLING of #board-layer / .public-board, never inside it --
   so it can never affect board geometry, pill positions, or clue layout.
   The same markup (js/womf.js) renders on the GM's main view, the GM's
   Public View preview, and the player's join.html; only the GM's main
   view additionally shows the OPEN WOMF control (#womf-open-btn, wired in
   js/app.js), never the preview or the player view.

   Visual states, driven purely by [data-state] (set by womf.js from the
   charge total):
     0-3  dormant   -- dark, cold, no animation
     4-7  charging  -- gradual purple/red glow via --womf-intensity
     8    unstable  -- intermittent, restrained 1-2px shake
     9    critical  -- stronger/more frequent shake + counter flicker
     10   ready     -- one-shot arming sequence, then stable "WHEEL READY"
   ========================================================= */
.womf-tracker {
  width: 100%;
  max-width: var(--canvas-width);
  margin-bottom: 14px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(180deg, rgba(15, 17, 22, 0.9), rgba(10, 12, 16, 0.95));
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(138, 143, 158, 0.08), 0 0 16px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  position: relative;
  --womf-intensity: 0;
}

.womf-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-dim);
  text-transform: uppercase;
  flex-shrink: 0;
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

.womf-segments {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.womf-segment {
  flex: 1;
  height: 14px;
  min-width: 6px;
  max-width: 28px;
  border-radius: 2px;
  background: rgba(60, 64, 76, 0.35);
  border: 1px solid rgba(90, 95, 110, 0.4);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.womf-segment.filled {
  background: linear-gradient(180deg, var(--asoc-red), var(--asoc-purple));
  border-color: rgba(230, 120, 120, 0.6);
  box-shadow: 0 0 6px rgba(200, 90, 130, 0.5);
}

.womf-segment.womf-newly-filled {
  animation: womf-segment-light 0.6s ease-out;
}

@keyframes womf-segment-light {
  0% { box-shadow: 0 0 2px rgba(255, 255, 255, 0); background: rgba(60, 64, 76, 0.35); }
  35% { box-shadow: 0 0 18px rgba(255, 200, 200, 0.9); background: #fff2e0; }
  100% { box-shadow: 0 0 6px rgba(200, 90, 130, 0.5); }
}

.womf-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
  flex-shrink: 0;
  min-width: 3.2em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.womf-status {
  font-size: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  flex-shrink: 0;
  min-width: 8em;
  text-align: right;
  transition: color 0.4s ease;
}

.womf-open-btn {
  flex-shrink: 0;
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: not-allowed;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.womf-open-btn.armed {
  cursor: pointer;
  opacity: 1;
  color: var(--asoc-gold);
  border-color: var(--asoc-gold);
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.2), rgba(25, 28, 35, 0.9));
  animation: womf-ready-glow 1.8s ease-in-out infinite;
}

@keyframes womf-ready-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(212, 168, 67, 0.3); }
  50% { box-shadow: 0 0 16px rgba(212, 168, 67, 0.7); }
}

/* CHARGING/AWAKENING (4-7): a slow ambient glow only, intensity ramps with
   --womf-intensity -- never a shake. */
.womf-tracker[data-state="charging"] {
  border-color: rgba(200, 106, 106, 0.5);
  animation: womf-charging-pulse 3.6s ease-in-out infinite;
}

.womf-tracker[data-state="charging"] .womf-label,
.womf-tracker[data-state="unstable"] .womf-label,
.womf-tracker[data-state="critical"] .womf-label {
  color: var(--asoc-red);
  text-shadow: 0 0 8px rgba(200, 106, 106, 0.5);
}

@keyframes womf-charging-pulse {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(138, 143, 158, 0.08), 0 0 16px rgba(0, 0, 0, 0.4); }
  50% { box-shadow: inset 0 1px 0 rgba(138, 143, 158, 0.08), 0 0 calc(16px + var(--womf-intensity) * 14px) rgba(154, 74, 138, calc(0.15 + var(--womf-intensity) * 0.25)); }
}

/* UNSTABLE (8): intermittent and restrained -- long pauses between very
   short 1-2px shakes. "Unease, not visual noise." */
.womf-tracker[data-state="unstable"] {
  border-color: rgba(200, 106, 106, 0.55);
  animation: womf-unstable-shake 4.2s ease-in-out infinite;
}

@keyframes womf-unstable-shake {
  0%, 88%, 100% { transform: translateX(0); }
  89% { transform: translateX(-1.5px); }
  90% { transform: translateX(1.5px); }
  91% { transform: translateX(-1px); }
  92% { transform: translateX(0); }
}

/* CRITICAL (9): more frequent and stronger, with an occasional counter
   flicker -- "must not look like a broken webpage." */
.womf-tracker[data-state="critical"] {
  border-color: rgba(230, 90, 90, 0.75);
  animation: womf-critical-shake 2.4s ease-in-out infinite;
}

@keyframes womf-critical-shake {
  0%, 78%, 100% { transform: translateX(0); }
  79% { transform: translateX(-2.5px); }
  80% { transform: translateX(2px); }
  81% { transform: translateX(-2px); }
  82% { transform: translateX(1.5px); }
  83% { transform: translateX(0); }
}

.womf-tracker[data-state="critical"] .womf-count {
  animation: womf-flicker 2.4s ease-in-out infinite;
}

@keyframes womf-flicker {
  0%, 76%, 79%, 100% { opacity: 1; }
  77%, 78% { opacity: 0.35; }
}

/* ARMING (10, one-shot transition): brief escalation then sudden
   stillness -- "the machine has stopped waiting." This class is added and
   removed by womf.js exactly once per arming event; it never loops. */
.womf-tracker.womf-arming {
  animation: womf-arming-sequence 1.1s cubic-bezier(0.2, 0, 0.1, 1) 1;
}

@keyframes womf-arming-sequence {
  0% { transform: translateX(0); }
  15% { transform: translateX(-2.5px); }
  30% { transform: translateX(2.5px); }
  45% { transform: translateX(-2px); }
  60% { transform: translateX(1.5px); }
  75% { transform: translateX(0); }
  100% { transform: translateX(0); }
}

.womf-tracker.womf-arm-flash {
  animation: womf-arm-flash 0.6s ease-out 1;
}

@keyframes womf-arm-flash {
  0% { box-shadow: inset 0 1px 0 rgba(138, 143, 158, 0.08), 0 0 16px rgba(0, 0, 0, 0.4); border-color: var(--panel-border); }
  30% { box-shadow: 0 0 50px rgba(230, 150, 200, 0.9); border-color: #ffd0e6; }
  100% { box-shadow: inset 0 1px 0 rgba(138, 143, 158, 0.08), 0 0 20px rgba(212, 168, 67, 0.4); border-color: var(--asoc-gold); }
}

/* READY (10, stable): deliberate stillness -- no shake, no flicker, only a
   slow ambient gold glow while it waits, armed, for the GM. */
.womf-tracker[data-state="ready"] {
  border-color: var(--asoc-gold);
  animation: womf-ready-ambient 3s ease-in-out infinite;
}

@keyframes womf-ready-ambient {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(138, 143, 158, 0.08), 0 0 20px rgba(212, 168, 67, 0.35); }
  50% { box-shadow: inset 0 1px 0 rgba(138, 143, 158, 0.08), 0 0 30px rgba(212, 168, 67, 0.55); }
}

.womf-tracker[data-state="ready"] .womf-label,
.womf-tracker[data-state="ready"] .womf-status {
  color: var(--asoc-gold);
  text-shadow: 0 0 10px rgba(212, 168, 67, 0.6);
}

@media (max-width: 720px) {
  .womf-tracker {
    flex-wrap: wrap;
    gap: 8px;
  }
  .womf-segments {
    order: 3;
    width: 100%;
  }
}

/* WOMF: column declared FAILED. Only ever applied to a solution slot
   (A5/B5/C5/D5) that the GM force-revealed via DECLARE [X] FAILED --
   colors the word red instead of the normal reveal color, mirroring how a
   failed Final already gets its own outcome. A pure color override: box
   size/position, font-size, weight and padding are all untouched, and
   this rule is placed after every other .cell-content color declaration
   (fallback and container-query layout paths alike) so it always wins
   regardless of which layout is active. */
.board-cell.outcome-failed .cell-content,
.asoc-board .board-cell.outcome-failed .cell-content {
  color: #ff5a5a;
}

/* =========================================================
   BLOOD TRIBUTE
   WOMF consequence: selected Little Hero submits an image, it remains in
   public Battle Comms for 120 seconds, then only the GM Tribute Vault keeps
   the archived copy.
   ========================================================= */
.blood-tribute-overlay[hidden] { display: none !important; }
.blood-tribute-overlay {
  position: fixed;
  inset: 0;
  z-index: 720;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 5, 8, 0.92);
  backdrop-filter: blur(8px);
}
.blood-tribute-shell {
  width: min(520px, 100%);
  padding: 26px;
  border: 1px solid rgba(210, 67, 67, 0.72);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(39, 14, 17, 0.98), rgba(10, 8, 11, 0.99));
  box-shadow: 0 0 70px rgba(120, 20, 30, 0.34), inset 0 1px rgba(255,255,255,0.04);
  text-align: center;
}
.blood-tribute-kicker,
.blood-tribute-vault-status {
  font: 700 0.58rem var(--font-machine);
  letter-spacing: 1.8px;
  color: #a9aeb8;
  text-transform: uppercase;
}
.blood-tribute-shell h2 {
  margin: 8px 0 6px;
  color: #f1d6d6;
  font: 800 1.05rem var(--font-system);
  letter-spacing: 2px;
}
.blood-tribute-player {
  margin-bottom: 18px;
  color: #d45f65;
  font: 700 0.7rem var(--font-machine);
  letter-spacing: 1px;
}
.blood-tribute-upload {
  display: grid;
  gap: 8px;
  padding: 15px;
  border: 1px dashed rgba(210, 91, 91, 0.55);
  border-radius: 6px;
  background: rgba(0,0,0,0.24);
  color: #d9dce3;
  font: 700 0.62rem var(--font-machine);
  letter-spacing: 1px;
  cursor: pointer;
}
.blood-tribute-upload input { width: 100%; color: #aeb4bf; font-size: 0.72rem; }
.blood-tribute-retention-note {
  margin: 14px 0;
  padding: 10px 12px;
  border-left: 2px solid #8d4b50;
  background: rgba(255,255,255,0.025);
  color: #a8adb7;
  font-size: 0.63rem;
  line-height: 1.5;
  text-align: left;
}
.blood-tribute-submit {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #a64f55;
  border-radius: 5px;
  background: linear-gradient(180deg, #5a2026, #2a1115);
  color: #f2d8da;
  font: 800 0.68rem var(--font-machine);
  letter-spacing: 1.4px;
  cursor: pointer;
}
.blood-tribute-status { min-height: 1.2em; margin-top: 10px; color: #c7cbd3; font: 700 0.58rem var(--font-machine); letter-spacing: 0.8px; }
.chat-blood-tribute-entry,
.gm-chat-blood-tribute-entry {
  margin: 8px 6px;
  padding: 8px;
  border: 1px solid rgba(187, 73, 81, 0.55);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(50, 17, 21, 0.82), rgba(12, 9, 12, 0.94));
  box-shadow: inset 3px 0 #8f343b;
}
.blood-tribute-chat-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: #cf8b8f;
  font: 700 0.54rem var(--font-machine);
  letter-spacing: 0.8px;
}
.blood-tribute-chat-head b { color: #e2c3c5; font-weight: 700; white-space: nowrap; }
.blood-tribute-public-image {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 4px;
  background: #050608;
}
.blood-tribute-vault-status { margin-bottom: 8px; }
.blood-tribute-vault-status.debt-outstanding { color: #d56268; }
.blood-tribute-vault-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}
.blood-tribute-vault-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(121, 74, 79, 0.45);
  border-radius: 5px;
  background: rgba(7, 8, 11, 0.55);
}
.blood-tribute-vault-item img {
  width: 62px;
  height: 52px;
  object-fit: cover;
  border-radius: 3px;
  background: #050608;
}
.blood-tribute-vault-meta { min-width: 0; display: grid; gap: 3px; }
.blood-tribute-vault-meta strong { color: #dedfe4; font: 700 0.62rem var(--font-machine); overflow: hidden; text-overflow: ellipsis; }
.blood-tribute-vault-meta span { color: #858b96; font: 600 0.48rem var(--font-machine); letter-spacing: 0.45px; }

/* =========================================================
   WHEEL OF MISFORTUNE -- the actual spin interface, revealed by
   OPEN WOMF once armed at 10/10 (js/wheel.js renders it; this only
   styles the shell it builds). Shared by index.html (GM, with ROLL/
   CLOSE controls) and join.html (players, read-only) via the same
   #wheel-overlay id + css/asoc.css.
   ========================================================= */
.wheel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 12, 0.97);
  /* Above #score-announcement-layer (500) and .final-outcome-banner (600):
     FAIL K -- one of the two ways WOMF actually reaches 10/10 -- shows
     that banner too, and it stays up until the GM dismisses it, so a
     deliberately-opened Wheel must never end up hidden behind it. */
  z-index: 650;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
}

.wheel-overlay.active {
  display: flex;
}

.wheel-shell {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, rgba(15, 17, 22, 0.96), rgba(10, 12, 16, 0.98));
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(138, 143, 158, 0.1);
  text-align: center;
}

.wheel-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--asoc-gold);
  text-shadow: 0 0 12px rgba(212, 168, 67, 0.5);
  margin-bottom: 22px;
}

.wheel-stage {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
}

.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 20px solid var(--asoc-gold);
  z-index: 3;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.7));
}

.wheel-dial {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 5px solid var(--accent-silver);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.7), inset 0 0 24px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform-origin: 0 0;
}

.wheel-label span {
  position: absolute;
  left: 16px;
  top: -9px;
  display: inline-block;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #0a0c10;
}

.wheel-result {
  margin-top: 22px;
  min-height: 22px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #2ecc71;
  text-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
  transition: opacity 0.3s ease;
}

.wheel-result[data-empty="true"] {
  opacity: 0;
}

.wheel-controls {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* WHEEL SETUP -- GM-only, local (never broadcast) name-selection step
   that OPEN WOMF opens; reuses the .forge-overlay/.forge-shell shell for
   visual consistency with the Game Library. */
.wheel-setup-body {
  padding: 18px 20px 22px;
  text-align: left;
}

.wheel-setup-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.4;
}

.wheel-setup-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 14px;
}

.wheel-setup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 5px;
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
}

.wheel-setup-row:hover {
  border-color: var(--accent-silver);
}

.wheel-setup-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--asoc-gold);
  cursor: pointer;
}

.wheel-setup-add-row {
  display: flex;
  gap: 8px;
}

.wheel-setup-input {
  flex: 1;
  background: var(--button-bg);
  border: 1px solid var(--button-border);
  border-radius: 5px;
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: inherit;
}

.wheel-setup-input:focus {
  outline: none;
  border-color: var(--accent-silver);
}

@media (max-width: 720px) {
  .wheel-stage {
    width: 220px;
    height: 220px;
  }
  .wheel-label span {
    max-width: 76px;
    font-size: 0.58rem;
  }
}

/* =========================================================
   ASOC TELEMETRY RACK — TIMER + WOMF VISUAL OVERHAUL
   Functional state/geometry stay untouched; this is presentation only.
   ========================================================= */
.timer-tracker,
.womf-tracker {
  min-height: 72px;
  margin-bottom: 10px;
  padding: 9px 12px 9px 14px;
  gap: 12px;
  border-radius: 2px;
  border: 1px solid rgba(116, 122, 136, 0.58);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.025), transparent 14%, transparent 86%, rgba(255,255,255,0.02)),
    linear-gradient(180deg, rgba(24,27,34,0.98), rgba(8,10,14,0.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.8),
    0 8px 20px rgba(0,0,0,0.34);
  clip-path: polygon(0 7px, 7px 0, calc(100% - 7px) 0, 100% 7px, 100% calc(100% - 7px), calc(100% - 7px) 100%, 7px 100%, 0 calc(100% - 7px));
}
.timer-tracker::before,
.womf-tracker::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #aeb5c3, #555d69);
  opacity: 0.85;
  pointer-events: none;
}

.timer-identity,
.womf-identity {
  width: 118px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 10px;
  border-right: 1px solid rgba(118,125,140,0.28);
  flex-shrink: 0;
}
.timer-kicker,
.womf-kicker {
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 1.7px;
  color: #676f7e;
  margin-bottom: 2px;
}
.timer-label,
.womf-label {
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #d7dce5;
  text-shadow: 0 1px 0 #000;
}
.timer-core {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 104px minmax(140px, 1fr);
  gap: 12px;
  align-items: center;
}
.timer-readout,
.womf-readout {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.timer-count {
  min-width: 0;
  text-align: left;
  font-size: 1.22rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #edf1f7;
  text-shadow: 0 0 10px rgba(180,190,210,0.14);
}

.timer-status,
.womf-status {
  min-width: 0;
  margin-top: 5px;
  text-align: left;
  font-size: 0.49rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: #7f8796;
}
.timer-bars {
  height: 30px;
  display: block;
  position: relative;
  padding-bottom: 11px;
}
.timer-bar-track {
  top: 0;
  bottom: auto;
  height: 12px;
  border-radius: 1px;
  border-color: rgba(112,120,137,0.5);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 10%),
    rgba(33,37,46,0.82);
}
.timer-bar-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(5,7,10,0.75) calc(10% - 1px) 10%);
  pointer-events: none;
}
.timer-bar-normal {
  background: linear-gradient(90deg, #717987, #c4cad4 72%, #eef2f8);
}
.timer-scale,
.womf-scale {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.42rem;
  font-weight: 800;
  letter-spacing: 1.1px;
  color: #565e6c;
}
.timer-controls {
  padding-left: 10px;
  border-left: 1px solid rgba(118,125,140,0.25);
}
.timer-controls .toolbar-btn,
.womf-open-btn {
  border-radius: 2px;
  min-height: 28px;
}

.womf-meter {
  min-width: 0;
  flex: 1;
  position: relative;
  padding-bottom: 13px;
}
.womf-segments {
  height: 24px;
  gap: 5px;
  align-items: stretch;
}
.womf-segment {
  position: relative;
  max-width: none;
  height: 24px;
  border-radius: 1px;
  background: linear-gradient(180deg, rgba(43,47,57,0.72), rgba(20,23,29,0.95));
  border: 1px solid rgba(98,105,119,0.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}
.womf-segment::before {
  content: attr(data-index);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.42rem;
  font-weight: 900;
  color: rgba(135,142,155,0.45);
}
.womf-segment::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3px;
  height: 2px;
  background: rgba(255,255,255,0.05);
}
.womf-segment.filled {
  background: linear-gradient(180deg, #a83845 0%, #6c273f 48%, #43204f 100%);
  border-color: rgba(217,93,112,0.78);
  box-shadow: inset 0 1px 0 rgba(255,215,220,0.18), 0 0 9px rgba(168,56,79,0.42);
}
.womf-segment.filled::before {
  color: rgba(255,232,236,0.84);
}
.womf-readout {
  width: 82px;
  padding-left: 10px;
  border-left: 1px solid rgba(118,125,140,0.25);
  flex-shrink: 0;
}
.womf-count {
  min-width: 0;
  text-align: left;
  font-size: 1.12rem;
  line-height: 1;
  font-weight: 900;
}
.womf-count-max {
  margin-left: 2px;
  font-size: 0.56rem;
  color: #626b79;
}

.timer-tracker[data-level="warning"]::before { background: linear-gradient(180deg, #e0b458, #8a6428); }
.timer-tracker[data-level="danger"]::before { background: linear-gradient(180deg, #e05a5a, #7e2424); }
.timer-tracker[data-mode="borrowed"]::before { background: linear-gradient(180deg, var(--asoc-red), var(--asoc-purple)); }
.timer-tracker[data-mode="borrowed"] .timer-label,
.timer-tracker[data-mode="borrowed"] .timer-kicker { color: #d86a88; }
.womf-tracker[data-state="charging"]::before,
.womf-tracker[data-state="unstable"]::before,
.womf-tracker[data-state="critical"]::before { background: linear-gradient(180deg, #d35d65, #6d294d); }
.womf-tracker[data-state="ready"]::before { background: linear-gradient(180deg, #f1cf76, #9b712b); }
.womf-open-btn.armed {
  color: #f1cf76;
  background: linear-gradient(180deg, rgba(105,79,27,0.92), rgba(41,31,15,0.96));
}
@media (max-width: 720px) {
  .timer-tracker,
  .womf-tracker { min-height: 0; padding: 8px 10px; }
  .timer-identity,
  .womf-identity { width: 88px; }
  .timer-core { grid-template-columns: 82px minmax(100px, 1fr); gap: 8px; }
  .timer-count { font-size: 1rem; }
  .womf-readout { width: 66px; }
  .timer-controls { width: 100%; border-left: 0; padding: 6px 0 0; }
}
/* =========================================================
   TIMER — LIVE BURNING FUSE
   Server time remains authoritative; --fuse-progress-pct is visual only.
   ========================================================= */
.timer-fuse-wrap {
  min-width: 0;
  height: 38px;
  position: relative;
  display: flex;
  align-items: center;
  padding-bottom: 12px;
}
.timer-fuse {
  position: relative;
  width: 100%;
  height: 24px;
  overflow: visible;
}
.timer-fuse-cord {
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 8px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(115deg, rgba(202,160,92,.25) 0 3px, transparent 3px 7px),
    linear-gradient(180deg, #6a5638 0%, #3b3021 48%, #211b14 100%);
  border: 1px solid rgba(137,111,74,.65);
  box-shadow: inset 0 1px 1px rgba(255,228,174,.12), 0 1px 4px rgba(0,0,0,.8);
}.timer-fuse-burned,
.timer-fuse-live {
  position: absolute;
  top: 8px;
  height: 8px;
  border-radius: 999px;
  pointer-events: none;
  transition: width 1s linear, left 1s linear;
}
.timer-fuse-burned {
  left: 0;
  width: var(--fuse-progress-pct, 0%);
  z-index: 2;
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #252525, #080808);
  border: 1px solid rgba(61,61,61,.9);
  box-shadow: inset 0 0 4px #000, 0 0 6px rgba(0,0,0,.8);
}
.timer-fuse-live {
  left: var(--fuse-progress-pct, 0%);
  width: calc(100% - var(--fuse-progress-pct, 0%));
  z-index: 1;
  background:
    repeating-linear-gradient(115deg, rgba(231,183,102,.25) 0 3px, transparent 3px 7px),
    linear-gradient(180deg, #806542, #46371f);
  border: 1px solid rgba(155,123,72,.72);
}.timer-fuse-tip {
  position: absolute;
  left: var(--fuse-progress-pct, 0%);
  top: 12px;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  z-index: 5;
  border-radius: 50%;
  pointer-events: none;
  transition: left 1s linear;
  background: radial-gradient(circle, rgba(255,246,178,.96) 0 10%, #ffc246 18%, #ff6b16 38%, rgba(225,42,10,.74) 55%, rgba(225,42,10,0) 73%);
  filter: drop-shadow(0 0 5px rgba(255,101,19,.95));
  animation: timer-fuse-flame .16s ease-in-out infinite alternate;
}
.timer-fuse-core {
  position: absolute;
  width: 7px;
  height: 7px;
  left: 8px;
  top: 8px;
  border-radius: 50%;
  background: #fff8c6;
  box-shadow: 0 0 6px #ffd85a, 0 0 13px #ff6320, 0 0 21px rgba(255,44,0,.72);
}
.timer-fuse-tip::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 17px;
  left: 8px;
  top: -10px;
  border-radius: 50%;
  background: rgba(130,136,145,.22);
  filter: blur(4px);
  animation: timer-fuse-smoke 1.4s ease-out infinite;
}.timer-fuse-spark {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff0a0;
  box-shadow: 0 0 5px #ff7a1d;
  opacity: 0;
}
.timer-fuse-spark.spark-a { left: 15px; top: 5px; animation: timer-spark-a .62s linear infinite; }
.timer-fuse-spark.spark-b { left: 11px; top: 2px; animation: timer-spark-b .84s linear .18s infinite; }
.timer-fuse-spark.spark-c { left: 16px; top: 13px; animation: timer-spark-c .72s linear .31s infinite; }
@keyframes timer-fuse-flame {
  from { transform: translate(-50%, -50%) scale(.92) rotate(-3deg); filter: drop-shadow(0 0 4px rgba(255,91,18,.82)); }
  to { transform: translate(-50%, -50%) scale(1.08) rotate(3deg); filter: drop-shadow(0 0 9px rgba(255,126,24,1)); }
}
@keyframes timer-fuse-smoke {
  0% { transform: translate(0, 2px) scale(.7); opacity: .25; }
  55% { opacity: .12; }
  100% { transform: translate(5px, -11px) scale(1.3); opacity: 0; }
}
@keyframes timer-spark-a {
  0% { transform: translate(0,0) scale(1); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(13px,-10px) scale(.2); opacity: 0; }
}@keyframes timer-spark-b {
  0% { transform: translate(0,0) scale(1); opacity: 0; }
  15% { opacity: .9; }
  100% { transform: translate(-7px,-15px) scale(.15); opacity: 0; }
}
@keyframes timer-spark-c {
  0% { transform: translate(0,0) scale(1); opacity: 0; }
  20% { opacity: .95; }
  100% { transform: translate(14px,8px) scale(.2); opacity: 0; }
}
.timer-tracker[data-phase="ready"] .timer-fuse-tip {
  animation: none;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, #8d929b 0 20%, #3d424b 50%, rgba(25,27,32,0) 72%);
  filter: none;
}
.timer-tracker[data-phase="ready"] .timer-fuse-core,
.timer-tracker[data-phase="ready"] .timer-fuse-spark,
.timer-tracker[data-phase="ready"] .timer-fuse-tip::before {
  display: none;
}
.timer-tracker.timer-paused .timer-fuse-tip,
.timer-tracker.timer-paused .timer-fuse-spark,
.timer-tracker.timer-paused .timer-fuse-tip::before {
  animation-play-state: paused;
}.timer-tracker[data-level="warning"] .timer-fuse-tip {
  filter: drop-shadow(0 0 8px rgba(255,137,25,1)) drop-shadow(0 0 10px rgba(255,76,0,.55));
}
.timer-tracker[data-level="danger"] .timer-fuse-tip {
  animation-duration: .09s;
  filter: drop-shadow(0 0 10px rgba(255,178,55,1)) drop-shadow(0 0 16px rgba(255,27,0,.8));
}
.timer-tracker[data-level="danger"] .timer-fuse-core {
  box-shadow: 0 0 7px #fff0a6, 0 0 16px #ff4d17, 0 0 27px rgba(255,0,0,.92);
}
.timer-tracker[data-mode="borrowed"] .timer-fuse-live {
  background:
    repeating-linear-gradient(115deg, rgba(255,113,189,.18) 0 3px, transparent 3px 7px),
    linear-gradient(180deg, #712a53, #3a204d);
  border-color: rgba(183,73,151,.72);
}
.timer-tracker[data-mode="borrowed"] .timer-fuse-tip {
  background: radial-gradient(circle, #ffe0ff 0 10%, #ff75cf 20%, #bd39ff 42%, rgba(113,24,218,.76) 58%, rgba(113,24,218,0) 74%);
  filter: drop-shadow(0 0 7px rgba(232,78,255,1)) drop-shadow(0 0 14px rgba(151,35,255,.75));
}
.timer-tracker[data-mode="borrowed"] .timer-fuse-core {
  background: #ffe7ff;
  box-shadow: 0 0 7px #ff9ee3, 0 0 15px #c246ff, 0 0 24px rgba(91,22,230,.9);
}.timer-tracker[data-phase="expired"] .timer-fuse-tip,
.timer-tracker[data-phase="stopped"] .timer-fuse-tip {
  animation: none;
  opacity: .34;
  filter: grayscale(.7);
}
.timer-tracker[data-phase="expired"] .timer-fuse-spark,
.timer-tracker[data-phase="expired"] .timer-fuse-tip::before,
.timer-tracker[data-phase="stopped"] .timer-fuse-spark,
.timer-tracker[data-phase="stopped"] .timer-fuse-tip::before {
  display: none;
}
.timer-tracker[data-phase="expired"] .timer-fuse-cord,
.timer-tracker[data-phase="expired"] .timer-fuse-live {
  filter: grayscale(1) brightness(.45);
}
.timer-fuse-wrap .timer-scale {
  left: 0;
  right: 0;
  bottom: 0;
}
@media (max-width: 720px) {
  .timer-fuse-wrap { height: 34px; padding-bottom: 11px; }
  .timer-fuse { height: 21px; }
  .timer-fuse-cord,
  .timer-fuse-burned,
  .timer-fuse-live { top: 7px; height: 7px; }
  .timer-fuse-tip { top: 10.5px; width: 21px; height: 21px; }
  .timer-fuse-core { left: 7px; top: 7px; }
}

.timer-fuse {
  width: calc(100% - 24px);
  margin: 0 12px;
}
@media (max-width: 720px) {
  .timer-fuse { width: calc(100% - 20px); margin: 0 10px; }
}

/* =========================================================
   TELEMETRY COLOR CORRECTION
   TIMER = hot fuse / amber. WOMF = threat engine / crimson-purple.
   ========================================================= */
.timer-kicker {
  color: #9b7040;
}
.timer-label {
  color: #e7a84f;
  text-shadow: 0 0 8px rgba(224,137,42,.18), 0 1px 0 #000;
}
.timer-count {
  color: #f2eee6;
}
.timer-status,
.timer-scale {
  color: #8c765c;
}
.timer-controls .toolbar-btn.primary,
.timer-controls .timer-pause-btn,
.timer-controls .timer-resume-btn {
  color: #efc27b;
  border-color: rgba(180,124,53,.62);
  background: linear-gradient(180deg, rgba(58,45,28,.96), rgba(22,18,14,.98));
}
.timer-controls .timer-adjust-btn {
  color: #b8b1a5;
  border-color: rgba(99,103,111,.62);
  background: linear-gradient(180deg, rgba(34,37,43,.98), rgba(15,17,21,.98));
}
.timer-tracker[data-level="warning"] .timer-label,
.timer-tracker[data-level="warning"] .timer-count {
  color: #f0b34e;
  text-shadow: 0 0 9px rgba(239,151,39,.32);
}
.timer-tracker[data-level="danger"] .timer-label,
.timer-tracker[data-level="danger"] .timer-count {
  color: #ef654e;
  text-shadow: 0 0 10px rgba(229,59,39,.42);
}
.timer-tracker[data-mode="borrowed"] .timer-label,
.timer-tracker[data-mode="borrowed"] .timer-kicker,
.timer-tracker[data-mode="borrowed"] .timer-status {
  color: #cc5ad7;
  text-shadow: 0 0 9px rgba(173,58,191,.38);
}

.womf-kicker {
  color: #7d3d50;
}
.womf-label {
  color: #d2495d;
  text-shadow: 0 0 9px rgba(190,43,66,.24), 0 1px 0 #000;
}
.womf-count {
  color: #f0d9df;
}
.womf-count-max,
.womf-scale {
  color: #75545e;
}
.womf-status {
  color: #80505d;
}
.womf-segment {
  border-color: rgba(94,62,72,.72);
  background: linear-gradient(180deg, rgba(40,32,38,.88), rgba(15,13,17,.98));
}
.womf-segment::before {
  color: rgba(123,83,96,.65);
}
.womf-segment.filled {
  background: linear-gradient(180deg, #7f2838 0%, #501e35 52%, #2d1835 100%);
  border-color: rgba(198,66,91,.82);
  box-shadow: inset 0 1px 0 rgba(255,190,202,.12), 0 0 8px rgba(173,40,72,.42);
}
.womf-segment.filled::before {
  color: #efb3bf;
}
.womf-open-btn {
  color: #765965;
  border-color: rgba(91,61,72,.7);
  background: linear-gradient(180deg, rgba(35,26,31,.96), rgba(15,12,15,.98));
}
.womf-open-btn.armed {
  color: #ffd28a;
  border-color: rgba(222,153,59,.86);
  background: linear-gradient(180deg, rgba(93,54,29,.98), rgba(44,20,24,.98));
  box-shadow: 0 0 13px rgba(208,77,52,.26), inset 0 1px 0 rgba(255,218,139,.14);
}
.womf-tracker[data-state="charging"] .womf-label,
.womf-tracker[data-state="charging"] .womf-status {
  color: #db5268;
}
.womf-tracker[data-state="unstable"] .womf-label,
.womf-tracker[data-state="unstable"] .womf-status {
  color: #e13f5b;
  text-shadow: 0 0 9px rgba(214,44,78,.42);
}
.womf-tracker[data-state="critical"] .womf-label,
.womf-tracker[data-state="critical"] .womf-status,
.womf-tracker[data-state="critical"] .womf-count {
  color: #ff536a;
  text-shadow: 0 0 11px rgba(244,53,86,.58);
}
.womf-tracker[data-state="ready"] .womf-label,
.womf-tracker[data-state="ready"] .womf-status,
.womf-tracker[data-state="ready"] .womf-count {
  color: #f0b74d;
  text-shadow: 0 0 10px rgba(222,149,42,.52);
}

/* =========================================================
   TELEMETRY RACK V2
   TIMER is a disciplined fuse. WOMF is a failing containment engine.
   ========================================================= */
.timer-tracker {
  min-height:82px;
  background:
    repeating-linear-gradient(115deg,transparent 0 18px,rgba(211,164,82,.018) 18px 19px),
    linear-gradient(90deg,rgba(116,83,37,.09),transparent 26%),
    linear-gradient(180deg,rgba(25,27,31,.99),rgba(7,9,12,.99));
}
.womf-tracker {
  min-height:76px;
  background:
    repeating-linear-gradient(0deg,transparent 0 5px,rgba(197,49,75,.018) 5px 6px),
    radial-gradient(ellipse at 72% 50%,rgba(109,24,57,.10),transparent 42%),
    linear-gradient(180deg,rgba(24,20,25,.99),rgba(8,7,10,.99));
}
.timer-identity{width:128px}
.womf-identity{width:128px}
.timer-label,.womf-label{font-size:1rem}
.timer-count{font-size:1.5rem;letter-spacing:2px}
.timer-status{margin-top:7px;color:#a88a63}
.timer-fuse-wrap{height:43px;padding-bottom:15px}
.timer-fuse{height:28px}
.timer-fuse-cord,
.timer-fuse-burned,
.timer-fuse-live{top:9px;height:10px}
.timer-fuse-live{
  background:
    linear-gradient(90deg,transparent,rgba(255,204,101,.28),transparent) 0 0/34px 100%,
    repeating-linear-gradient(115deg,rgba(231,183,102,.25) 0 3px,transparent 3px 7px),
    linear-gradient(180deg,#8c6a3f,#41301c);
  animation:timer-live-current 1.8s linear infinite;
}
.timer-fuse-tip{top:14px;width:28px;height:28px}
.timer-fuse-core{left:10px;top:10px}
@keyframes timer-live-current{to{background-position:68px 0,0 0,0 0}}
.timer-scale{bottom:-1px;overflow:visible}
.timer-scale span{
  position:relative;
  min-width:72px;
  color:#625440;
  transition:color .28s,text-shadow .28s;
}
.timer-scale span:nth-child(2){text-align:center}
.timer-scale span:last-child{text-align:right}
.timer-scale span::before{
  content:"";
  position:absolute;
  top:-8px;
  width:5px;height:5px;
  border:1px solid #604c31;
  background:#17130e;
  transform:rotate(45deg);
}
.timer-scale span:first-child::before{left:1px}
.timer-scale span:nth-child(2)::before{left:50%;margin-left:-3px}
.timer-scale span:last-child::before{right:1px}
.timer-scale span.passed{color:#947342}
.timer-scale span.passed::before{background:#9a7134;box-shadow:0 0 6px rgba(217,158,69,.35)}
.timer-scale span.active{color:#efb95c;text-shadow:0 0 7px rgba(235,163,62,.48)}
.timer-scale span.active::before{background:#ffd27d;border-color:#f0ae45;box-shadow:0 0 4px #ffc05c,0 0 11px rgba(255,126,28,.72);animation:timer-marker-live 1.1s ease-in-out infinite}
.timer-tracker[data-stage="detonation"] .timer-scale span.active{color:#ff6d56}
.timer-tracker[data-stage="detonation"] .timer-scale span.active::before{background:#ff6750;border-color:#ff8a70;box-shadow:0 0 5px #ff4b35,0 0 13px rgba(255,29,15,.78)}
@keyframes timer-marker-live{50%{filter:brightness(1.5);transform:rotate(45deg) scale(1.28)}}

.womf-meter{padding-bottom:15px}
.womf-meter::before{
  content:"";
  position:absolute;
  left:1%;right:1%;top:50%;
  height:3px;
  transform:translateY(-7px);
  background:
    linear-gradient(90deg,transparent 0 var(--womf-charge-pct,0%),#21171d var(--womf-charge-pct,0%) 100%),
    linear-gradient(90deg,#45a65f 0%,#79ad43 12%,#c7b63e 38%,#d7792e 62%,#c63d35 80%,#b91f2d 90%,#050607 100%);
  box-shadow:0 0 8px rgba(216,50,83,.42);
}
.womf-segments{height:30px;gap:6px;position:relative;z-index:1}
.womf-segment{
  height:30px;
  clip-path:polygon(5px 0,calc(100% - 5px) 0,100% 5px,100% calc(100% - 5px),calc(100% - 5px) 100%,5px 100%,0 calc(100% - 5px),0 5px);
  background:
    linear-gradient(90deg,transparent 0 46%,rgba(255,255,255,.035) 47% 53%,transparent 54%),
    linear-gradient(180deg,#2a2228,#100d11 72%);
  box-shadow:inset 0 0 0 2px rgba(0,0,0,.44),inset 0 1px rgba(255,255,255,.045);
}
.womf-segment::before{font-size:.48rem;z-index:2}
.womf-segment::after{
  left:6px;right:6px;top:6px;bottom:6px;height:auto;
  background:linear-gradient(180deg,rgba(142,37,59,.12),rgba(62,20,43,.06));
  border:1px solid rgba(125,45,66,.18);
  box-shadow:inset 0 0 6px rgba(0,0,0,.55);
}
.womf-segment.filled{
  background:linear-gradient(180deg,#9d3245 0%,#631f3d 54%,#36183d 100%);
  box-shadow:inset 0 0 0 2px rgba(32,5,14,.42),inset 0 1px rgba(255,205,214,.18),0 0 10px rgba(193,40,73,.46);
}
.womf-segment.filled::after{
  background:radial-gradient(ellipse,#f0536c 0 10%,#a62f4a 24%,rgba(85,18,50,.22) 68%);
  border-color:rgba(243,91,118,.34);
  box-shadow:0 0 8px rgba(227,55,88,.42),inset 0 0 5px rgba(255,194,207,.2);
}
.womf-segment.filled[data-index="1"]{background:linear-gradient(180deg,#45a65f,#216d3a 58%,#123d24);box-shadow:inset 0 0 0 2px rgba(6,38,18,.5),inset 0 1px rgba(202,255,215,.18),0 0 8px rgba(66,188,94,.34)}
.womf-segment.filled[data-index="1"]::after{background:radial-gradient(ellipse,#79df8e 0 10%,#3caa5a 25%,rgba(24,93,48,.22) 68%);border-color:rgba(116,220,139,.36);box-shadow:0 0 7px rgba(69,185,96,.34),inset 0 0 5px rgba(213,255,220,.15)}
.womf-segment.filled[data-index="2"]{background:linear-gradient(180deg,#79ad43,#477a28 58%,#294817);box-shadow:inset 0 0 0 2px rgba(30,54,9,.48),inset 0 1px rgba(231,255,193,.17),0 0 8px rgba(129,188,67,.34)}
.womf-segment.filled[data-index="2"]::after{background:radial-gradient(ellipse,#aee96b 0 10%,#6fb13d 25%,rgba(59,100,25,.22) 68%);border-color:rgba(176,223,103,.34);box-shadow:0 0 7px rgba(119,178,60,.34),inset 0 0 5px rgba(239,255,207,.14)}
.womf-segment.filled[data-index="3"]{background:linear-gradient(180deg,#a9b83f,#6f7925 58%,#424817);box-shadow:inset 0 0 0 2px rgba(54,58,7,.48),inset 0 1px rgba(255,255,194,.17),0 0 8px rgba(181,190,61,.34)}
.womf-segment.filled[data-index="3"]::after{background:radial-gradient(ellipse,#d9e867 0 10%,#a4b53a 25%,rgba(87,91,23,.22) 68%);border-color:rgba(213,224,93,.34);box-shadow:0 0 7px rgba(179,187,54,.34),inset 0 0 5px rgba(255,255,210,.14)}
.womf-segment.filled[data-index="4"]{background:linear-gradient(180deg,#c7b63e,#887526 58%,#4f4217);box-shadow:inset 0 0 0 2px rgba(66,53,6,.48),inset 0 1px rgba(255,245,190,.18),0 0 8px rgba(203,180,54,.35)}
.womf-segment.filled[data-index="4"]::after{background:radial-gradient(ellipse,#f0dd68 0 10%,#c2aa39 25%,rgba(102,84,22,.22) 68%);border-color:rgba(235,211,91,.36);box-shadow:0 0 7px rgba(202,174,50,.34),inset 0 0 5px rgba(255,246,205,.14)}
.womf-segment.filled[data-index="5"]{background:linear-gradient(180deg,#d39a35,#985f20 58%,#573414);box-shadow:inset 0 0 0 2px rgba(73,40,4,.5),inset 0 1px rgba(255,225,177,.18),0 0 9px rgba(220,143,44,.36)}
.womf-segment.filled[data-index="5"]::after{background:radial-gradient(ellipse,#f2c45c 0 10%,#d48d31 25%,rgba(113,65,20,.22) 68%);border-color:rgba(238,183,79,.36);box-shadow:0 0 8px rgba(214,132,42,.36),inset 0 0 5px rgba(255,230,186,.14)}
.womf-segment.filled[data-index="6"]{background:linear-gradient(180deg,#d7792e,#9a461c 58%,#562512);box-shadow:inset 0 0 0 2px rgba(76,27,5,.5),inset 0 1px rgba(255,207,174,.18),0 0 9px rgba(224,105,40,.38)}
.womf-segment.filled[data-index="6"]::after{background:radial-gradient(ellipse,#f2a24f 0 10%,#d66b2a 25%,rgba(111,45,18,.23) 68%);border-color:rgba(240,143,72,.37);box-shadow:0 0 8px rgba(218,91,38,.37),inset 0 0 5px rgba(255,216,190,.14)}
.womf-segment.filled[data-index="7"]{background:linear-gradient(180deg,#d85c2d,#98331d 58%,#551a12);box-shadow:inset 0 0 0 2px rgba(75,18,6,.5),inset 0 1px rgba(255,193,172,.18),0 0 9px rgba(225,74,40,.4)}
.womf-segment.filled[data-index="7"]::after{background:radial-gradient(ellipse,#ef8250 0 10%,#d64d2c 25%,rgba(108,32,18,.24) 68%);border-color:rgba(239,116,78,.38);box-shadow:0 0 8px rgba(219,66,40,.39),inset 0 0 5px rgba(255,204,185,.14)}
.womf-segment.filled[data-index="8"]{background:linear-gradient(180deg,#c63d35,#842225 58%,#47151b);box-shadow:inset 0 0 0 2px rgba(64,9,12,.52),inset 0 1px rgba(255,178,177,.18),0 0 10px rgba(207,48,53,.42)}
.womf-segment.filled[data-index="8"]::after{background:radial-gradient(ellipse,#e75d58 0 10%,#bd3438 25%,rgba(91,24,27,.25) 68%);border-color:rgba(230,82,83,.4);box-shadow:0 0 9px rgba(205,45,51,.42),inset 0 0 5px rgba(255,191,190,.14)}
.womf-segment.filled[data-index="9"]{background:linear-gradient(180deg,#b91f2d,#781423 58%,#410d18);box-shadow:inset 0 0 0 2px rgba(58,4,10,.54),inset 0 1px rgba(255,165,175,.18),0 0 11px rgba(209,26,45,.48)}
.womf-segment.filled[data-index="9"]::after{background:radial-gradient(ellipse,#ef4051 0 10%,#b91f35 25%,rgba(82,13,26,.28) 68%);border-color:rgba(235,60,79,.44);box-shadow:0 0 10px rgba(220,28,48,.48),inset 0 0 5px rgba(255,177,187,.14)}
.womf-segment.filled[data-index="10"]{background:linear-gradient(180deg,#17191d,#07080a 58%,#000);border-color:#5d636c;box-shadow:inset 0 0 0 2px #000,inset 0 1px rgba(255,255,255,.08),0 0 13px rgba(0,0,0,.95)}
.womf-segment.filled[data-index="10"]::before{color:#d9dde2;text-shadow:0 0 6px rgba(255,255,255,.22)}
.womf-segment.filled[data-index="10"]::after{background:radial-gradient(ellipse,#31353b 0 8%,#0d0f12 30%,#000 72%);border-color:rgba(135,143,154,.34);box-shadow:0 0 9px rgba(0,0,0,.9),inset 0 0 7px #000}
.womf-segment.next{border-color:rgba(166,76,101,.82);animation:womf-next-chamber 1.6s ease-in-out infinite}
.womf-segment.next::after{background:radial-gradient(ellipse,rgba(177,49,79,.18),rgba(52,18,35,.05));border-color:rgba(176,62,90,.30)}
@keyframes womf-next-chamber{50%{filter:brightness(1.35);box-shadow:0 0 10px rgba(197,47,80,.28)}}
.womf-count{font-size:1.35rem;letter-spacing:1px}
.womf-status{
  align-self:flex-start;
  min-width:66px;
  padding:4px 6px;
  margin-top:6px;
  border:1px solid rgba(113,60,77,.54);
  background:rgba(45,24,33,.55);
  text-align:center;
  letter-spacing:1.15px;
}
.womf-tracker[data-state="charging"] .womf-segment.current,
.womf-tracker[data-state="unstable"] .womf-segment.current,
.womf-tracker[data-state="critical"] .womf-segment.current{animation:womf-hot-cell 1s ease-in-out infinite}
@keyframes womf-hot-cell{50%{filter:brightness(1.35) saturate(1.25)}}
.womf-tracker[data-state="unstable"] .womf-meter::after,
.womf-tracker[data-state="critical"] .womf-meter::after{
  content:"";position:absolute;left:4%;right:3%;top:4px;height:22px;z-index:3;pointer-events:none;
  background:linear-gradient(105deg,transparent 0 43%,rgba(255,107,137,.7) 43.4% 43.7%,transparent 44.1% 62%,rgba(214,60,102,.45) 62.4% 62.7%,transparent 63.1%);
  filter:drop-shadow(0 0 4px rgba(255,46,87,.65));
  animation:womf-arc-fault 2.2s steps(1,end) infinite;
}
.womf-tracker[data-state="critical"] .womf-meter::after{animation-duration:.9s;opacity:.9}
@keyframes womf-arc-fault{0%,68%,74%,100%{opacity:0}69%,71%,73%{opacity:.85}70%,72%{opacity:.2}}
.womf-tracker[data-state="ready"]{animation:womf-ready-ambient 3s ease-in-out infinite!important}
.womf-tracker[data-state="ready"] .womf-segment{animation:none;filter:none}
.womf-tracker[data-state="ready"] .womf-status{border-color:#b88938;background:rgba(87,59,18,.62);color:#ffd278}
@media(max-width:720px){
  .timer-tracker,.womf-tracker{min-height:0}
  .timer-identity,.womf-identity{width:92px}
  .timer-count{font-size:1.12rem}
  .womf-segments{height:25px;gap:3px}
  .womf-segment{height:25px}
}

/* =========================================================
   SKYNET DETENTION RACK - TIMER + WOMF
   Shared prison-gunmetal shell. Timer gets a barbed-wire restraint frame;
   WOMF gets a reinforced threat cage. Functional telemetry is untouched.
   ========================================================= */
.timer-tracker,
.womf-tracker {
  border-color: rgba(86, 94, 104, .88);
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 5px),
    linear-gradient(90deg, rgba(255,255,255,.025), transparent 12%, transparent 88%, rgba(255,255,255,.018)),
    linear-gradient(180deg, #171b20 0%, #0b0e12 58%, #06080a 100%);
  box-shadow:
    inset 0 1px rgba(255,255,255,.075),
    inset 0 -2px 0 rgba(0,0,0,.88),
    inset 0 0 24px rgba(0,0,0,.46),
    0 0 0 1px #050607,
    0 9px 20px rgba(0,0,0,.34);
}

.timer-tracker::after {
  content:"";
  position:absolute;
  inset:3px 8px;
  z-index:4;
  pointer-events:none;
  opacity:.72;
  background:
    linear-gradient(180deg,#858b93,#343940 55%,#121519) top 3px left / 100% 1px no-repeat,
    linear-gradient(180deg,#858b93,#343940 55%,#121519) bottom 3px left / 100% 1px no-repeat,
    repeating-linear-gradient(64deg,transparent 0 22px,rgba(154,160,168,.88) 22px 23px,transparent 23px 30px) top left / 100% 8px no-repeat,
    repeating-linear-gradient(116deg,transparent 0 22px,rgba(96,102,111,.9) 22px 23px,transparent 23px 30px) bottom left / 100% 8px no-repeat;
  filter:drop-shadow(0 1px 0 #000);
}
.timer-tracker[data-level="warning"]::after { opacity:.82; filter:drop-shadow(0 0 3px rgba(214,158,66,.2)); }
.timer-tracker[data-level="danger"]::after { opacity:.94; filter:drop-shadow(0 0 4px rgba(207,74,62,.28)); }
.timer-tracker[data-mode="borrowed"]::after { filter:drop-shadow(0 0 4px rgba(150,58,170,.34)); }

.womf-tracker::after {
  content:"";
  position:absolute;
  inset:4px 7px;
  z-index:4;
  pointer-events:none;
  border-top:1px solid rgba(90,45,52,.74);
  border-bottom:1px solid rgba(56,31,38,.9);
  background:
    linear-gradient(135deg,#69717b 0 5px,transparent 5px) top left / 13px 13px no-repeat,
    linear-gradient(225deg,#69717b 0 5px,transparent 5px) top right / 13px 13px no-repeat,
    linear-gradient(45deg,#3d434b 0 5px,transparent 5px) bottom left / 13px 13px no-repeat,
    linear-gradient(315deg,#3d434b 0 5px,transparent 5px) bottom right / 13px 13px no-repeat;
  opacity:.68;
}
.womf-tracker[data-state="charging"]::after,
.womf-tracker[data-state="unstable"]::after,
.womf-tracker[data-state="critical"]::after {
  border-color:rgba(145,48,62,.8);
  filter:drop-shadow(0 0 3px rgba(197,43,66,.2));
}
.womf-tracker[data-state="ready"]::after {
  border-color:rgba(171,126,45,.82);
  filter:drop-shadow(0 0 4px rgba(212,168,67,.24));
}

/* =========================================================
   COMPACT TELEMETRY RACK
   Keep the detention-hardware look while giving the board more vertical room.
   ========================================================= */
.timer-tracker,
.womf-tracker {
  min-height: 58px;
  margin-bottom: 8px;
  padding: 6px 12px 6px 14px;
  gap: 10px;
}
.timer-identity,
.womf-identity {
  width: 108px;
  padding-right: 8px;
}
.timer-kicker,
.womf-kicker {
  font-size: .43rem;
  margin-bottom: 1px;
}
.timer-label,
.womf-label {
  font-size: .82rem;
  letter-spacing: 3px;
}
.timer-core {
  grid-template-columns: 90px minmax(140px,1fr);
  gap: 10px;
}
.timer-count { font-size: 1.08rem; }
.womf-count { font-size: 1rem; }
.timer-status,
.womf-status {
  margin-top: 3px;
  font-size: .44rem;
}
.timer-bars {
  height: 24px;
  padding-bottom: 9px;
}
.timer-bar-track { height: 10px; }
.womf-meter { padding-bottom: 10px; }
.womf-segments,
.womf-segment { height: 20px; }
.womf-segments { gap: 4px; }
.womf-readout {
  width: 72px;
  padding-left: 8px;
}
.timer-tracker::after,
.womf-tracker::after { inset: 2px 7px; }

/* =========================================================
   BATTLE LAUNCH SEQUENCE — T-10 + FULL-WIDTH SYSTEM ONLINE
   ========================================================= */
.battle-launch-countdown {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(5,6,9,.72), rgba(5,6,9,.46) 35%, rgba(5,6,9,.58) 65%, rgba(5,6,9,.78));
  backdrop-filter: blur(1.5px);
}
.battle-launch-countdown::before,
.battle-launch-countdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(201,38,52,.9) 12%, rgba(235,73,85,1) 50%, rgba(201,38,52,.9) 88%, transparent);
  box-shadow: 0 0 14px rgba(218,38,52,.55);
}
.battle-launch-countdown::before { top: 31%; }
.battle-launch-countdown::after { bottom: 31%; }
.battle-launch-scan {
  position: absolute;
  inset: 0;
  opacity: .18;
  background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(255,255,255,.035) 3px 4px);
  animation: battle-launch-scan 1.15s linear infinite;
}
.battle-launch-copy {
  width: min(900px, 90vw);
  text-align: center;
  font-family: var(--font-system);
  text-transform: uppercase;
}
.battle-launch-kicker,
.battle-launch-status {
  font-weight: 800;
  letter-spacing: .24em;
}
.battle-launch-kicker {
  color: #b72736;
  font-size: clamp(.72rem, 1.35vw, 1.05rem);
  text-shadow: 0 0 8px rgba(204,39,54,.42);
}
.battle-launch-time {
  margin: .08em 0 .04em;
  color: #f0f1f4;
  font-size: clamp(5.2rem, 16vw, 13rem);
  line-height: .86;
  font-weight: 900;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 0 10px rgba(255,255,255,.14),
    0 0 26px rgba(207,34,49,.38),
    4px 0 0 rgba(127,20,31,.28);
}
.battle-launch-status {
  color: #8a8f9a;
  font-size: clamp(.62rem, 1.1vw, .88rem);
}
.battle-launch-pulse .battle-launch-time {
  animation: battle-launch-digit .88s cubic-bezier(.22,.7,.2,1);
}
.battle-launch-out {
  opacity: 0;
  transition: opacity 200ms ease;
}
@keyframes battle-launch-digit {
  0% { opacity: .18; transform: scale(1.14); filter: blur(2px) contrast(1.8); }
  18% { opacity: 1; transform: scale(.98); filter: blur(0) contrast(1.15); }
  100% { opacity: 1; transform: scale(1); filter: blur(0) contrast(1); }
}
@keyframes battle-launch-scan {
  from { transform: translateY(-8px); }
  to { transform: translateY(8px); }
}

/* After T-1 the server accepts START GAME and broadcasts this to GM +
   every Little Hero. Full-width by design: this is the battlefield handoff. */
.battle-controls-online {
  left: 0;
  right: 0;
  top: 50%;
  width: 100vw;
  min-width: 0;
  padding: 24px 4vw 26px;
  transform: translateY(-50%);
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, transparent 0%, rgba(17,18,22,.95) 8%, rgba(28,29,35,.99) 50%, rgba(17,18,22,.95) 92%, transparent 100%);
  box-shadow:
    inset 0 1px 0 rgba(236,65,78,.62),
    inset 0 -1px 0 rgba(236,65,78,.62),
    0 0 38px rgba(191,26,41,.34),
    0 16px 45px rgba(0,0,0,.72);
  animation: battle-controls-in 360ms steps(2,end);
}
.battle-controls-title {
  font-size: clamp(2.8rem, 8vw, 6.5rem);
  letter-spacing: .09em;
  color: #f5f5f6;
  text-shadow: 0 0 11px rgba(233,45,59,.78), 4px 0 0 rgba(139,20,31,.36);
}
.battle-controls-link,
.battle-controls-channel {
  color: #d03645;
  letter-spacing: .26em;
}
.battle-controls-online-out {
  opacity: 0;
  filter: blur(3px);
  transform: translateY(-50%) scaleY(1.06);
}
@keyframes battle-controls-in {
  0%   { opacity: 0; transform: translateY(-50%) scaleX(1.06); filter: contrast(1.8); }
  28%  { opacity: 1; transform: translateY(-50%) translateX(-8px) scaleX(.99); }
  52%  { opacity: .44; transform: translateY(-50%) translateX(7px) scaleX(1.02); }
  100% { opacity: 1; transform: translateY(-50%) scaleX(1); filter: contrast(1); }
}

@media (max-width: 720px) {
  .battle-launch-countdown::before { top: 35%; }
  .battle-launch-countdown::after { bottom: 35%; }
  .battle-controls-online { padding: 20px 14px 22px; }
  .battle-controls-title { font-size: clamp(2rem, 12vw, 4rem); }
  .battle-controls-link,
  .battle-controls-channel { letter-spacing: .16em; }
}
/* =========================================================
   GM CONTROL SURFACES — BATTLE CONTROL + BACKDOOR
   ========================================================= */
.gm-control-surface[hidden] { display: none !important; }
.gm-control-surface { width: 100%; }

.battle-session-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(120,126,139,.22);
  font-size: .54rem;
  font-weight: 800;
  letter-spacing: 1.05px;
  color: #777f8e;
}
.battle-session-strip b { color: #d6b565; font-weight: 900; }
.gm-maintenance .gm-module-game .current-game { margin-bottom: 14px; }
.gm-maintenance { position: relative; }

.gm-maintenance .maintenance-module {
  margin-bottom: 22px;
  padding: 15px;
  border-color: rgba(77,103,108,.52);
  background:
    linear-gradient(90deg, rgba(47,93,96,.035), transparent 32%),
    var(--panel-bg);
}
.gm-maintenance .maintenance-module .gm-section-title {
  margin-bottom: 13px;
  padding-bottom: 9px;
  color: #78a9aa;
  border-color: rgba(76,109,113,.38);
}
.gm-maintenance .gm-global-btn:not(.reset-btn):not(.primary) {
  border-color: rgba(85,105,112,.72);
}
#host-room-btn.kill-session-btn {
  border-color: rgba(210,74,74,.92) !important;
  color: #ff9f9f !important;
  background:
    linear-gradient(180deg, rgba(91,27,32,.94), rgba(39,17,21,.98)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,190,190,.08),
    inset 0 0 16px rgba(210,74,74,.08),
    0 0 10px rgba(190,50,50,.08);
  font-weight: 800;
  letter-spacing: .075em;
}
#host-room-btn.kill-session-btn:hover:not(:disabled) {
  border-color: rgba(240,94,94,1) !important;
  color: #ffd0d0 !important;
  background:
    linear-gradient(180deg, rgba(112,31,38,.98), rgba(49,18,23,.99)) !important;
}
.gm-footer .maintenance-toggle-btn {
  border-color: rgba(73,126,129,.62);
  color: #82b4b4;
}
.gm-footer .maintenance-toggle-btn:hover,
.gm-footer .maintenance-toggle-btn.active {
  border-color: rgba(112,188,188,.86);
  color: #c3e1df;
  background: rgba(45,93,95,.22);
}
#gm-panel.maintenance-open .gm-header {
  border-bottom-color: rgba(78,137,139,.5);
}
#gm-panel.maintenance-open .gm-subtitle { color: #6e9a9b; }
#gm-panel.maintenance-open .gm-content {
  padding: 18px 18px 34px;
}
#gm-panel.maintenance-open .gm-maintenance .gm-global-controls {
  gap: 10px;
}
#gm-panel.maintenance-open .gm-maintenance .gm-global-controls + .gm-global-controls {
  margin-top: 10px;
}
#gm-panel.maintenance-open .gm-maintenance .difficulty-picker {
  margin-top: 11px;
  margin-bottom: 12px;
  gap: 8px;
}
#gm-panel.maintenance-open .gm-maintenance .battle-session-strip {
  margin-top: 12px;
  padding-top: 10px;
}
#gm-panel.maintenance-open .gm-footer {
  padding-top: 18px;
}
#gm-panel.maintenance-open #reveal-hide-all-btn {
  margin-top: 12px !important;
}

/* =========================================================
   GM FOOTER — PUBLIC VIEW / BACKDOOR VISUAL SPLIT
   PUBLIC VIEW = polished command surface
   BACKDOOR = black/yellow restricted-access warning tape
   ========================================================= */
#public-view-btn {
  position: relative;
  overflow: hidden;
  border-color: rgba(214, 169, 56, 0.88) !important;
  color: #e4bd58 !important;
  background:
    linear-gradient(180deg, rgba(45, 40, 27, 0.96), rgba(17, 17, 16, 0.99)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 229, 151, 0.11),
    inset 0 0 18px rgba(212, 168, 67, 0.06),
    0 0 11px rgba(212, 168, 67, 0.08);
}

#library-btn-footer.maintenance-toggle-btn {
  position: relative;
  overflow: hidden;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid #d8aa19 !important;
  color: #f0c934 !important;
  background:
    linear-gradient(180deg, #171717 0%, #090909 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.035),
    inset 0 0 0 1px rgba(0,0,0,0.85),
    0 0 12px rgba(216,170,25,0.09);
  text-shadow: 0 0 7px rgba(240,201,52,0.18);
  letter-spacing: 0.12em;
  font-weight: 900;
}

#library-btn-footer.maintenance-toggle-btn::before,
#library-btn-footer.maintenance-toggle-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 7px;
  background:
    repeating-linear-gradient(
      -45deg,
      #e3b51e 0 11px,
      #e3b51e 11px 14px,
      #111 14px 25px,
      #111 25px 28px
    );
  opacity: 0.92;
  pointer-events: none;
  transition: filter 160ms ease, opacity 160ms ease;
}

#library-btn-footer.maintenance-toggle-btn::before { top: 0; }
#library-btn-footer.maintenance-toggle-btn::after { bottom: 0; }

#library-btn-footer.maintenance-toggle-btn:hover,
#library-btn-footer.maintenance-toggle-btn.active {
  border-color: #f2ca38 !important;
  color: #ffe36a !important;
  background:
    linear-gradient(180deg, #211e13 0%, #0b0b0a 100%) !important;
  box-shadow:
    inset 0 0 18px rgba(237,190,35,0.07),
    0 0 15px rgba(229,180,28,0.16);
}

#library-btn-footer.maintenance-toggle-btn:hover::before,
#library-btn-footer.maintenance-toggle-btn:hover::after,
#library-btn-footer.maintenance-toggle-btn.active::before,
#library-btn-footer.maintenance-toggle-btn.active::after {
  filter: brightness(1.15);
  opacity: 1;
  animation: backdoor-warning-tape 1.15s linear infinite;
}

@keyframes backdoor-warning-tape {
  from { background-position: 0 0; }
  to { background-position: 28px 0; }
}

/* =========================================================
   FINAL DEBRIEF — SHARED GM / LITTLE HERO PRESENTATION
   ========================================================= */
.final-outcome-banner.fo-debrief {
  width: min(720px, 90vw);
  max-width: min(720px, 90vw);
  max-height: min(78vh, 760px);
  overflow-y: auto;
  padding: 26px 30px 28px;
}

.fo-debrief-label {
  margin-top: 9px;
  color: #89909d;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.fo-debrief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 16px;
}

.fo-debrief-row,
.fo-final-answer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(112,120,137,.32);
  background: rgba(9,11,15,.72);
  text-align: left;
}

.fo-debrief-row span,
.fo-final-answer span {
  flex: 0 0 auto;
  min-width: 34px;
  color: #7f8792;
  font-size: .6rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.fo-debrief-row b,
.fo-final-answer b {
  min-width: 0;
  color: #d9dde5;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.fo-final-answer {
  margin-top: 9px;
  border-color: rgba(212,168,67,.48);
  box-shadow: inset 0 0 14px rgba(212,168,67,.05);
}

.fo-final-answer span,
.fo-final-answer b {
  color: #d6a843;
}

.final-outcome-banner.fo-debrief .fo-story {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid rgba(112,120,137,.22);
  color: #b1b6c0;
  font-size: .82rem;
  line-height: 1.55;
  text-align: left;
  white-space: pre-wrap;
}

/* =========================================================
   GM BATTLE CHAT V4 // PLAYER-FLOW PARITY
   ========================================================= */
.gm-module-chat .gm-chat-panel {
  position: relative;
  overflow: hidden;
}

.gm-module-chat .gm-chat-messages {
  padding: 7px 5px 8px;
}

.gm-module-chat .gm-chat-message.gm-flow-message {
  display: grid !important;
  grid-template-columns: 22px minmax(0,1fr) auto !important;
  align-items: start;
  column-gap: 7px;
  min-height: 30px;
  margin: 0 !important;
  padding: 4px 4px 4px 2px !important;
  border: 0 !important;
  border-left: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  clip-path: none !important;
  overflow: visible;
  animation: none !important;
  transition: opacity .42s ease, background-color .14s ease;
}

.gm-module-chat .gm-chat-message.gm-flow-message:not(.grouped) {
  box-shadow: inset 1px 0 color-mix(in srgb,var(--little-hero-theme,#6f7885) 62%,transparent) !important;
}

.gm-module-chat .gm-chat-message.gm-flow-message:hover {
  background: linear-gradient(90deg,color-mix(in srgb,var(--theme-message-top,#151A20) 58%,transparent),transparent 78%) !important;
}

.gm-module-chat .gm-chat-avatar-rail {
  width: 22px;
  min-width: 22px;
  min-height: 1px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1px;
}

.gm-module-chat .gm-chat-avatar-rail .little-hero-avatar,
.gm-module-chat .gm-chat-avatar-rail .little-hero-avatar-compact {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
}

.gm-module-chat .gm-chat-message-main {
  position: relative;
  min-width: 0;
  padding-right: 2px;
}

.gm-module-chat .gm-chat-flow-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0 0 2px;
}

.gm-module-chat .gm-chat-flow-header .gm-chat-player-name {
  color: color-mix(in srgb,var(--little-hero-theme,#d4a843) 74%,#f0f3f7) !important;
  font-size: .60rem;
  font-weight: 800;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.gm-module-chat .gm-chat-flow-header .gm-chat-time {
  color: #69727d !important;
  font-size: .39rem !important;
  margin: 0 !important;
}

.gm-module-chat .gm-flow-message .gm-chat-message-text {
  display: block !important;
  color: #d7dce2 !important;
  font-family: var(--font-human);
  font-size: .74rem !important;
  line-height: 1.3;
  text-decoration: none !important;
}

.gm-module-chat .gm-flow-message.grouped {
  min-height: 21px;
  padding-top: 1px !important;
  padding-bottom: 2px !important;
}

.gm-module-chat .gm-flow-message.grouped .gm-chat-avatar-rail {
  padding: 0;
}

.gm-module-chat .gm-flow-message.wrong .gm-chat-message-text {
  color: #d86157 !important;
  text-decoration: line-through !important;
  text-decoration-color: rgba(255,72,72,.9) !important;
  text-decoration-thickness: 2px !important;
}

.gm-module-chat .gm-flow-message.aged-rejected {
  opacity: .72;
}

.gm-module-chat .gm-flow-message.aged-rejected:hover,
.gm-module-chat .gm-flow-message.aged-rejected:focus-within {
  opacity: 1;
}

.gm-module-chat .gm-flow-message.correct {
  min-height: 42px;
  margin: 3px 0 !important;
  padding-top: 7px !important;
  padding-bottom: 7px !important;
  background: linear-gradient(90deg,rgba(92,184,122,.055),transparent 72%) !important;
}

.gm-module-chat .gm-flow-message.correct .gm-chat-message-text {
  color: #5cb87a !important;
  font-size: .89rem !important;
  font-weight: 800;
  line-height: 1.28;
  text-decoration: none !important;
}

.gm-module-chat .gm-chat-reply-context {
  margin: 0 0 2px;
  padding-left: 7px;
  border-left: 1px solid rgba(132,143,156,.48);
  color: #78828e;
  font: 700 .41rem var(--font-machine);
  letter-spacing: .6px;
  text-transform: uppercase;
}

.gm-module-chat .gm-chat-machine-verdict {
  display: block;
  margin-top: 1px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: right;
  font: 800 .39rem var(--font-machine);
  letter-spacing: .7px;
}

.gm-module-chat .gm-chat-machine-verdict.rejected { color: #c95c5c; }
.gm-module-chat .gm-chat-machine-verdict.accepted {
  color: #69bd83;
  margin-top: 0;
}

.gm-module-chat .gm-chat-quick-actions {
  align-self: start;
  display: inline-flex !important;
  gap: 2px;
  margin-left: 2px;
  min-width: 36px;
}

.gm-module-chat .gm-chat-quick-actions.adjudicated {
  visibility: hidden;
  pointer-events: none;
}

.gm-module-chat .gm-flow-message .gm-chat-verdict-response {
  grid-column: auto !important;
  width: auto !important;
  margin: 6px 0 1px 10px !important;
  position: relative;
}

.gm-module-chat .gm-flow-message .gm-chat-verdict-response .shadow-broker-transmission {
  width: auto;
  max-width: 94%;
  margin: 0;
}

.gm-module-chat .gm-flow-message .gm-chat-verdict-response .shadow-broker-verdict-response::before {
  content: "";
  position: absolute;
  left: -10px;
  top: -7px;
  width: 1px;
  height: calc(100% + 7px);
  background: linear-gradient(180deg,#5cb87a 0%,rgba(113,86,145,.9) 72%,rgba(155,93,224,.7) 100%);
  box-shadow: 0 0 5px rgba(92,184,122,.18);
  pointer-events: none;
}

.gm-module-chat .gm-chat-reactions {
  grid-column: auto !important;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  min-height: 0;
  margin: 0;
  position: relative;
}

.gm-module-chat .gm-chat-reactions.has-reactions {
  min-height: 18px;
  margin-top: 3px;
}

.gm-module-chat .gm-chat-reaction-chip,
.gm-module-chat .gm-chat-reaction-add {
  height: 18px;
  min-width: 25px;
  padding: 0 5px;
  border: 1px solid rgba(107,117,130,.42);
  background: rgba(8,10,13,.82);
  color: #aeb6c0;
  font: 700 .50rem var(--font-machine);
  line-height: 16px;
  cursor: pointer;
}

.gm-module-chat .gm-chat-reaction-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.gm-module-chat .gm-chat-reaction-chip > span {
  font-family: "Segoe UI Emoji","Apple Color Emoji",sans-serif;
  font-size: .70rem;
  line-height: 1;
}

.gm-module-chat .gm-chat-reaction-chip b {
  color: inherit;
  font-size: .40rem;
}

.gm-module-chat .gm-chat-reaction-chip:hover,
.gm-module-chat .gm-chat-reaction-add:hover {
  border-color: #8b96a4;
  background: #151a20;
  color: #eef0f5;
}

.gm-module-chat .gm-chat-reaction-chip.mine {
  border-color: rgba(155,93,224,.82);
  color: #d2b4ef;
  background: rgba(155,93,224,.10);
}

.gm-module-chat .gm-chat-reaction-add {
  min-width: 20px;
  width: 20px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}

.gm-module-chat .gm-chat-reactions.has-reactions .gm-chat-reaction-add {
  opacity: .42;
  pointer-events: auto;
}

.gm-module-chat .gm-flow-message:hover .gm-chat-reaction-add,
.gm-module-chat .gm-flow-message:focus-within .gm-chat-reaction-add,
.gm-module-chat .gm-shadow-broker-entry:hover .gm-chat-reaction-add,
.gm-module-chat .gm-shadow-broker-entry:focus-within .gm-chat-reaction-add {
  opacity: 1;
  pointer-events: auto;
}

.gm-module-chat .gm-shadow-broker-entry {
  width: auto;
  max-width: calc(100% - 28px);
  margin: 7px 3px 8px 26px;
}

.gm-module-chat .gm-shadow-broker-entry > .shadow-broker-transmission {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.gm-module-chat .gm-shadow-broker-entry > .gm-chat-reactions {
  margin: 3px 0 0 3px;
}

.gm-module-chat .gm-chat-time-separator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 7px 4px 6px 28px;
  color: #5f6874;
  font: 700 .37rem var(--font-machine);
  letter-spacing: .75px;
}


/* CLASSIC SKYPE TRIBUTE // GM transcript parity */
.gm-module-chat .gm-flow-message {
  grid-template-columns:28px minmax(0,1fr) auto;
  column-gap:6px;
  padding-top:2px !important;
  padding-bottom:3px !important;
}
.gm-module-chat .gm-flow-message:not(.grouped) {
  margin-top:8px !important;
  padding-top:4px !important;
}
.gm-module-chat .gm-chat-avatar-rail {
  width:28px;
  min-width:28px;
}
.gm-module-chat .gm-chat-avatar-rail .little-hero-avatar,
.gm-module-chat .gm-chat-avatar-rail .little-hero-avatar-compact {
  width:24px;
  height:24px;
  flex-basis:24px;
}
.gm-module-chat .gm-chat-message-main { min-width:0; }
.gm-module-chat .gm-chat-flow-header { min-height:13px; margin-bottom:1px; }
.gm-module-chat .gm-chat-message-line {
  display:flex;
  align-items:flex-end;
  gap:7px;
  min-width:0;
}
.gm-module-chat .gm-chat-message-text {
  flex:1 1 auto;
  min-width:0;
  overflow-wrap:anywhere;
}
.gm-module-chat .gm-chat-message-line .gm-chat-time {
  flex:0 0 auto;
  margin-left:auto;
  padding:0 1px 1px 4px;
  opacity:.76;
  font-size:.36rem;
}
.gm-module-chat .gm-flow-message:hover {
  background:linear-gradient(90deg,color-mix(in srgb,var(--theme-message-top,#151A20) 32%,transparent),transparent 88%) !important;
}
.gm-module-chat .gm-chat-reaction-chip { border-radius:9px; }
.gm-module-chat .gm-chat-reply-context { opacity:.82; }


/* PRIME SKYPE MESSAGE CLOUDS // GM parity.
   Every answer remains its own identity unit. The adjudication buttons stay
   outside the cloud so judging is fast, while the conversation itself reads
   like a compact Skype transcript instead of a stack of moderation cards. */
.gm-module-chat .gm-chat-message.gm-flow-message,
.gm-module-chat .gm-chat-message.gm-flow-message:hover,
.gm-module-chat .gm-flow-message.correct,
.gm-module-chat .gm-flow-message.wrong {
  background:transparent !important;
  box-shadow:none !important;
}
.gm-module-chat .gm-flow-message:not(.grouped) {
  margin-top:9px !important;
}
.gm-module-chat .gm-chat-message-main {
  position:relative;
  justify-self:start;
  width:fit-content;
  min-width:106px;
  max-width:100%;
  padding:5px 8px 5px 8px;
  border:1px solid color-mix(in srgb,var(--little-hero-accent,#6f7885) 44%,#444d58);
  border-radius:10px 10px 10px 4px;
  background:
    linear-gradient(180deg,
      color-mix(in srgb,var(--theme-message-top,#151A20) 92%,#27313b 8%),
      color-mix(in srgb,var(--theme-message-bottom,#0C0F13) 94%,#050607 6%));
  box-shadow:inset 0 1px rgba(255,255,255,.04),0 1px 2px rgba(0,0,0,.52);
  transition:border-color .14s ease,background .14s ease,box-shadow .14s ease;
}
.gm-module-chat .gm-chat-message-main::before {
  content:"";
  position:absolute;
  left:-6px;
  top:9px;
  width:7px;
  height:10px;
  clip-path:polygon(100% 0,100% 100%,0 50%);
  background:color-mix(in srgb,var(--theme-message-top,#151A20) 90%,#27313b 10%);
  filter:drop-shadow(-1px 0 0 color-mix(in srgb,var(--little-hero-accent,#6f7885) 40%,#444d58));
  pointer-events:none;
}
.gm-module-chat .gm-flow-message:hover .gm-chat-message-main,
.gm-module-chat .gm-flow-message:focus-within .gm-chat-message-main {
  border-color:color-mix(in srgb,var(--little-hero-accent,#6f7885) 65%,#c5ccd5);
  background:
    linear-gradient(180deg,
      color-mix(in srgb,var(--theme-message-top,#151A20) 86%,#34414d 14%),
      color-mix(in srgb,var(--theme-message-bottom,#0C0F13) 91%,#10151b 9%));
  box-shadow:inset 0 1px rgba(255,255,255,.05),0 2px 6px rgba(0,0,0,.36);
}
.gm-module-chat .gm-chat-flow-header {
  min-height:13px;
  margin-bottom:2px;
}
.gm-module-chat .gm-chat-flow-header .gm-chat-player-name {
  color:color-mix(in srgb,var(--little-hero-accent,#d4a843) 72%,#f4f6f8) !important;
}
.gm-module-chat .gm-chat-message-line {
  align-items:flex-end;
  gap:9px;
}
.gm-module-chat .gm-chat-message-line .gm-chat-time {
  align-self:flex-end;
  padding-bottom:1px;
  color:#78818c !important;
  opacity:.72;
  white-space:nowrap;
}
.gm-module-chat .gm-chat-reply-context {
  border-left:2px solid color-mix(in srgb,var(--little-hero-accent,#6f7885) 58%,#68727d);
  background:rgba(0,0,0,.10);
  border-radius:0 4px 4px 0;
  padding:2px 5px 2px 7px;
  margin:2px 0 4px;
}
.gm-module-chat .gm-chat-reactions.has-reactions { margin-top:4px; }
.gm-module-chat .gm-chat-reaction-chip,
.gm-module-chat .gm-chat-reaction-add {
  border-radius:9px;
  background:rgba(6,8,11,.58);
}
.gm-module-chat .gm-flow-message.wrong .gm-chat-message-main {
  border-color:rgba(197,74,70,.48);
}
.gm-module-chat .gm-flow-message.correct .gm-chat-message-main {
  border-color:rgba(92,184,122,.58);
  box-shadow:inset 0 1px rgba(255,255,255,.04),0 0 8px rgba(92,184,122,.08);
}


/* COMPACT SKYPE PASS // preserve identity + adjudication, reclaim vertical space. */
.gm-module-chat .gm-chat-message.gm-flow-message {
  padding:2px 3px 2px 1px !important;
}
.gm-module-chat .gm-flow-message:not(.grouped) {
  margin-top:6px !important;
}
.gm-module-chat .gm-chat-message-main {
  min-width:92px;
  padding:4px 7px 4px 7px;
  border-radius:9px 9px 9px 4px;
}
.gm-module-chat .gm-chat-message-main::before {
  left:-5px;
  top:8px;
  width:6px;
  height:9px;
}
.gm-module-chat .gm-chat-avatar-rail {
  width:20px !important;
  min-width:20px !important;
}
.gm-module-chat .gm-chat-avatar-rail .little-hero-avatar,
.gm-module-chat .gm-chat-avatar-rail .little-hero-avatar-compact {
  width:18px !important;
  height:18px !important;
  flex-basis:18px !important;
}
.gm-module-chat .gm-chat-flow-header {
  min-height:11px;
  margin:0 0 1px;
}
.gm-module-chat .gm-chat-flow-header .gm-chat-player-name {
  font-size:.56rem !important;
  letter-spacing:.55px !important;
}
.gm-module-chat .gm-chat-message-line {
  gap:6px;
}
.gm-module-chat .gm-flow-message .gm-chat-message-text {
  font-size:.70rem !important;
  line-height:1.18 !important;
}
.gm-module-chat .gm-chat-message-line .gm-chat-time {
  font-size:.34rem !important;
  padding:0 0 1px 3px !important;
  opacity:.62;
}
.gm-module-chat .gm-chat-reply-context {
  margin:1px 0 3px;
  padding:1px 4px 1px 6px;
  font-size:.49rem;
  line-height:1.12;
}
.gm-module-chat .gm-chat-machine-verdict {
  margin-top:2px !important;
  font-size:.43rem !important;
  line-height:1.1;
}
.gm-module-chat .gm-flow-message .gm-chat-verdict-response {
  margin:3px 0 0 8px !important;
}
.gm-module-chat .gm-flow-message .gm-chat-verdict-response .shadow-broker-transmission {
  margin:0 !important;
  padding:3px 6px !important;
  font-size:.43rem !important;
  line-height:1.08 !important;
  max-width:88%;
}
.gm-module-chat .gm-chat-reactions.has-reactions {
  margin-top:3px;
}
.gm-module-chat .gm-chat-reaction-chip,
.gm-module-chat .gm-chat-reaction-add {
  min-height:16px !important;
  padding:0 5px !important;
  font-size:.48rem !important;
}

.gm-module-chat .gm-chat-time-separator::before,
.gm-module-chat .gm-chat-time-separator::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(112,122,135,.22);
}

.gm-module-chat .gm-chat-new-messages {
  position: absolute;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  z-index: 14;
  border: 1px solid rgba(212,168,67,.52);
  background: rgba(10,12,16,.96);
  color: #d6a843;
  padding: 4px 7px;
  font: 800 .40rem var(--font-machine);
  letter-spacing: .65px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.45);
}

.gm-module-chat .gm-chat-new-messages[hidden] { display: none; }
.gm-module-chat .gm-chat-target-controls { grid-column: 1 / -1 !important; }

/* GM emoji input + reaction pickers */
.shadow-broker-form {
  position: relative;
}

.gm-emoji-toggle {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(155,93,224,.32);
  background: rgba(12,8,18,.70);
  color: #9b8aa9;
  font-family: "Segoe UI Emoji","Apple Color Emoji",sans-serif;
  font-size: .9rem;
  cursor: pointer;
}

.gm-emoji-toggle:hover {
  color: #c9a7e8;
  border-color: rgba(155,93,224,.72);
}

.gm-emoji-picker,
.gm-chat-floating-emoji-picker {
  display: grid;
  grid-template-columns: repeat(4,34px);
  gap: 3px;
  padding: 5px;
  border: 1px solid #51445f;
  background: rgba(7,9,12,.98);
  box-shadow: 0 8px 24px rgba(0,0,0,.62), inset 0 1px rgba(255,255,255,.035);
  z-index: 80;
}

.gm-emoji-picker[hidden],
.gm-chat-floating-emoji-picker[hidden] {
  display: none;
}

.gm-emoji-picker {
  position: absolute;
  left: 118px;
  bottom: calc(100% + 5px);
}

.gm-chat-floating-emoji-picker {
  position: fixed;
}

.gm-chat-context-menu {
  position: fixed;
  z-index: 200000;
  min-width: 132px;
  padding: 4px;
  border: 1px solid #5b4f67;
  border-top-color: #846b98;
  border-radius: 4px;
  background: linear-gradient(180deg,#1b1620,#0b090d);
  box-shadow: 0 12px 30px rgba(0,0,0,.72), inset 0 1px rgba(255,255,255,.03);
}
.gm-chat-context-menu[hidden]{display:none}
.gm-chat-context-menu::before{
  content:"MESSAGE ACTIONS";
  display:block;
  padding:4px 7px 5px;
  margin-bottom:3px;
  border-bottom:1px solid #3b3144;
  color:#7f6d8b;
  font:800 .38rem var(--font-system);
  letter-spacing:.15em;
}
.gm-chat-context-menu button{
  display:grid;
  grid-template-columns:20px 1fr;
  align-items:center;
  gap:6px;
  width:100%;
  min-height:30px;
  padding:4px 8px;
  border:0;
  border-radius:2px;
  background:transparent;
  color:#ddd7e4;
  font:800 .55rem var(--font-system);
  letter-spacing:.10em;
  text-align:left;
  cursor:pointer;
}
.gm-chat-context-menu button span{
  color:#c48bf2;
  font-size:.9rem;
  text-align:center;
}
.gm-chat-context-menu button:hover,
.gm-chat-context-menu button:focus-visible{
  background:#24192d;
  color:#fff;
  outline:none;
}

.gm-emoji-option {
  width: 34px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  background: #0d1014;
  font-family: "Segoe UI Emoji","Apple Color Emoji",sans-serif;
  font-size: 1rem;
  cursor: pointer;
}

.gm-emoji-option:hover {
  border-color: #775e8b;
  background: #19121f;
}

@media (max-width: 620px) {
  .final-outcome-banner.fo-debrief {
    width: 92vw;
    max-width: 92vw;
    padding: 20px 16px 22px;
  }
  .fo-debrief-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   RECOUNT // post-game audit (js/recount.js). Cold, clinical, gunmetal.
   Delivered only after the host's manual SHOW RESULTS. Presentation only.
   ===================================================================== */

/* GM console: SHOW RESULTS / RECOUNT strip -- hidden until the game is over. */
.recount-btn {
  display: none;
  width: 100%;
  margin: 10px 0 0 !important;
  min-height: 46px;
  font-weight: 900;
  letter-spacing: .14em;
  border-color: rgba(212,168,67,.9) !important;
  color: #f0c65d !important;
  background:
    linear-gradient(90deg, rgba(212,168,67,.07), rgba(212,168,67,.18), rgba(212,168,67,.07)),
    linear-gradient(180deg, #211d13, #100f0c) !important;
  box-shadow: inset 0 0 0 1px rgba(255,220,126,.04), 0 0 16px rgba(212,168,67,.10);
}
.recount-btn:hover { border-color: #f1c653 !important; color: #ffe49b !important; }
body.game-complete .recount-btn,
.recount-btn.has-recount { display: block; }
.recount-btn.has-recount {
  border-color: rgba(120,140,160,.6) !important;
  color: #b8c2cf !important;
  background: linear-gradient(180deg, #1a2027, #0d1014) !important;
  box-shadow: none;
}

/* Players: small reopen pill once a RECOUNT exists. */
.recount-pill {
  position: fixed;
  left: 14px;
  bottom: 62px;
  z-index: 1500;
  padding: 7px 12px;
  border: 1px solid rgba(212,168,67,.7);
  border-radius: 3px;
  background: linear-gradient(180deg, #1c1912, #0d0c09);
  color: #f0c65d;
  font: 800 .62rem var(--font-machine, monospace);
  letter-spacing: .16em;
  cursor: pointer;
}
.recount-pill[hidden] { display: none; }

.recount-overlay {
  position: fixed;
  inset: 0;
  z-index: 190000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: clamp(10px, 3vh, 34px) clamp(8px, 3vw, 28px);
  background:
    radial-gradient(circle at 50% 0%, rgba(212,168,67,.07), transparent 55%),
    rgba(4, 5, 8, .94);
  -webkit-overflow-scrolling: touch;
}
.recount-overlay::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.022) 0 1px, transparent 1px 4px);
}

.recount-panel {
  position: relative;
  width: min(880px, 100%);
  padding: clamp(14px, 2.4vw, 26px);
  border: 1px solid #39414c;
  border-top-color: #5d6875;
  border-radius: 4px;
  background: linear-gradient(180deg, #12161b, #0a0c10);
  box-shadow: 0 24px 70px rgba(0,0,0,.75), inset 0 1px rgba(255,255,255,.04);
  color: #cfd4dc;
  font-family: var(--font-machine, monospace);
}
.recount-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #d4a843, rgba(212,168,67,.15));
}

.recount-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid #313842;
}
.recount-title {
  font: 900 clamp(1.7rem, 5vw, 2.6rem)/1 var(--font-system, sans-serif);
  letter-spacing: .3em;
  color: #e8ecf2;
  text-shadow: 0 0 18px rgba(212,168,67,.22);
}
.recount-sub { margin-top: 8px; font-size: .6rem; letter-spacing: .16em; color: #7b8794; }
.rc-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: .56rem;
  letter-spacing: .18em;
}
.rc-badge-won { color: #22e69a; }
.rc-badge-lost { color: #e0605f; }
.recount-controls { display: flex; gap: 8px; flex: 0 0 auto; }
.recount-controls button {
  padding: 7px 12px;
  border: 1px solid #4a535f;
  border-radius: 2px;
  background: #171b21;
  color: #aab3bf;
  font: 800 .58rem var(--font-machine, monospace);
  letter-spacing: .14em;
  cursor: pointer;
}
.recount-controls button:hover { border-color: #d4a843; color: #f0c65d; }
.recount-overlay.rc-done .recount-skip { display: none; }

/* staged reveal */
.rc-step {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(2px);
  transition: opacity .55s ease, transform .55s ease, filter .55s ease;
  transition-delay: calc(var(--i, 0) * 90ms);
}
.rc-step.is-in { opacity: 1; transform: none; filter: none; }

.rc-block { margin-top: 18px; }
.rc-block h3 {
  margin: 0 0 9px;
  font: 800 .62rem var(--font-machine, monospace);
  letter-spacing: .24em;
  color: #d4a843;
}
.rc-sub-h { margin-top: 16px !important; color: #e0605f !important; }
.rc-label { font-size: .62rem; letter-spacing: .3em; color: #d4a843; }

.rc-top { text-align: center; padding: 18px 8px 14px; border: 1px solid #2c333c; border-radius: 3px; background: rgba(255,255,255,.015); }
.rc-top-name {
  margin-top: 8px;
  font: 900 clamp(1.7rem, 6vw, 3rem)/1.05 var(--font-system, sans-serif);
  letter-spacing: .06em;
  color: #f2f4f7;
  text-shadow: 0 0 22px rgba(212,168,67,.28);
  word-break: break-word;
}
.rc-top-name i { font-style: normal; color: #7b8794; font-size: .6em; }
.rc-top-points { margin-top: 6px; font-size: .82rem; letter-spacing: .24em; color: #d4a843; }
.rc-strip { margin-top: 12px; font-size: .52rem; letter-spacing: .12em; color: #6f7a87; line-height: 1.7; }
.rc-dim { color: #6f7a87 !important; }

.rc-table { width: 100%; border-collapse: collapse; font-size: .74rem; }
.rc-table th {
  padding: 5px 8px;
  border-bottom: 1px solid #313842;
  color: #6f7a87;
  font-size: .5rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-align: left;
}
.rc-table td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,.05); }
.rc-num { text-align: right !important; font-variant-numeric: tabular-nums; }
.rc-rank { width: 34px; color: #d4a843; font-weight: 800; }
.rc-name { color: #e6e9ee; font-weight: 700; letter-spacing: .05em; word-break: break-word; }
.rc-crown { color: #d4a843; }
.rc-inmatch .rc-name { color: #f0c65d; }
.rc-move { font-weight: 800; letter-spacing: .04em; }
.rc-move-up { color: #22e69a; }
.rc-move-down { color: #e0605f; }
.rc-move-none { color: #59626e; }

/* award cards: category colours the rail, severity deepens it */
.rc-award {
  margin-top: 10px;
  border: 1px solid #2c333c;
  border-left: 3px solid #d4a843;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.008));
}
.rc-cat-anomaly { border-left-color: #9b6de0; }
.rc-cat-failure { border-left-color: #e0605f; }
.rc-cat-loss { border-left-color: #8a4a4a; }
.rc-sev-catastrophic { box-shadow: inset 0 0 26px rgba(224,96,95,.10); border-color: rgba(224,96,95,.45); }
.rc-award-head {
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: .5rem;
  letter-spacing: .26em;
  color: #7b8794;
}
.rc-award-body { padding: 12px; }
.rc-award-title {
  font: 900 clamp(.95rem, 3.2vw, 1.25rem)/1.15 var(--font-system, sans-serif);
  letter-spacing: .12em;
  color: #eef1f5;
}
.rc-award-who { margin-top: 5px; font-size: .78rem; letter-spacing: .12em; color: #f0c65d; }
.rc-award-who i { font-style: normal; color: #6f7a87; }
.rc-evidence { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.rc-evidence li {
  padding: 3px 8px;
  border: 1px solid #3a424d;
  border-radius: 2px;
  background: rgba(0,0,0,.35);
  font-size: .55rem;
  letter-spacing: .1em;
  color: #b3bcc8;
}
.rc-commentary { margin-top: 11px; font: italic 400 .74rem/1.55 var(--font-system, sans-serif); color: #9aa5b1; }
.rc-empty { margin-top: 10px; padding: 14px; border: 1px dashed #39414c; color: #6f7a87; font-size: .6rem; letter-spacing: .16em; text-align: center; }

.rc-hide-sm { }
@media (max-width: 560px) {
  .rc-hide-sm { display: none; }
  .recount-head { flex-wrap: wrap; }
  .recount-controls { width: 100%; }
  .recount-controls button { flex: 1; min-height: 40px; }
  .rc-table td, .rc-table th { padding: 7px 5px; }
  .recount-pill { bottom: 70px; }
}

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

/* Final cascade lock: the legacy GAME WON overlay retains useful shared
   geometry, but its old 7.2s root animation must never fade the takeover.
   Only Skeleton's explicit click-confirm handler may remove it. */
.victory-overlay.is-live,
.victory-overlay.is-static,
.victory-overlay.is-settled {
  animation: none !important;
  opacity: 1 !important;
}

/* Endgame subtitle legibility: isolate the quiet italic line from busy board
   artwork without turning it into another headline. */
.defeat-ceremony .defeat-subline,
.victory-ceremony .victory-subline {
  display: inline-block;
  padding: .38em .9em .44em;
  border: 1px solid rgba(210, 226, 219, .18);
  border-radius: 2px;
  background: rgba(2, 6, 7, .78);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .68), inset 0 1px rgba(255, 255, 255, .035);
  color: #d7e7df;
  font-weight: 600;
  text-shadow: 0 2px 3px #000, 0 0 10px rgba(210, 238, 224, .2);
  backdrop-filter: blur(5px);
}

.defeat-ceremony .defeat-subline {
  border-color: rgba(225, 75, 85, .25);
  color: #ead8da;
  text-shadow: 0 2px 3px #000, 0 0 10px rgba(225, 75, 85, .2);
}

/* Column verdicts are independent of the overall match outcome. A GAME LOST
   screen may therefore contain four green hits when only the Final failed. */
.victory-columns .column-result.is-hit,
.defeat-columns .column-result.is-hit {
  border: 1px solid rgba(42, 220, 139, .46);
  background: rgba(8, 55, 37, .62);
  color: #c8f6df;
  box-shadow: inset 0 0 16px rgba(34, 230, 154, .08);
}

.victory-columns .column-result.is-hit b,
.defeat-columns .column-result.is-hit b {
  color: #35e49a;
}

.victory-columns .column-result.is-miss,
.defeat-columns .column-result.is-miss {
  border: 1px solid rgba(225, 75, 85, .46);
  background: rgba(65, 10, 18, .62);
  color: #f1cdd1;
  box-shadow: inset 0 0 16px rgba(225, 75, 85, .08);
}

.victory-columns .column-result.is-miss b,
.defeat-columns .column-result.is-miss b {
  color: #f05b66;
}
