/* Pulau Pintar — web. Colors from Theme.kt. Kid mode is always the bright "Pulau Ceria" look (no dark theme on purpose). */
:root {
  --sky: #EAF6FF; --ink: #1C2A4A; --muted: #5B6A86; --line: #D6E2EE; --card: #fff;
  --sea: #2EA6DC; --sand: #FFF1CC; --sun: #FFC12E; --coral: #FF6C5C; --leaf: #2FC274; --grape: #7B5CFF;
  --p-bg: #F2F4F8; --p-accent: #2B62DF; --p-accent-soft: #E6EEFF;
  --ok: #1D9A56; --ok-soft: #E3F6EB; --warn: #C77F00; --warn-soft: #FFF3D6; --bad: #D64343; --bad-soft: #FDE8E8;
  --pink: #FF5FA2; --orange: #FF8A1F; --purple: #8A5CFF; --magenta: #C04BFF; --lime: #7EE04A; --night: #1D2147; --cream: #FFF0C2;
  --game: 'Fredoka', 'Nunito', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #5FD0FF; }
body { font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: 700; color: var(--ink);
  -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
input, textarea { -webkit-user-select: text; user-select: text; font: inherit; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3, p { margin: 0; }
#app, .app { position: fixed; inset: 0; }
.app > * { position: absolute; inset: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.app > .toast, .app > .relogin { position: absolute; inset: auto; padding: 14px; }
.boot { display: grid; place-items: center; height: 100%; font: 700 28px var(--game); color: #fff; }

/* ---------- utilities ---------- */
.row { display: flex; } .col { display: flex; flex-direction: column; }
.row.center { align-items: center; } .row.end { align-items: flex-end; } .col.center { align-items: center; } .col.left { align-items: flex-start; text-align: left; }
.center-row { display: flex; justify-content: center; } .wrap { flex-wrap: wrap; }
.grow { flex: 1 1 0; min-width: 0; } .grow12 { flex: 1.2 1 0; min-width: 0; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; }
.py6 { padding: 6px 0; } .mb6 { margin-bottom: 6px; } .mb24 { margin-bottom: 24px; } .mb70 { margin-bottom: 70px; }
.maxw200 { max-width: 200px; } .maxw420 { max-width: 420px; } .w180 { width: 180px; } .full { width: 100%; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0; }
.hscroll { display: flex; overflow-x: auto; padding-bottom: 4px; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fill { position: absolute; inset: 0; width: 100%; height: 100%; } .cover { object-fit: cover; }
.white { color: #fff; } .white80 { color: rgba(255,255,255,.8); } .white85 { color: rgba(255,255,255,.85); } .white90 { color: rgba(255,255,255,.9); }
.night { color: var(--night); } .muted { color: var(--muted); } .ink { color: var(--ink); } .pink { color: var(--pink); } .purple { color: var(--purple); }
.bad { color: var(--bad); } .ok { color: var(--ok); } .warn { color: var(--warn); }
.shadow { text-shadow: 0 4px 0 rgba(0,0,0,.2); }
.center { text-align: center; }
.t-hero { font-size: 28px; font-weight: 900; } .t-title { font-size: 22px; font-weight: 900; } .t-card { font-size: 18px; font-weight: 800; }
.t-body { font-size: 15px; font-weight: 600; } .t-small { font-size: 13px; font-weight: 700; color: var(--muted); } .tiny { font-size: 11px; }
.t-small.white, .t-small.white90 { color: rgba(255,255,255,.92); } .t-small.night { color: var(--night); } .t-small.ink { color: var(--ink); }
.t-small.bad { color: var(--bad); } .t-small.warn { color: var(--warn); } .t-small.ok { color: var(--ok); }
.label { font-size: 12px; font-weight: 800; letter-spacing: .8px; color: var(--muted); }
.label.white { color: #fff; } .label.white85 { color: rgba(255,255,255,.85); } .label.night { color: var(--night); } .label.purple { color: var(--purple); }
.game { font-family: var(--game); font-weight: 700; color: #fff; text-shadow: 0 4px 0 rgba(0,0,0,.2); line-height: 1.1; }
.big-emoji { font-size: 36px; }

/* ---------- animations ---------- */
.art { display: block; overflow: visible; }
.blink { animation: blink 4200ms infinite; transform-box: fill-box; transform-origin: center !important; }
@keyframes blink { 0%, 92% { transform: scaleY(1); } 95% { transform: scaleY(.1); } 98%, 100% { transform: scaleY(1); } }
.spin { animation: spin 40s linear infinite; transform-origin: 50px 50px; }
@keyframes spin { to { transform: rotate(360deg); } }
.bob { animation: bob 1.2s ease-in-out infinite alternate; } .bob-slow { animation: bob 1.4s ease-in-out infinite alternate; }
.bob-small { animation: bobs .9s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-6px); } } @keyframes bobs { to { transform: translateY(-4px); } }
.pulse { animation: pulse 1.2s ease-in-out infinite alternate; } @keyframes pulse { to { transform: scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .bob, .bob-slow, .bob-small, .pulse, .spin { animation: none; } }

/* ---------- jelly button ---------- */
.jelly { --r: 24px; --top: #FFB43A; --bot: var(--orange); --base: #C95A00; position: relative; display: block;
  border-radius: var(--r); background: var(--base); padding: 0 0 7px; margin-top: 0; transition: transform .06s, padding .06s; }
.jelly-face { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 100%;
  border-radius: var(--r); padding: 14px 16px; background: linear-gradient(var(--top), var(--bot)); overflow: hidden; }
.jelly-face::before { content: ''; position: absolute; left: 12px; right: 12px; top: 5px; height: 14px; border-radius: var(--r);
  background: linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,0)); pointer-events: none; }
.jelly:active:not(:disabled) { transform: translateY(5px); padding-bottom: 2px; }
.jelly:disabled { --top: #E4E7F1; --bot: #D3D7E6; --base: #B9BED3; cursor: default; }
.j-green { --top: #6EE67C; --bot: #2FC45A; --base: #1F8D3E; } .j-blue { --top: #4CC3FF; --bot: #1B97E8; --base: #0F6DB0; }
.j-yellow { --top: #FFD04A; --bot: #FFAB00; --base: #C47F00; } .j-red { --top: #FF7C8A; --bot: #FF4D61; --base: #C02436; }
.j-purple { --top: #A98BFF; --bot: var(--purple); --base: #5B34C9; } .j-white { --top: #fff; --bot: #F4F6FF; --base: #D5DBEE; }
.jelly.back { width: 56px; } .jelly.back .jelly-face { padding: 6px; }
.jelly.dim, .jelly.tf.dim { opacity: .45; }

.candy-pill { display: inline-flex; align-items: center; gap: 4px; background: #fff; border-radius: 99px; padding: 3px 11px 3px 4px;
  font-size: 16px; font-weight: 800; color: var(--night); white-space: nowrap; }
.candy-pill.bordered { box-shadow: 0 0 0 2px var(--cream); } .cp-icon { display: inline-flex; font-size: 16px; }
.pbar { width: 100%; border-radius: 99px; overflow: hidden; } .pbar > div { height: 100%; border-radius: 99px; transition: width .3s; }
.bubble { background: #fff; border-radius: 20px 20px 20px 6px; padding: 9px 12px; font-size: 15px; font-weight: 700; color: var(--night); line-height: 1.25; }

/* ---------- kid chrome ---------- */
.kid-bg { background: linear-gradient(#5FD0FF, #B8ECFF, #E6F8FF); display: flex; flex-direction: column; }
.kid-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; flex: none; }
.kid-title { flex: 1; font-size: 28px; font-weight: 900; color: #fff; text-shadow: 0 5px 0 rgba(0,0,0,.2); line-height: 1.1; }
.kid-scroll { flex: 1; overflow-y: auto; padding: 0 14px 18px; min-height: 0; }
.kid-col { margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.white-card { background: #fff; border-radius: 24px; padding: 14px; }
.hud { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 6px; padding: 8px 12px; z-index: 3; }
.avatar-badge { position: relative; flex: none; }
.avatar-badge > svg { position: absolute; left: 0; top: 0; }
.ab-face { position: absolute; left: 5px; top: 5px; border-radius: 50%; overflow: hidden; }
.ab-lv { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); background: var(--purple); color: #fff; border: 2px solid #fff;
  border-radius: 99px; padding: 0 6px; font-size: 10px; font-weight: 900; white-space: nowrap; }
.parent-lock { position: relative; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.75); display: grid; place-items: center; touch-action: none; flex: none; }
.parent-lock svg { position: absolute; inset: 3px; } .parent-lock span { font-size: 15px; opacity: .7; }
.kid-tabs { display: flex; background: #fff; border-radius: 24px; padding: 6px; }
.kid-tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; border-radius: 18px; padding: 4px 0; font-size: 11px; font-weight: 800; color: var(--muted); transition: transform .1s; }
.kid-tabs button .e { font-size: 22px; } .kid-tabs button.on { background: var(--cream); color: var(--night); transform: translateY(-4px); }

/* ---------- home ---------- */
.home { overflow: hidden; }
.sky-sea { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(#5FD0FF 0, #B8ECFF calc(var(--sea) * .6), #DFF6FF var(--sea)); }
.sea { position: absolute; left: 0; right: 0; top: calc(var(--sea) - 10px); bottom: 0; background: linear-gradient(#3CC8F7, #0F8FD6); }
.sea::before { content: ''; position: absolute; left: 0; right: 0; top: -9px; height: 20px;
  background: radial-gradient(circle at 25% 100%, #3CC8F7 60%, transparent 62%) 0 0 / 60px 20px repeat-x; }
.self-end { align-self: flex-end; margin-right: 8px; }
.rainbow { position: absolute; left: 50%; top: calc(var(--sea) - 46vw * .55); width: 124vw; height: calc(62vw * 1.1); transform: translateX(-50%);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0; opacity: .5;
  background: radial-gradient(ellipse at 50% 100%, transparent 55%, #7EE04A 55.5%, #7EE04A 60%, #FFD23F 60.5%, #FFD23F 65%, #FF8FBD 65.5%, #FF8FBD 70%, transparent 70.5%); }
.landscape .rainbow { width: 80%; height: 300px; top: calc(var(--sea) - 200px); }
.cloud { position: absolute; }
.sun { position: absolute; top: 52px; right: 4px; z-index: 1; } .sun.land { top: 10px; right: 20px; }
.field-wrap { position: absolute; left: 0; right: 0; z-index: 2; }
.isle-field { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; }
.route { position: absolute; left: 0; top: 0; pointer-events: none; }
.isle-pos { position: absolute; }
.isle { display: flex; flex-direction: column; align-items: center; border-radius: 18px; }
.isle:active { transform: scale(.96); }
.isle-stars { display: flex; }
.island-art { position: relative; } .island-art .isle-emoji { position: absolute; top: 4px; left: 0; right: 0; text-align: center; font-size: 26px; }
.island-art .zz { position: absolute; right: 6px; top: 14px; font-size: 11px; color: #5B6EA8; }
.isle-name { margin-top: -6px; background: #fff; border-radius: 99px; padding: 1px 9px; font-size: 12px; font-weight: 800; color: var(--night); white-space: nowrap; }
.isle-name.today { background: var(--pink); color: #fff; }
.home-dock { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.play-wrap { position: relative; } .jelly.play { width: 100%; } .jelly.play .jelly-face { padding: 12px; }
.play-badge { position: absolute; top: -8px; right: 12px; background: var(--pink); color: #fff; border: 2px solid #fff; border-radius: 99px; padding: 2px 9px; font-size: 12px; font-weight: 900; }
.home.landscape { display: flex; } .home-main { position: relative; flex: 1; overflow: hidden; }
.home-pet { position: absolute; right: 8px; bottom: 0; display: flex; align-items: flex-end; z-index: 3; }
.home-side { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: rgba(255,255,255,.9); }
.mission-mini { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid #E6EBF7; border-radius: 18px; padding: 8px; text-align: left; }
.mm-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; flex: none; }
.mission-mini small { font-size: 11px; color: var(--muted); } .mm-r { font-size: 12px; font-weight: 800; }

/* ---------- missions / league / rewards / exams ---------- */
.jelly.mission .jelly-face { justify-content: flex-start; padding: 14px; gap: 12px; }
.m-icon { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; flex: none; }
.chest { display: flex; align-items: center; gap: 12px; border-radius: 22px; padding: 14px; background: rgba(255,255,255,.7); font-size: 16px; }
.chest.open { background: var(--sun); }
.boss { border-radius: 24px; padding: 14px; background: linear-gradient(135deg, #2B2370, var(--night)); display: flex; flex-direction: column; gap: 8px; }
.league-head { display: flex; align-items: center; gap: 10px; border-radius: 24px; padding: 14px; background: linear-gradient(135deg, #D48A3C, #F2B77A); }
.league-row { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 20px; padding: 10px; }
.league-row.me { background: var(--sun); } .league-row .rank { width: 30px; text-align: center; }
.league-row small { font-size: 13px; }
.lr-face { position: relative; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: #EFF4FF; display: grid; place-items: center; font-size: 24px; flex: none; }
.coin-banner, .exam-banner { display: flex; align-items: center; gap: 12px; border-radius: 24px; padding: 16px; background: linear-gradient(135deg, var(--purple), var(--magenta)); }
.voucher-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .voucher-grid { grid-template-columns: repeat(4, 1fr); } }
.voucher { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #fff; border-radius: 24px; padding: 12px; text-align: center; }
.v-emoji { width: 64px; height: 64px; border-radius: 50%; background: var(--cream); display: grid; place-items: center; font-size: 34px; }
.v-name { font-size: 16px; min-height: 2.5em; display: flex; align-items: center; }
.voucher .jelly .jelly-face { padding: 8px; }
.subj-chip { flex: none; border-radius: 16px; padding: 8px 12px; background: var(--sky); border: 2px solid transparent; font-size: 15px; font-weight: 800; }
.subj-chip.on { border-color: var(--night); }
.exam-grid { display: grid; gap: 12px; } .exam-grid.two { grid-template-columns: 1fr 1fr; align-items: start; }
.ex-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; flex: none; }
.hminus { border-radius: 16px; padding: 6px 10px; display: flex; flex-direction: column; align-items: center; color: #fff; font-size: 10px; font-weight: 900; }
.jelly .jelly-face small { line-height: 1; }
.score { border-radius: 99px; padding: 6px 12px; font-size: 22px; font-weight: 900; } .score.ok { background: var(--ok-soft); } .score.warn { background: var(--warn-soft); }

/* ---------- island ---------- */
.isle-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 8px; }
.isle-wide { flex: 1; display: flex; min-height: 0; } .isle-wide > .isle-head { flex: .8; justify-content: center; } .isle-wide > .scroll { flex: 1.2; }
.chapter-path { padding-bottom: 24px; }
.ch-row { display: flex; align-items: center; padding: 0 20px; } .ch-row.right { justify-content: flex-end; }
.ch-node { width: 68px; height: 68px; border-radius: 50%; box-shadow: 0 6px 0 rgba(0,0,0,.2); display: grid; place-items: center; font-size: 26px; font-weight: 900; flex: none; }
.ch-node.current { width: 84px; height: 84px; font-size: 32px; }
.ch-label { margin: 0 10px; max-width: 200px; background: #fff; border-radius: 16px; padding: 8px 12px; text-align: left; display: flex; flex-direction: column; }
.ch-label > span { display: flex; }
.path-dots { height: 34px; display: flex; justify-content: center; align-items: center; gap: 20px; }
.path-dots i { width: 10px; height: 10px; border-radius: 50%; background: #FFF3C4; }
.path-dots.down-right i:nth-child(1) { transform: translateY(-6px); } .path-dots.down-right i:nth-child(2) { transform: translateY(-2px); }
.path-dots.down-right i:nth-child(3) { transform: translateY(2px); } .path-dots.down-right i:nth-child(4) { transform: translateY(6px); }
.path-dots.down-left i:nth-child(4) { transform: translateY(-6px); } .path-dots.down-left i:nth-child(3) { transform: translateY(-2px); }
.path-dots.down-left i:nth-child(2) { transform: translateY(2px); } .path-dots.down-left i:nth-child(1) { transform: translateY(6px); }

/* ---------- quiz ---------- */
.quiz-bg { background: linear-gradient(135deg, var(--purple), var(--magenta), var(--pink)); overflow: hidden; }
.quiz-bg.dots::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255,255,255,.14) 2px, transparent 2.5px) 0 0 / 18px 18px; pointer-events: none; }
.pad20 { padding: 20px; }
.quiz-col { position: relative; height: 100%; display: flex; flex-direction: column; padding: 0 14px; }
.quiz-top { display: flex; align-items: center; padding: 10px 0; gap: 10px; }
.quit { width: 40px; height: 40px; border-radius: 14px; background: rgba(255,255,255,.25); color: #fff; font-size: 22px; font-weight: 900; flex: none; }
.q-progress { flex: 1; display: flex; justify-content: center; gap: 5px; } .q-progress i { height: 10px; border-radius: 99px; flex: 0 1 auto; transition: background .2s; }
.race { background: #3A3F6B; border-radius: 22px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.lane { display: flex; align-items: center; } .lane-track { position: relative; flex: 1; height: 38px;
  background: linear-gradient(90deg, rgba(255,255,255,.35) 50%, transparent 0) 0 50% / 20px 3px repeat-x; }
.lane-track::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 12px;
  background: conic-gradient(#fff 25%, var(--night) 0 50%, #fff 0 75%, var(--night) 0) 0 0 / 12px 12px; }
.lane-runner { position: absolute; top: 1px; display: flex; align-items: center; transition: left .5s cubic-bezier(.34,1.56,.64,1); }
.lane-face { position: relative; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; flex: none; background: #fff; }
.lane-name { margin-left: 3px; background: #fff; border-radius: 99px; padding: 0 6px; font-size: 10px; font-weight: 900; color: var(--night); white-space: nowrap; }
.lane-score { width: 30px; text-align: right; font-size: 20px; }
.rival-say { align-self: flex-end; background: var(--cream); color: var(--night); border-radius: 12px; padding: 3px 10px; font-size: 12px; }
.quiz-wide { flex: 1; display: flex; gap: 14px; padding: 44px 0 12px; min-height: 0; } .quiz-wide > * { flex: 1; } .answers-col { flex: 1.1; }
.quiz-narrow { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 44px 0 16px; }
.qcard-wrap { position: relative; } .qcard-wrap.fillh { display: flex; } .qcard-wrap.fillh .qcard { flex: 1; justify-content: center; }
.qcard { background: #fff; border-radius: 28px; padding: 18px 18px 22px; display: flex; flex-direction: column; gap: 8px; }
.q-text { font-size: 23px; line-height: 30px; font-weight: 900; } .q-text.big { font-size: 34px; line-height: 40px; }
.speak { width: 44px; height: 44px; border-radius: 50%; background: var(--sun); font-size: 20px; }
.q-dragon { position: absolute; right: 8px; top: -40px; }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt { transition: opacity .2s; } .opt .jelly-face { padding: 16px 8px; min-height: 88px; text-align: center; }
.opt.bounce { animation: bounce .5s; } @keyframes bounce { 30% { transform: scale(1.12); } 60% { transform: scale(.97); } }
.shape { font-size: 14px; color: rgba(255,255,255,.9); }
.hint { background: #fff; border-radius: 99px; padding: 9px 18px; font-size: 15px; font-weight: 800; }
.jelly.tf .jelly-face { padding: 26px 8px; }
.fill-input { width: 100%; border: 3px solid #fff; border-radius: 24px; padding: 14px; font-size: 30px; font-weight: 900; text-align: center; color: var(--ink); outline: none; background: #fff; }
.fill-input:focus { border-color: var(--sun); }
.match .jelly-face { padding: 12px 6px; text-align: center; }
.burst { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.burst .pop { font-size: 46px; animation: pop .5s cubic-bezier(.34,1.8,.64,1); } .burst .pop.sad { color: #FFE0E3; }
@keyframes pop { from { transform: scale(.3); } to { transform: scale(1); } }

/* ---------- result ---------- */
.result-bg { overflow: hidden; } .result-bg.good { background: #FFCD3C; } .result-bg.meh { background: #7FD0FF; }
.burst-rays { position: absolute; left: 50%; top: 38%; width: 300vmax; height: 300vmax; margin: -150vmax 0 0 -150vmax; animation: spin 30s linear infinite; transform-origin: center;
  background: repeating-conic-gradient(var(--ray) 0 10deg, transparent 10deg 20deg); }
.result-bg.good .burst-rays { --ray: #FFE27A; } .result-bg.meh .burst-rays { --ray: #A9E1FF; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 13px; animation: fall 4.2s linear infinite; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
.result-wide { position: relative; height: 100%; display: flex; align-items: center; padding: 24px; } .result-wide > * { flex: 1; } .result-wide > .scroll { flex: 1.2; max-height: 100%; }
.result-narrow { position: relative; height: 100%; padding: 40px 20px 20px; display: flex; flex-direction: column; align-items: center; }
.result-hero { position: relative; width: 260px; height: 230px; margin: 0 auto; }
.result-hero .trophy { position: absolute; right: 0; top: 0; } .result-hero .trophy.tilt { transform: rotate(8deg); }
.result-hero .hero-knight { position: absolute; left: 0; bottom: 0; } .result-hero .hero-dragon { position: absolute; right: 10px; bottom: 0; }
.party { align-items: flex-end; } .party .pet { margin-left: -14px; }
.hero-fig { position: relative; flex: none; display: block; }
.hero-photo { position: absolute; right: -2px; top: 0; width: 34%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid #fff; box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.result-info { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.result-title { font-size: 40px; transform: rotate(-3deg); text-align: center; }
.score-circle { width: 120px; height: 120px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 52px; font-weight: 900; }
.pop-star { animation: pop .5s cubic-bezier(.34,1.8,.64,1) backwards; } .pop-star.d1 { animation-delay: .2s; } .pop-star.d2 { animation-delay: .4s; }

/* ---------- sign-in ---------- */
.signin-bg { background: linear-gradient(#FF9AC6, #FFC3A0, #FFE6A8); overflow-y: auto; }
.signin { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 18px; }
@media (orientation: landscape) and (min-width: 560px) { .signin { flex-direction: row; gap: 48px; } }
.logo1, .logo2 { font-size: 50px; } .logo1 { text-shadow: 0 6px 0 #E2477F; } .logo2 { color: var(--sun); text-shadow: 0 6px 0 #D08A00; }
.signin-card { width: 100%; max-width: 420px; background: #fff; border-radius: 28px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gsi-btn { min-height: 44px; }
.relogin { left: 12px !important; right: 12px !important; bottom: 12px !important; z-index: 50; background: #fff; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.2);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; font-size: 14px; max-width: 560px; margin: 0 auto; }

/* ---------- parent side ---------- */
.parent-bg { background: var(--p-bg); overflow: hidden; }
.parent { height: 100%; max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; background: var(--p-bg); }
.setup { height: 100%; max-width: 720px; margin: 0 auto; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.p-head { display: flex; align-items: center; gap: 10px; background: #fff; padding: 12px 16px; flex: none; }
.p-face, .avatar-big { position: relative; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; flex: none; }
.avatar-big { width: 84px; height: 84px; box-shadow: 0 0 0 3px var(--lime); }
.p-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.p-tabs { display: flex; background: #fff; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); flex: none; }
.p-tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 19px; }
.p-tabs small { font-size: 11px; color: var(--muted); } .p-tabs .on small { color: var(--p-accent); }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pbtn { background: var(--p-accent); color: #fff; border-radius: 10px; padding: 10px 14px; font-weight: 800; font-size: 15px; white-space: nowrap; }
.pbtn.big { padding: 14px; font-size: 17px; } .pbtn:disabled { opacity: .45; cursor: default; }
.pbtn.soft { background: var(--p-accent-soft); color: var(--p-accent); } .pbtn.ok { background: var(--ok); }
.pbtn.bad { background: var(--bad); } .pbtn.bad-soft { background: var(--bad-soft); color: var(--bad); }
.pbtn:active:not(:disabled) { transform: scale(.98); }
.link-btn { padding: 8px 10px; font-weight: 800; color: var(--p-accent); white-space: nowrap; } .link-btn.bad { color: var(--bad); } .link-btn.ok { color: var(--ok); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.field input, .field textarea { border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 16px; font-weight: 600; color: var(--ink); background: #fff; outline: none; width: 100%; }
.field input:focus, .field textarea:focus { border-color: var(--p-accent); }
.choices { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.choices button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 700; color: var(--ink); }
.choices button.on { background: var(--p-accent); border-color: var(--p-accent); color: #fff; }
.pill { border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.kpi { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; }
.kpi small { font-size: 11px; color: var(--muted); }
.bars { height: 130px; display: flex; gap: 6px; align-items: flex-end; padding-top: 14px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; font-size: 11px; color: var(--muted); }
.bar-col i { width: 24px; border-radius: 6px 6px 2px 2px; }
.wbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--line); }
.wrow { display: flex; align-items: center; gap: 6px; } .we { width: 28px; font-size: 18px; }
.wn { width: 112px; display: flex; flex-direction: column; font-size: 13px; } .wn small { font-size: 10px; }
.wrow input { flex: 1; min-width: 0; accent-color: var(--p-accent); } .wv { width: 44px; text-align: right; }
input[type=range] { accent-color: var(--p-accent); width: 100%; }
.days-left { width: 56px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); display: flex; flex-direction: column; align-items: center; padding: 6px 0; font-size: 20px; flex: none; }
.days-left small { font-size: 11px; }
.subj { border-radius: 12px; } .subj.open { background: var(--p-accent-soft); }
.subj-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; text-align: left; }
.subj-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; }
.ch-editor { padding: 6px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.mat-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: inherit; text-decoration: none; }
.mat-pick { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 8px; text-align: left; font-size: 13px; }
.mat-pick.on { background: var(--p-accent-soft); }
.draft { background: #F7F9FF; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 6px; } .draft.off { background: var(--bad-soft); }
.draft-opt { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px; text-align: left; font-size: 15px; font-weight: 600; }
.draft-opt.key { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.pin-gate { background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px; overflow-y: auto; }
@media (orientation: landscape) { .pin-gate { flex-direction: row; justify-content: space-evenly; } }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--line); } .pin-dot.on { background: var(--ink); }
.keypad { width: 280px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
.keypad button { height: 58px; border-radius: 16px; background: var(--p-bg); font-size: 22px; font-weight: 900; }
.keypad button.ok { background: var(--p-accent); color: #fff; }
@media (max-height: 560px) { .keypad button { height: 46px; } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--p-accent); animation: spin .8s linear infinite; display: inline-block; flex: none; }
.toast { left: 16px !important; right: 16px !important; bottom: 16px !important; max-width: 560px; margin: 0 auto; z-index: 60; background: var(--night); color: #fff;
  border-radius: 16px; text-align: center; font-size: 15px; font-weight: 600; animation: pop .25s; }
