@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700;900&family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --bg0: #06060f;
  --bg1: #0c0c1e;
  --bg2: #13132a;
  --bg3: #1b1b38;
  --bg4: #242448;
  --surface: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.07);
  --purple: #7c3aed;
  --purple-l: #a78bfa;
  --red: #ef4444;
  --gold: #d9a406;
  --green: #22c55e;
  --cyan: #22d3ee;
  --pink: #ec4899;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #4b5563;
  --ff-head: 'Cinzel', serif;
  --ff-ui: 'Inter', sans-serif;
  --r: 12px;
  --r-lg: 18px;
  --shadow: 0 4px 24px rgba(0,0,0,0.6);
}

html, body { height: 100%; }
body {
  background: var(--bg0); color: var(--text);
  font-family: var(--ff-ui); font-size: 15px; line-height: 1.5; min-height: 100vh;
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg1); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }

.doodle-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse at 15% 80%, rgba(236,72,153,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(34,211,238,0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(124,58,237,0.07) 0%, transparent 70%);
}

.top-bar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; gap: 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(6,6,15,0.75); backdrop-filter: blur(8px);
}
.top-brand { color: var(--text2); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; }
.top-brand:hover { color: var(--text); }
.top-title {
  font-family: var(--ff-head); font-weight: 900; letter-spacing: 5px; font-size: 16px;
  background: linear-gradient(90deg, var(--pink), var(--cyan), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

#app { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 16px 12px 50px; }

.loading { text-align: center; padding: 80px 0; color: var(--text2); }
.spinner { font-size: 40px; display: inline-block; animation: wiggle 1s ease-in-out infinite; }
@keyframes wiggle { 0%,100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg) translateY(-4px); } }

#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg3); color: var(--text); border: 1px solid var(--border);
  padding: 10px 22px; border-radius: 30px; font-size: 14px; opacity: 0;
  transition: all .25s; z-index: 100; pointer-events: none; box-shadow: var(--shadow); max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { border-color: var(--red); color: #fca5a5; }

button {
  font-family: var(--ff-ui); font-size: 14px; font-weight: 600;
  border: none; border-radius: var(--r); cursor: pointer; transition: all .18s; color: var(--text);
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  padding: 13px 26px; width: 100%;
  box-shadow: 0 4px 18px rgba(236,72,153,0.3);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(236,72,153,0.45); }
.btn-secondary { background: var(--bg3); border: 1px solid var(--border); padding: 11px 20px; }
.btn-secondary:hover:not(:disabled) { background: var(--bg4); }
.btn-danger { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.4); color: #fca5a5; padding: 11px 20px; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text2); padding: 8px 14px; font-size: 13px; }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--pink); }

/* ─── Landing ─── */
.landing-hero { text-align: center; padding: 36px 0 24px; }
.landing-hero h1 {
  font-family: var(--ff-head); font-size: clamp(34px, 7vw, 54px); font-weight: 900; letter-spacing: 4px;
  background: linear-gradient(100deg, var(--pink) 10%, var(--cyan) 55%, var(--gold) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.landing-hero .tagline { color: var(--text2); font-size: 16px; margin-top: 4px; }
.hero-crayons { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; font-size: 36px; }
.hero-crayons span { display: inline-block; animation: wiggle 2.4s ease-in-out infinite; }
.hero-crayons span:nth-child(2) { animation-delay: .3s; }
.hero-crayons span:nth-child(3) { animation-delay: .6s; }

.action-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }
.action-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 24px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .2s, transform .2s;
}
.action-card:hover { border-color: var(--pink); transform: translateY(-2px); }
.action-card h3 { font-family: var(--ff-head); font-size: 17px; letter-spacing: 1px; }
.action-card p { color: var(--text2); font-size: 13.5px; flex: 1; }
.action-card input {
  background: var(--bg1); border: 1px solid var(--border); border-radius: var(--r);
  color: var(--text); padding: 11px 14px; font-size: 16px; letter-spacing: 4px;
  text-align: center; text-transform: uppercase; font-weight: 700; width: 100%;
}
.action-card input:focus { outline: none; border-color: var(--pink); }

/* ─── Panels compartidos ─── */
.panel { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px; }
.panel h4 { font-family: var(--ff-head); letter-spacing: 2px; font-size: 13px; color: var(--text2); margin-bottom: 12px; }

/* ─── Lobby ─── */
.lobby { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .lobby { grid-template-columns: 1fr; } }
.lobby-code {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--bg2); border: 1px dashed rgba(236,72,153,0.5); border-radius: var(--r-lg);
  padding: 16px 20px; margin-bottom: 16px;
}
.lobby-code-label { color: var(--text2); font-size: 13px; }
.lobby-code-value { font-family: var(--ff-head); font-size: 26px; font-weight: 700; letter-spacing: 6px; color: var(--gold); }
.copy-btn { background: var(--bg3); border: 1px solid var(--border); padding: 8px 14px; font-size: 13px; border-radius: 8px; }

