/* GCS Kids – styles. Palette pulled from the school logo (navy / red / silver) plus kid-friendly brights. */
:root {
  --navy: #1b2a5c;
  --red: #d0243a;
  --sky: #bfe8ff;
  --ink: #1d2447;
  --white: #fff;

  --c-red: #ef4b5f;     --c-red-d: #b8283b;
  --c-pink: #ff8fc1;    --c-pink-d: #d0568e;
  --c-blue: #3fa9f5;    --c-blue-d: #1f78c4;
  --c-green: #4cc76a;   --c-green-d: #2a9446;
  --c-purple: #a56cf0;  --c-purple-d: #7440c4;
  --c-gold: #ffbf2e;    --c-gold-d: #d48f00;

  --dock-h: 104px;
  --radius: 32px;
  --k: 1;               /* size multiplier for coins & bills */
}

* { box-sizing: border-box; }
/* everything is sized in rem, so the whole site scales gently with the screen */
html { -webkit-text-size-adjust: 100%; font-size: clamp(15px, 0.55vw + 12px, 20px); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Fredoka', 'Baloo 2', 'Comic Sans MS', 'Trebuchet MS', system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #8fd3ff 0%, var(--sky) 55%, #e9f9d8 100%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow-x: hidden;
}
body.has-dock { padding-bottom: calc(var(--dock-h) + 24px); }

