/* class-pin.css · 🎮 «Jugar en clase» from anywhere in the kid's home (his rule 2026-11-02; js/class-pin.js).
   The button: Dralingo on the front page's «Jugar en clase» blue, a gold «PIN» badge, bottom-right (the left corner is
   «Tu guía»'s face), above the dock on a phone; a laptop also shows its name. The sheet: the front page's PIN sheet
   (css/portada.css .pt-sheet), its own names so neither page's rules touch the other. */
.cp-fab, .cp-sheet {
  --cp-blue: #3c5bb0; --cp-blue-2: #1b2f6b; --cp-blue-3: #0a1435; --cp-gold: #e8c878; --cp-gold-2: #b88b2c; --cp-ink: #3d0707;
  --cp-cream: #fffdf8; --cp-sand: #f7f1e4; --cp-line: #e2d4b4; --cp-text: #1c1a17; --cp-text-2: #4a3f36; --cp-text-3: #6b5d4f;
  --cp-ease: cubic-bezier(.23, 1, .32, 1);
  --cp-ui: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --cp-kid: 'Baloo 2', 'Nunito', system-ui, sans-serif;
}
.cp-fab *, .cp-sheet, .cp-sheet * { box-sizing: border-box; }

/* ── the button ── */
.cp-fab {
  position: fixed; z-index: 57; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: none;
  color: var(--cp-cream); font: 900 16px/1.1 var(--cp-ui); cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.cp-fab[hidden] { display: none; }
/* (a phone's dock under the page: the button sits above it, level with «Tu guía»'s face on the other side) */
.cp-fab.is-dock { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
/* (a rounded square, never a circle: the round face in the other corner is «Tu guía») */
.cp-face {
  position: relative; display: block; flex: none; width: 64px; height: 64px; border-radius: 20px;
  background: radial-gradient(circle at 50% 28%, #6f8fe0 0%, var(--cp-blue) 48%, var(--cp-blue-2) 100%);
  box-shadow: 0 6px 16px rgba(10, 20, 53, .38), inset 0 0 0 3px var(--cp-gold), 0 0 0 3px rgba(255, 253, 248, .92);
  transition: transform 140ms var(--cp-ease);
}
.cp-face img {
  position: absolute; left: 3px; top: 3px; width: calc(100% - 6px); height: calc(100% - 6px); border-radius: 17px;
  object-fit: cover; object-position: 50% 14%; pointer-events: none;
}
.cp-badge {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); padding: 3px 9px 4px; border-radius: 999px;
  background: linear-gradient(180deg, #f3db93 0%, #d6ad55 100%); color: var(--cp-ink); font: 900 12px/1 var(--cp-ui); letter-spacing: .08em;
  box-shadow: 0 2px 0 var(--cp-gold-2), 0 0 0 2px var(--cp-cream); white-space: nowrap;
}
.cp-label { display: none; }
.cp-fab:active .cp-face { transform: scale(.93); }
.cp-fab:focus-visible { outline: none; }
.cp-fab:focus-visible .cp-face { box-shadow: 0 6px 16px rgba(10, 20, 53, .38), inset 0 0 0 3px var(--cp-gold), 0 0 0 3px var(--cp-cream), 0 0 0 6px var(--cp-blue); }
.cp-fab:not(.is-calm) { animation: cpPop 360ms cubic-bezier(.3, 1.45, .5, 1) both; }
@keyframes cpPop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
/* a laptop: its name beside Dralingo, one pill */
@media (min-width: 700px) {
  .cp-fab {
    right: 24px; bottom: 24px; padding: 4px 22px 4px 4px; border-radius: 24px;
    background: linear-gradient(180deg, var(--cp-blue) 0%, var(--cp-blue-2) 100%);
    box-shadow: 0 12px 26px -10px rgba(10, 20, 53, .7), inset 0 0 0 2px rgba(232, 200, 120, .55);
  }
  .cp-fab.is-dock { bottom: 24px; }
  .cp-face { width: 60px; height: 60px; }
  .cp-label { display: block; font: 900 17px/1.1 var(--cp-ui); letter-spacing: .01em; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
  .cp-fab:active { transform: scale(.97); }
}
@media (hover: hover) and (pointer: fine) {
  .cp-fab:hover .cp-face { transform: translateY(-2px); }
  .cp-fab:hover { filter: brightness(1.06); }
}
/* a laptop's band (the home, an episode, Practicar, Mensajes): the button rides first among its links, gold */
#screen-list.md .tv-bd-links .cp-band {
  flex: none; white-space: nowrap; gap: 8px; padding: 0 12px 0 5px; background: linear-gradient(180deg, #f3db93 0%, #d6ad55 100%); color: #3d0707; font: 900 15px/1 'Nunito', system-ui, sans-serif;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 14px -8px rgba(0, 0, 0, .6);
}
#screen-list.md .tv-bd-links .cp-band[hidden] { display: none; }
#screen-list.md .tv-bd-links .cp-band img {
  width: 34px; height: 34px; border-radius: 11px; object-fit: cover; object-position: 50% 14%; flex: none;
  background: radial-gradient(circle at 50% 28%, #6f8fe0 0%, #3c5bb0 48%, #1b2f6b 100%); box-shadow: inset 0 0 0 2px #fffdf8;
}
#screen-list.md .tv-bd-links .cp-band-pin { padding: 3px 6px; border-radius: 999px; background: #3d0707; color: #f3db93; font: 900 11px/1 'Nunito', system-ui, sans-serif; letter-spacing: .08em; }
#screen-list.md .tv-bd-links .cp-band:active { transform: scale(.97); }
#screen-list.md .tv-bd-links .cp-band:focus-visible { outline: 3px solid #fffdf8; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { #screen-list.md .tv-bd-links .cp-band:hover { background: linear-gradient(180deg, #f7e3a8 0%, #dcb560 100%); } }
/* nothing hides under it: room under the page, measured by js/class-pin.js from where the button really is (--cp-room:
   the dock, a laptop's pill), so every view's last card, row or button clears the corner at the end of the page; a
   full-screen view (the word cards and list, .tv-full) keeps its own bottom bar at the bottom (the button rises above
   it) and the word list leaves a gap under its last word (--cp-gap) */
body.cp-on:not(.cp-full) #screen-list.md .md-app { padding-bottom: var(--cp-room, 112px); }
body.cp-on #screen-settings.md-pf { padding-bottom: var(--cp-room, 112px); }
body.cp-on.cp-full #screen-list.md .tvl-list { margin-bottom: var(--cp-gap, 88px); }
body.cp-on.cp-lift #screen-list.md .tvw-deck { margin-bottom: calc(var(--cp-gap, 88px) - 24px); }
/* (the Draly Souk's pages: that room wears the Souk's own night, css/souk.css, never a strip of another colour) */
body.cp-on #screen-list.md .md-app:has(> .md-zc .zc:not(.zc-pickpage)) { background: #12060e; }
body.cp-on #screen-list.md.lv-teen .md-app:has(> .md-zc .zc:not(.zc-pickpage)) { background: #05070f; }

/* ── the sheet ── */
.cp-sheet { position: fixed; inset: 0; z-index: 9550; font-family: var(--cp-ui); }
.cp-sheet[hidden] { display: none; }
.cp-veil { position: absolute; inset: 0; background: rgba(8, 6, 14, .55); animation: cpFade 200ms ease-out; }
@keyframes cpFade { from { opacity: 0; } }
.cp-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: var(--cp-cream); color: var(--cp-text); box-shadow: 0 -16px 40px -12px rgba(0, 0, 0, .5); animation: cpUp 320ms cubic-bezier(.32, .72, 0, 1);
}
@keyframes cpUp { from { transform: translateY(100%); } }
.cp-sheet.is-calm .cp-veil, .cp-sheet.is-calm .cp-card { animation: none; }
.cp-grab { width: 42px; height: 5px; border-radius: 3px; background: var(--cp-line); margin: 0 auto; }
.cp-head { display: flex; align-items: center; gap: 12px; }
.cp-head-dr {
  flex: none; width: 52px; height: 52px; border-radius: 16px; object-fit: cover; object-position: 50% 14%;
  background: radial-gradient(circle at 50% 28%, #6f8fe0 0%, var(--cp-blue) 48%, var(--cp-blue-2) 100%); box-shadow: inset 0 0 0 2px var(--cp-gold);
}
.cp-t { flex: 1; min-width: 0; margin: 0; font: 800 26px/1.1 var(--cp-kid); letter-spacing: -.01em; color: var(--cp-text); }
.cp-x {
  flex: none; width: 48px; height: 48px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--cp-cream); color: var(--cp-text); box-shadow: 0 0 0 1.5px var(--cp-line); transition: transform 140ms var(--cp-ease);
}
.cp-x:active { transform: scale(.94); }
.cp-line { margin: 0; font: 800 17px/1.35 var(--cp-ui); color: var(--cp-text-2); }
.cp-form { display: grid; gap: 14px; margin: 0; }
.cp-pin { position: relative; display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 10px; }
.cp-pin span {
  height: 76px; border-radius: 16px; display: grid; place-items: center; background: var(--cp-sand);
  box-shadow: inset 0 0 0 2px var(--cp-line); font: 900 40px/1 var(--cp-ui); color: var(--cp-text); font-variant-numeric: tabular-nums;
}
.cp-pin span.is-cur { box-shadow: inset 0 0 0 3px var(--cp-blue); }
.cp-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;
}
.cp-pin:focus-within span.is-cur { box-shadow: inset 0 0 0 3px var(--cp-blue), 0 0 0 4px rgba(60, 91, 176, .2); }
.cp-name { display: grid; gap: 6px; }
.cp-name[hidden] { display: none; }
.cp-name label { font: 800 15px var(--cp-ui); color: var(--cp-text-3); }
.cp-name input {
  width: 100%; min-height: 56px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--cp-sand); color: var(--cp-text);
  box-shadow: inset 0 0 0 2px var(--cp-line); font: 800 19px var(--cp-ui);
}
.cp-name input:focus { outline: none; box-shadow: inset 0 0 0 3px var(--cp-blue); }
.cp-as { display: flex; align-items: center; gap: 8px; margin: 0; font: 700 16px/1.2 var(--cp-ui); color: var(--cp-text-3); min-width: 0; }
.cp-as[hidden] { display: none; }
.cp-as img { flex: none; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #f3e2b3; box-shadow: 0 0 0 2px var(--cp-gold); }
.cp-as b { color: var(--cp-text); font-weight: 900; overflow-wrap: anywhere; }
.cp-err { margin: -4px 0 0; min-height: 1.3em; color: #b42222; font: 800 15px/1.3 var(--cp-ui); }
.cp-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: var(--cp-ink); font: 900 20px/1.1 var(--cp-ui); cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 12px 22px -12px rgba(0, 0, 0, .55); transition: transform 140ms var(--cp-ease), filter 160ms ease;
}
.cp-go:active { transform: scale(.97); }
.cp-go[disabled] { filter: saturate(.6); cursor: progress; }
/* ⏩ 2026-11-04 the 3rd digit is going in by itself (js/class-pin.js autoGo): the button glows for that beat */
.cp-go.is-going { animation: cp-going 450ms ease-out infinite alternate; }
@keyframes cp-going { to { filter: brightness(1.12); transform: scale(1.02); } }
@media (prefers-reduced-motion: reduce) { .cp-go.is-going { animation: none; } }
.cp-x:focus-visible, .cp-go:focus-visible { outline: 3px solid var(--cp-blue); outline-offset: 3px; }
.cp-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* a laptop: the sheet in the middle of the screen */
@media (min-width: 700px) {
  .cp-card {
    left: 50%; right: auto; top: 50%; bottom: auto; width: min(440px, calc(100% - 32px)); max-height: calc(100% - 32px);
    transform: translate(-50%, -50%); border-radius: 26px; padding: 18px 22px 22px; animation: cpFade 200ms ease-out;
  }
  .cp-grab { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cp-fab:not(.is-calm), .cp-veil, .cp-card { animation: none; }
  .cp-face, .cp-x, .cp-go { transition: none; }
}
