/* =====================================================================
   SanSil English World — public website (homepage + inner pages)
   Uses tokens from app.css. Logical properties everywhere → RTL ready.
   ===================================================================== */

body.area-site { background: #F4FAFF; }
body.area-site .sky { display: none; }
[dir="rtl"] body, [dir="rtl"] .btn, [dir="rtl"] input { font-family: var(--font-ar); }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { font-family: var(--font-ar); font-weight: 800; }

.skip-link { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: 12px; background: var(--ink); color: #fff; }
.skip-link:focus { top: 8px; }
.wrap { width: min(1240px, 100% - 24px); margin-inline: auto; padding-block: 8px 40px; }

/* ---------- Buttons (brand) ---------- */
.btn-blue   { --b: var(--blue);  --bl: var(--blue-l); --bd: var(--blue-d); }
.btn-navy   { --b: #12398F; --bl: #2F5BC4; --bd: #0B2A6F; }
.btn-yellow { --b: var(--sun); --bl: #FFE57F; --bd: var(--sun-d); color: #7A1F00; text-shadow: 0 1px 0 rgba(255,255,255,.45); }
.btn-red    { --b: var(--red); --bl: #EF5350; --bd: var(--red-d); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 30; padding: calc(8px + var(--safe-top)) 10px 8px;
  background: linear-gradient(180deg, rgba(64, 170, 255, .96), rgba(64, 170, 255, .86)); backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(11, 42, 111, .18); }
.sh-inner { width: min(1320px, 100%); margin-inline: auto; display: flex; align-items: center; gap: 10px; }
.sh-logo { flex: none; display: block; width: 64px; margin-block: -10px -26px; filter: drop-shadow(0 6px 8px rgba(11, 42, 111, .28)); transition: transform .2s; }
.sh-logo:hover { transform: rotate(-3deg) scale(1.04); }
.sh-logo img { width: 100%; height: auto; display: block; }
.sh-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

.sh-nav { position: fixed; inset: 0 0 0 auto; inset-inline-start: auto; inset-inline-end: 0; width: min(320px, 86vw); z-index: 40;
  background: #fff; padding: calc(80px + var(--safe-top)) 18px 24px; display: none;
  box-shadow: -10px 0 30px rgba(0, 0, 0, .2); overflow-y: auto; }
[dir="rtl"] .sh-nav { box-shadow: 10px 0 30px rgba(0, 0, 0, .2); }
.sh-nav.open { display: block; animation: drawerIn .28s cubic-bezier(.2, .9, .3, 1.1); }
[dir="rtl"] .sh-nav.open { animation-name: drawerInRtl; }
@keyframes drawerIn { from { transform: translateX(100%); } }
@keyframes drawerInRtl { from { transform: translateX(-100%); } }
.sh-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sh-nav a { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 18px; font-family: var(--font-head); font-weight: 600;
  font-size: 1.2rem; color: var(--brand-navy); }
[dir="rtl"] .sh-nav a { font-family: var(--font-ar); font-weight: 700; }
.sh-nav a:hover { background: var(--cloud); }
.sh-nav a.is-active { background: linear-gradient(180deg, #A35BE0, var(--brand-purple)); color: #fff; box-shadow: 0 4px 0 var(--grape-d); }
.nav-ico { font-size: 1.25rem; }
.sh-drawer-extra { margin-top: 16px; }
.sh-drawer-extra .btn { width: 100%; }
.nav-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(11, 42, 111, .4); }

.sh-burger { display: grid; gap: 4px; place-content: center; position: relative; z-index: 41; }
.sh-burger span { display: block; width: 20px; height: 3px; border-radius: 3px; background: var(--brand-navy); transition: transform .2s, opacity .2s; }
.sh-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sh-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.sh-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.sh-parent { min-height: 44px; padding: 6px 14px; font-size: 1rem; }
.sh-parent .lbl { display: none; }
.sh-logout { margin: 0; }

.lang-select { position: relative; }
.lang-select summary { list-style: none; display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 12px; border-radius: var(--r-pill);
  background: #fff; color: var(--brand-navy); font-weight: 800; cursor: pointer; box-shadow: 0 4px 0 #90CAF9; }
.lang-select summary::-webkit-details-marker { display: none; }
.lang-select summary::after { content: "▾"; font-size: .8rem; }
.lang-select ul { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 150px; list-style: none; margin: 0; padding: 6px;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-soft); z-index: 50; }
.lang-select a { display: block; padding: 10px 12px; border-radius: 10px; font-weight: 800; }
.lang-select a:hover, .lang-select a[aria-current] { background: var(--cloud); color: var(--blue); }
.lang-select a[lang="ar"] { font-family: var(--font-ar); }

/* ---------- Flash / alerts ---------- */
.flash, .alert { margin: 12px auto; width: min(720px, 100% - 24px); padding: 12px 16px; border-radius: 16px; font-weight: 800; text-align: center; }
.flash-ok, .alert-ok { background: #E8F5E9; color: var(--mint-d); box-shadow: inset 0 -3px 0 var(--mint-l); }
.alert-err { background: #FFEBEE; color: var(--red-d); box-shadow: inset 0 -3px 0 var(--red-l); }
.alert { width: 100%; text-align: start; }

/* ---------- Hero ---------- */
.hero-site { position: relative; overflow: hidden; isolation: isolate; padding: 34px 12px 60px;
  background: radial-gradient(60% 50% at 50% 30%, #E6F6FF 0%, rgba(230, 246, 255, 0) 70%),
              linear-gradient(180deg, #4FB3F6 0%, #8CD2FB 38%, #CDEBFF 70%, #EAF7FF 100%); }
.scene { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.rainbow { position: absolute; width: 520px; height: 520px; inset-inline-end: -120px; top: 40px; border-radius: 50%; opacity: .55;
  background: radial-gradient(circle, transparent 54%, #E53935 54.5% 57%, #FB8C00 57% 60%, #FFC107 60% 63%, #43A047 63% 66%, #29B6F6 66% 69%, #8E24AA 69% 72%, transparent 72.5%);
  mask: linear-gradient(180deg, #000 52%, transparent 53%); -webkit-mask: linear-gradient(180deg, #000 52%, transparent 53%); }
.cloud-s { position: absolute; width: 160px; height: 50px; border-radius: 50px; background: #fff; opacity: .92; animation: floatX 14s ease-in-out infinite alternate; }
.cloud-s::before, .cloud-s::after { content: ""; position: absolute; border-radius: 50%; background: #fff; }
.cloud-s::before { width: 70px; height: 70px; top: -34px; inset-inline-start: 24px; }
.cloud-s::after  { width: 90px; height: 90px; top: -46px; inset-inline-start: 64px; }
.cs1 { top: 70px; inset-inline-start: 6%; transform: scale(.8); }
.cs2 { top: 150px; inset-inline-end: 22%; transform: scale(.6); animation-duration: 18s; }
.cs3 { top: 36px; inset-inline-start: 44%; transform: scale(.5); animation-duration: 22s; }
@keyframes floatX { to { translate: 40px 0; } }
.balloon { position: absolute; top: 60px; inset-inline-end: 6%; font-size: 3rem; animation: bob 4s ease-in-out infinite; filter: drop-shadow(0 8px 8px rgba(0,0,0,.15)); }
.island { position: absolute; width: 120px; height: 46px; border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%;
  background: linear-gradient(180deg, #7ED957 0 38%, #B88A5A 38% 100%); box-shadow: inset 0 -8px 0 rgba(0,0,0,.12); animation: bob 5s ease-in-out infinite; opacity: .9; }
.isl1 { top: 120px; inset-inline-start: 2%; }
.isl2 { top: 210px; inset-inline-end: 3%; width: 90px; animation-delay: -2s; }
.hills { position: absolute; bottom: 0; left: 0; width: 100%; height: 130px; }
.cloud-band { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; z-index: 4; pointer-events: none;
  background:
    radial-gradient(70px 56px at 50% 100%, #F4FAFF 97%, transparent 100%) 0 100% / 130px 86px repeat-x,
    radial-gradient(54px 44px at 50% 100%, #F4FAFF 97%, transparent 100%) 65px 100% / 130px 104px repeat-x,
    linear-gradient(#F4FAFF, #F4FAFF) 0 100% / 100% 44px no-repeat;
  filter: drop-shadow(0 -6px 10px rgba(255, 255, 255, .9)); }

.hero-grid { position: relative; z-index: 3; width: min(1320px, 100%); margin-inline: auto;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "center center" "san sil"; align-items: end; gap: 0 4px; }
.hero-center { grid-area: center; display: grid; justify-items: center; text-align: center; gap: 14px; }
.hero-san { grid-area: san; }
.hero-sil { grid-area: sil; }
.hero-logo-wrap { margin: 0; width: min(330px, 84vw); }
.hero-logo-img { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 18px rgba(11, 42, 111, .25)); animation: logoIn .7s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes logoIn { from { transform: scale(.7) translateY(20px); opacity: 0; } }

.highlights { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: min(460px, 100%); }
.highlights li { display: grid; justify-items: center; gap: 2px; font-family: var(--font-head); font-weight: 600; color: var(--brand-navy); font-size: .98rem; line-height: 1.1; }
[dir="rtl"] .highlights li { font-family: var(--font-ar); font-weight: 800; }
.hl-ico { width: 56px; height: 56px; display: grid; place-items: center; font-size: 1.9rem; border-radius: 20px;
  background: radial-gradient(circle at 35% 25%, #fff, #E3F2FD 70%); box-shadow: 0 5px 0 #90CAF9, 0 10px 16px rgba(11, 42, 111, .15); }
.highlights li:nth-child(2) .hl-ico { box-shadow: 0 5px 0 var(--grape-l), 0 10px 16px rgba(11,42,111,.15); }
.highlights li:nth-child(3) .hl-ico { box-shadow: 0 5px 0 var(--orange-l), 0 10px 16px rgba(11,42,111,.15); }
.highlights li:nth-child(4) .hl-ico { box-shadow: 0 5px 0 var(--sun-l), 0 10px 16px rgba(11,42,111,.15); }

.cta-start { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 72px; padding: 10px 14px 10px 34px;
  border-radius: var(--r-pill); font-family: var(--font-head); font-weight: 700; font-size: 1.75rem; color: #B71C1C;
  background: linear-gradient(180deg, #FFF3B0 0%, #FFD54F 35%, var(--sun) 70%); border: 4px solid #fff;
  box-shadow: 0 8px 0 var(--sun-d), 0 16px 28px rgba(224, 161, 0, .45), inset 0 3px 0 rgba(255,255,255,.7);
  animation: pulse 2.2s ease-in-out infinite; transition: transform .08s; }
[dir="rtl"] .cta-start { padding: 10px 34px 10px 14px; font-family: var(--font-ar); font-weight: 800; }
.cta-start:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--sun-d); animation: none; }
.cta-play { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; color: #fff; padding-inline-start: 3px;
  background: radial-gradient(circle at 35% 30%, #FF8A80, var(--red) 60%, var(--red-d)); box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); }
[dir="rtl"] .cta-play { transform: scaleX(-1); }
.cta-sm { min-height: 60px; font-size: 1.35rem; }
.cta-sm .cta-play { width: 40px; height: 40px; font-size: 1.05rem; }
.hero-sub { font-weight: 800; color: var(--brand-navy); font-size: .95rem; opacity: .85; }
.link-demo { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }

.hero-char { position: relative; display: flex; justify-content: center; cursor: pointer; margin-bottom: -30px; }
.hero-char img { width: 100%; max-width: 190px; height: auto; display: block; filter: drop-shadow(0 16px 18px rgba(11, 42, 111, .28)); }
.hero-san img { animation: charIn .8s .1s cubic-bezier(.2, .9, .3, 1.2) both, sway 5s 1s ease-in-out infinite; transform-origin: bottom center; }
.hero-sil img { animation: charIn .8s .25s cubic-bezier(.2, .9, .3, 1.2) both, sway 5.5s 1.2s ease-in-out infinite reverse; transform-origin: bottom center; }
.hero-char.hop img { animation: hop .6s ease-out; }
@keyframes charIn { from { transform: translateY(60px) scale(.9); opacity: 0; } }
@keyframes sway { 50% { transform: rotate(-1.6deg) translateY(-4px); } }
@keyframes hop { 30% { transform: translateY(-22px) scale(1.03, .97); } 60% { transform: none; } }
.speech { position: absolute; top: 0; z-index: 2; max-width: 170px; padding: 8px 12px; border-radius: 16px; background: #fff; font-weight: 800;
  font-size: .85rem; color: var(--brand-navy); box-shadow: var(--shadow-soft); opacity: 0; transform: scale(.6); transition: .25s cubic-bezier(.2, .9, .3, 1.3); pointer-events: none; }
.speech-san { inset-inline-start: 4px; } .speech-sil { inset-inline-end: 4px; }
.hero-char.talking .speech { opacity: 1; transform: none; }

/* ---------- Section titles ---------- */
.sec-title { display: flex; align-items: center; justify-content: center; gap: 12px; text-align: center; font-size: clamp(1.5rem, 5vw, 2.3rem);
  color: var(--brand-navy); margin: 0 12px; line-height: 1.15; }
.sec-sub { text-align: center; color: var(--ink-2); font-weight: 700; margin: 6px 12px 18px; }
.spark { width: 26px; height: 26px; flex: none; background:
  linear-gradient(var(--sun), var(--sun)) 50% 0 / 4px 9px no-repeat, linear-gradient(var(--sun), var(--sun)) 0 60% / 9px 4px no-repeat,
  linear-gradient(var(--sun), var(--sun)) 100% 60% / 9px 4px no-repeat; transform: rotate(-12deg); }
.spark:last-child { transform: rotate(12deg) scaleX(-1); }

/* ---------- Worlds ---------- */
.worlds { position: relative; z-index: 4; padding: 0 12px 26px; margin-top: -8px; }
.world-grid { width: min(1320px, 100%); margin-inline: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
.world-card { display: grid; justify-items: center; transition: transform .18s; }
.world-card:hover { transform: translateY(-6px); }
.world-card:active { transform: translateY(2px); }
.wc-art { width: 100%; filter: drop-shadow(0 10px 14px rgba(11, 42, 111, .2)); }
.wc-art img { width: 100%; height: auto; display: block; }
.wc-label { margin-top: -18px; position: relative; z-index: 1; width: 92%; min-height: 54px; display: grid; place-items: center; padding: 6px 10px;
  border-radius: 22px; text-align: center; line-height: 1.05; font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--wc) 70%, #fff) 0%, var(--wc) 55%); border: 3px solid #fff;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--wc) 65%, #000), 0 12px 18px rgba(0, 0, 0, .15); text-shadow: 0 2px 0 rgba(0,0,0,.22); }
[dir="rtl"] .wc-label { font-family: var(--font-ar); font-weight: 800; }
.world-grid-sm { grid-template-columns: repeat(2, 1fr); }

/* ---------- Age groups ---------- */
.ages { padding: 6px 12px 34px; }
.ages-bar { width: min(1320px, 100%); margin-inline: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px;
  border-radius: 30px; background: rgba(255, 255, 255, .85); box-shadow: var(--shadow-card); }
.ages-title { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 10px 18px; border-radius: 22px;
  font-size: 1.35rem; color: #fff; background: linear-gradient(180deg, #2F5BC4, #12398F); box-shadow: 0 5px 0 #0B2A6F; }
.age-card { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 8px; border-radius: 22px; min-height: 76px;
  background: linear-gradient(180deg, #fff 0%, var(--ac) 100%); box-shadow: 0 5px 0 color-mix(in srgb, var(--ac) 55%, #8a8a8a), 0 10px 14px rgba(0,0,0,.08);
  border: 3px solid #fff; transition: transform .15s; }
.age-card:hover { transform: translateY(-4px); }
.ac-face { flex: none; width: 54px; height: 54px; border-radius: 50%; overflow: hidden; background: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.12); border: 3px solid #fff; }
.ac-face img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ac-text { display: grid; line-height: 1.1; min-width: 0; }
.ac-text b { font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; color: #B23A00; }
[dir="rtl"] .ac-text b { font-family: var(--font-ar); font-weight: 800; }
.ac-text small { font-weight: 800; color: var(--brand-navy); font-size: .88rem; }

/* ---------- Meet San & Sil ---------- */
.meet { padding: 10px 12px 34px; }
.meet-grid { width: min(980px, 100%); margin-inline: auto; display: grid; gap: 16px; }
.meet-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 28px; box-shadow: var(--shadow-card); border: 3px solid #fff; }
.meet-san { background: linear-gradient(135deg, #E3F2FD, #BBDEFB); }
.meet-sil { background: linear-gradient(135deg, #FCE4EC, #F8BBD0); }
.meet-card h3 { font-size: 2rem; line-height: 1; }
.meet-san h3 { color: var(--blue); } .meet-sil h3 { color: var(--pink-d); }
.meet-card h3 small { display: block; font-size: 1.15rem; color: var(--brand-navy); margin-top: 4px; }
.traits { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-weight: 800; }
.traits li::before { content: "✔"; color: var(--sun-d); margin-inline-end: 8px; }
.char { flex: none; display: block; width: 110px; }
.char img { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 10px rgba(11,42,111,.22)); }

/* ---------- How it works ---------- */
.how-it { padding: 10px 12px 50px; text-align: center; }
.how-steps { list-style: none; width: min(1100px, 100%); margin: 18px auto 24px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; counter-reset: s; }
.how-steps li { position: relative; display: grid; justify-items: center; gap: 6px; padding: 18px 12px 14px; border-radius: 24px; background: #fff; box-shadow: var(--shadow-card); }
.step-n { position: absolute; top: -12px; inset-inline-start: 12px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--red); color: #fff; font-family: var(--font-head); box-shadow: 0 3px 0 var(--red-d); }
.step-ico { font-size: 2.2rem; }
.how-steps p { font-weight: 800; color: var(--brand-navy); }

/* ---------- Inner pages ---------- */
.page-head { position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  width: min(1240px, 100% - 24px); margin: 18px auto 18px; padding: 20px 20px 0; border-radius: 30px; min-height: 150px;
  background: linear-gradient(135deg, #2F8CFF 0%, var(--blue) 50%, #4C3BCF 100%); color: #fff; box-shadow: var(--shadow-card); }
.page-head::before { content: ""; position: absolute; inset: auto -60px -120px auto; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.1); }
.ph-text { padding-bottom: 20px; position: relative; }
.page-head h1 { display: flex; align-items: center; gap: 10px; font-size: clamp(1.7rem, 5vw, 2.5rem); text-shadow: 0 3px 0 rgba(0,0,0,.18); }
.ph-ico { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; background: rgba(255,255,255,.2); font-size: 1.8rem; }
.page-head p { font-weight: 700; opacity: .95; margin-top: 6px; }
.ph-char { width: 96px; margin-bottom: -6px; position: relative; }
.sub-title { font-size: 1.5rem; color: var(--brand-navy); margin: 26px 4px 12px; }

.game-grid { display: grid; gap: 12px; }
.game-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 22px; background: #fff; box-shadow: 0 5px 0 color-mix(in srgb, var(--gc) 45%, #fff), var(--shadow-soft);
  border-inline-start: 6px solid var(--gc); transition: transform .15s; }
.game-card:hover { transform: translateY(-3px); }
.gc-ico { flex: none; width: 60px; height: 60px; display: grid; place-items: center; font-size: 2rem; border-radius: 18px;
  background: color-mix(in srgb, var(--gc) 18%, #fff); box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--gc) 35%, #fff); }
.gc-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.gc-body b { font-family: var(--font-head); font-weight: 600; font-size: 1.2rem; color: var(--brand-navy); }
[dir="rtl"] .gc-body b { font-family: var(--font-ar); font-weight: 800; }
.gc-body small { color: var(--ink-2); font-weight: 700; }
.gc-go { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .9rem; background: var(--gc); box-shadow: 0 3px 0 color-mix(in srgb, var(--gc) 60%, #000); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { padding: 8px 16px; border-radius: var(--r-pill); background: #fff; font-weight: 800; color: var(--brand-navy); box-shadow: 0 3px 0 #BBDEFB; }
.chip.is-active { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-d); }
.level-block { margin-top: 20px; padding: 16px; border-radius: 28px; background: #fff; box-shadow: var(--shadow-card); border-top: 8px solid var(--lc); }
.lb-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lb-ico { font-size: 2.4rem; }
.lb-head h2 { font-size: 1.4rem; color: var(--brand-navy); }
.lb-head p { color: var(--ink-2); font-weight: 700; }
.unit-grid { display: grid; gap: 12px; }
.unit-card { padding: 12px; border-radius: 22px; background: color-mix(in srgb, var(--uc) 10%, #fff); box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--uc) 30%, #fff); }
.unit-card h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 1.15rem; color: var(--brand-navy); margin-bottom: 8px; }
.unit-card h3 small { color: var(--ink-2); font-size: .9rem; margin-inline-start: auto; }
.u-ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--uc); color: #fff; font-size: 1.1rem; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.unit-card ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.unit-card li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #fff; font-weight: 800; }
.unit-card li a:hover { background: var(--cloud); }
.st-n { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--uc); color: #fff; font-family: var(--font-head); }
.st-n.boss { background: var(--sun); }
.st-g { margin-inline-start: auto; }

.challenge-grid { display: grid; gap: 14px; }
.challenge-card { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 18px; border-radius: 28px;
  background: linear-gradient(160deg, #FFF8E1, #FFE082); box-shadow: 0 6px 0 var(--sun-d), var(--shadow-soft); }
.cc-age { padding: 2px 12px; border-radius: var(--r-pill); background: #fff; font-weight: 800; color: #B23A00; font-size: .9rem; }
.cc-ico { font-size: 3rem; }
.challenge-card h2 { font-size: 1.25rem; color: var(--brand-navy); }
.cc-game, .cc-time { color: var(--ink-2); font-weight: 700; }
.cc-bonus { font-weight: 800; color: #92400E; }

.rules { padding: 18px; border-radius: 28px; background: #fff; box-shadow: var(--shadow-card); }
.rules h2 { font-size: 1.35rem; color: var(--brand-navy); margin-bottom: 10px; }
.rules ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rules li { display: flex; align-items: center; gap: 10px; font-weight: 800; padding: 10px 12px; border-radius: 16px; background: var(--cloud); }
.ach-grid, .shop-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ach { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 14px 8px; border-radius: 22px; background: #fff; box-shadow: var(--shadow-soft); }
.ach small { color: var(--ink-2); font-weight: 700; }
.shop-item { display: grid; justify-items: center; gap: 4px; padding: 14px 8px; border-radius: 22px; background: #fff; box-shadow: var(--shadow-soft); text-align: center; }
.si-ico { font-size: 2.4rem; }
.si-cost { padding: 2px 12px; border-radius: var(--r-pill); background: #FFF3CD; color: #92400E; font-weight: 800; }

.world-hero { width: min(1240px, 100% - 24px); margin: 18px auto 0; display: grid; gap: 14px; align-items: center; padding: 18px; border-radius: 32px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--wc) 15%, #fff), color-mix(in srgb, var(--wc) 35%, #fff)); box-shadow: var(--shadow-card); }
.wh-art img { width: 100%; max-width: 420px; height: auto; display: block; margin-inline: auto; filter: drop-shadow(0 12px 16px rgba(0,0,0,.18)); }
.wh-text { display: grid; gap: 10px; justify-items: start; }
.wh-text h1 { font-size: clamp(2rem, 6vw, 3rem); color: var(--wc); text-shadow: 0 3px 0 #fff; filter: brightness(.85); }
.wh-text p { font-weight: 700; font-size: 1.1rem; color: var(--brand-navy); }
.back-link { font-weight: 800; color: var(--blue); }
.empty { font-weight: 800; color: var(--ink-2); }

/* ---------- Auth & profiles ---------- */
.auth { width: min(1000px, 100% - 24px); margin: 22px auto 40px; display: grid; gap: 10px; align-items: end; }
.auth-art { display: flex; justify-content: center; align-items: flex-end; gap: 4px; }
.auth-art .char { width: 104px; }
.auth-card { padding: 22px 18px; border-radius: 30px; background: #fff; box-shadow: var(--shadow-card); border-top: 8px solid var(--blue); }
.auth-card h1 { font-size: 1.8rem; color: var(--brand-navy); }
.auth-sub { color: var(--ink-2); font-weight: 700; margin: 4px 0 14px; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field legend { font-weight: 800; color: var(--brand-navy); padding: 0; }
.field small { color: var(--ink-2); font-weight: 700; }
.field input[type="text"], .field input[type="email"], .field input[type="password"] { width: 100%; min-height: 54px; padding: 10px 16px; border-radius: 16px;
  border: 3px solid #D6E6FB; background: #F7FBFF; font: inherit; font-size: 1.1rem; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(13, 110, 253, .18); background: #fff; }
.pin-input { letter-spacing: 12px; text-align: center; font-size: 1.6rem !important; max-width: 220px; }
.field-row { display: grid; gap: 14px; }
.auth-switch { display: block; text-align: center; margin-top: 14px; font-weight: 800; color: var(--ink-2); }
.auth-switch a, a.auth-switch { color: var(--blue); }

.avatar-pick, .age-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.age-pick { grid-template-columns: 1fr 1fr; }
.avatar-opt input, .age-opt input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-opt span, .age-opt span { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; border-radius: 20px; cursor: pointer; text-align: center;
  background: var(--cloud); border: 3px solid transparent; font-weight: 800; box-shadow: inset 0 -4px 0 #BBDEFB; transition: transform .12s; }
.avatar-opt i { font-style: normal; font-size: 2.6rem; }
.age-opt span { background: color-mix(in srgb, var(--ac) 14%, #fff); box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--ac) 40%, #fff); }
.age-opt small { color: var(--ink-2); }
.avatar-opt input:checked + span, .age-opt input:checked + span { border-color: var(--blue); background: #fff; transform: translateY(-3px); box-shadow: 0 5px 0 var(--blue-d); }
.avatar-opt input:focus-visible + span, .age-opt input:focus-visible + span { outline: 4px solid var(--sun); }

.profiles { width: min(1000px, 100% - 24px); margin: 22px auto 40px; text-align: center; }
.profiles h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); color: var(--brand-navy); }
.profile-grid { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.profile-grid form { margin: 0; }
.profile-card { width: 100%; display: grid; justify-items: center; gap: 4px; padding: 18px 10px; border-radius: 28px; background: #fff;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--pc, #0D6EFD) 60%, #000), var(--shadow-soft); border: 3px solid color-mix(in srgb, var(--pc, #0D6EFD) 30%, #fff); transition: transform .15s; }
.profile-card:hover { transform: translateY(-5px); }
.pc-avatar { width: 84px; height: 84px; display: grid; place-items: center; font-size: 3rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--sun-l) 60%, var(--sun)); box-shadow: inset 0 -4px 0 rgba(224,161,0,.4); }
.profile-card b { font-family: var(--font-head); font-weight: 600; font-size: 1.4rem; color: var(--brand-navy); }
.profile-card small { color: var(--ink-2); font-weight: 700; }
.pc-stars { font-weight: 800; color: #92400E; }
.profile-card.add { border-style: dashed; box-shadow: var(--shadow-soft); }
.profile-card.add .pc-avatar { background: var(--cloud); color: var(--blue); box-shadow: inset 0 -4px 0 #BBDEFB; }

/* ---------- Footer ---------- */
.site-footer { background: linear-gradient(180deg, #12398F, #0B2A6F); color: #fff; padding: 30px 16px calc(24px + var(--safe-bottom)); margin-top: 20px; }
.sf-inner { width: min(1240px, 100%); margin-inline: auto; display: grid; gap: 16px; justify-items: center; text-align: center; }
.sf-brand { display: flex; align-items: center; gap: 12px; text-align: start; }
.sf-logo { width: 84px; height: auto; }
.sf-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-weight: 800; }
.sf-links a:hover { color: var(--sun); }
.sf-safe { padding: 6px 14px; border-radius: var(--r-pill); background: rgba(255,255,255,.12); font-weight: 800; }
.sf-copy { opacity: .75; font-size: .9rem; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (min-width: 480px) {
  .hero-char img { max-width: 230px; }
  .avatar-pick { grid-template-columns: repeat(3, 1fr); }
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  .sh-logo { width: 78px; }
  .sh-parent .lbl { display: inline; }
  .world-grid { grid-template-columns: repeat(3, 1fr); }
  .world-grid-sm { grid-template-columns: repeat(5, 1fr); }
  .ages-bar { grid-template-columns: repeat(4, 1fr); }
  .meet-grid { grid-template-columns: 1fr 1fr; }
  .how-steps { grid-template-columns: repeat(4, 1fr); }
  .char { width: 130px; }
  .game-grid, .unit-grid { grid-template-columns: repeat(2, 1fr); }
  .challenge-grid { grid-template-columns: repeat(2, 1fr); }
  .ach-grid { grid-template-columns: repeat(4, 1fr); }
  .shop-grid { grid-template-columns: repeat(6, 1fr); }
  .rules ul { grid-template-columns: 1fr 1fr; }
  .ph-char { width: 130px; }
  .world-hero { grid-template-columns: 1fr 1fr; padding: 28px; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .profile-grid { grid-template-columns: repeat(3, 1fr); }
  .age-pick { grid-template-columns: repeat(4, 1fr); }
  .hero-logo-wrap { width: 380px; }
  .hero-char img { max-width: 260px; }
}

@media (min-width: 1100px) {
  /* Desktop header: inline pill navigation like the approved design */
  .sh-nav, .sh-nav.open { display: block; animation: none; position: static; width: auto; padding: 0; background: rgba(255,255,255,.95); border-radius: var(--r-pill);
    box-shadow: 0 4px 0 #90CAF9, var(--shadow-soft); overflow: visible; margin-inline: auto; }
  .sh-nav ul { display: flex; gap: 2px; padding: 5px; }
  .sh-nav a { padding: 8px 16px; font-size: 1.05rem; }
  .sh-drawer-extra, .sh-burger { display: none; }
  .sh-actions { margin-inline-start: 0; }
  .nav-backdrop { display: none; }

  .hero-site { padding: 26px 20px 90px; }
  .hero-grid { grid-template-columns: 1fr minmax(420px, 1.15fr) 1fr; grid-template-areas: "san center sil"; align-items: center; }
  .hero-char { margin-bottom: -90px; }
  .hero-char img { max-width: 360px; }
  .hero-sil img { max-width: 390px; }
  .hero-logo-wrap { width: 400px; }
  .speech { top: 30px; font-size: 1rem; max-width: 200px; }
  .world-grid { grid-template-columns: repeat(6, 1fr); }
  .wc-label { font-size: 1.25rem; }
  .ages-bar { grid-template-columns: auto repeat(4, 1fr); align-items: center; padding: 10px; }
  .ages-title { grid-column: auto; height: 100%; }
  .game-grid { grid-template-columns: repeat(3, 1fr); }
  .unit-grid { grid-template-columns: repeat(3, 1fr); }
  .challenge-grid { grid-template-columns: repeat(4, 1fr); }
  .ach-grid { grid-template-columns: repeat(5, 1fr); }
  .auth { grid-template-columns: 1fr 1.2fr; align-items: center; }
  .auth-art .char { width: 180px; }
  .profile-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1600px) {
  .hero-logo-wrap { width: 460px; }
  .hero-char img { max-width: 420px; }
  .hero-sil img { max-width: 450px; }
}
@media (max-width: 379px) {
  .ac-face { width: 44px; height: 44px; }
  .ac-text b { font-size: 1rem; }
  .ac-text small { font-size: .8rem; }
  .highlights li { font-size: .85rem; }
  .hl-ico { width: 50px; height: 50px; font-size: 1.6rem; }
  .cta-start { font-size: 1.45rem; padding-inline-start: 24px; }
}

/* =====================================================================
   Parent area
   ===================================================================== */
.pwrap { width: min(1240px, 100% - 24px); margin: 18px auto 40px; display: grid; gap: 16px; }
.pwrap.narrow { width: min(820px, 100% - 24px); }
.pnav { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px; border-radius: 22px; background: #fff; box-shadow: var(--shadow-soft); }
.pnav a, .pnav button { padding: 10px 16px; border-radius: 16px; font-weight: 800; color: var(--brand-navy); font: inherit; font-weight: 800; }
.pnav a:hover, .pnav button:hover { background: var(--cloud); }
.pnav a.is-active { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-d); }
.pnav form { margin: 0 0 0 auto; margin-inline-start: auto; }
.phead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 18px; border-radius: 28px; color: #fff;
  background: linear-gradient(135deg, #2F8CFF, var(--blue) 55%, #4C3BCF); box-shadow: var(--shadow-card); }
.phead > div { flex: 1; min-width: 200px; }
.phead h1 { font-size: clamp(1.5rem, 5vw, 2.1rem); }
.phead p { font-weight: 700; opacity: .92; }
.pcard { padding: 18px; border-radius: 24px; background: #fff; box-shadow: var(--shadow-card); }
.pcard h2 { font-size: 1.2rem; color: var(--brand-navy); margin-bottom: 12px; }
.pcard h2 + .muted + h2, .pcard ul + h2 { margin-top: 16px; }
.pkids { display: grid; gap: 16px; }
.pkid { display: grid; gap: 12px; padding: 16px; border-radius: 26px; background: #fff; box-shadow: var(--shadow-card); border-top: 6px solid var(--ac); }
.pkid header { display: flex; align-items: center; gap: 12px; }
.pkid h2 { font-size: 1.5rem; color: var(--brand-navy); }
.pkid header small { color: var(--ink-2); font-weight: 700; }
.pk-av { width: 60px; height: 60px; flex: none; display: grid; place-items: center; font-size: 2.2rem; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--sun-l) 60%, var(--sun)); box-shadow: 0 4px 0 var(--sun-d); }
.pk-av.big { width: 84px; height: 84px; font-size: 3rem; box-shadow: 0 0 0 4px #fff, 0 6px 0 var(--sun-d); }
.pk-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pk-stats li { display: grid; padding: 8px 10px; border-radius: 16px; background: var(--cloud); }
.pk-stats b { font-family: var(--font-head); font-size: 1.2rem; color: var(--brand-navy); }
.pk-stats small { color: var(--ink-2); font-weight: 700; }
.pk-last { color: var(--ink-2); font-weight: 700; font-size: .9rem; }
.pkid footer { display: flex; gap: 8px; flex-wrap: wrap; }
.pkid footer .btn, .phead .btn { min-height: 46px; font-size: 1rem; padding: 6px 16px; }
.pchart { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; align-items: end; height: 150px; }
.pc-col { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; height: 100%; gap: 2px; min-width: 0; }
.pc-v { font-size: .7rem; font-weight: 800; color: var(--grape-d); }
.pc-bar { align-self: end; width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #B26CE0, var(--brand-purple)); }
.pc-col small { font-size: .72rem; font-weight: 800; color: var(--ink-2); }
.ptiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ptiles > div { display: grid; padding: 14px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-soft); }
.ptiles b { font-family: var(--font-head); font-size: 1.6rem; color: var(--blue); }
.ptiles small { color: var(--ink-2); font-weight: 800; }
.pgrid { display: grid; gap: 16px; }
.ptags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ptags li { padding: 6px 12px; border-radius: var(--r-pill); font-weight: 800; }
.ptags.ok li { background: #E8F5E9; color: var(--mint-d); }
.ptags.warn li { background: #FFF3E0; color: #E65100; }
.pbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pbars li { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: 10px; align-items: center; font-weight: 800; }
.pbars small { color: var(--ink-2); }
.pb { height: 12px; border-radius: 12px; background: #E3F2FD; overflow: hidden; }
.pb span { display: block; height: 100%; background: var(--sky); border-radius: inherit; }
.pb span.hi { background: var(--mint); } .pb span.lo { background: var(--orange); }
.ptable-wrap { overflow-x: auto; }
.ptable { width: 100%; border-collapse: collapse; font-size: .95rem; }
.ptable th, .ptable td { padding: 10px; text-align: start; border-bottom: 1px solid #E3F2FD; white-space: nowrap; }
.ptable th { color: var(--ink-2); font-size: .85rem; }
.ptable small { color: var(--ink-2); }
.pbadges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pbadges li { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 10px; border-radius: 18px; background: var(--cloud); }
.pbadges small { color: var(--ink-2); }
.auth-card.danger { border-top-color: var(--red); }
.auth-card.danger h2 { color: var(--red-d); }
.form-h { font-size: 1.2rem; color: var(--brand-navy); margin-top: 6px; }
.pin-card { text-align: center; }
.big-pin { margin: 0 auto; width: 100%; }
.kswitch { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 18px; background: #F5FAFF; font-weight: 800; cursor: pointer; }
.kswitch input { width: 22px; height: 22px; accent-color: var(--blue); }
.field input[type="number"] { width: 100%; min-height: 54px; padding: 10px 16px; border-radius: 16px; border: 3px solid #D6E6FB; background: #F7FBFF; font: inherit; font-size: 1.1rem; }
.profiles-parent { margin-top: 18px; }
@media (min-width: 640px) {
  .pk-stats { grid-template-columns: repeat(4, 1fr); }
  .ptiles { grid-template-columns: repeat(4, 1fr); }
  .pbadges { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) {
  .pkids { grid-template-columns: repeat(2, 1fr); }
  .pgrid { grid-template-columns: 1fr 1fr; align-items: start; }
}
