/* portada.css · the front page «Dralingo TV» (2026-10-31, his yes to the clickable design: «I'm liking everything»;
   design `.claude/handoff/tv-design/index.html` «Portada»). Dubai at night and two premium game cards that fly like
   /audios' module cards (js/fly.js + css/fly.css): «Dralingo TV» (the kid's home: this week's episode in its little
   screen, Dralingo stepping out of it) and «Jugar en clase» (one tap opens the class PIN). Under the cards, the two
   doors named as tabs (a teacher says «toca Jugar en clase» and every kid sees it). A laptop shows both cards side by
   side, turned a little toward each other, like a game's mode select. Reduced motion: nothing flies, a crossfade.
   The page scrolls by wheel and finger when it is taller than the screen: <body> is never a scroll box here. */
:root {
  --pt-ease: cubic-bezier(.23, 1, .32, 1);
  --pt-drawer: cubic-bezier(.32, .72, 0, 1);
  --pt-kid: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --pt-ui: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --pt-ink: #f7f1e4;
  --pt-gold: #e8c878;
  --pt-sw: 100vw;
  --pt-sh: 100vh;
}
@supports (height: 100svh) { :root { --pt-sh: 100svh; } }
* { box-sizing: border-box; }
html { background: #150f30; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.pt-page {
  margin: 0; min-height: 100vh; min-height: var(--pt-sh); background: #150f30; color: var(--pt-ink);
  font: 700 16px/1.35 var(--pt-ui); -webkit-tap-highlight-color: transparent;
}
.pt-page :focus-visible { outline: 3px solid var(--pt-gold); outline-offset: 3px; }
.pt-page button { font: inherit; color: inherit; cursor: pointer; }
.pt-page img { -webkit-user-drag: none; }
.pt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── the stage: Dubai at night ─────────────────────────────────────── */
.pt {
  position: relative; min-height: 100vh; min-height: var(--pt-sh); display: flex; flex-direction: column;
  overflow: hidden; isolation: isolate;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
@supports (overflow: clip) { .pt { overflow: clip; } }
.pt-bg { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }
.pt::before {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 6, 30, .55) 0%, rgba(10, 6, 30, 0) 28%, rgba(10, 6, 30, 0) 66%, rgba(10, 6, 30, .6) 100%);
}
.pt-top { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 0 18px; }
.pt-brand { font: 800 18px/1.05 var(--pt-kid); color: #f3dc9a; letter-spacing: .005em; text-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.pt-lang {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .1); color: var(--pt-ink); font: 800 14px var(--pt-ui);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.pt-main { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 6px 0; }
.pt-foot { position: relative; z-index: 3; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 8px 16px 18px; }
.pt-foot a, .pt-foot button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px; border: 0;
  border-radius: 999px; background: rgba(10, 6, 30, .5); color: var(--pt-ink); font: 800 15px var(--pt-ui); text-decoration: none;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
  transition: background-color 160ms ease, transform 140ms var(--pt-ease);
}
.pt-foot a:active, .pt-foot button:active { transform: scale(.96); }
.pt-foot svg { width: 18px; height: 18px; }
/* «Maestros» (2026-11-10, his words «too small… make it obvious»): one wide door with Profe Fer stepping out of its left
   edge, gold frame like the game cards; a kid's eye stays on the two cards above (it sits under them, calmer colours) */