.seat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.seat {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 10px 12px;
}
.seat.empty { border-style: dashed; color: var(--text3); justify-content: center; min-height: 56px; font-size: 13px; }
.seat.is-me { border-color: rgba(236,72,153,0.65); }
.seat .player-avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--bg4); display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.seat .p-name { font-weight: 600; font-size: 13.5px; }
.seat .p-meta { font-size: 11.5px; color: var(--text2); }
.seat .host-tag { margin-left: auto; font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 20px; color: var(--gold); background: rgba(217,164,6,0.12); }

.opt-group { margin-bottom: 14px; }
.opt-group .opt-label { font-size: 12.5px; color: var(--text2); margin-bottom: 7px; font-weight: 600; }
.opt-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.opt-pill {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 20px;
  padding: 7px 13px; font-size: 13px; color: var(--text2);
}
.opt-pill.sel { background: rgba(236,72,153,0.25); border-color: var(--pink); color: #fff; }
select.lista-select {
  width: 100%; background: var(--bg1); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r); padding: 9px 12px; font-size: 13.5px;
}

/* ─── Layout de partida ─── */
.game { display: grid; grid-template-columns: 210px minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
@media (max-width: 1050px) { .game { grid-template-columns: minmax(0, 1fr) 300px; } .players-col { grid-column: 1 / -1; order: 3; } }
@media (max-width: 760px) { .game { grid-template-columns: 1fr; } .side-col { order: 2; } .players-col { order: 3; } }

/* barra superior de la partida */
.game-hud {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 10px 16px; margin-bottom: 12px;
}
.hud-round { font-size: 12px; color: var(--text2); font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
.hud-word {
  flex: 1; text-align: center; font-family: 'Courier New', monospace;
  font-size: clamp(18px, 3.2vw, 26px); font-weight: 800; letter-spacing: 6px; min-width: 0;
  overflow-wrap: anywhere; color: #fff;
}
.hud-word.es-pista { color: var(--gold); }
.hud-timer {
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 22px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 4px 12px;
}
.hud-timer.low { color: #fecaca; border-color: var(--red); animation: pulse-red 1s infinite; }
@keyframes pulse-red { 50% { box-shadow: 0 0 14px rgba(239,68,68,0.55); } }
.hud-bar { height: 4px; border-radius: 3px; background: var(--bg4); overflow: hidden; width: 100%; }
.hud-bar > div { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); transition: width .3s linear; }

/* jugadores */
.players-col { display: flex; flex-direction: column; gap: 8px; }
.pcard {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r);
  padding: 8px 10px; position: relative;
}
.pcard.drawer { border-color: rgba(34,211,238,0.6); box-shadow: 0 0 12px rgba(34,211,238,0.15); }
.pcard.guessed { border-color: rgba(34,197,94,0.55); }
.pcard.is-me { outline: 1px dashed rgba(236,72,153,0.4); }
.pcard .player-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--bg4); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.pcard .pc-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .pc-score { font-size: 12.5px; color: var(--text2); font-variant-numeric: tabular-nums; }
.pcard .pc-delta { color: var(--green); font-weight: 700; font-size: 12px; margin-left: 4px; }
.pcard .pc-badge { margin-left: auto; font-size: 16px; }

