/* ============================================================================
   Election Tamasha — structural / layout stylesheet.
   Consumes theme.css variables only. No brand colours hardcoded here so the
   skin stays swappable. Mobile-first collapse to a bottom-sheet War Room.
   ============================================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--et-body);
  color: var(--et-ink);
  background:
    var(--et-halftone) 0 0 / 22px 22px,
    var(--et-paper);
  background-attachment: fixed;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--et-head); font-weight: 700; letter-spacing: -0.01em; }
button { font-family: var(--et-body); cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible, select:focus-visible {
  outline: 3px solid var(--p-bright); outline-offset: 2px; border-radius: 6px;
}

/* fine paper grain overlay, fixed + non-interactive (perf-safe) */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================ TOP BAR ============================ */
.et-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 14px clamp(16px, 3vw, 40px);
  background: color-mix(in srgb, var(--et-paper) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--et-hairline);
}
.et-brand { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }
.et-brand .et-logo {
  font-family: var(--et-display);
  font-size: clamp(20px, 2.6vw, 30px);
  line-height: 0.95; letter-spacing: 0.01em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.et-logo .p-word { color: var(--p-ink); }
.et-logo .y-word { color: var(--y-ink); }
.et-brand .et-tag {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--et-ink-faint); font-weight: 600;
}
.et-topctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.et-topctl label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--et-ink-soft); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.et-topctl input, .et-topctl select {
  font-family: var(--et-body); font-size: 13px; font-weight: 600;
  border: 1px solid var(--et-hairline); border-radius: 10px;
  padding: 7px 9px; background: var(--et-card); color: var(--et-ink);
  width: 74px;
}
.et-topctl select { width: auto; }

