/* Canary Arcade — sala recreativa nocturna con la paleta de Canary Options.
   Diseño de un solo aspecto (oscuro) a propósito: el color de cada paquete es la señal. */
:root {
  --ink: #0E1A26;
  --panel: #152738;
  --panel-2: #1B3247;
  --line: #2A4762;
  --text: #F4F2EA;
  --muted: #A9B7C5;
  --azul: #1688B4;
  --amarillo: #E3BB32;
  --naranja: #E17B46;
  --verde: #77A56B;
  --coral: #D15B63;
  --violeta: #8174B3;
  --gris: #8B929B;
  --display: 'Bungee', 'Arial Black', Impact, system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--ink); }
body {
  margin: 0; min-height: 100%;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(22,136,180,.22), transparent 60%),
    radial-gradient(900px 420px at -10% 30%, rgba(129,116,179,.16), transparent 60%),
    var(--ink);
  color: var(--text); font: 16px/1.5 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
img { max-width: 100%; display: block; }
button, a { font: inherit; }
:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 2px; }
main, .top, .foot { max-width: 1180px; margin: 0 auto; }

/* Cabecera */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-block: 14px; background: linear-gradient(var(--ink) 70%, transparent);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--ink); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 11px); gap: 3px; }
.brand-mark i { width: 11px; height: 11px; border-radius: 3px; }
.brand-mark i:nth-child(1) { background: var(--azul); }
.brand-mark i:nth-child(2) { background: var(--amarillo); }
.brand-mark i:nth-child(3) { background: var(--coral); }
.brand-mark i:nth-child(4) { background: var(--verde); }
.brand-name { font-family: var(--display); font-size: 18px; letter-spacing: .02em; }
.brand-name b { color: var(--amarillo); font-weight: 400; margin-left: 4px; }
.top-actions { display: flex; gap: 8px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 10px 16px; cursor: pointer;
  font-weight: 800; text-decoration: none; color: #111; transition: transform .12s, filter .12s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.big { padding: 14px 22px; font-size: 17px; }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.play { background: var(--amarillo); box-shadow: 0 4px 0 #9c7f17; }
.btn.outline { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost { background: var(--panel-2); color: var(--text); }
.btn.danger { background: var(--coral); color: #111; }
.btn[disabled] { opacity: .55; cursor: default; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 4px 0; font-size: 14px; }

/* Portada */
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: center; padding-block: 28px 36px; }
.eyebrow { margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 7vw, 76px); line-height: .98; margin: 0 0 16px; text-wrap: balance; }
h1 #game-count { color: var(--amarillo); }
.lede { margin: 0 0 22px; max-width: 36ch; color: var(--muted); font-size: 18px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.steps { background: var(--panel); border-radius: var(--r); padding: 18px; box-shadow: inset 0 0 0 1px var(--line); }
.steps-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.steps h2 { margin: 0; font-size: 18px; }
.steps-count { color: var(--verde); font-weight: 800; font-variant-numeric: tabular-nums; }
.steps-list { list-style: none; margin: 14px 0 8px; padding: 0; display: grid; gap: 8px; }
.steps-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px; border-radius: 10px; background: var(--panel-2); }
.steps-list .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--line); color: var(--text); }
.steps-list li.done .dot { background: var(--verde); color: #111; }
.steps-list li.done strong { text-decoration: line-through; color: var(--muted); }
.steps-list strong { display: block; }
.steps-list button { background: none; border: 0; color: var(--amarillo); padding: 0; cursor: pointer; font-weight: 800; font-size: 14px; }

/* Secciones */
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-family: var(--display); font-weight: 400; font-size: 26px; margin: 0; }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.packs-section, .games-section { padding-block: 18px; }