/* canvas */
.canvas-wrap {
  position: relative; width: 100%;
  border-radius: var(--r-lg); overflow: hidden;
  background: #fff; aspect-ratio: 4 / 3;
  box-shadow: 0 0 0 3px var(--bg3), var(--shadow);
  touch-action: none;
}
.canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.canvas-wrap.no-draw canvas { cursor: default; }

.canvas-overlay {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,6,15,0.72); backdrop-filter: blur(2px);
  animation: fade-in .3s;
}
@keyframes fade-in { from { opacity: 0; } }
.overlay-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 22px 28px; text-align: center; max-width: 92%; box-shadow: var(--shadow);
  animation: pop-in .3s cubic-bezier(.2, 1.5, .4, 1);
}
@keyframes pop-in { from { transform: scale(0.75); opacity: 0; } }
.overlay-card h3 { font-family: var(--ff-head); letter-spacing: 2px; font-size: 16px; margin-bottom: 12px; }
.word-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.word-buttons button {
  background: var(--bg3); border: 1px solid var(--purple); padding: 12px 20px; font-size: 15px; font-weight: 700;
}
.word-buttons button:hover { background: rgba(124,58,237,0.3); transform: translateY(-2px); }
.reveal-word { font-size: 26px; font-weight: 800; color: var(--gold); letter-spacing: 2px; margin: 6px 0 10px; }
.turn-points { font-size: 13.5px; color: var(--text2); }
.turn-points b { color: var(--green); }

