/* ARMA TU JUGADOR (/armar.html). Mismos colores que el juego y la política de
   privacidad. Escala de espacios: 4 · 8 · 12 · 16 · 24 · 32 · 48. */
:root {
  --ink: #06222f; --ink-2: #0b3345; --ink-3: #124459;
  --foam: #e8f7fc; --mute: #b6d1da; --aqua: #6fd3ef; --sol: #ffd23c;
  --line: rgba(160, 220, 240, .22);
  --r: 12px;
  --sale: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--ink); color: var(--foam); font: 15px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; }

.armar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); height: 100dvh; }

/* ---- el jugador ---- */
.escena { position: relative; min-height: 0; background: radial-gradient(120% 90% at 50% 0%, #2f9ab8 0%, #17607a 55%, #0b3a4f 100%); overflow: hidden; }
#vista { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#vista:active { cursor: grabbing; }
.volver { position: absolute; left: max(12px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: rgba(6, 34, 47, .72); color: var(--foam); font-weight: 700; text-decoration: none; backdrop-filter: blur(6px); }
.volver:hover { background: rgba(6, 34, 47, .9); }
.vistas { position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(6, 34, 47, .72); backdrop-filter: blur(6px); }
.vistas button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--mute); font-weight: 600; transition: background .15s ease-out, color .15s ease-out; }
.vistas button:hover { color: var(--foam); }
.vistas button.on { background: var(--foam); color: var(--ink); }
.pista { position: absolute; right: 16px; top: max(24px, env(safe-area-inset-top)); font-size: 12px; color: rgba(232, 247, 252, .75); pointer-events: none; transition: opacity .4s ease-out; }
.pista.ya { opacity: 0; }
.cargando { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: var(--foam); pointer-events: none; }
.cargando.ya { display: none; }

/* ---- el panel ---- */
.panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 24px 0; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 24px; }
.kicker { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--aqua); font-weight: 700; }
h1 { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.12; margin-top: 4px; }
.sub { margin-top: 8px; color: var(--mute); max-width: 44ch; }
h2 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); font-weight: 700; }
.grupo { display: flex; flex-direction: column; gap: 8px; }
.grupo .elegido { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; min-height: 24px; }
.grupo .elegido b { font-weight: 600; }
.grupo .elegido span { color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fila { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.nota { font-size: 12px; color: var(--mute); max-width: 52ch; }
.sublado { font-size: 12px; color: var(--mute); margin-top: 4px; }
#opciones { display: flex; flex-direction: column; gap: 24px; }

.chips { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--ink-2); }
.chips button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--mute); font-weight: 600; transition: background .15s ease-out, color .15s ease-out; }
.chips button:hover { color: var(--foam); }
.chips button.on { background: var(--ink-3); color: var(--foam); box-shadow: inset 0 0 0 1px var(--aqua); }