/* Paquetes */
.packs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.pack {
  --c: var(--gris);
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 16px; border-radius: var(--r); background: var(--panel); overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
}
.pack::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--c); }
.pack h3 { margin: 6px 0 0; font-size: 18px; }
.pack p { margin: 0; color: var(--muted); font-size: 14px; }
.pack .titles { font-size: 13px; color: var(--text); }
.pack .price { font-family: var(--display); font-size: 26px; color: var(--c); margin-top: auto; font-variant-numeric: tabular-nums; }
.pack .save { font-size: 12px; font-weight: 800; color: #111; background: var(--c); border-radius: 999px; padding: 2px 8px; align-self: flex-start; }
.pack .btn { width: 100%; }
.pack .owned { color: var(--verde); font-weight: 800; }
.pack.todo { background: linear-gradient(160deg, rgba(227,187,50,.18), var(--panel) 55%); box-shadow: inset 0 0 0 2px var(--amarillo); }
[data-c="verde"] { --c: var(--verde); } [data-c="naranja"] { --c: var(--naranja); }
[data-c="azul"] { --c: var(--azul); } [data-c="violeta"] { --c: var(--violeta); }
[data-c="amarillo"] { --c: var(--amarillo); } [data-c="coral"] { --c: var(--coral); }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 0; border-radius: 999px; padding: 7px 12px; background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; }
.chip[aria-selected="true"] { background: var(--text); color: var(--ink); font-weight: 800; }