/* Drifting clouds */
.clouds { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.clouds i {
  position: absolute; left: -200px; width: 160px; height: 52px; background: #fff; border-radius: 60px; opacity: .85;
  animation: drift 60s linear infinite;
}
.clouds i::before, .clouds i::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.clouds i::before { width: 70px; height: 70px; top: -32px; left: 24px; }
.clouds i::after  { width: 52px; height: 52px; top: -22px; left: 82px; }
.clouds i:nth-child(1) { top: 12%; animation-duration: 70s; }
.clouds i:nth-child(2) { top: 38%; transform: scale(.7); animation-duration: 95s; animation-delay: -30s; }
.clouds i:nth-child(3) { top: 70%; transform: scale(1.2); animation-duration: 120s; animation-delay: -60s; }
@keyframes drift { to { left: 110vw; } }

/* Header */
.top {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 24px;
  background: var(--navy);
  border-bottom: 6px solid var(--red);
  box-shadow: 0 6px 0 rgba(0,0,0,.08);
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; margin-right: auto; }
.brand img { height: 64px; width: auto; display: block; }
.brand-text { color: #fff; font-size: 2rem; font-weight: 600; letter-spacing: .5px; }
.brand-text b { color: #ffd34d; }
.grade-badge {
  background: #fff; color: var(--navy); font-weight: 600; font-size: 1.5rem;
  padding: 8px 22px; border-radius: 999px;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 8px 24px; border-radius: 999px;
  background: var(--c-gold); color: var(--navy); font-size: 1.4rem; font-weight: 600;
  text-decoration: none; box-shadow: 0 5px 0 var(--c-gold-d);
}
.pill:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--c-gold-d); }

main { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 28px 20px 40px; }

.big-title {
  text-align: center; margin: 12px 0 32px;
  font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 700; color: var(--navy);
  text-shadow: 0 4px 0 #fff;
}

/* Speaker button */
.speak {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; font-size: 1.7rem; line-height: 1;
  box-shadow: 0 4px 0 rgba(0,0,0,.2);
  vertical-align: middle;
}
.speak:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.card .speak { position: absolute; top: 14px; right: 14px; }

/* Big cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 28px; }
.card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 280px; padding: 28px 16px;
  border-radius: var(--radius); text-decoration: none; color: #fff; text-align: center;
  background: var(--bg); box-shadow: 0 10px 0 var(--bg-d), 0 18px 28px rgba(0,0,0,.18);
  transition: transform .15s ease;
}
.card:hover { transform: translateY(-6px) rotate(-1deg); }
.card:active { transform: translateY(6px); box-shadow: 0 4px 0 var(--bg-d); }
.card-icon { font-size: 5.5rem; line-height: 1.1; filter: drop-shadow(0 4px 0 rgba(0,0,0,.15)); }
.card-num  { font-size: 4rem; font-weight: 700; line-height: 1; text-shadow: 0 4px 0 var(--bg-d); }
.card-label { font-size: 2.2rem; font-weight: 700; text-shadow: 0 3px 0 var(--bg-d); }
.card-sub { font-size: 2rem; opacity: .9; }
.card.locked { filter: grayscale(.85); opacity: .6; cursor: not-allowed; }
.card.locked:hover { transform: none; }
.lock { background: rgba(0,0,0,.35); padding: 4px 16px; border-radius: 999px; font-size: 1.1rem; margin-top: 6px; }

.red, .c-red       { --bg: var(--c-red);    --bg-d: var(--c-red-d); }
.pink              { --bg: var(--c-pink);   --bg-d: var(--c-pink-d); }
.blue              { --bg: var(--c-blue);   --bg-d: var(--c-blue-d); }
.green             { --bg: var(--c-green);  --bg-d: var(--c-green-d); }
.purple            { --bg: var(--c-purple); --bg-d: var(--c-purple-d); }
.gold              { --bg: var(--c-gold);   --bg-d: var(--c-gold-d); }
.gold.card, .gold .card-label, .gold .card-num { color: var(--navy); }
.gold.card .card-label { text-shadow: 0 3px 0 rgba(255,255,255,.5); }

/* Category page banner + content area */
.cat-banner {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  background: var(--bg); color: #fff; border-radius: var(--radius);
  padding: 18px 24px; margin-bottom: 28px; box-shadow: 0 8px 0 var(--bg-d);
}
.cat-banner h1 { margin: 0; font-size: clamp(2.4rem, 6vw, 4rem); text-shadow: 0 4px 0 var(--bg-d); }
.cat-banner.gold { color: var(--navy); }
.cat-banner.gold h1 { text-shadow: 0 3px 0 rgba(255,255,255,.5); }
.cb-icon { font-size: 4rem; }

.content-area {
  background: #fff; border-radius: var(--radius); padding: 32px; text-align: center;
  box-shadow: 0 8px 0 rgba(0,0,0,.1);
}
.coming { padding: 40px 10px; }
.coming .emoji { font-size: 7rem; display: block; animation: bob 2s ease-in-out infinite; }
.coming h2 { font-size: 2.4rem; margin: 12px 0 4px; color: var(--navy); }
.coming p { font-size: 1.5rem; margin: 0; }
@keyframes bob { 50% { transform: translateY(-14px); } }

/* Bottom dock: always-visible, thumb-reachable subject switcher */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; gap: 12px; justify-content: center; align-items: stretch;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: var(--navy); border-top: 6px solid var(--red);
}
.dock-item {
  flex: 1 1 0; max-width: 260px; min-height: 80px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 24px; text-decoration: none; color: #fff; font-weight: 700; font-size: 1.6rem;
  background: var(--bg, #5b6aa8); box-shadow: 0 6px 0 var(--bg-d, #3d4a85);
  transition: transform .12s ease;
}
.dock-item.gold { color: var(--navy); }
.dock-item.home { --bg: #7d8bc6; --bg-d: #4c5a95; flex: 0 1 140px; }
.dock-item:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--bg-d, #3d4a85); }
.dock-item.active { outline: 5px solid #fff; outline-offset: 2px; transform: translateY(-6px) scale(1.04); }
.d-icon { font-size: 2.4rem; line-height: 1; }

:focus-visible { outline: 5px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 8px var(--navy); }

/* Phones / small tablets */
@media (max-width: 640px) {
  .brand img { height: 48px; }
  .brand-text { font-size: 1.5rem; }
  .card { min-height: 220px; }
  .dock-item { flex-direction: column; gap: 0; font-size: 1.15rem; min-height: 84px; }
  .dock-item.home { flex: 0 1 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .clouds i, .coming .emoji { animation: none; }
  .card, .dock-item { transition: none; }
}

/* ======================================================================
   RESPONSIVE: phones, tablets, landscape phones, big desktops
   ====================================================================== */
@media (min-width: 1100px) { :root { --k: 1.15; } }
@media (min-width: 1500px) { main { max-width: 1360px; } }

/* phones in portrait */
@media (max-width: 640px) {
  :root { --dock-h: 84px; --k: .8; }
  .top { flex-wrap: nowrap; gap: 8px; padding: 8px 12px; border-bottom-width: 5px; }
  .brand { gap: 8px; min-width: 0; }
  .brand img { height: 40px; }
  .brand-text { font-size: 1.25rem; white-space: nowrap; }
  .grade-badge { font-size: 1rem; padding: 5px 12px; white-space: nowrap; }
  .pill { min-height: 46px; padding: 6px 16px; font-size: 1.1rem; }
  main { padding: 14px 12px 24px; }
  .big-title { font-size: 1.9rem; margin: 6px 0 16px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 14px; }
  .cards > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .card { min-height: 170px; padding: 14px 8px; border-radius: 26px; box-shadow: 0 7px 0 var(--bg-d), 0 12px 18px rgba(0,0,0,.15); }
  .card-icon { font-size: 3.6rem; }
  .card-num { font-size: 2.4rem; }
  .card-label { font-size: 1.4rem; }
  .card-sub { font-size: 1.3rem; }
  .lock { font-size: .85rem; padding: 3px 10px; }
  .card .speak { width: 44px; height: 44px; font-size: 1.3rem; top: 8px; right: 8px; }
  .cat-banner { padding: 10px 14px; margin-bottom: 16px; box-shadow: 0 6px 0 var(--bg-d); }
  .cb-icon { font-size: 2.6rem; }
  .dock { gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top-width: 5px; }
  .dock-item { min-height: 62px; font-size: 1rem; flex-direction: column; gap: 0; border-radius: 18px; box-shadow: 0 4px 0 var(--bg-d, #3d4a85); }
  .d-icon { font-size: 1.9rem; }
  .dock-item.home { flex: 0 1 72px; }
}

/* phones turned sideways (short screens) */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --dock-h: 58px; --k: .75; }
  .top { padding: 5px 14px; border-bottom-width: 4px; box-shadow: none; }
  .brand img { height: 36px; }
  .brand-text { font-size: 1.2rem; }
  .grade-badge { font-size: 1rem; padding: 3px 14px; }
  .pill { min-height: 40px; padding: 4px 14px; font-size: 1.05rem; box-shadow: 0 3px 0 var(--c-gold-d); }
  main { padding: 10px 16px 16px; }
  .big-title { font-size: 1.7rem; margin: 2px 0 10px; }
  .cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
  .card { min-height: 150px; padding: 10px 6px; border-radius: 24px; box-shadow: 0 6px 0 var(--bg-d); }
  .card-icon { font-size: 3rem; }
  .card-num { font-size: 2rem; }
  .card-label { font-size: 1.25rem; }
  .card-sub { font-size: 1.1rem; }
  .card .speak { width: 38px; height: 38px; font-size: 1.1rem; top: 6px; right: 6px; }
  .cat-banner { display: none; }
  .dock { padding: 6px 10px; border-top-width: 4px; }
  .dock-item { min-height: 44px; flex-direction: row; gap: 8px; font-size: 1.1rem; border-radius: 16px; box-shadow: 0 4px 0 var(--bg-d, #3d4a85); }
  .d-icon { font-size: 1.5rem; }
  body.has-dock { padding-bottom: calc(var(--dock-h) + 8px); }
}

/* tablets in portrait: keep cards big but not gigantic */
@media (min-width: 641px) and (max-width: 900px) and (orientation: portrait) {
  .cards { gap: 22px; }
  .card { min-height: 240px; }
}
