:root {
  color-scheme: dark;
  font: 16px/1.48 "DM Sans", "Avenir Next", system-ui, sans-serif;
  background: #120f1b; color: #fff5ee;
  --panel: #211a2c; --muted: #cec0d0; --line: #4a394d;
  --coral: #ff8fa7; --mint: #9cebdc; --amber: #ffc892;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: auto; max-width: 1320px; padding: 0 clamp(16px, 4.5vw, 70px) 60px }
header, .marca, .linea, .acciones, .fila-form, .reloj { display: flex; align-items: center; gap: 12px }
header, .linea { justify-content: space-between }
header { height: 65px; color: var(--muted) }
.marca { font-weight: 800; font-size: 1.18rem; letter-spacing: -.055em; color: #fff5ee }
.marca i {
  width: 29px; height: 26px; transform: skew(-13deg);
  background: linear-gradient(#ffc280, #ff7b9e 55%, #c972e2);
  border-radius: 70% 70% 12% 12%;
  mask-image: linear-gradient(to bottom, black 51%, transparent 51% 58%, black 58% 72%, transparent 72% 79%, black 79% 90%, transparent 90% 95%, black 95%);
  -webkit-mask-image: linear-gradient(to bottom, black 51%, transparent 51% 58%, black 58% 72%, transparent 72% 79%, black 79% 90%, transparent 90% 95%, black 95%);
}
#entorno, .rol, .etiqueta, .total, .reloj, kbd, li::before { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace }
#entorno { font-size: .83rem; color: var(--mint); display: flex; align-items: center; gap: 9px }
#entorno::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor }
.portada {
  position: relative; isolation: isolate; display: flex; align-items: end; overflow: hidden;
  height: clamp(215px, 23vw, 315px); border-radius: 16px; margin-bottom: 20px;
  background: #512941 url("/costa.jpg") center 62% / cover no-repeat;
}
.portada::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgb(28 12 33 / 76%), transparent 67%), linear-gradient(0deg, rgb(35 13 39 / 42%), transparent 50%);
}
.portada-texto { padding: 0 clamp(20px, 3.4vw, 48px) clamp(22px, 3.1vw, 43px) }
.rol, .etiqueta { font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase }
.rol { color: #fff3e2; text-shadow: 0 1px 5px #210d27 }
h1, h2, p { margin: 0 }
h1 { margin-top: 8px; font-family: "Archivo Black", "Arial Black", system-ui, sans-serif; font-size: clamp(3.5rem, 7.8vw, 7rem); letter-spacing: -.085em; line-height: .95; color: #fff5e3 }
h1 em { display: inline-block; transform: rotate(-5deg); font-family: "Brush Script MT", "Snell Roundhand", Georgia, cursive; font-style: italic; font-weight: 700; color: #ffa7c6; letter-spacing: -.075em; text-shadow: 0 2px 14px #6d2d5c }
h2, summary { font-size: 1.45rem; line-height: 1.17; letter-spacing: -.04em; font-weight: 750 }
.layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(240px,.85fr); gap: 18px }
.panel { padding: clamp(22px, 2.6vw, 38px); margin-bottom: 18px; min-width: 0; border-radius: 14px; background: var(--panel); border: 1px solid var(--line) }
.principal { position: relative; background: linear-gradient(118deg,#322035,#231b2f 75%); overflow: hidden }
.principal::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, #ffb481,#fa83af 47%,#966bbd 82%,transparent) }
.etiqueta { color: var(--coral) }
.principal h2 { font-size: clamp(2rem, 3.6vw, 3.45rem); line-height: 1.04; margin-top: 9px; overflow-wrap: anywhere }
p, small { color: var(--muted) }
.panel p { margin: 10px 0 16px }
.panel p:last-child { margin-bottom: 0 }
.cola .linea { padding-bottom: 16px; border-bottom: 1px solid var(--line) }
.total { background: #263939; color: var(--mint); padding: 2px 10px; border: 1px solid #426360; border-radius: 6px; font-weight: 700 }
#vacia { padding: 13px 0; color: #b3a3ba }
#en-juego { color: var(--mint); font-weight: 600 }
.fila-form, .acciones { flex-wrap: wrap }
label { display: block; font-size: .9rem; font-weight: 650; margin-bottom: 7px }
button, input, a { font: inherit }
input { background: #18121e; color: inherit; border: 1px solid #70586d; border-radius: 8px; padding: 11px 13px; width: 100%; min-width: 0 }
input::placeholder { color: #af9cb0 }
.fila-form input { flex: 1 1 145px }
button, a#localguest { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-weight: 750; border: 1px solid transparent; border-radius: 8px; padding: 10px 18px; text-decoration: none; background: #ff9bb0; color: #321426 }
button:hover, a#localguest:hover { background: #ffb7c4 }
button.sec, #controls button { background: #34273e; color: #f8edf8; border-color: #705673 }
button.sec:hover, #controls button:active { background: #51384e }
button:disabled { background: #3a2c40; border-color: #514056; color: #bca8bd; cursor: default }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px }
.reloj { font-size: 1.65rem; font-variant-numeric: tabular-nums; color: var(--amber); margin-top: 12px }
progress { width: min(185px, 44%); height: 6px; appearance: none; border: 0; border-radius: 4px; overflow: hidden; background: #453346; accent-color: var(--amber) }
progress::-webkit-progress-bar { background: #453346 } progress::-webkit-progress-value { background: currentColor } progress::-moz-progress-bar { background: var(--amber) }
body[data-fase=juego] .reloj { color: var(--mint) }
ol { list-style: none; padding: 0; margin: 0; counter-reset: lugar }
li { counter-increment: lugar; border-bottom: 1px solid var(--line); padding: 12px 0; overflow-wrap: anywhere }
li::before { content: counter(lugar,decimal-leading-zero); color: #f1b2cc; font-size: .9rem; margin-right: 14px }
li.propio { color: var(--mint); font-weight: 700 }
.invitar { border-left: 3px solid #89cecb }
#conexion summary { cursor: pointer }
#mesa { border-top-color: #73c7bb }
#screen, #field { width: 100%; display: block; background: #11101c; border-radius: 9px; margin-top: 16px }
#screen { aspect-ratio: 16/9; object-fit: contain }
#received { color: var(--mint) }
#controls { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 8px }
#controls button { min-width: 0; font-size: .91rem; padding: 7px 4px; touch-action: none; user-select: none; -webkit-user-select: none }
#controls button:nth-child(n+9) { color: var(--mint) }
.en-turno .portada, .solo .portada { height: 110px }
.en-turno .portada-texto, .solo .portada-texto { padding: 15px 24px }
.en-turno h1, .solo h1 { font-size: 2.9rem }
@media(max-width:680px){
 body { padding: 0 14px 34px } header { height: 52px }
 .portada { height: clamp(170px, 46vw, 235px); background-position: 67% 65%; margin-bottom: 12px }
 .portada::before { background: linear-gradient(90deg,rgb(25 14 35 / 55%),transparent 78%),linear-gradient(0deg,rgb(27 13 30 / 68%),transparent 56%) }
 .portada-texto { padding: 18px } h1 { font-size: clamp(3rem, 12vw, 5rem) }
 .layout { grid-template-columns: 1fr; gap: 0 } .panel { border-radius: 12px; padding: 19px; margin-bottom: 12px }
 .en-turno main { display: flex; flex-direction: column } .en-turno .layout { display: contents } .en-turno aside { order: 1 }
 .en-turno .portada { display: none } #controls { grid-template-columns: repeat(4,minmax(0,1fr)) }
}

/* Keyboard is the default input on computers. */
@media (hover:hover) and (pointer:fine) { #controls { display:none } }
#mesa:focus { outline:none }
#tiempo-juego { font:1.2rem ui-monospace,monospace; color:var(--mint) }
#mesa:fullscreen { width:100vw;height:100dvh;overflow:auto;padding:12px 20px;margin:0;border:0;border-radius:0;background:#0d0a13; }
#mesa:fullscreen #screen { height:calc(100dvh - 160px);object-fit:contain;aspect-ratio:auto;margin-top:8px; }
#mesa:fullscreen .ayuda-teclas, #mesa:fullscreen #status { margin:7px 0;font-size:.85rem }
#mesa:fullscreen #network-note { display:none }