/* Juegos */
.games { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.game { display: flex; flex-direction: column; border-radius: var(--r); background: var(--panel); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.cover { position: relative; aspect-ratio: 16 / 10; background: var(--panel-2); max-width: 100%; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.game.locked .cover img { filter: grayscale(.75) brightness(.6); }
.badge { --c: var(--gris); position: absolute; left: 10px; top: 10px; background: var(--c); color: #111; font-weight: 800; font-size: 12px; padding: 3px 9px; border-radius: 999px; }
.lock { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(14,26,38,.85); font-size: 15px; }
.game-body { display: flex; flex-direction: column; gap: 8px; padding: 14px; flex: 1; }
.game h3 { margin: 0; font-size: 19px; }
.kind { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.game p { margin: 0; color: var(--muted); font-size: 14px; }
.modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.modes span { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--panel-2); color: var(--text); }
.game .btn { margin-top: auto; width: 100%; }
.external { font-size: 12px; color: var(--muted); }

/* Pie */
.foot { padding-block: 30px 40px; color: var(--muted); font-size: 13px; text-align: center; }
.foot-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 12px; }

/* Hoja de compra */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(5,10,16,.72); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.sheet { --c: var(--amarillo); width: min(460px, 100%); background: #FFFDF6; color: #111; border-radius: 18px; padding: 22px; position: relative; overflow: hidden; max-height: 100%; overflow-y: auto; }
.sheet-band { position: absolute; inset: 0 0 auto; height: 8px; background: var(--c); }
.sheet h3 { margin: 6px 0 6px; font-family: var(--display); font-weight: 400; font-size: 24px; }
.sheet p { margin: 0 0 10px; font-weight: 600; }
.sheet-games { margin: 0 0 12px; padding-left: 18px; font-weight: 800; }
.sheet-note { background: #F3EBCB; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }

/* Recorrido */
.tour { position: fixed; inset: 0; z-index: 60; }
.tour-ring { position: absolute; border-radius: 16px; box-shadow: 0 0 0 4px var(--amarillo), 0 0 0 9999px rgba(5,10,16,.72); transition: all .25s ease; pointer-events: none; }
.tour-card { position: absolute; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(420px, calc(100% - 32px)); background: #FFFDF6; color: #111; border-radius: 16px; padding: 18px; }
.tour-card h3 { margin: 0 0 6px; font-size: 20px; }
.tour-card p { margin: 0 0 8px; font-weight: 600; }
.tour-step { color: #6b5a12; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800 !important; }

/* Aviso */
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 70px); transform: translateX(-50%); z-index: 70; width: min(440px, calc(100% - 32px)); display: flex; align-items: center; gap: 10px; background: #FFFDF6; color: #111; font-weight: 800; border-radius: 12px; padding: 12px 12px 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.4), inset 6px 0 0 var(--verde); text-align: center; justify-content: center; }
.toast span { flex: 1; }
.toast-x { border: 0; background: #eee; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 18px; line-height: 1; }

@media (max-width: 1000px) {
  .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pack.todo { grid-column: 1 / -1; }
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 12px 20px; }
  .top-actions .btn { padding: 8px 12px; font-size: 14px; }
  .brand-name { font-size: 15px; }
}
@media (max-width: 520px) {
  .packs { grid-template-columns: minmax(0, 1fr); }
  .games { grid-template-columns: minmax(0, 1fr); }
  .hero-cta .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Cuenta */
.field { display: grid; gap: 6px; font-weight: 800; margin-bottom: 10px; }
.field input { width: 100%; font: 600 16px/1.3 var(--body); padding: 12px; border-radius: 10px; border: 2px solid #d9d4c3; background: #fff; color: #111; }
.field input:focus { border-color: var(--azul); outline: none; }
.pw { position: relative; display: block; }
.pw input { padding-right: 48px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 8px; background: #eceae2; cursor: pointer; font-size: 18px; }
.pw-eye[aria-pressed="true"] { background: var(--amarillo); }
.form-error { background: #f8dcdd; color: #6d1219; border-radius: 10px; padding: 10px 12px; font-weight: 800 !important; }
.btn.ghost-light { background: #eceae2; color: #111; }
.account-chip { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link.dark { color: #1b4f66; justify-self: start; margin: -4px 0 6px; font-weight: 600; }

/* Sin conexión */
.offline-pill { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 6px 12px; border-radius: 999px; background: rgba(119,165,107,.18); color: #bfe0b5; box-shadow: inset 0 0 0 1px rgba(119,165,107,.55); font-weight: 800; font-size: 14px; }
.offline-pill span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--verde); color: #111; font-size: 13px; }
.offline-hint #offline-count { color: var(--verde); font-weight: 800; }
.net-banner { max-width: 1180px; margin: 0 auto 8px; padding: 10px 14px; border-radius: 12px; background: var(--naranja); color: #111; font-weight: 800; text-align: center; }
.game .btn.dl-btn { margin-top: 0; background: transparent; color: var(--text); }
.dl { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 800; min-height: 40px; }
.dl.ready { color: var(--verde); }
.dl.busy { flex-direction: column; align-items: stretch; gap: 6px; color: var(--muted); }
.dl-bar { display: block; height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.dl-bar i { display: block; height: 100%; background: var(--verde); transition: width .15s; }
.link.small { font-size: 13px; padding: 0; }

/* 1.4.0 · cada juego con el color de su paquete: marco, franja, etiqueta y botón */
.game { position: relative; box-shadow: inset 0 0 0 3px var(--c, var(--gris)); }
.game::before { content: ""; position: absolute; inset: 0 0 auto; height: 8px; background: var(--c, var(--gris)); z-index: 2; }
.game .cover { margin: 3px 3px 0; border-radius: 11px 11px 0 0; overflow: hidden; }
.game .kind { color: var(--c); filter: brightness(1.25); }
.game[data-c] .badge { --c: inherit; background: var(--c); color: #111; }
.game .btn.play { background: var(--c); color: #111; box-shadow: 0 4px 0 rgba(0,0,0,.45); }
.game .btn.ghost[data-buy] { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--c); }
.game .btn.dl-btn { box-shadow: inset 0 0 0 2px var(--c); }
.chip[data-c] { box-shadow: inset 0 0 0 2px var(--c); }
.chip[data-c][aria-selected="true"] { background: var(--c); color: #111; box-shadow: none; }
.packs { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
#back-home { white-space: nowrap; }
@media (max-width: 600px) {
  .top { flex-wrap: wrap; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  #back-home .back-text { display: none; }
}
@media (max-width: 420px) { .brand-name { font-size: 15px; } }
.pack .btn.ghost { background: var(--c); color: #111; box-shadow: 0 4px 0 rgba(0,0,0,.45); }

/* 1.4.2 · los paquetes llevan a sus juegos */
.pack { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.pack:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 2px var(--c); }
.pack-see { align-self: flex-start; background: none; border: 0; padding: 6px 0; color: var(--c); font-weight: 800; font-size: 14px; cursor: pointer; filter: brightness(1.2); }
.pack-see:hover { text-decoration: underline; text-underline-offset: 4px; }