.pt-foot a.pt-teach {
  position: relative; flex: 0 1 auto; width: min(100%, 420px); min-height: 78px; margin-top: 18px; padding: 10px 16px 10px 104px;
  justify-content: flex-start; gap: 10px; border-radius: 22px; text-align: left; color: var(--pt-ink);
  background: radial-gradient(70% 120% at 18% 100%, rgba(66, 160, 150, .55) 0%, rgba(0, 0, 0, 0) 70%), linear-gradient(170deg, #1d4f58 0%, #0e2b35 100%);
  box-shadow: inset 0 0 0 1.5px rgba(232, 200, 120, .75), inset 0 1px 0 rgba(255, 255, 255, .22), 0 18px 30px -18px rgba(4, 2, 18, .85);
}
.pt-teach-fer {
  position: absolute; left: 4px; bottom: 0; width: 96px; height: 116px; object-fit: contain; object-position: 50% 100%;
  pointer-events: none; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45));
}
/* his own admin device shows the fixed «Super Master» pill bottom-right: room under the door so it never covers it */
body:has(#sa-badge) .pt-foot { padding-bottom: 78px; }
.pt-teach-t { display: grid; gap: 2px; min-width: 0; flex: 1; }
.pt-teach-t b { font: 800 26px/1 var(--pt-kid); letter-spacing: -.01em; padding-top: 3px; }
.pt-teach-t small { font: 800 14px/1.2 var(--pt-ui); color: var(--pt-gold); }
.pt-foot .pt-teach-go {
  flex: none; width: 40px; height: 40px; padding: 9px; border-radius: 50%; color: #3d0707;
  background: linear-gradient(180deg, #f2d98f, #d8b05a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 6px 12px -6px rgba(0, 0, 0, .6);
}
@media (min-width: 760px) and (min-height: 500px) {
  .pt-foot a.pt-teach { width: 460px; min-height: 86px; padding-left: 118px; }
  .pt-teach-fer { width: 108px; height: 132px; }
  .pt-teach-t b { font-size: 30px; }
  .pt-teach-t small { font-size: 15px; }
}
[data-pwa-install][hidden] { display: none !important; }

/* ── the flying cards (the /audios spring, js/fly.js) ──────────────── */
.pt-stage {
  --cw: clamp(214px, min(calc(var(--pt-sw) * .74), 300px, calc((var(--pt-sh) - 250px) / 1.42)), 300px);
  height: calc(var(--cw) * 1.42 + 30px);
}
.pt-stage .fly-slide { height: calc(var(--cw) * 1.42); }

/* a game card: jewel colour, gloss, a gold frame, the shine when it lands (js/ruta.js cardHtml look) */
.gcard {
  --gold: #e8c878; position: absolute; inset: 0; display: block; width: 100%; padding: 0; margin: 0; border: 0; overflow: hidden; isolation: isolate;
  border-radius: calc(var(--cw) * .08); color: var(--pt-ink); text-align: left; text-decoration: none; font: inherit; cursor: pointer;
  background: radial-gradient(80% 52% at 76% 58%, var(--c1) 0%, rgba(0, 0, 0, 0) 72%), linear-gradient(168deg, var(--c2) 0%, var(--c2) 42%, var(--c3) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 26px 38px -22px rgba(4, 2, 18, .8), 0 8px 16px -8px rgba(4, 2, 18, .5);
  transition: transform 160ms var(--pt-ease);
  -webkit-touch-callout: none;
}
.gcard:active { transform: scale(.98); }
.gcard::before { content: ""; position: absolute; inset: 0 0 52% 0; z-index: 6; pointer-events: none; background: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, 0)); }
.gcard::after { content: ""; position: absolute; inset: calc(var(--cw) * .027); z-index: 6; pointer-events: none; border: 1.5px solid rgba(232, 200, 120, .6); border-radius: calc(var(--cw) * .056); }
.gcard:focus-visible { outline: 3px solid var(--pt-gold); outline-offset: 4px; }
.gc-tv { --c1: #a8352c; --c2: #6c1513; --c3: #360606; }
.gc-pin { --c1: #3c5bb0; --c2: #1b2f6b; --c3: #0a1435; }
.gc-title {
  position: absolute; z-index: 4; left: calc(var(--cw) * .085); right: calc(var(--cw) * .085); top: calc(var(--cw) * .085);
  font: 800 calc(var(--cw) * .148)/.95 var(--pt-kid); letter-spacing: -.02em; text-shadow: 0 2px 12px rgba(0, 0, 0, .28); text-wrap: balance;
}
.gc-sub { position: absolute; z-index: 4; left: calc(var(--cw) * .085); right: calc(var(--cw) * .085); top: calc(var(--cw) * .285); font: 800 calc(var(--cw) * .055)/1.2 var(--pt-ui); color: var(--gold); }
.tvbug {
  display: inline-block; margin-left: .14em; padding: .08em .2em 0; border-radius: .2em; font-size: .74em; line-height: 1;
  background: linear-gradient(180deg, #f3db93, #d6ad55); color: #3d0707; transform: rotate(-6deg) translateY(-.08em);
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .6); text-shadow: none; letter-spacing: 0;
}
.gc-screen {
  position: absolute; z-index: 2; left: calc(var(--cw) * .075); right: calc(var(--cw) * .075); top: calc(var(--cw) * .43);
  aspect-ratio: 16 / 10; border-radius: calc(var(--cw) * .05); overflow: hidden; background: #0b0a1a;
  box-shadow: 0 0 0 2px rgba(232, 200, 120, .75), 0 14px 22px -10px rgba(0, 0, 0, .75);
}
.gc-screen img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gc-screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(128deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, 0) 36%); }
.gc-ep {
  position: absolute; z-index: 2; left: 7%; bottom: 9%; display: inline-flex; align-items: baseline; gap: .3em; padding: .22em .62em .14em;
  border-radius: 999px; background: rgba(10, 6, 12, .66); color: var(--pt-ink); font: 800 calc(var(--cw) * .046)/1.2 var(--pt-ui);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.gc-ep[hidden] { display: none; }
.gc-ep b { font-size: 1.3em; color: #f3dc9a; }
.gc-char { position: absolute; z-index: 3; right: -9%; bottom: 13%; width: 50%; height: auto; pointer-events: none; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .42)); }
.gc-pin .gc-char { right: -3%; bottom: 13%; width: auto; height: 54%; max-width: 40%; object-fit: contain; object-position: right bottom; }
.gc-pins { position: absolute; z-index: 3; left: calc(var(--cw) * .085); top: calc(var(--cw) * .43); display: flex; gap: calc(var(--cw) * .03); }
.gc-pins i {
  width: calc(var(--cw) * .135); height: calc(var(--cw) * .175); border-radius: calc(var(--cw) * .03); display: grid; place-items: center;
  background: linear-gradient(180deg, #f6e2a4, #d4ac52); box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.gc-pins i::after { content: ""; width: 26%; aspect-ratio: 1; border-radius: 50%; background: #3d0707; }
.gc-sky { position: absolute; z-index: 1; left: 0; bottom: 16%; width: 100%; height: auto; aspect-ratio: 400 / 110; opacity: .55; pointer-events: none; }
.gc-foot { position: absolute; z-index: 7; left: calc(var(--cw) * .085); right: calc(var(--cw) * .07); bottom: calc(var(--cw) * .07); display: flex; justify-content: flex-end; }
.gc-go {
  display: inline-flex; align-items: center; gap: 4px; min-height: 48px; height: calc(var(--cw) * .16); padding: 0 calc(var(--cw) * .045) 0 calc(var(--cw) * .065);
  border-radius: 999px; background: linear-gradient(180deg, #f2d98f, #d8b05a); color: #3d0707; font: 900 calc(var(--cw) * .062)/1 var(--pt-ui);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 6px 14px -6px rgba(0, 0, 0, .55); white-space: nowrap;
}
.gc-go svg { width: 1.05em; height: 1.05em; flex: none; }

/* the two doors, named under the cards (a tap on «Jugar en clase» flies its card in AND opens the PIN) */
.pt-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: min(100% - 32px, 420px); margin: 0 auto; padding: 4px;
  border-radius: 999px; background: rgba(10, 6, 30, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.pt-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 10px; border: 0; border-radius: 999px;
  background: transparent; color: var(--pt-ink); font: 800 16px/1.1 var(--pt-ui); white-space: nowrap; transition: background-color 200ms ease, color 200ms ease;
}
.pt-tab-tv { font: 800 19px/1 var(--pt-kid); padding-top: 2px; }
.pt-tab-tv .tvbug { font-size: .7em; }
.pt-tab[aria-selected="true"] { background: linear-gradient(180deg, #f3db93, #d6ad55); color: #3d0707; }
.pt-tab.is-pin[aria-selected="false"] { background: rgba(60, 91, 176, .6); }
.pt-tab-pins { display: inline-flex; gap: 2px; }
.pt-tab-pins i { width: 6px; height: 9px; border-radius: 2px; background: currentColor; opacity: .85; }
/* a 360 px phone: «Jugar en clase» keeps its whole name in its half of the pill (review 2026-10-31) */
@media (max-width: 379px) {
  .pt-tabs { width: calc(100% - 24px); gap: 4px; }
  .pt-tab { padding: 0 6px; font-size: 15px; }
  .pt-tab-tv { font-size: 18px; }
  .pt-tab-pins { display: none; }
}

/* «Volver a la partida»: only when this phone joined a game that is still open */
.pt-rematch { display: flex; justify-content: center; padding: 0 16px; }
.pt-rematch[hidden] { display: none; }
.pt-rematch button {
  display: flex; align-items: center; gap: 12px; width: min(100%, 420px); min-height: 62px; padding: 8px 16px 8px 8px; border: 0; border-radius: 18px; text-align: left;
  background: #fbf0d0; color: #3d0707; box-shadow: inset 0 0 0 2px #e8c878, 0 12px 24px -14px rgba(0, 0, 0, .7); font: 900 17px/1.15 var(--pt-ui);
}
.pt-rematch img { width: 46px; height: 46px; object-fit: contain; flex: none; }
.pt-rematch small { display: block; font: 700 13px var(--pt-ui); color: #85631d; }

/* ── the PIN sheet (the class's join: #home-join, #home-pin, #home-name, #home-error) ─────────── */
.pt-sheet { position: fixed; inset: 0; z-index: 50; }
.pt-sheet[hidden] { display: none; }
.pt-veil { position: absolute; inset: 0; background: rgba(8, 6, 14, .55); animation: pt-fade 200ms ease-out; }
@keyframes pt-fade { from { opacity: 0; } }
.pt-card {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92%; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 14px;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0px)); border-radius: 26px 26px 0 0;
  background: #fffdf8; color: #1c1a17; box-shadow: 0 -16px 40px -12px rgba(0, 0, 0, .5); animation: pt-up 320ms var(--pt-drawer);
}
@keyframes pt-up { from { transform: translateY(100%); } }
.pt-grab { width: 42px; height: 5px; border-radius: 3px; background: #e2d4b4; margin: 0 auto; }
.pt-sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pt-sheet-h h2 { margin: 0; font: 800 26px/1.1 var(--pt-kid); letter-spacing: -.01em; }
.pt-x {
  flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: #fffdf8; color: #1c1a17; box-shadow: 0 0 0 1.5px #e2d4b4; transition: transform 140ms var(--pt-ease);
}
.pt-x:active { transform: scale(.94); }
.pt-x svg { width: 22px; height: 22px; }
.pt-form { display: grid; gap: 14px; margin: 0; }
.pt-pin { position: relative; display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 10px; }
.pt-pin span {
  height: 76px; border-radius: 16px; display: grid; place-items: center; background: #f7f1e4;
  box-shadow: inset 0 0 0 2px #e2d4b4; font: 900 40px/1 var(--pt-ui); color: #1c1a17; font-variant-numeric: tabular-nums;
}
.pt-pin span.is-cur { box-shadow: inset 0 0 0 3px #3c5bb0; }
.pt-pin input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; border: 0; font-size: 16px;
  caret-color: transparent; cursor: text; color: transparent; background: transparent;
}
.pt-pin:focus-within span.is-cur { box-shadow: inset 0 0 0 3px #3c5bb0, 0 0 0 4px rgba(60, 91, 176, .2); }
.pt-field { display: grid; gap: 6px; }
.pt-field label { font: 800 15px var(--pt-ui); color: #6b5d4f; }
.pt-field input {
  min-height: 56px; padding: 0 16px; border: 0; border-radius: 14px; background: #f7f1e4; color: #1c1a17;
  box-shadow: inset 0 0 0 2px #e2d4b4; font: 800 19px var(--pt-ui); width: 100%;
}
.pt-field input:focus { outline: none; box-shadow: inset 0 0 0 3px #3c5bb0; }
.pt-err { margin: -4px 0 0; min-height: 1.3em; color: #b42222; font: 800 15px/1.3 var(--pt-ui); }
/* ⏩ 2026-11-04 the PIN step / the name step (js/portada.js setStep): a hidden part really leaves (its display rule would
   otherwise win over [hidden]); a name this phone knows reads as one line with its way out */
.pt-field[hidden], .pt-go[hidden], .pt-as[hidden] { display: none; }
.pt-as { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font: 800 17px/1.3 var(--pt-ui); color: #6b5d4f; }
.pt-as b { color: #1c1a17; font-size: 19px; }
.pt-as-x {
  margin-left: auto; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: #f7f1e4;
  box-shadow: inset 0 0 0 2px #e2d4b4; color: #3c5bb0; font: 800 15px var(--pt-ui); cursor: pointer;
}
.pt-go.is-going { animation: pt-going 450ms ease-out infinite alternate; }
@keyframes pt-going { to { filter: brightness(1.12); transform: scale(1.02); } }
@media (prefers-reduced-motion: reduce) { .pt-go.is-going { animation: none; } }
.pt-go {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 60px; padding: 0 22px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #f3db93 0%, #d6ad55 100%); color: #3d0707; font: 900 20px/1.1 var(--pt-ui);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 12px 22px -12px rgba(0, 0, 0, .55); transition: transform 140ms var(--pt-ease), filter 160ms ease;
}
.pt-go:active { transform: scale(.97); }

/* the TV turns on: the card grows into the whole screen, then the home is there (js/portada.js) */
.pt-tvon {
  position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 60; pointer-events: none; transform-origin: 0 0;
  display: grid; place-items: center;
  background: radial-gradient(80% 52% at 76% 58%, #a8352c 0%, rgba(0, 0, 0, 0) 72%), linear-gradient(168deg, #6c1513 0%, #6c1513 42%, #360606 100%);
}
/* the name shows once the screen is full (while the home loads on a slow class Wi-Fi) */
.pt-tvon-logo { font: 800 clamp(40px, 12vw, 72px)/1 var(--pt-kid); color: var(--pt-ink); letter-spacing: -.02em; opacity: 0; animation: pt-logo 260ms ease-out 360ms forwards; }
@keyframes pt-logo { to { opacity: 1; } }

/* ── a laptop or a tablet: both cards side by side, turned a little toward each other ─────────── */
@media (min-width: 760px) and (min-height: 500px) {
  .pt-top { padding: 16px 22px 0 26px; }
  .pt-brand { font-size: 20px; }
  .pt-stage {
    --cw: clamp(240px, calc((var(--pt-sh) - 210px) / 1.42), 300px);
    height: auto; display: flex; justify-content: center; align-items: center; gap: 64px; perspective: 1400px; padding: 10px 0; overflow: visible;
    cursor: auto;
  }
  .pt-stage .fly-slide { position: relative; left: auto; top: auto; margin: 0; transition: transform 260ms var(--pt-ease); }
  .pt-stage .fly-slide:first-child { transform: rotateY(9deg); }
  .pt-stage .fly-slide:last-child { transform: rotateY(-9deg); }
  .pt-tabs { display: none; }
  .pt-card {
    left: 50%; right: auto; bottom: auto; top: 50%; width: 460px; max-height: calc(100% - 40px); border-radius: 24px; transform: translate(-50%, -50%);
    animation: pt-pop 240ms var(--pt-ease); padding: 18px 24px 24px;
  }
  .pt-grab { display: none; }
}
@media (min-width: 760px) and (min-height: 500px) and (hover: hover) and (pointer: fine) {
  .pt-stage .fly-slide:hover { transform: rotateY(0) translateY(-8px); }
  .pt-foot a:not(.pt-teach):hover, .pt-foot button:hover { background: rgba(10, 6, 30, .7); }
  .pt-foot a.pt-teach:hover { filter: brightness(1.08); }
  .pt-go:hover, .pt-lang:hover { filter: brightness(1.06); }
}
@keyframes pt-pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.97); } }

/* reduced motion: nothing flies, nothing tilts; things appear where they stand */
@media (prefers-reduced-motion: reduce) {
  .pt-veil, .pt-card { animation-duration: 1ms; }
  .gcard:active, .pt-go:active, .pt-x:active, .pt-foot a:active, .pt-foot button:active { transform: none; }
  .pt-stage .fly-slide { transition: none; }
}
@media (prefers-reduced-motion: reduce) and (min-width: 760px) and (min-height: 500px) {
  .pt-stage .fly-slide:first-child, .pt-stage .fly-slide:last-child, .pt-stage .fly-slide:hover { transform: none; }
}