/* herramientas del dibujante */
.tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 8px 12px; margin-top: 10px;
}
.tools .colors { display: flex; gap: 5px; flex-wrap: wrap; }
.tools .col {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent;
  transition: transform .12s;
}
.tools .col:hover { transform: scale(1.2); }
.tools .col.sel { border-color: #fff; transform: scale(1.15); }
.tools .sizes { display: flex; gap: 5px; align-items: center; }
.tools .size {
  width: 30px; height: 30px; border-radius: 8px; background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.tools .size.sel { border-color: var(--pink); background: rgba(236,72,153,0.2); }
.tools .size i { background: #ddd; border-radius: 50%; display: block; }
.tools .tool-btn { padding: 7px 11px; font-size: 13px; background: var(--bg3); border: 1px solid var(--border); }
.tools .tool-btn.sel { border-color: var(--cyan); background: rgba(34,211,238,0.15); }

/* chat / adivinanzas */
.side-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.chat-panel { display: flex; flex-direction: column; height: 420px; }
.chat-messages { flex: 1; overflow-y: auto; font-size: 13.5px; margin-bottom: 10px; }
.chat-msg { padding: 2px 0; word-wrap: break-word; }
.chat-msg .from { font-weight: 700; color: var(--purple-l); }
.chat-msg.acierto { color: var(--green); font-weight: 700; }
.chat-msg.casi { color: var(--gold); font-style: italic; }
.chat-msg.guessed-msg { color: var(--text3); font-style: italic; }
.chat-msg.sistema { color: var(--cyan); }
.chat-input { display: flex; gap: 8px; }
.chat-input input {
  flex: 1; background: var(--bg1); border: 1px solid var(--border); border-radius: var(--r);
  color: var(--text); padding: 10px 12px; font-size: 14px; min-width: 0;
}
.chat-input input:focus { outline: none; border-color: var(--pink); }
.chat-input input:disabled { opacity: .5; }
.chat-input button { padding: 9px 14px; background: var(--bg3); border: 1px solid var(--border); font-size: 13px; }

/* fin de partida */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin: 14px 0 6px; }
.podium .step { text-align: center; }
.podium .step .cup { font-size: 30px; }
.podium .step .nm { font-weight: 700; font-size: 13.5px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .step .pt { color: var(--text2); font-size: 12.5px; }
.podium .base { background: var(--bg3); border-radius: 8px 8px 0 0; margin-top: 6px; }
.podium .p1 .base { height: 64px; width: 90px; background: linear-gradient(180deg, rgba(217,164,6,0.5), var(--bg3)); }
.podium .p2 .base { height: 44px; width: 84px; background: linear-gradient(180deg, rgba(148,163,184,0.4), var(--bg3)); }
.podium .p3 .base { height: 30px; width: 78px; background: linear-gradient(180deg, rgba(180,83,9,0.4), var(--bg3)); }
.end-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }

/* modal listas */
#lista-modal {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(6,6,15,0.78); backdrop-filter: blur(3px);
}
#lista-modal[hidden] { display: none !important; }
#lista-modal .lm-box {
  background: var(--bg2); border: 1px solid var(--pink); border-radius: var(--r-lg);
  padding: 22px; width: min(560px, 94vw); max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow);
}
#lista-modal textarea {
  width: 100%; min-height: 150px; background: var(--bg1); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; font-size: 13.5px;
  font-family: var(--ff-ui); resize: vertical;
}
#lista-modal input[type=text] {
  width: 100%; background: var(--bg1); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 12px; font-size: 14px; margin-bottom: 10px;
}
#lista-modal .lm-row { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.mis-listas-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 6px; font-size: 13.5px;
}
.mis-listas-item .del { margin-left: auto; color: #fca5a5; cursor: pointer; font-size: 12px; }

@media (max-width: 560px) {
  #app { padding: 10px 6px 40px; }
  .top-title { letter-spacing: 3px; font-size: 14px; }
  .chat-panel { height: 300px; }
  .hud-word { letter-spacing: 3px; }
}

/* capa de trazos en vivo de otro jugador: encima del lienzo, sin tocar eventos */
.canvas-wrap canvas.cv-vivo { pointer-events: none; cursor: default; }
.center-col { min-width: 0; }

/* ── Móvil en partida: pantalla pegada a la zona visible ──────────────────
   /js/visor-juego.js pone --vv-top y --vv-h (lo que de verdad se ve, con o
   sin teclado). #app se fija a eso y reparte el alto en columna: encabezado,
   jugadores, LIENZO (ocupa lo que sobre y se achica con el teclado abierto)
   y el campo de respuestas abajo, siempre a la vista. Nada de deslizar. */
.hud-exit { display: none; }
@media (max-width: 760px), (max-height: 500px) {
  /* <16px: Safari iOS hace zoom a toda la página al enfocar el campo */
  .chat-input input { font-size: 16px; }

  body.en-juego { overflow: hidden; overscroll-behavior: none; }
  body.en-juego .top-bar { display: none; }
  body.en-juego #app {
    position: fixed; left: 0; right: 0;
    top: var(--vv-top, 0px); height: var(--vv-h, 100dvh);
    max-width: none; margin: 0;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 6px calc(6px + env(safe-area-inset-bottom, 0px));
    display: flex; flex-direction: column; overflow: hidden;
  }
  body.en-juego .hud-gap { display: none; }
  body.en-juego .game-hud { flex: none; padding: 6px 10px; margin-bottom: 4px; gap: 8px; flex-wrap: nowrap; }
  body.en-juego .hud-word { letter-spacing: 3px; font-size: clamp(16px, 5vw, 22px); }
  body.en-juego .hud-timer { font-size: 16px; padding: 2px 8px; }
  body.en-juego .hud-exit {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 30px; height: 30px; padding: 0; border-radius: 8px; font-size: 14px;
    background: var(--bg3); border: 1px solid var(--border); color: var(--text2);
  }
  body.en-juego .hud-bar { flex: none; }

  /* align-items: stretch es OBLIGATORIO: la grilla de escritorio trae
     align-items: start y, heredado en esta columna, cada bloque medía solo el
     ancho de su contenido. El área del lienzo no tiene contenido propio
     (container-type: size) → quedaba en ancho 0 y no se veía ni el dibujo ni
     las palabras para elegir (bug del 24-09-2026). */
  body.en-juego .game {
    flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: stretch;
    gap: 6px; margin-top: 6px;
  }

  /* jugadores: tira horizontal compacta sobre el lienzo */
  body.en-juego .players-col { order: 0; flex: none; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 2px; }
  body.en-juego .players-col > .panel { display: none; }
  body.en-juego .pcard { flex: 0 0 auto; padding: 4px 8px; gap: 6px; }
  body.en-juego .pcard .player-avatar { width: 22px; height: 22px; font-size: 11px; }
  body.en-juego .pcard .pc-name { max-width: 64px; font-size: 12px; }
  body.en-juego .pcard .pc-score { font-size: 11.5px; }
  body.en-juego .pcard .pc-badge { margin-left: 2px; font-size: 13px; }

  /* lienzo: toma el alto libre y se encaja en 4:3 (lo más grande que quepa) */
  body.en-juego .center-col { order: 1; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
  body.en-juego .canvas-area {
    flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
    container-type: size;
  }
  body.en-juego .canvas-wrap { width: 100%; max-height: 100%; aspect-ratio: 4 / 3; margin: 0 auto; }
  @supports (width: 1cqh) {
    body.en-juego .canvas-wrap { width: min(100cqw, calc(100cqh * 4 / 3)); max-height: none; }
  }
  body.en-juego #tools-slot { flex: none; }
  body.en-juego .tools { padding: 6px 8px; margin-top: 0; gap: 6px; flex-wrap: nowrap; overflow-x: auto; }
  body.en-juego .tools .colors { flex-wrap: nowrap; }
  body.en-juego .tools .col { width: 24px; height: 24px; flex: none; }
  body.en-juego .tools .size { width: 30px; height: 30px; flex: none; }
  body.en-juego .tools .tool-btn { padding: 6px 9px; font-size: 12px; flex: none; white-space: nowrap; }
  body.en-juego .overlay-card { max-height: 96%; overflow-y: auto; padding: 14px 16px; }
  body.en-juego .overlay-card h3 { font-size: 14px; margin-bottom: 8px; }
  body.en-juego .word-buttons button { padding: 10px 14px; font-size: 14px; }

  /* respuestas: siempre abajo, a la vista (dentro del contenedor, no fixed) */
  body.en-juego .side-col {
    order: 2; flex: none; gap: 4px;
    background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 6px 8px;
  }
  body.en-juego .chat-panel { height: auto; padding: 0; border: 0; background: transparent; margin: 0; border-radius: 0; }
  body.en-juego .chat-panel h4 { display: none; }
  body.en-juego .chat-messages { flex: none; max-height: 60px; margin-bottom: 6px; font-size: 12.5px; }
  body.en-juego .side-col .btn-ghost { display: none; }

  /* quien dibuja no escribe: más lienzo, solo ve lo que van diciendo */
  body.soy-dibujante .chat-input { display: none; }
  body.soy-dibujante .chat-messages { max-height: 40px; margin-bottom: 0; }

  /* teclado abierto: fuera lo accesorio, el lienzo se queda con el espacio */
  body.kb-abierto .players-col, body.kb-abierto .hud-bar, body.kb-abierto #tools-slot { display: none; }
  body.kb-abierto .game-hud { padding: 4px 8px; margin-bottom: 0; }
  body.kb-abierto .game { margin-top: 4px; gap: 4px; }
  body.kb-abierto .chat-messages { max-height: 36px; margin-bottom: 4px; }
}

/* celular apaisado: lienzo a la izquierda, respuestas a la derecha */
@media (max-height: 500px) and (orientation: landscape) {
  body.en-juego .game { flex-direction: row; }
  body.en-juego .players-col { display: none; }
  body.en-juego .side-col { width: 38%; max-width: 320px; display: flex; flex-direction: column; }
  body.en-juego .chat-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  body.en-juego .chat-messages { flex: 1; max-height: none; }
  body.kb-abierto .chat-messages { max-height: none; }
}