/* buttons */
.btn {
  border: 1px solid var(--et-hairline);
  background: var(--et-card); color: var(--et-ink);
  font-weight: 600; font-size: 13px;
  padding: 9px 16px; border-radius: 999px;
  transition: transform .35s var(--et-ease), box-shadow .35s var(--et-ease), background .3s var(--et-ease);
  box-shadow: var(--et-inner-hi);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--et-lift-soft); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary {
  background: linear-gradient(180deg, var(--et-ink), #2c2437);
  color: #fff; border-color: transparent;
}
.btn-primary .ico {
  width: 26px; height: 26px; border-radius: 999px; margin: -2px -8px -2px 2px;
  background: rgba(255,255,255,0.14); display: grid; place-items: center; font-size: 13px;
  transition: transform .4s var(--et-ease);
}
.btn-primary:hover .ico { transform: translate(2px, -1px) scale(1.06); }
.btn-p { background: var(--p-ink); color: #fff; border-color: transparent; }
.btn-y { background: var(--y-bright); color: var(--y-contrast); border-color: transparent; }

/* ============================ PHASE STRIP ============================ */
.et-phasestrip {
  display: flex; align-items: stretch; gap: 8px;
  padding: 14px clamp(16px, 3vw, 40px) 0;
  flex-wrap: wrap;
}
.et-phase {
  flex: 1 1 0; min-width: 130px;
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--et-r-md);
  background: var(--et-tray); border: 1px solid var(--et-hairline-2);
  transition: all .5s var(--et-ease);
}
.et-phase .ph-no {
  font-family: var(--et-display); font-size: 15px;
  width: 28px; height: 28px; border-radius: 999px;
  display: grid; place-items: center;
  background: #fff; color: var(--et-ink-faint);
  border: 1px solid var(--et-hairline);
}
.et-phase .ph-txt { display: flex; flex-direction: column; }
.et-phase .ph-name { font-family: var(--et-head); font-weight: 700; font-size: 14px; }
.et-phase .ph-sub { font-size: 10.5px; color: var(--et-ink-faint); letter-spacing: 0.04em; }
.et-phase[data-state="done"] { background: color-mix(in srgb, var(--et-good) 12%, transparent); }
.et-phase[data-state="done"] .ph-no { background: var(--et-good); color: #fff; border-color: transparent; }
.et-phase[data-state="active"] {
  background: linear-gradient(180deg, #fff, var(--et-card-2));
  border-color: var(--et-ink); box-shadow: var(--et-lift-soft);
  transform: translateY(-2px);
}
.et-phase[data-state="active"] .ph-no { background: var(--et-ink); color: #fff; border-color: transparent; }
.et-phase[data-state="active"] .ph-name { color: var(--et-ink); }

/* ============================ MAIN GRID ============================ */
.et-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  padding: 18px clamp(16px, 3vw, 40px) 120px;
  align-items: start;
}

/* ============================ BOARD ============================ */
.et-boardwrap { min-width: 0; }
.et-boardhead {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.et-boardhead h2 {
  font-family: var(--et-display); text-transform: uppercase;
  font-size: clamp(22px, 3.4vw, 40px); line-height: 0.9;
}
.et-helper {
  margin-left: auto;
  display: flex; align-items: flex-start; gap: 10px;
  max-width: 440px;
  background: linear-gradient(180deg, #fff, var(--et-card-2));
  border: 1px solid var(--et-hairline); border-radius: var(--et-r-md);
  padding: 10px 14px; box-shadow: var(--et-inner-hi);
  font-size: 12.5px; color: var(--et-ink-soft);
}
.et-helper .compass { font-size: 18px; line-height: 1; }
.et-helper b { color: var(--et-ink); }

.et-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 14px;
  background: var(--et-tray);
  border: 1px solid var(--et-hairline);
  border-radius: var(--et-r-lg);
  box-shadow: var(--et-inner-hi);
}

/* seat card — double-bezel */
.seat {
  position: relative;
  background: var(--et-card);
  border: 1px solid var(--et-hairline);
  border-radius: var(--et-r-md);
  padding: 12px;
  box-shadow: var(--et-inner-hi), var(--et-lift-soft);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .45s var(--et-ease), box-shadow .45s var(--et-ease), outline-color .3s;
  outline: 2px solid transparent; outline-offset: 2px;
  min-height: 172px;
}
.seat.selectable { cursor: pointer; }
.seat.selectable:hover { transform: translateY(-3px); box-shadow: var(--et-inner-hi), var(--et-lift); }
.seat.targetable { outline-color: var(--et-stamp); animation: pulseTarget 1.3s var(--et-ease) infinite; }
@keyframes pulseTarget { 0%,100% { outline-offset: 2px; } 50% { outline-offset: 5px; } }
.seat.lead-P { border-left: 5px solid var(--p-ink); }
.seat.lead-Y { border-left: 5px solid var(--y-bright); }
.seat.tied { border-left: 5px dashed var(--et-ink-faint); }
/* nomination: highlight where the human's BigNeta is contesting */
.seat.bigneta-seat { outline-color: var(--et-stamp); box-shadow: var(--et-inner-hi), var(--et-lift-soft); }
.cand-bignetatag {
  font-size: 8px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 1px 5px; border-radius: 5px; background: var(--et-stamp); color: #fff; flex: none;
}

.seat-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.seat-name {
  font-family: var(--et-head); font-weight: 800; font-size: 15px;
  text-transform: uppercase; letter-spacing: 0.02em;
}
.seat-group { font-size: 9.5px; color: var(--et-ink-faint); letter-spacing: 0.06em; text-transform: uppercase; }
.seat-leadchip {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}
.seat-leadchip.P { background: var(--p-soft); color: var(--p-ink); }
.seat-leadchip.Y { background: var(--y-soft); color: var(--y-ink); }
.seat-leadchip.tie { background: var(--et-tray); color: var(--et-ink-faint); }

/* candidate rows */
.cand {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px;
}
.cand .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.cand[data-party="P"] .swatch { background: var(--p-ink); }
.cand[data-party="Y"] .swatch { background: var(--y-bright); }
.cand .cand-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cand .cand-type {
  font-size: 8.5px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 1px 5px; border-radius: 5px; font-weight: 700; margin-left: auto; flex: none;
}
.cand-type.Clean   { background: #e6f4ec; color: var(--et-good); }
.cand-type.Corrupt { background: #fdeecf; color: var(--et-warn); }
.cand-type.Crook   { background: #fce3e6; color: var(--et-bad); }

/* votebank tug-of-war bar */
.votebar {
  height: 22px; border-radius: 8px; overflow: hidden;
  display: flex; background: var(--et-tray);
  border: 1px solid var(--et-hairline-2);
  font-size: 10px; font-weight: 800; color: #fff;
}
.votebar .vb {
  display: flex; align-items: center; justify-content: center;
  transition: width .6s var(--et-ease);
  min-width: 0;
}
.votebar .vb-p { background: linear-gradient(180deg, var(--p-bright), var(--p-ink)); }
.votebar .vb-y { background: linear-gradient(180deg, var(--y-bright), #d98b00); color: var(--y-contrast); }
.votebar .vb span { padding: 0 4px; }

/* ============================ HUD (party cards) ============================ */
.et-hud { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hudcard {
  position: relative; overflow: hidden;
  background: var(--et-card); border: 1px solid var(--et-hairline);
  border-radius: var(--et-r-md); padding: 12px;
  box-shadow: var(--et-inner-hi), var(--et-lift-soft);
}
.hudcard[data-party] { border-top: 4px solid var(--party-bright); }
.hudcard[data-party="P"] { border-top-color: var(--p-ink); }
.hudcard.active {
  outline: 2px solid var(--party-ink); outline-offset: -2px;
  box-shadow: var(--et-inner-hi), var(--et-lift), 0 0 0 6px var(--party-glow);
}
.hud-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.hud-avatar {
  width: 30px; height: 30px; border-radius: 999px; flex: none;
  display: grid; place-items: center; font-family: var(--et-display);
  color: #fff; font-size: 14px;
}
.hudcard[data-party="P"] .hud-avatar { background: var(--p-ink); }
.hudcard[data-party="Y"] .hud-avatar { background: var(--y-bright); color: var(--y-contrast); }
.hud-name { font-family: var(--et-head); font-weight: 800; font-size: 13.5px; line-height: 1; }
.hud-who { font-size: 10px; color: var(--et-ink-faint); }
.hud-youtag {
  margin-left: auto; font-size: 8.5px; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
  background: var(--party-soft); color: var(--party-ink);
}
.hud-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.stat {
  background: var(--et-tray); border-radius: 10px; padding: 7px 9px;
  display: flex; flex-direction: column; gap: 1px;
}
.stat .st-val { font-family: var(--et-head); font-weight: 800; font-size: 16px; line-height: 1; }
.stat .st-lbl { font-size: 9px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--et-ink-faint); }
.stat.cpf { grid-column: 1 / -1; background: color-mix(in srgb, var(--party-soft) 55%, var(--et-tray)); }
.stat.cpf.hidden-cpf .st-val { letter-spacing: 3px; }
.stat .seats-mini { font-size: 10px; color: var(--et-ink-soft); }

/* ============================ WAR ROOM (right rail / bottom sheet) ============================ */
.et-warroom {
  position: sticky; top: 96px;
  background: linear-gradient(180deg, #fff, var(--et-card-2));
  border: 1px solid var(--et-hairline);
  border-radius: var(--et-r-lg);
  box-shadow: var(--et-inner-hi), var(--et-lift-soft);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: calc(100dvh - 116px);
}
.wr-head {
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--et-hairline);
}
.wr-head h3 { font-family: var(--et-display); text-transform: uppercase; font-size: 18px; letter-spacing: 0.02em; }
.wr-turnchip {
  margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  background: var(--party-soft, var(--et-tray)); color: var(--party-ink, var(--et-ink));
}
.wr-body { padding: 12px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.wr-section-title {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--et-ink-faint); font-weight: 700;
  display: flex; align-items: center; gap: 6px; margin-bottom: 2px;
}
.wr-cardrow { display: flex; flex-direction: column; gap: 8px; }

/* action card */
.acard {
  position: relative; text-align: left;
  background: var(--et-card); border: 1px solid var(--et-hairline);
  border-radius: var(--et-r-sm); padding: 10px 12px;
  box-shadow: var(--et-inner-hi);
  transition: transform .35s var(--et-ease), box-shadow .35s var(--et-ease), border-color .3s;
  display: flex; flex-direction: column; gap: 5px; width: 100%;
}
.acard:not(:disabled):hover { transform: translateY(-2px) rotate(-0.3deg); box-shadow: var(--et-lift-soft); border-color: var(--et-ink); }
.acard:not(:disabled):active { transform: scale(0.985); }
.acard:disabled { opacity: 0.45; cursor: not-allowed; }
.acard.selected { border-color: var(--et-ink); box-shadow: 0 0 0 3px var(--et-ink) inset, var(--et-lift-soft); }
.acard .ac-top { display: flex; align-items: center; gap: 8px; }
.acard .ac-kind {
  font-size: 8px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px; flex: none;
}
.ac-kind.campaign { background: var(--p-soft); color: var(--p-ink); }
.ac-kind.big { background: var(--y-soft); color: var(--y-ink); }
.ac-kind.news { background: #fce3e6; color: var(--et-bad); }
.acard .ac-title { font-family: var(--et-head); font-weight: 700; font-size: 13px; }
.acard .ac-meta { display: flex; gap: 10px; font-size: 11px; color: var(--et-ink-soft); flex-wrap: wrap; }
.acard .ac-meta .up { color: var(--et-good); font-weight: 700; }
.acard .ac-seat { margin-left: auto; font-size: 9.5px; color: var(--et-ink-faint); font-weight: 600; }

.wr-empty { font-size: 12px; color: var(--et-ink-faint); font-style: italic; padding: 6px 2px; }
.wr-footer { padding: 12px 14px; border-top: 1px solid var(--et-hairline); display: flex; flex-direction: column; gap: 8px; }

/* selection tray preview */
.tray {
  background: var(--et-ink); color: #fff; border-radius: var(--et-r-sm);
  padding: 12px; box-shadow: var(--et-lift-soft);
}
.tray .tray-title { font-family: var(--et-head); font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.tray .tray-flow {
  display: flex; align-items: center; gap: 10px; font-family: var(--et-head);
  font-weight: 800; font-size: 15px; flex-wrap: wrap;
}
.tray .cost { color: #ffb4be; }
.tray .arrow { opacity: 0.6; }
.tray .gain { color: #86efac; }
.tray .tray-warn {
  margin-top: 8px; font-size: 11px; color: #ffd7a8; display: flex; gap: 6px; align-items: flex-start;
}
.tray .tray-actions { display: flex; gap: 8px; margin-top: 10px; }
.tray .btn { flex: 1; justify-content: center; }
.tray .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.3); }

/* ============================ LOG ============================ */
.et-log { margin-top: 4px; }
.et-log summary {
  cursor: pointer; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--et-ink-faint); font-weight: 700; list-style: none;
}
.et-log summary::-webkit-details-marker { display: none; }
.et-log ol { margin: 8px 0 0; padding: 0 0 0 4px; list-style: none; display: flex; flex-direction: column; gap: 5px; max-height: 160px; overflow-y: auto; }
.et-log li { font-size: 11px; color: var(--et-ink-soft); border-left: 2px solid var(--et-hairline); padding-left: 8px; }
.et-log li[data-party="P"] { border-left-color: var(--p-ink); }
.et-log li[data-party="Y"] { border-left-color: var(--y-bright); }

/* ============================ TOOLTIP (jargon) ============================ */
.jargon {
  border-bottom: 1.5px dotted var(--et-ink-faint); cursor: help;
  position: relative; font-weight: 600;
}
.jargon .info { font-size: 0.8em; opacity: 0.6; vertical-align: super; }
.jargon:hover::after, .jargon:focus::after {
  content: attr(data-tip);
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 70;
  width: max-content; max-width: 260px;
  background: var(--et-ink); color: #fff; font-weight: 400;
  font-size: 11.5px; line-height: 1.4; letter-spacing: 0;
  padding: 9px 11px; border-radius: 10px; box-shadow: var(--et-lift);
  white-space: normal; text-transform: none;
}

/* ============================ MODAL ============================ */
.et-modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--et-ink) 55%, transparent);
  backdrop-filter: blur(8px);
  animation: fadeIn .3s var(--et-ease-out);
}
.et-modal[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--et-paper); border-radius: var(--et-r-lg);
  border: 1px solid var(--et-hairline); box-shadow: var(--et-lift);
  width: min(560px, 100%); max-height: 86dvh; overflow: auto;
  padding: 22px 24px;
  animation: popIn .5s var(--et-ease);
}
@keyframes popIn { from { transform: translateY(16px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-card h3 { font-family: var(--et-display); text-transform: uppercase; font-size: 22px; margin-bottom: 4px; }
.modal-card .modal-sub { color: var(--et-ink-soft); font-size: 13px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* seat picker grid inside modal */
.pickgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pickcell {
  border: 1px solid var(--et-hairline); background: var(--et-card);
  border-radius: 10px; padding: 8px; text-align: center; font-size: 11px; font-weight: 600;
  transition: transform .3s var(--et-ease), border-color .2s;
}
.pickcell:hover { transform: translateY(-2px); border-color: var(--et-ink); }
.pickcell .pc-name { font-family: var(--et-head); font-weight: 800; font-size: 13px; }
.pickcell .pc-cand { font-size: 9.5px; color: var(--et-ink-faint); }

/* ============================ RESULTS ============================ */
.result-hero {
  text-align: center; padding: 10px 0 18px;
}
.result-hero .winner-word {
  font-family: var(--et-display); text-transform: uppercase;
  font-size: clamp(30px, 7vw, 58px); line-height: 0.9;
}
.result-hero .winner-word[data-party="P"] { color: var(--p-ink); }
.result-hero .winner-word[data-party="Y"] { color: var(--y-ink); }
.result-hero .speech {
  font-style: italic; color: var(--et-ink-soft); max-width: 440px; margin: 12px auto 0;
  font-size: 14px;
}
.ht-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 12.5px; }
.ht-table th, .ht-table td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--et-hairline); }
.ht-table th { font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--et-ink-faint); }
.ht-table td.rowlabel { text-align: left; font-weight: 700; }
.ht-table .cell-P { color: var(--p-ink); font-weight: 700; }
.ht-table .cell-Y { color: var(--y-ink); font-weight: 700; }
.ht-table tr.final td { font-family: var(--et-head); font-size: 15px; background: var(--et-tray); }
.ht-legend { font-size: 11px; color: var(--et-ink-faint); margin-top: 8px; }
.seatchips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 8px 0; }
.seatchips .sc {
  font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
}
.seatchips .sc.P { background: var(--p-soft); color: var(--p-ink); }
.seatchips .sc.Y { background: var(--y-soft); color: var(--y-ink); }

/* ============================ TOAST ============================ */
#toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--et-ink); color: #fff;
  font-size: 13px; font-weight: 500;
  padding: 12px 18px; border-radius: 999px;
  box-shadow: var(--et-lift);
  max-width: min(90vw, 440px); text-align: center;
  transition: transform .5s var(--et-ease), opacity .5s var(--et-ease);
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 940px) { #toast { bottom: 76px; } }

/* ============================ ENTRY ANIMATION ============================ */
.reveal { opacity: 0; transform: translateY(16px); filter: blur(6px); }
.reveal.in { opacity: 1; transform: none; filter: none; transition: opacity .7s var(--et-ease-out), transform .7s var(--et-ease-out), filter .7s var(--et-ease-out); }

/* mobile sheet toggle button (hidden on desktop) */
.wr-fab { display: none; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 940px) {
  .et-main { grid-template-columns: 1fr; padding-bottom: 96px; }
  .et-hud { grid-template-columns: 1fr 1fr; }
  .et-helper { max-width: none; margin-left: 0; width: 100%; }

  /* War Room becomes a bottom sheet */
  .et-warroom {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    max-height: 82dvh; border-radius: var(--et-r-lg) var(--et-r-lg) 0 0;
    transform: translateY(calc(100% - 62px));
    transition: transform .5s var(--et-ease); z-index: 45;
  }
  .et-warroom.open { transform: translateY(0); }
  .wr-head { cursor: pointer; }
  .wr-head::before {
    content: ''; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
    width: 40px; height: 4px; border-radius: 999px; background: var(--et-hairline);
  }
}
@media (max-width: 560px) {
  .et-board { gap: 8px; padding: 10px; }
  .seat { padding: 9px; min-height: 156px; }
  .et-hud { grid-template-columns: 1fr; }
  .et-topbar { flex-wrap: wrap; }
  .et-topctl { width: 100%; }
}

/* ============================ NO-SCROLL PLAY (desktop) ============================ */
/* Once a match starts, the game view fits one screen: the page itself never scrolls,
   only the board column and the War Room scroll internally. Below 940px the War Room
   is a bottom sheet, so the page keeps its normal flow there. */
@media (min-width: 941px) {
  body.et-playing {
    min-height: 0; height: 100dvh; overflow: hidden;
    display: flex; flex-direction: column;
  }
  body.et-playing .et-main {
    flex: 1 1 auto; min-height: 0; padding-bottom: 18px;
  }
  body.et-playing .et-boardwrap {
    height: 100%; min-height: 0; display: flex; flex-direction: column;
    overflow-y: auto; padding-right: 4px;
  }
  body.et-playing .et-warroom { position: static; top: auto; height: 100%; max-height: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
}