.ops { display: flex; flex-wrap: wrap; gap: 8px; }
.op { position: relative; width: 48px; height: 48px; padding: 0; display: grid; place-items: center; border-radius: var(--r); border: 2px solid transparent; background: var(--ink-2); transition: transform .12s ease-out, border-color .15s ease-out, background .15s ease-out; }
.op:hover { background: var(--ink-3); }
.op:active { transform: scale(.94); }
.op[aria-pressed="true"] { border-color: var(--sol); background: var(--ink-3); }
.op[aria-pressed="true"]::after { content: ''; position: absolute; right: -5px; top: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--sol); box-shadow: 0 0 0 2px var(--ink); }
.op i { display: block; }
.op .punto { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.op .careta { width: 36px; height: 22px; border-radius: 9px; border: 4px solid; box-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.op .nada { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--mute); position: relative; opacity: .7; }
.op .nada::after { content: ''; position: absolute; left: 50%; top: -3px; width: 2px; height: 24px; background: var(--mute); transform: rotate(45deg); }
.op[disabled] { cursor: not-allowed; opacity: .38; }
.op[disabled]::before { content: ''; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; background: var(--foam); transform: rotate(-35deg); }

.tarjetas { display: grid; gap: 8px; }
.tarjeta { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; text-align: left; border-radius: var(--r); border: 2px solid transparent; background: var(--ink-2); transition: border-color .15s ease-out, background .15s ease-out; }
.tarjeta:hover { background: var(--ink-3); }
.tarjeta[aria-pressed="true"] { border-color: var(--sol); background: var(--ink-3); }
.tarjeta .pala { width: 20px; height: 40px; margin: 0 auto; border-radius: 6px 6px 10px 10px; border: 3px solid; }
.tarjeta .nada { width: 22px; height: 22px; margin: 0 auto; border-radius: 50%; border: 2px solid var(--mute); opacity: .7; }
.tarjeta b { font-weight: 600; line-height: 1.3; }
.tarjeta small { display: block; color: var(--mute); font-size: 12px; }
.tarjeta span { color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tarjeta[disabled] { opacity: .45; cursor: not-allowed; }

.resumen { padding: 16px; border-radius: var(--r); background: var(--ink-2); display: flex; flex-direction: column; gap: 8px; }
#lista li { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
#lista li span { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--mute); }
#lista li a { color: inherit; text-decoration: none; }
#lista li a:hover { text-decoration: underline; }
#lista li.vacio { border: 0; color: var(--mute); }
.total { display: flex; justify-content: space-between; font-weight: 700; font-size: 16px; }
.total:empty { display: none; }

.acciones { position: sticky; bottom: 0; margin: 0 -24px; padding: 24px 24px 12px; display: grid; gap: 8px; background: linear-gradient(to bottom, rgba(6, 34, 47, 0), var(--ink) 18px); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 20px; border-radius: 14px; border: 0; font-weight: 800; font-size: 16px; letter-spacing: .02em; text-decoration: none; text-align: center; transition: transform .12s ease-out, filter .15s ease-out; }
.btn:active { transform: scale(.98); }
.btn.primario { background: var(--sol); color: #1d1600; }
.btn.primario:hover { filter: brightness(1.06); }
.btn.compra { white-space: pre-wrap; background: transparent; color: var(--foam); box-shadow: inset 0 0 0 2px var(--aqua); min-height: 48px; font-size: 15px; }
.btn .corto { display: none; }
.btn.compra:hover { background: rgba(111, 211, 239, .12); }
.btn.compra[aria-disabled="true"] { opacity: .45; pointer-events: none; box-shadow: inset 0 0 0 2px var(--line); }
.menores { display: flex; justify-content: space-between; gap: 16px; margin-top: -16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.enlace { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--mute); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.enlace:hover { color: var(--foam); }
.aviso { font-size: 13px; color: var(--aqua); text-align: center; }
.aviso:empty { display: none; }

/* ---- celular de pie: el jugador arriba, fijo; las opciones pasan por debajo ---- */
@media (max-width: 760px) and (orientation: portrait) {
  .armar { display: block; height: auto; }
  .escena { position: sticky; top: 0; height: 40dvh; z-index: 2; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
  .panel { overflow: visible; border-left: 0; padding: 24px 16px 0; }
  .acciones { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .pista { top: auto; bottom: 64px; right: 50%; transform: translateX(50%); }
}
/* ---- celular acostado (así abre la app de Android) ---- */
@media (max-height: 520px) and (orientation: landscape) {
  .armar { grid-template-columns: minmax(0, 1fr) minmax(300px, 46vw); }
  .panel { padding: 16px 16px 0; gap: 16px; }
  .panel { padding-right: max(16px, env(safe-area-inset-right)); }
  .sub { display: none; }
  h1 { font-size: 24px; }
  #opciones { gap: 16px; }
  .acciones { margin: 0 -16px; padding: 16px 16px 8px; grid-template-columns: 1fr 1fr; }
  .aviso { grid-column: 1 / -1; order: -1; }
  .btn { min-height: 46px; font-size: 14px; }
  .btn .largo { display: none; }
  .btn .corto { display: inline; }
  .btn.compra { white-space: pre; }
  .vistas button { min-height: 36px; padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Atajos a cada pieza: se quedan pegados arriba del panel mientras se baja */
.atajos { position: sticky; top: -24px; z-index: 3; display: flex; gap: 4px; margin: 0 -24px; padding: 8px 24px; background: var(--ink); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.atajos::-webkit-scrollbar { display: none; }
.atajos button { flex: 0 0 auto; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--ink-2); color: var(--foam); font-weight: 600; font-size: 14px; transition: background .15s ease-out; }
.atajos button:hover { background: var(--ink-3); }
.atajos button:active { transform: scale(.97); }
.grupo { scroll-margin-top: 64px; }
@media (max-width: 760px) and (orientation: portrait) {
  .atajos { top: 40dvh; margin: 0 -16px; padding: 8px 16px; }
  .grupo { scroll-margin-top: calc(40dvh + 64px); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .atajos { top: -16px; margin: 0 -16px; padding: 6px 16px; }
  .atajos button { min-height: 36px; }
}
