/* ===================== Game UI (kid mode) — globe, HUD, dock, panels ===================== */

/* ---------- globe ---------- */
.globe-wrap { position: relative; overflow: hidden; touch-action: none; }
.globe-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; cursor: grab; }
.globe-canvas:active { cursor: grabbing; }
.globe-labels { position: absolute; inset: 0; pointer-events: none; }
.isle-tag { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font: 700 13px/1.1 var(--game); color: var(--night); transition: opacity .2s; will-change: transform; white-space: nowrap; }
.isle-tag .it-name { background: rgba(255,255,255,.96); padding: 5px 11px; border-radius: 99px; box-shadow: 0 3px 0 rgba(20,60,120,.18), 0 6px 14px rgba(20,60,120,.18); }
.isle-tag .it-stars { display: flex; gap: 1px; }
.isle-tag .it-stars i { width: 13px; height: 13px; background: rgba(255,255,255,.6);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.isle-tag .it-stars i.on { background: #FFD23F; filter: drop-shadow(0 1px 0 #E08A00); }
.isle-tag.today .it-name { background: linear-gradient(#FF7DB5, #FF4F98); color: #fff; }
.isle-tag .it-go { position: absolute; top: -8px; right: -16px; background: #FFD23F; color: var(--night); font-size: 10px; padding: 2px 6px; border-radius: 99px;
  box-shadow: 0 2px 0 #E0A000; animation: bobs .8s ease-in-out infinite alternate; }
.isle-tag.asleep:not(.today) .it-name { color: #6B7895; }
.isle-tag.asleep .it-name::after { content: ' 💤'; font-size: 11px; }
.globe-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(29,33,71,.55); color: #fff; backdrop-filter: blur(6px);
  font: 600 12px var(--game); padding: 6px 12px; border-radius: 99px; pointer-events: none; animation: hintfade 6s forwards; white-space: nowrap; }
@keyframes hintfade { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- screen + sky ---------- */
.screen { position: absolute; inset: 0; animation: screenIn .32s cubic-bezier(.2,.9,.3,1.2); }
@keyframes screenIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.sky { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 110%, #E8FAFF 0%, #B6EBFF 40%, #6FD3FF 75%, #4BC0F5 100%); }
.sky > .cloud { position: absolute; z-index: 0; pointer-events: none; animation: drift 40s linear infinite alternate; }
@keyframes drift { to { transform: translateX(40px); } }
.sky-sun { position: absolute; top: calc(72px + env(safe-area-inset-top)); right: 14px; z-index: 0; pointer-events: none; opacity: .95; }
.spin-slow { animation: spin 60s linear infinite; }
.sky > *:not(.cloud):not(.sky-sun) { position: relative; z-index: 1; }
.glass { background: rgba(255,255,255,.82); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255,255,255,.9); border-radius: 24px; box-shadow: 0 10px 30px rgba(20,70,140,.15), 0 2px 0 rgba(255,255,255,.6) inset; }
.pad14 { padding: 14px; }
.sprite { filter: drop-shadow(0 8px 8px rgba(20,60,120,.22)); }
.face-img { object-fit: cover; }

/* ---------- HUD ---------- */
.hud { position: relative; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 6px; flex: none; z-index: 3; }
.hud-player { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; min-width: 0;
  background: rgba(255,255,255,.85); backdrop-filter: blur(10px); box-shadow: 0 4px 14px rgba(20,70,140,.18); }
.hud-face { position: relative; width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: linear-gradient(#E6F6FF, #BFE8FF); box-shadow: 0 0 0 3px #fff, 0 0 0 5px #7EE04A; }
.hud-face > img { border-radius: 50%; }
.hud-lv { position: absolute; right: -6px; bottom: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: linear-gradient(#A98BFF, #7B5CFF);
  color: #fff; font: 700 11px/20px var(--game); text-align: center; box-shadow: 0 0 0 2px #fff; }
.hud-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hud-meta b { font: 700 14px/1 var(--game); color: var(--night); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xpbar { width: 76px; height: 7px; border-radius: 99px; background: rgba(29,33,71,.12); overflow: hidden; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #7EE04A, #2FC45A); border-radius: 99px; }
.hud-chip { display: flex; align-items: center; gap: 3px; padding: 4px 11px 4px 5px; border-radius: 99px; background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px); box-shadow: 0 4px 14px rgba(20,70,140,.16); font: 700 16px var(--game); color: var(--night); flex: none; }
.parent-lock { background: rgba(255,255,255,.7); backdrop-filter: blur(8px); box-shadow: 0 4px 14px rgba(20,70,140,.15); }

/* ---------- home ---------- */
.home.portrait .globe-wrap { flex: 1 1 auto; min-height: 220px; }
.dock { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 0 12px calc(10px + env(safe-area-inset-bottom)); }
.party-card { display: flex; align-items: flex-end; gap: 6px; }
.party-figs { display: flex; align-items: flex-end; flex: none; } .party-figs .pet { margin-left: -12px; }
.party-say { position: relative; flex: 1; margin: 0 0 14px 6px; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: rgba(255,255,255,.95);
  font: 600 15px/1.25 var(--game); color: var(--night); box-shadow: 0 6px 16px rgba(20,70,140,.14); }
.party-card.compact .party-say { font-size: 14px; padding: 8px 12px; margin-bottom: 10px; }
.play-wrap { position: relative; }
.jelly.play { width: 100%; } .jelly.play .jelly-face { padding: 12px; }
.play-txt { font-size: 30px; letter-spacing: .5px; }
.jelly.play .jelly-face::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.45) 50%, transparent 60%) -200% 0 / 200% 100% no-repeat; animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0%, 60% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.play-badge { position: absolute; top: -9px; right: 14px; z-index: 2; }
.kid-tabs { background: rgba(255,255,255,.92); backdrop-filter: blur(12px); box-shadow: 0 8px 24px rgba(20,70,140,.18); border-radius: 26px; padding: 6px; gap: 2px; }
.kid-tabs button { padding: 5px 0 4px; font: 600 11px var(--game); color: #7A86A6; border-radius: 20px; transition: transform .15s, background .15s; }
.kid-tabs button .e { font-size: 24px; line-height: 1.1; }
.kid-tabs button.on { background: linear-gradient(#FFF6D6, #FFE9A6); color: var(--night); transform: translateY(-5px); box-shadow: 0 6px 12px rgba(224,154,0,.25); }
.home.landscape .sky { flex-direction: row; }
.home-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.home-main .globe-wrap { flex: 1; }
.home-side { width: min(320px, 34vw); flex: none; display: flex; flex-direction: column; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.72); backdrop-filter: blur(16px); border-left: 1px solid rgba(255,255,255,.9); }
.side-title { font: 700 22px var(--game); color: var(--night); margin: 0; }
.mission-mini { border: 0; box-shadow: 0 3px 0 #DDE4F2, 0 6px 14px rgba(20,70,140,.08); border-radius: 18px; padding: 9px; }
.mission-mini.done { opacity: .65; }
.mm-r { display: flex; align-items: center; gap: 2px; font: 700 13px var(--game); }

/* ---------- page frame ---------- */
.kid-page .sky { padding-top: env(safe-area-inset-top); }
.page-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex: none; }
.back-btn { width: 46px; height: 46px; border-radius: 16px; background: #fff; color: var(--night); display: grid; place-items: center;
  box-shadow: 0 4px 0 #D5DBEE, 0 8px 16px rgba(20,70,140,.15); flex: none; transition: transform .08s; }
.back-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #D5DBEE; }
.page-title { margin: 0; font: 700 28px/1.1 var(--game); color: #fff; text-shadow: 0 3px 0 rgba(20,60,120,.25), 0 8px 20px rgba(20,60,120,.2); }
.page-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 14px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.page-col { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.page-col.wide { max-width: 980px; }
.sec-title { font: 700 20px var(--game); color: #fff; text-shadow: 0 2px 0 rgba(20,60,120,.25); margin: 6px 2px 0; }
.note { font-size: 13px; color: var(--night); opacity: .8; text-align: center; margin: 4px 8px; }
.muted { color: var(--muted); }

/* ---------- missions ---------- */
.quest-progress { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; font: 700 15px var(--game); color: var(--night); }
.quest-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 24px; background: #fff; text-align: left;
  box-shadow: 0 6px 0 #D5DBEE, 0 12px 24px rgba(20,70,140,.12); transition: transform .08s; }
.quest-card:active { transform: translateY(4px); box-shadow: 0 2px 0 #D5DBEE; }
.quest-card.done { opacity: .7; }
.q-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 32px; flex: none; box-shadow: inset 0 -4px 0 rgba(0,0,0,.06); }
.q-title { font: 700 19px var(--game); color: var(--night); } .quest-card small { color: var(--muted); font-size: 13px; }
.q-reward { display: flex; align-items: center; gap: 3px; background: #FFF6D6; padding: 6px 10px; border-radius: 99px; font: 700 15px var(--game); color: #A86A00; flex: none; }
.q-done { width: 38px; height: 38px; border-radius: 50%; background: #2FC45A; color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 900; flex: none; }
.chest-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 24px; background: rgba(255,255,255,.75); color: var(--night); }
.chest-card.open { background: linear-gradient(135deg, #FFE27A, #FFC12E); }
.chest-card b { display: block; font: 700 17px var(--game); } .chest-card small { font-size: 13px; opacity: .8; }
.boss-card { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 24px; color: #fff; background: linear-gradient(135deg, #2B2370, #1D2147); box-shadow: 0 12px 24px rgba(29,33,71,.3); }
.boss-card b { display: block; font: 700 17px var(--game); } .boss-card small { display: block; opacity: .8; font-size: 13px; margin: 2px 0 8px; }
.boss-emoji { font-size: 46px; }
.bounce-in { animation: pop .6s cubic-bezier(.34,1.8,.64,1); }
.between { justify-content: space-between; }

/* ---------- island chapters ---------- */
.isle-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 18px 16px; }
.island-3d img.float { animation: bob 2.2s ease-in-out infinite alternate; }
.island-3d.asleep img { filter: saturate(.6) drop-shadow(0 8px 8px rgba(20,60,120,.2)); }
.isle-mastery { display: flex; align-items: baseline; gap: 6px; font-family: var(--game); color: var(--night); }
.isle-mastery b { font-size: 26px; } .isle-mastery small { font-size: 14px; color: var(--muted); }
.isle-head .pbar { max-width: 240px; }
.isle-split { display: grid; grid-template-columns: minmax(240px, .8fr) 1.2fr; gap: 18px; align-items: start; }
.isle-split .isle-head { position: sticky; top: 0; }
.ch-node { --c: #FFC12E; background: #fff; color: var(--night); border: 0; font: 700 26px var(--game); box-shadow: 0 7px 0 rgba(29,33,71,.18), 0 12px 20px rgba(20,70,140,.15); }
.ch-node.played { background: var(--c); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.ch-node.gold { background: linear-gradient(#FFE27A, #FFC12E); color: #fff; text-shadow: 0 2px 0 rgba(160,90,0,.4); }
.ch-node.current { background: var(--c); color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.2); animation: bobs .9s ease-in-out infinite alternate;
  box-shadow: 0 0 0 6px rgba(255,255,255,.7), 0 7px 0 rgba(29,33,71,.18), 0 16px 28px rgba(20,70,140,.25); }
.ch-label { border-radius: 18px; box-shadow: 0 4px 0 #D5DBEE, 0 8px 16px rgba(20,70,140,.1); font-family: var(--game); }
.ch-label b { font-weight: 600; font-size: 15px; color: var(--night); }
.ch-here { color: var(--pink); font: 700 12px var(--game); }

/* ---------- league ---------- */
.league-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 24px; color: #fff;
  background: linear-gradient(135deg, #C9792E, #F2B77A); box-shadow: 0 12px 24px rgba(160,90,30,.3); }
.league-banner b { display: block; font: 700 22px var(--game); text-shadow: 0 2px 0 rgba(0,0,0,.15); } .league-banner small { font-size: 13px; opacity: .95; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; padding: 6px 4px 0; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: var(--game); color: var(--night); min-width: 0; }
.pod b { font-size: 14px; max-width: 100%; } .pod small { font-size: 12px; color: #4b587a; }
.pod-face { position: relative; width: 62px; height: 62px; border-radius: 50%; overflow: hidden; background: #E6F6FF; box-shadow: 0 0 0 4px #fff; font-size: 34px; display: grid; place-items: center; }
.pod1 .pod-face { width: 76px; height: 76px; box-shadow: 0 0 0 4px #FFD23F; }
.pod.me .pod-face { box-shadow: 0 0 0 4px #7EE04A; }
.pod-step { width: 100%; margin-top: 6px; border-radius: 14px 14px 6px 6px; color: #fff; font: 700 24px var(--game); text-align: center; text-shadow: 0 2px 0 rgba(0,0,0,.2);
  background: linear-gradient(#C3CBDE, #9AA6C2); height: 54px; line-height: 54px; }
.pod1 .pod-step { background: linear-gradient(#FFE27A, #F2B000); height: 76px; line-height: 76px; }
.pod3 .pod-step { background: linear-gradient(#F2B77A, #C9792E); height: 42px; line-height: 42px; }
.list-card { padding: 6px 12px; } .lc-title { display: block; font: 700 16px var(--game); color: var(--night); padding: 8px 2px 4px; }
.league-row { background: transparent; border-radius: 16px; padding: 8px 6px; gap: 10px; }
.league-row + .league-row { border-top: 1px solid rgba(29,33,71,.06); }
.league-row.me { background: linear-gradient(90deg, #FFF3C4, #FFE27A); border-top-color: transparent; }
.league-row .rank { width: 26px; text-align: center; font: 700 18px var(--game); color: var(--night); }
.league-row small { font-size: 12px; color: var(--muted); } .lr-xp { font: 700 15px var(--game); color: var(--night); }
.zone-line { text-align: center; font: 700 11px var(--game); letter-spacing: 1px; color: #8A96B5; padding: 6px 0 2px; text-transform: uppercase; }

/* ---------- rewards ---------- */
.wallet { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 26px; color: #fff;
  background: linear-gradient(135deg, #8A5CFF, #C04BFF); box-shadow: 0 14px 28px rgba(123,92,255,.35); }
.wallet-n { display: block; font: 700 38px/1 var(--game); text-shadow: 0 3px 0 rgba(0,0,0,.15); } .wallet small { opacity: .9; font-size: 13px; }
.voucher { border-radius: 24px; box-shadow: 0 6px 0 #D5DBEE, 0 12px 22px rgba(20,70,140,.1); padding: 14px 10px; gap: 8px; }
.v-name { font: 600 16px/1.2 var(--game); color: var(--night); }
.v-cost { display: flex; align-items: center; gap: 3px; font: 700 16px var(--game); color: #A86A00; }
.v-wait { color: var(--warn); font-weight: 800; font-size: 12px; } .v-need { color: var(--muted); font-weight: 700; font-size: 12px; }
.got-row { padding: 6px 2px; font-weight: 700; color: var(--night); }

/* ---------- exams ---------- */
.exam-banner { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 8px; border-radius: 26px; color: #fff;
  background: linear-gradient(135deg, #8A5CFF, #C04BFF); box-shadow: 0 14px 28px rgba(123,92,255,.35); }
.exam-banner b { display: block; font: 700 21px var(--game); } .exam-banner small { opacity: .9; font-size: 13px; }
.subj-chip { --c: #FFC12E; border: 0; background: #fff; box-shadow: 0 3px 0 #D5DBEE; font-family: var(--game); font-weight: 600; color: var(--night); }
.subj-chip.on { background: var(--c); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.2); box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.hminus { background: var(--sun); border-radius: 16px; padding: 6px 10px; text-align: center; color: #fff; font-family: var(--game); }
.hminus b { display: block; font-size: 18px; } .hminus small { font-size: 10px; } .hminus.hot { background: var(--pink); }

/* ---------- character picker ---------- */
.char-stage { position: relative; display: flex; justify-content: center; align-items: flex-end; padding: 18px 10px 44px; overflow: hidden;
  background: radial-gradient(80% 90% at 50% 100%, rgba(126,224,74,.35), rgba(255,255,255,.75) 60%); }
.stage-floor { position: absolute; left: 15%; right: 15%; bottom: 30px; height: 26px; border-radius: 50%; background: rgba(29,33,71,.12); }
.stage-names { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font: 600 15px var(--game); color: var(--night); }
.char-card { box-shadow: 0 6px 0 #D5DBEE, 0 12px 22px rgba(20,70,140,.1); }
.char-card img { width: 108px; height: 108px; }
.char-card b { font-family: var(--game); font-weight: 700; color: var(--night); }
.char-card.on { border-color: #2FC45A; background: linear-gradient(#fff, #EEFBEA); }
