/* Área Kids — céu claro, formas redondas, letras grandes. Visual claro de propósito (um só tema). */
:root {
  --sky: #7dd3fc; --ink: #3b2a20; --purple: #7c3aed; --purple-2: #8b5cf6; --sun: #facc15; --muted: #57534e; --white: #ffffff; --err: #b91c1c;
  --font: "Baloo 2", "Arial Rounded MT Bold", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--sky); color: var(--ink); font: 18px/1.45 var(--font); }
h1, h2 { margin: 0; line-height: 1; }
p { margin: 0; }
a { color: var(--purple); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.eyebrow { font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--purple); font-size: 0.95rem; }
.note { color: var(--muted); font-size: 1rem; }
#home-msg.err, .note.err { color: var(--err); }

.btn { font: 800 1.15rem/1 var(--font); cursor: pointer; color: var(--purple); background: var(--white); border: 3px solid var(--purple); border-radius: 999px; padding: 0.75em 1.4em; }
.btn.primary { background: var(--purple); color: var(--white); }
.btn.small { padding: 0.55em 1em; font-size: 0.95rem; }
.btn:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, .corner:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; }

.screen { position: fixed; inset: 0; overflow-y: auto; }
.home { background: rgba(224, 242, 254, 0.82); padding: 32px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 22px; align-content: start; justify-items: start; }
.home > * { max-width: 980px; width: 100%; }
.head { display: grid; gap: 10px; }
.home h1 { font-size: clamp(3.2rem, 10vw, 6rem); color: var(--purple); }
.lede { font-size: 1.2rem; max-width: 56ch; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.mode { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 22px; background: var(--white); box-shadow: 0 6px 0 rgba(124, 58, 237, 0.18); min-width: 0; }
.mode.main { box-shadow: 0 6px 0 var(--purple); }
.mode h2 { font-size: 1.7rem; color: var(--purple); }
.mode p { flex: 1; }
.code-form { display: flex; gap: 8px; flex-wrap: wrap; }
.code-form input { flex: 1 1 110px; min-width: 0; font: 800 1.5rem/1 var(--font); letter-spacing: 0.25em; text-transform: uppercase; text-align: center; color: var(--ink); background: #f5f3ff; border: 3px solid #ddd6fe; border-radius: 999px; padding: 0.35em; }
.settings { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.settings summary { cursor: pointer; font-weight: 800; color: var(--purple); }
.settings select { font: inherit; border: 2px solid #ddd6fe; border-radius: 10px; padding: 0.3em; background: var(--white); color: var(--ink); }

.pair { display: grid; place-items: center; background: rgba(224, 242, 254, 0.92); padding: 24px 16px; }
.pair-box { display: grid; gap: 18px; max-width: 980px; }
.pair-box h1 { font-size: clamp(2.4rem, 6vw, 4rem); color: var(--purple); }
.pair-row { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; }
.qr { width: min(300px, 70vw); aspect-ratio: 1; background: var(--white); border-radius: 22px; padding: 12px; max-width: 100%; box-shadow: 0 6px 0 var(--purple); }
.qr svg { width: 100%; height: 100%; display: block; }
.pair-info { display: grid; gap: 10px; min-width: 0; }
.pair-info p { font-size: 1.25rem; }
.big-code { font: 800 clamp(4rem, 12vw, 8rem)/1 var(--font) !important; letter-spacing: 0.15em; color: var(--purple); }
.small { font-size: 0.95rem !important; word-break: break-all; color: var(--muted); }

.sender { background: #000; overflow: hidden; color: var(--white); }
.sender canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sender-hud { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 6px; padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: linear-gradient(transparent, rgba(0,0,0,0.85) 35%); }
.sender-hud .note { color: #d6d3d1; }
.sender-hud .btn { justify-self: start; }
.sender-status { font-weight: 800; font-size: 1.6rem; }
.dim { position: absolute; inset: 0; background: #000; display: grid; place-items: center; text-align: center; color: #555; z-index: 5; }

/* durante o jogo */
.corner { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); left: max(14px, env(safe-area-inset-left, 0px)); font: 800 1rem/1 var(--font); color: var(--purple); background: rgba(255,255,255,0.9); border: 3px solid var(--purple); border-radius: 999px; padding: 0.5em 1em; cursor: pointer; }
.caption { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: min(900px, calc(100% - 32px)); text-align: center; background: rgba(255,255,255,0.93); color: var(--purple); border-radius: 22px; padding: 10px 24px; font-weight: 800; font-size: clamp(1.2rem, 3vw, 2rem); line-height: 1.2; box-shadow: 0 6px 0 rgba(124, 58, 237, 0.25); pointer-events: none; }
.chip { position: fixed; right: max(10px, env(safe-area-inset-right, 0px)); top: calc(10px + env(safe-area-inset-top, 0px)); font-size: 0.8rem; color: rgba(59, 42, 32, 0.55); pointer-events: none; font-variant-numeric: tabular-nums; }

.caption.top { bottom: auto; top: calc(96px + env(safe-area-inset-top, 0px)); font-size: clamp(1.1rem, 2.6vw, 1.7rem); }
