/* Juego «Nuestra historia familiar» · Familia Cabrera Martín — hoja de estilos */

@font-face { font-family: 'Pagella'; src: url('../fonts/pagella-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pagella'; src: url('../fonts/pagella-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Pagella'; src: url('../fonts/pagella-bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Pagella'; src: url('../fonts/pagella-bolditalic.woff2') format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --ink: #3b2a1a;
  --ink-2: #5e4630;
  --ink-3: #8a7155;
  --paper: #f6eedb;
  --paper-2: #efe2c4;
  --paper-3: #e2d3b0;
  --line: #cdb48a;
  --red: #8a2b1c;
  --red-2: #a13a28;
  --red-dark: #5b1d12;
  --gold: #b8862b;
  --gold-2: #d8b25e;
  --green: #4a6b2f;
  --ok: #3e7a2e;
  --ko: #9b2b1c;
  --shadow: 0 10px 30px rgba(59, 42, 26, .22), 0 2px 6px rgba(59, 42, 26, .15);
  --shadow-lg: 0 24px 70px rgba(30, 18, 8, .45);
  --radius: 12px;
  --top: 64px;
  --font: 'Pagella', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: #e7d8b8 url('../img/fondo_par.webp') center top / cover fixed;
  min-height: 100vh;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at center, rgba(255, 248, 230, 0) 55%, rgba(120, 80, 35, .22) 100%);
}
#app { position: relative; z-index: 1; min-height: 100vh; }
a { color: var(--red); }
a:hover { color: var(--red-2); }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; margin: 0 0 .5em; color: var(--red-dark); }
h1 { font-size: 2rem; }
h2 { font-size: 1.25rem; letter-spacing: .01em; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: .88em; }
.kicker { text-transform: uppercase; letter-spacing: .22em; font-size: .72rem; color: var(--gold); font-weight: 700; margin: 0 0 .3em; }
.lead { font-size: 1.1rem; color: var(--ink-2); }
.empty { color: var(--ink-3); font-style: italic; margin: .4em 0; }
.caption { font-size: .82rem; color: var(--ink-3); font-style: italic; margin-top: .5em; }
.notice { background: #fff4d6; border: 1px solid var(--gold-2); border-radius: 10px; padding: .6em 1em; margin: 0 0 16px; }
.inline { display: inline-flex; align-items: center; gap: .45em; }
.noscript { padding: 2em; text-align: center; }

/* ---------- arranque ---------- */
.boot, .loading { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1em; color: var(--ink-2); font-size: 1.15rem; }
.boot-rose { width: 90px; height: 90px; animation: spin 9s linear infinite; opacity: .9; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- botones ---------- */
.btn {
  --b1: #a13a28; --b2: #7a2414;
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  font: inherit; font-weight: 700; font-size: .98rem; letter-spacing: .01em;
  color: #fff7e8; text-decoration: none; cursor: pointer;
  padding: .58em 1.15em; border-radius: 9px; border: 1px solid #4d170e;
  background: linear-gradient(180deg, var(--b1), var(--b2));
  box-shadow: inset 0 1px 0 rgba(255, 220, 190, .35), 0 2px 5px rgba(60, 20, 10, .25);
  transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.08); color: #fff; }
.btn:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .25); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; filter: grayscale(.3); }
.btn:focus-visible, .icon-btn:focus-visible, .opt:focus-visible, .choose-tile:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; }
.btn.gold { --b1: #e0b55a; --b2: #b3802a; color: #3a2408; border-color: #84591a; box-shadow: inset 0 1px 0 rgba(255, 245, 210, .7), 0 3px 8px rgba(110, 70, 10, .3); }
.btn.gold:hover { color: #2a1804; }
.btn.ghost { background: rgba(255, 250, 238, .7); color: var(--red-dark); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: #fffaf0; color: var(--red); }
.btn.danger { --b1: #b03a2a; --b2: #7f1d12; }
.btn.lg { font-size: 1.08rem; padding: .75em 1.4em; border-radius: 11px; }
.btn.small { font-size: .88rem; padding: .42em .85em; }
.btn.tiny { font-size: .78rem; padding: .28em .6em; border-radius: 7px; }
.btn.block { width: 100%; }
.icon-btn { background: none; border: 0; cursor: pointer; color: inherit; padding: 6px; border-radius: 8px; font: inherit; line-height: 1; }
.icon-btn:hover { background: rgba(255, 255, 255, .15); }
.chip { display: inline-flex; align-items: center; gap: .3em; font: inherit; font-size: .82rem; padding: .22em .7em; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 250, 238, .8); color: var(--ink-2); cursor: default; }
button.chip { cursor: pointer; }
button.chip:hover { background: #fff; border-color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; background: var(--paper-3); border-radius: 4px; padding: 0 .4em; color: var(--ink-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #b9a88c; display: inline-block; flex: none; }
.dot.on { background: #3fa34d; box-shadow: 0 0 0 3px rgba(63, 163, 77, .18); }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; flex: none; border: 1.5px solid rgba(59, 42, 26, .55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.cat-icon { display: inline-flex; line-height: 0; }
.cat-chip { display: inline-flex; align-items: center; gap: .35em; color: #fff; font-weight: 700; font-size: .85rem; padding: .25em .75em .25em .55em; border-radius: 999px; --icon-bg: currentColor; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.cat-chip.small { font-size: .75rem; padding: .15em .6em .15em .45em; }

/* ---------- barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 18px;
  background: linear-gradient(180deg, #6b2215, #4e170d);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 4px 16px rgba(40, 15, 5, .35);
  color: #f7ead0;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.brand-shield { height: 44px; width: auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-kicker { font-size: .62rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold-2); }
.brand-title { font-size: 1.22rem; font-weight: 700; color: #fff3dc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: #e2c78f; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.music-widget { display: flex; align-items: center; gap: 8px; background: rgba(0, 0, 0, .18); border: 1px solid rgba(216, 178, 94, .35); border-radius: 10px; padding: 3px 4px 3px 3px; }
.mw-thumb { width: 72px; height: 40px; padding: 0; border: 1px solid rgba(216, 178, 94, .6); border-radius: 6px; overflow: hidden; background: #2a160c url('../img/escudo.webp') center / auto 80% no-repeat; cursor: pointer; flex: none; }
.mw-thumb video, .sp-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.music-widget:not(.playing) .mw-thumb video { opacity: .35; }
.mw-text { font-size: .8rem; color: #efdcb2; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mw-toggle { color: #f7ead0; }
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid rgba(216, 178, 94, .35); color: inherit; font: inherit; border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer; }
.user-chip:hover { background: rgba(255, 255, 255, .08); }
.user-name { font-size: .92rem; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-box { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: none; flex-direction: column; }
.menu-box.open { display: flex; }
.menu-box a, .menu-box button { text-align: left; font: inherit; color: var(--ink); background: none; border: 0; padding: .55em .8em; border-radius: 7px; text-decoration: none; cursor: pointer; }
.menu-box a:hover, .menu-box button:hover { background: var(--paper-2); color: var(--red); }

/* ---------- maquetación ---------- */
.main { max-width: 1240px; margin: 0 auto; padding: 22px 18px 60px; }
.main.wide { max-width: 1320px; }
.main.narrow { max-width: 900px; }
.main.game-main { max-width: none; padding: 14px 14px 30px; }
.panel {
  background: linear-gradient(180deg, rgba(251, 245, 230, .96), rgba(243, 233, 210, .96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 0 0 4px rgba(255, 252, 244, .55), inset 0 0 0 5px rgba(205, 180, 138, .45);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.panel > h2 { border-bottom: 1px solid rgba(205, 180, 138, .7); padding-bottom: .35em; }
.page h1 { font-size: 2.1rem; }

/* ---------- formularios ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.form.two-cols > div { display: flex; flex-direction: column; gap: 14px; }
.form-actions { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: .92rem; color: var(--ink-2); }
label small { font-weight: 400; color: var(--ink-3); }
label.check { flex-direction: row; align-items: flex-start; gap: 9px; font-weight: 400; color: var(--ink); cursor: pointer; }
label.check input { margin-top: .25em; accent-color: var(--red); width: 17px; height: 17px; flex: none; }
label.check.small { font-size: .85rem; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: #fffdf7;
  border: 1px solid var(--line); border-radius: 8px; padding: .55em .7em; width: 100%;
  box-shadow: inset 0 1px 2px rgba(59, 42, 26, .08);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 178, 94, .3); }
input[type=checkbox], input[type=radio], input[type=range] { width: auto; box-shadow: none; }
input[type=range] { accent-color: var(--red); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
legend { padding: 0 .4em; font-weight: 700; color: var(--ink-2); }
.form-msg { min-height: 1.3em; font-size: .95rem; }
.form-msg.error { color: var(--ko); font-weight: 700; }
.form-msg.ok { color: var(--ok); font-weight: 700; }
.field .lab { font-weight: 700; font-size: .92rem; color: var(--ink-2); display: block; margin-bottom: 6px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(59, 42, 26, .5); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.swatch.on { outline: 3px solid var(--gold); outline-offset: 2px; }
.swatch:disabled { opacity: .25; cursor: not-allowed; }
.swatches.small .swatch { width: 22px; height: 22px; }
.code-input { font-size: 1.6rem; letter-spacing: .3em; text-align: center; text-transform: uppercase; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.4rem; letter-spacing: .12em; background: #fffdf5; border: 1px dashed var(--gold); border-radius: 8px; padding: .25em .6em; display: inline-block; }

/* ---------- pestañas ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { font: inherit; font-weight: 700; color: var(--ink-3); background: none; border: 1px solid transparent; border-bottom: 0; padding: .5em 1em; border-radius: 9px 9px 0 0; cursor: pointer; text-decoration: none; position: relative; top: 1px; }
.tab:hover { color: var(--red); }
.tab.on { color: var(--red-dark); background: var(--paper); border-color: var(--line); }
.tabs.small .tab { font-size: .88rem; padding: .38em .8em; }
.badge { display: none; background: var(--red); color: #fff; border-radius: 999px; font-size: .7rem; min-width: 18px; padding: 0 5px; margin-left: 4px; }
.badge.on { display: inline-block; }

/* ---------- avisos y ventanas ---------- */
#toasts { position: fixed; top: calc(var(--top) + 10px); right: 14px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 28px)); }
.toast { background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: 10px; padding: .7em 1em; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; opacity: 0; transform: translateY(-8px); transition: all .3s ease; cursor: pointer; }
.toast.in { opacity: 1; transform: none; }
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--ko); }
.toast.warn { border-left-color: #c27a17; }
.toast-msg { flex: 1; }
.toast-btn { font: inherit; font-weight: 700; color: var(--red); background: none; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; padding: .2em .6em; }
.modal-wrap { position: fixed; inset: 0; z-index: 120; background: rgba(35, 20, 8, .55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 18px; opacity: 0; transition: opacity .22s ease; }
.modal-wrap.in { opacity: 1; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); transform: translateY(10px) scale(.98); transition: transform .22s ease; }
.modal.wide { width: min(900px, 100%); }
.modal-wrap.in .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 6px; }
.modal-head h2 { margin: 0; }
.modal-x { font-size: 1.6rem; color: var(--ink-3); }
.modal-body { padding: 8px 20px 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 18px; border-top: 1px solid rgba(205, 180, 138, .6); }

/* ---------- entrada ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); gap: 32px; align-items: center; max-width: 1150px; margin: 0 auto; padding: 32px 22px; }
.auth-art { position: relative; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg); border: 6px solid #f3e6c8; outline: 1px solid var(--line); max-height: calc(100vh - 64px); }
.auth-art img { display: block; width: 100%; height: 100%; object-fit: cover; animation: kenburns 40s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08) translateY(-2%); } }
.auth-art-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 16px 10px; font-size: .8rem; font-style: italic; color: #fff6e2; background: linear-gradient(transparent, rgba(30, 18, 8, .65)); }
.auth-panel { text-align: center; padding: 28px 30px; }
.auth-shield { height: 76px; filter: drop-shadow(0 3px 5px rgba(60, 30, 10, .35)); }
.auth-title { font-size: 2.3rem; margin: 0 0 .1em; color: var(--red); }
.auth-sub { text-transform: uppercase; letter-spacing: .25em; font-size: .8rem; color: var(--ink-2); }
.auth-welcome { font-style: italic; color: var(--ink-2); }
.auth-forms { text-align: left; }
.auth-foot { margin-top: 16px; font-size: .9rem; }
.public { padding-top: 30px; }

/* ---------- inicio ---------- */
.hero { display: grid; grid-template-columns: 220px 1fr; gap: 26px; align-items: center; }
.hero-art img { display: block; width: 220px; height: 220px; border-radius: 12px; box-shadow: var(--shadow); border: 4px solid #f6ebd2; transform: rotate(-2deg); }
.hero h1 { font-size: 2.3rem; color: var(--red); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.lobby-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid rgba(205, 180, 138, .8); border-radius: 10px; background: rgba(255, 252, 244, .7); }
.row-item.my-turn { border-color: var(--gold); background: #fff6dc; box-shadow: 0 0 0 3px rgba(216, 178, 94, .25); }
.row-item.invite { border-left: 4px solid var(--gold); }
.ri-main { display: flex; flex-direction: column; min-width: 0; }
.ri-meta { font-size: .85rem; color: var(--ink-3); }
.ri-status { font-size: .82rem; color: var(--ink-2); }
.ri-status.st-playing { color: var(--ok); font-weight: 700; }
.ri-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.btn.btn-del { display: inline-flex; align-items: center; justify-content: center; align-self: stretch; padding: 0 .6em; color: var(--ink-3); }
.btn.btn-del svg { display: block; }
.btn.btn-del:hover { color: #9b2a1c; border-color: #c98f80; background: #fff3ee; }
.online-list { display: flex; flex-direction: column; gap: 8px; }
.online-item { display: flex; align-items: center; gap: 8px; }
.online-item > span:nth-child(2) { flex: 1; }
.sound-card-actions { display: flex; gap: 8px; }
.lb-mini { margin: 0; padding: 0; list-style: none; counter-reset: lb; }
.lb-mini li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dotted var(--line); counter-increment: lb; }
.lb-mini li::before { content: counter(lb) '.'; width: 1.4em; color: var(--ink-3); }
.lb-name { flex: 1; }
.lb-num { font-size: .85rem; color: var(--ink-3); }
.more { display: inline-block; margin-top: 8px; font-size: .9rem; }
.pick-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.pick-list { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fffdf6; padding: 6px; margin: 8px 0; }
.pick-list.short { max-height: 220px; }
.pick { flex-direction: row; align-items: center; gap: 9px; font-weight: 400; color: var(--ink); padding: 5px 6px; border-radius: 7px; cursor: pointer; }
.pick:hover { background: var(--paper-2); }
.pick input { accent-color: var(--red); width: 17px; height: 17px; }
.pick-name { flex: 1; }
.pick small { color: var(--ink-3); font-size: .78rem; }

/* ---------- sala de espera ---------- */
.room-head { display: flex; justify-content: space-between; gap: 18px; align-items: center; flex-wrap: wrap; }
.room-title { margin-bottom: .2em; color: var(--red); }
.room-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.room-code { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.room-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 18px; }
.room-seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.seat-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 252, 244, .8); }
.seat-card.mine { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 178, 94, .25); }
.seat-body { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.seat-title { font-size: 1.05rem; }
.seat-name { font-weight: 700; }
.members { display: flex; flex-wrap: wrap; gap: 6px; font-size: .88rem; }
.member { display: inline-flex; align-items: center; gap: 5px; background: var(--paper-2); border-radius: 999px; padding: .1em .6em; }
.room-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.waiting { font-style: italic; color: var(--ink-2); margin: 0; }
.waiting::after { content: ''; display: inline-block; width: 1em; text-align: left; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ---------- charla y crónica ---------- */
.log, .chat-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; font-size: .9rem; }
.log li { display: flex; gap: 8px; padding: 4px 2px; border-bottom: 1px dotted rgba(205, 180, 138, .7); }
.log time { color: var(--ink-3); font-size: .78rem; flex: none; width: 3.2em; padding-top: .1em; }
.log li.turn { color: var(--ink-3); }
.log li.ok span { color: var(--ok); }
.log li.ko span { color: var(--ko); }
.log li.wedge span, .log li.win span { font-weight: 700; color: var(--red-dark); }
.chat-msg { padding: 4px 2px; }
.chat-who { font-weight: 700; margin-right: .4em; }
.chat-msg.mine .chat-who::after { content: ' (tú)'; font-weight: 400; color: var(--ink-3); }
.chat-quick { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.chat-form { display: flex; gap: 6px; }

/* ---------- partida ---------- */
.game { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 16px; align-items: start; max-width: 1500px; margin: 0 auto; }
.board-wrap { position: relative; display: flex; justify-content: center; }
.board { position: relative; width: min(100%, calc(100vh - var(--top) - 34px)); aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-lg); background: #e9d9b5; user-select: none; touch-action: manipulation; }
.board picture, .board-img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.board-img { object-fit: cover; }
.board-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.token { transition: transform .45s cubic-bezier(.3, .7, .4, 1); cursor: default; }
.token.turn .tok > circle:nth-child(2) { stroke: #fff3c4; stroke-width: 3.2; }
.token.turn { animation: turnglow 1.6s ease-in-out infinite; }
@keyframes turnglow { 0%, 100% { filter: url(#tokshadow) drop-shadow(0 0 0 rgba(255, 220, 120, 0)); } 50% { filter: url(#tokshadow) drop-shadow(0 0 6px rgba(255, 215, 110, .95)); } }
.token.hopping { animation: none; }
.tok-label { font: 700 11px var(--font); fill: #2a1c10; paint-order: stroke; stroke: #fff6e0; stroke-width: 3px; }
.target { cursor: pointer; outline: none; }
.target-in { transform-box: fill-box; transform-origin: center; animation: pulse 1.15s ease-in-out infinite; }
.target-ring { fill: rgba(255, 248, 225, .28); stroke-width: 5; filter: url(#glow); }
.target-hit { fill: transparent; stroke: #fff7dc; stroke-width: 2; stroke-dasharray: 6 5; }
.target-dot { stroke: #fff; stroke-width: 2; }
.target:hover .target-ring, .target:focus .target-ring { fill: rgba(255, 248, 225, .55); stroke-width: 7; }
@keyframes pulse { 0%, 100% { transform: scale(.92); } 50% { transform: scale(1.08); } }
.mark { fill: none; stroke-width: 5; stroke-dasharray: 10 6; filter: url(#glow); animation: dash 1.8s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -32; } }
.flash { fill: none; stroke-width: 6; animation: flash 1.1s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes flash { from { opacity: 1; transform: scale(.8); } to { opacity: 0; transform: scale(2); } }
.board-tip { position: absolute; transform: translate(-50%, -150%); background: rgba(40, 24, 10, .88); color: #fff3da; font-size: .82rem; padding: .25em .6em; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 5; }
.board-tip.on { opacity: 1; }
.float-banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9); background: rgba(251, 245, 230, .97); border: 2px solid var(--cat, var(--gold)); color: var(--red-dark); font-weight: 700; font-size: 1.3rem; padding: .6em 1.2em; border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: .5em; z-index: 8; animation: popin .35s ease-out forwards; pointer-events: none; }
.float-banner .cat-icon { color: var(--cat); }
.float-banner.out { opacity: 0; transition: opacity .5s ease; }
@keyframes popin { to { transform: translate(-50%, -50%) scale(1); } }
.choose-banner { position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); background: rgba(40, 24, 10, .85); color: #fff3da; padding: .5em 1em; border-radius: 10px; font-size: .95rem; z-index: 6; }
.g-side { position: sticky; top: calc(var(--top) + 12px); display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - var(--top) - 24px); overflow: auto; padding-right: 2px; }
.g-side > * { background: linear-gradient(180deg, rgba(251, 245, 230, .97), rgba(243, 233, 210, .97)); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; }
.g-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.g-title { font-size: 1.15rem; margin: 0; }
.rules-link { font-size: .85rem; }
.turn-box { display: flex; gap: 12px; align-items: center; min-height: 70px; }
.turn-box.mine { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 178, 94, .35), var(--shadow); background: linear-gradient(180deg, #fff8e2, #f7e7c0); }
.turn-text { display: flex; flex-direction: column; }
.turn-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .16em; color: var(--gold); font-weight: 700; }
.turn-box strong { font-size: 1.2rem; color: var(--red-dark); }
.turn-hint { font-size: .9rem; color: var(--ink-2); }
.dice-row { display: flex; gap: 14px; align-items: center; }
.action-box { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.action-box .hint { margin: 0; font-size: .92rem; color: var(--ink-2); }
.roll-btn { animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 245, 210, .7), 0 3px 8px rgba(110, 70, 10, .3); } 50% { box-shadow: inset 0 1px 0 rgba(255, 245, 210, .7), 0 0 0 6px rgba(216, 178, 94, .35); } }
.target-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.g-seats { display: flex; flex-direction: column; gap: 8px; }
.g-seat { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; border: 1px solid transparent; }
.g-seat.active { border-color: var(--gold); background: #fff6dc; }
.g-seat.out { opacity: .45; }
.g-seat.winner { background: #fff2c8; border-color: var(--gold); }
.gs-body { flex: 1; min-width: 0; }
.gs-name { display: flex; align-items: center; gap: 6px; }
.gs-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-members { font-size: .78rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-wedges { display: flex; align-items: center; gap: 3px; margin-top: 3px; }
.gs-wedges .w { width: 14px; height: 14px; border-radius: 3px; background: rgba(205, 180, 138, .45); border: 1px solid rgba(59, 42, 26, .25); }
.gs-wedges .w.on { border-color: rgba(255, 240, 210, .9); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.gs-count { font-size: .8rem; font-weight: 700; margin-left: 4px; color: var(--ink-2); }
.gs-pct { font-size: .75rem; color: var(--ink-3); margin-left: auto; }
.g-tabs .tabs { margin-bottom: 8px; }
.g-foot { display: flex; gap: 6px; flex-wrap: wrap; }
.g-foot:empty, .g-status:empty { display: none; }

/* ---------- dado ---------- */
.die { --s: 64px; width: var(--s); height: var(--s); perspective: 420px; flex: none; }
.die-cube { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(-18deg) rotateY(24deg); }
.die.idle .die-cube { animation: idle 7s ease-in-out infinite; }
@keyframes idle { 0%, 100% { transform: rotateX(-18deg) rotateY(24deg); } 50% { transform: rotateX(-26deg) rotateY(-28deg); } }
.die-face { position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 9px; border-radius: 13px; background: radial-gradient(circle at 30% 25%, #fffdf6, #f1e4c6 70%, #e3cfa3); border: 1px solid #b79a6a; box-shadow: inset 0 0 8px rgba(120, 85, 35, .35); backface-visibility: hidden; }
.die-face .pip { width: 70%; height: 70%; margin: auto; border-radius: 50%; }
.die-face .pip.on { background: radial-gradient(circle at 35% 30%, #a13a28, #5b1d12); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .45); }
.die-face.f1 .pip.on { background: radial-gradient(circle at 35% 30%, #c4472f, #6b1c10); width: 88%; height: 88%; }
.f1 { transform: translateZ(calc(var(--s) / 2)); }
.f6 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.f2 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.f5 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.f3 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.f4 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.die.rolling { animation: hop 1.05s ease-out; }
@keyframes hop { 0% { transform: translateY(0); } 25% { transform: translateY(-14px); } 55% { transform: translateY(0); } 70% { transform: translateY(-5px); } 100% { transform: translateY(0); } }

/* ---------- carta en juego ---------- */
.card-overlay { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: calc(var(--top) + 10px) 18px 18px; opacity: 0; transition: opacity .3s ease; }
.card-overlay.in { opacity: 1; }
.card-overlay.out { opacity: 0; }
.card-backdrop { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(40, 24, 10, .55), rgba(20, 10, 4, .78)); backdrop-filter: blur(2px); }
.card-stage { position: relative; display: flex; gap: 26px; align-items: center; max-width: 1080px; width: 100%; justify-content: center; }
.card-flip { width: min(400px, 38vw, calc((100vh - var(--top) - 60px) * 828 / 1240)); aspect-ratio: 828 / 1240; perspective: 1600px; flex: none; transform: translateY(30px) rotate(-3deg) scale(.9); opacity: 0; transition: transform .55s cubic-bezier(.2, .8, .25, 1.15), opacity .4s ease; }
.card-overlay.in .card-flip { transform: none; opacity: 1; }
.card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3, .7, .3, 1); }
.card-flip.flipped .card-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 4.4% / 2.9%; overflow: hidden; box-shadow: 0 22px 50px rgba(0, 0, 0, .55); background: #f3e6c8; }
.face img { width: 100%; height: 100%; display: block; object-fit: cover; }
.face.back { transform: rotateY(180deg); }
.face.cropped img { height: auto; }
.face.cropped { background: linear-gradient(180deg, #f3e6c8 46%, #efdfbc); }
.crop-q { position: absolute; left: 6%; right: 6%; top: 44%; bottom: 6%; display: flex; align-items: center; justify-content: center; text-align: center; background: rgba(255, 250, 238, .92); border: 2px solid var(--cat); border-radius: 12px; padding: 1em; }
.crop-q p { margin: 0; font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.card-side { flex: 1; max-width: 560px; max-height: calc(100vh - var(--top) - 40px); overflow: auto; background: linear-gradient(180deg, rgba(251, 245, 230, .98), rgba(243, 233, 210, .98)); border: 1px solid var(--line); border-top: 6px solid var(--cat); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 18px 20px; transform: translateX(20px); opacity: 0; transition: all .45s ease .1s; }
.card-overlay.in .card-side { transform: none; opacity: 1; }
.cs-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cs-kind { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); font-weight: 700; }
.cs-who { margin: 8px 0 4px; font-size: .92rem; display: flex; align-items: center; gap: 6px; }
.dot-c { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(59, 42, 26, .5); display: inline-block; }
.cs-question { font-size: 1.32rem; line-height: 1.25; color: var(--ink); margin: 4px 0 12px; }
.timer-bar { position: relative; height: 10px; border-radius: 6px; background: rgba(205, 180, 138, .45); overflow: hidden; margin: 4px 0 14px; }
.timer-bar span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .2s linear; }
.timer-bar.low span { background: linear-gradient(90deg, #b03a2a, #e05a3a); }
.timer-bar::after { content: attr(data-sec); position: absolute; right: 6px; top: -2px; font-size: .7rem; font-weight: 700; color: var(--ink); }
.options { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; font-size: 1.02rem; color: var(--ink); background: #fffdf6; border: 1.5px solid var(--line); border-radius: 11px; padding: .55em .8em; cursor: pointer; transition: all .15s ease; }
.opt:not(:disabled):hover { border-color: var(--cat); background: #fff; transform: translateX(3px); box-shadow: 0 3px 10px rgba(59, 42, 26, .15); }
.opt:disabled { cursor: default; }
.opt-letter { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; font-weight: 700; color: #fff; background: var(--cat); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 2px rgba(0, 0, 0, .3); }
.opt-text { flex: 1; }
.opt-mark { font-weight: 700; font-size: 1.3rem; }
.opt.chosen { border-color: var(--gold); background: #fff4d6; box-shadow: 0 0 0 3px rgba(216, 178, 94, .35); }
.opt.right { border-color: var(--ok); background: #eaf5e1; }
.opt.right .opt-letter { background: var(--ok); }
.opt.right .opt-mark { color: var(--ok); }
.opt.wrong { border-color: var(--ko); background: #fbe7e1; }
.opt.wrong .opt-letter { background: var(--ko); }
.opt.wrong .opt-mark { color: var(--ko); }
.opt.dim { opacity: .5; }
.expert-form { display: flex; gap: 8px; }
.expert-input { font-size: 1.1rem; }
.judge-box { margin-top: 12px; padding: 12px; border: 1px dashed var(--gold); border-radius: 10px; background: #fffaf0; }
.judge-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.judge-actions p { width: 100%; margin: 0 0 4px; }
.result { margin-top: 14px; padding: 12px 14px; border-radius: 12px; display: flex; flex-direction: column; gap: 3px; animation: popin2 .45s ease-out; }
.result strong { font-size: 1.25rem; }
.result.ok { background: linear-gradient(180deg, #eef7e6, #dcefcf); border: 1px solid #9cc98a; color: #24501a; }
.result.ko { background: linear-gradient(180deg, #fbece7, #f3d8cf); border: 1px solid #d79b8c; color: #6d1c10; }
@keyframes popin2 { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.did-you-know { margin-top: 12px; padding: 12px 14px; background: rgba(255, 252, 244, .9); border-left: 4px solid var(--cat); border-radius: 8px; }
.did-you-know h4 { margin: 0 0 4px; color: var(--cat); filter: brightness(.8); }
.did-you-know p { margin: 0 0 4px; }
.did-you-know .src { font-size: .8rem; font-style: italic; color: var(--ink-3); margin: 0; }
.cs-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.auto-note { font-size: .82rem; color: var(--ink-3); }
.wedge-pop { position: absolute; left: 50%; top: 50%; width: 110px; height: 110px; margin: -55px; border-radius: 50%; background: var(--cat); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 8px rgba(255, 245, 210, .6), 0 20px 50px rgba(0, 0, 0, .5); animation: wedgepop 1.7s ease-in-out forwards; z-index: 3; }
@keyframes wedgepop { 0% { transform: scale(.2); opacity: 0; } 25% { transform: scale(1.15); opacity: 1; } 60% { transform: scale(1); opacity: 1; } 100% { transform: translate(40vw, -40vh) scale(.2); opacity: 0; } }
.html-card { position: absolute; inset: 0; padding: 7% 7% 6%; display: flex; flex-direction: column; gap: .5em; background: radial-gradient(ellipse at center, #f8eed6, #ead8b0); border: 8px solid var(--cat); border-radius: inherit; text-align: center; font-size: clamp(.7rem, 1.6vw, 1rem); }
.hc-title strong { display: block; font-size: 1.4em; color: var(--red-dark); }
.hc-title span { font-size: .85em; color: var(--ink-3); }
.hc-art { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--cat); opacity: .8; }
.hc-ribbon { background: var(--cat); color: #fff; letter-spacing: .3em; font-weight: 700; margin: 0 auto; padding: .1em 1em; border-radius: 4px; }
.hc-q { font-weight: 700; font-size: 1.1em; }
.hc-opts { text-align: left; margin: 0; padding-left: 0; list-style: none; font-size: .92em; }
.hc-opts b { color: var(--cat); }
.hc-lema { font-style: italic; color: var(--ink-2); margin: 0; }
.hc-id { font-size: .75em; color: var(--ink-3); margin: 0; }
.back-html .hc-band { background: var(--cat); color: #fff; padding: .6em; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: .5em; font-weight: 700; letter-spacing: .2em; }
.hc-label { font-weight: 700; color: var(--red-dark); margin: .4em 0 0; }
.hc-answer { font-size: 1.25em; font-weight: 700; }
.hc-text { text-align: left; }
.hc-src { font-style: italic; color: var(--ink-3); font-size: .85em; }

/* ---------- elección de categoría ---------- */
.choose-wrap { position: fixed; inset: 0; z-index: 95; background: rgba(30, 18, 8, .6); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 18px; opacity: 0; transition: opacity .25s; }
.choose-wrap.in { opacity: 1; }
.choose-box { max-width: 760px; width: 100%; text-align: center; }
.choose-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.choose-tile { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .5); color: #fff; background: var(--cat); background: linear-gradient(180deg, color-mix(in srgb, var(--cat) 82%, white), var(--cat)); cursor: pointer; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); transition: transform .12s ease, box-shadow .12s ease; --icon-bg: var(--cat); }
.choose-tile:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 22px rgba(0, 0, 0, .32); }
.choose-tile strong { font-size: 1.05rem; }
.choose-tile small { opacity: .85; }
.choose-time { font-size: .9rem; color: var(--ink-3); }

/* ---------- victoria ---------- */
.victory-wrap { position: fixed; inset: 0; z-index: 110; background: radial-gradient(ellipse at center, rgba(60, 35, 10, .55), rgba(20, 10, 4, .85)); display: flex; align-items: center; justify-content: center; padding: 18px; opacity: 0; transition: opacity .5s; }
.victory-wrap.in { opacity: 1; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.victory { position: relative; max-width: 640px; width: 100%; text-align: center; max-height: calc(100vh - 36px); overflow: auto; animation: popin2 .6s ease-out; }
.victory h1 { font-size: 2.2rem; color: var(--red); margin-top: .3em; }
.victory .token-svg { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); animation: float 3s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.victory-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* ---------- tablas ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .95rem; background: rgba(255, 252, 244, .6); }
.table th, .table td { padding: .5em .6em; border-bottom: 1px solid rgba(205, 180, 138, .7); text-align: left; vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); background: rgba(226, 211, 176, .5); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.hl td { background: #fff4d6; }
.table tr.off td { opacity: .5; }
.table.compact { font-size: .9rem; margin-top: 12px; }
.table td.actions { display: flex; gap: 4px; flex-wrap: wrap; }
.cards-table td:nth-child(2) { max-width: 460px; }
.admin-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.admin-tools input { width: 180px; }
.import { margin-top: 18px; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; }
.import summary { cursor: pointer; font-weight: 700; color: var(--red-dark); }
.import input[type=file] { margin: 8px 0; }
.cat-bars { display: flex; flex-direction: column; gap: 8px; }
.cat-bar { display: grid; grid-template-columns: 190px 1fr 120px; gap: 10px; align-items: center; }
.cb-track { height: 14px; background: rgba(205, 180, 138, .45); border-radius: 7px; overflow: hidden; }
.cb-fill { display: block; height: 100%; border-radius: 7px; }
.cb-num { font-size: .85rem; color: var(--ink-2); }

/* ---------- reglamento ---------- */
.rules h2 { margin-top: 1.2em; }
.rules ol, .rules ul { padding-left: 1.3em; }
.rules li { margin-bottom: .45em; }
.rules-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rc { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px; border-radius: 12px; background: var(--cat); color: #fff; text-align: center; --icon-bg: var(--cat); }
.rc span { font-size: .85rem; opacity: .9; }
.credits { display: grid; grid-template-columns: 220px 1fr; gap: 6px 16px; }
.credits dt { font-weight: 700; color: var(--ink-2); }
.credits dd { margin: 0; }

/* ---------- banda sonora ---------- */
.sound-panel { display: flex; flex-direction: column; gap: 12px; }
.sp-video { aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #1d1007; box-shadow: var(--shadow); }
.sp-note { font-size: .88rem; color: var(--ink-3); font-style: italic; margin: 0; }
.sp-tracks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sp-track { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: #fffdf6; cursor: pointer; }
.sp-track strong { color: var(--red-dark); }
.sp-track span { font-size: .8rem; color: var(--ink-3); }
.sp-track.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 178, 94, .3); }
.sp-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.sp-range { flex-direction: row; align-items: center; gap: 10px; }
.sp-range span { flex: none; font-weight: 400; }
.sp-range input { flex: 1; }

/* ---------- pantallas medianas y pequeñas ---------- */
@media (max-width: 1180px) {
  .game { grid-template-columns: minmax(0, 1fr) 330px; }
}
@media (max-width: 980px) {
  :root { --top: 56px; }
  body { font-size: 16px; }
  .game { grid-template-columns: 1fr; }
  .board { width: min(100%, calc(100vh - var(--top) - 150px)); }
  .g-side { position: static; max-height: none; overflow: visible; }
  .lobby-cols, .room-cols { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; padding: 16px; }
  .auth-art { max-height: 32vh; }
  .card-stage { flex-direction: column; gap: 14px; align-items: stretch; }
  .card-overlay { align-items: flex-start; overflow: auto; padding-top: calc(var(--top) + 8px); }
  .card-flip { width: min(280px, 62vw, calc((42vh) * 828 / 1240)); align-self: center; }
  .card-side { max-height: none; max-width: none; }
  .form.two-cols { grid-template-columns: 1fr; }
  .brand-sub, .mw-text { display: none; }
}
@media (max-width: 640px) {
  .main { padding: 14px 10px 40px; }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-art img { margin: 0 auto; width: 160px; height: 160px; }
  .hero-actions { justify-content: center; }
  .panel { padding: 14px; }
  .brand-title { font-size: 1rem; }
  .brand-shield { height: 36px; }
  .user-name { display: none; }
  .user-chip { padding: 3px; }
  .mw-thumb { width: 54px; height: 32px; }
  .choose-grid, .rules-cats, .sp-tracks { grid-template-columns: repeat(2, 1fr); }
  .cat-bar { grid-template-columns: 1fr; }
  .credits { grid-template-columns: 1fr; }
  .sp-controls { grid-template-columns: 1fr; }
  .row-item { flex-direction: column; align-items: stretch; }
  .ri-actions { justify-content: flex-end; }
  .cs-question { font-size: 1.15rem; }
  .opt { font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
