/* Shared styles for the Ghana Kids Learning Hub games */
:root {
  --ink: #1f2a44;
  --accent: #6366f1;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #ffd93d;
  --card: #ffffff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100%;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #0ea5e9 0%, #6366f1 55%, #a855f7 100%) fixed;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
body[data-theme="b1maths"]   { background: linear-gradient(170deg, #38bdf8 0%, #a5f3fc 55%, #fde68a 100%) fixed; }
body[data-theme="b1science"] { background: linear-gradient(170deg, #86efac 0%, #4ade80 50%, #22c55e 100%) fixed; }
body[data-theme="b1english"] { background: linear-gradient(170deg, #fda4af 0%, #f9a8d4 50%, #c4b5fd 100%) fixed; }
body[data-theme="b4science"] { background: linear-gradient(160deg, #06b6d4 0%, #3b82f6 55%, #6366f1 100%) fixed; }
body[data-theme="b4english"] { background: linear-gradient(160deg, #f97316 0%, #ec4899 55%, #8b5cf6 100%) fixed; }
body[data-theme="b7maths"]   { background: linear-gradient(170deg, #0f172a 0%, #1e3a8a 50%, #0ea5e9 100%) fixed; color: #fff; }
body[data-theme="b7english"] { background: linear-gradient(160deg, #134e4a 0%, #0f766e 45%, #6366f1 100%) fixed; color: #fff; }
body[data-theme="b7maths"] .card, body[data-theme="b7english"] .card { color: var(--ink); }

.screen { display: none; min-height: 100vh; padding: 14px 12px 70px; flex-direction: column; align-items: center; gap: 14px; }
.screen.active { display: flex; }
.center { justify-content: center; text-align: center; }

.card {
  background: var(--card); border-radius: 22px; padding: 18px; width: 100%; max-width: 980px;
  box-shadow: 0 8px 0 rgba(0,0,0,.14), 0 16px 34px rgba(0,0,0,.18);
}
h1.logo {
  color: #fff; font-size: clamp(2rem, 8vw, 3.8rem); line-height: 1.05; text-transform: uppercase;
  text-shadow: 0 5px 0 rgba(0,0,0,.25); letter-spacing: 1px; text-align: center;
}
.sub { color: #fff; font-size: clamp(1rem, 3.5vw, 1.25rem); text-shadow: 0 2px 0 rgba(0,0,0,.25); text-align: center; max-width: 760px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 800; background: rgba(0,0,0,.08); border-radius: 999px; padding: 2px 8px; letter-spacing: .5px; }

.btn {
  font-family: inherit; font-weight: 900; font-size: 1.1rem; color: #fff; background: var(--green);
  border: none; border-radius: 16px; padding: 12px 22px; cursor: pointer; box-shadow: 0 6px 0 #15803d;
  text-transform: uppercase; letter-spacing: 1px; transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #15803d; }
.btn.blue { background: #2563eb; box-shadow: 0 6px 0 #1e40af; }
.btn.blue:active { box-shadow: 0 2px 0 #1e40af; }
.btn.gray { background: #64748b; box-shadow: 0 6px 0 #334155; }
.btn.gray:active { box-shadow: 0 2px 0 #334155; }
.btn.pink { background: #db2777; box-shadow: 0 6px 0 #9d174d; }
.btn.pink:active { box-shadow: 0 2px 0 #9d174d; }
.btn.small { font-size: .9rem; padding: 8px 14px; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* mode / pack menu */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; width: 100%; max-width: 980px; }
.mode-card {
  background: #fff; border: 0; border-radius: 20px; padding: 16px 12px; cursor: pointer; font-family: inherit; color: var(--ink);
  box-shadow: 0 6px 0 rgba(0,0,0,.18); display: flex; flex-direction: column; gap: 6px; align-items: center; transition: transform .08s;
}
.mode-card:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.mode-card .ic { font-size: 2.6rem; }
.mode-card h3 { font-size: 1.1rem; }
.mode-card p { font-size: .85rem; color: #475569; }
.mode-card .best { font-size: .8rem; font-weight: 800; color: #b45309; }

/* HUD */
.hud {
  width: 100%; max-width: 980px; background: #fff; border-radius: 18px; padding: 8px 14px; display: flex;
  gap: 10px; align-items: center; justify-content: space-between; box-shadow: 0 5px 0 rgba(0,0,0,.16); color: var(--ink);
}
.hud .big { font-size: clamp(1.2rem, 4.5vw, 1.9rem); font-weight: 900; }
.hud small { display: block; font-size: .72rem; color: #64748b; text-transform: uppercase; letter-spacing: 1px; }
.hud .hearts { font-size: 1.5rem; color: #ef4444; letter-spacing: 2px; }
.pop { animation: kpop .25s ease-out; }
@keyframes kpop { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
.shake { animation: kshake .35s; }
@keyframes kshake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
.rise { animation: krise .25s ease-out; }
@keyframes krise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.bar { width: 100%; max-width: 980px; height: 12px; border-radius: 8px; background: rgba(255,255,255,.45); overflow: hidden; }
.bar > div { height: 100%; width: 100%; background: linear-gradient(90deg, #22c55e, #facc15, #ef4444); transition: width .1s linear; }

.qbox { background: #fff; border-radius: 20px; padding: 14px 16px; text-align: center; box-shadow: 0 6px 0 rgba(0,0,0,.16); width: 100%; max-width: 980px; color: var(--ink); }
.qbox .q { font-size: clamp(1.2rem, 4.4vw, 2rem); font-weight: 900; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 980px; }
.choice {
  font-family: inherit; font-weight: 900; font-size: clamp(1.05rem, 3.6vw, 1.5rem); color: var(--ink); background: #fff;
  border: 4px solid #c7d2fe; border-radius: 16px; padding: 14px 8px; cursor: pointer; min-height: 64px;
  box-shadow: 0 5px 0 rgba(0,0,0,.18); transition: transform .08s;
}
.choice:active { transform: translateY(3px); }
.choice.right { background: #bbf7d0; border-color: var(--green); }
.choice.wrong { background: #fecaca; border-color: var(--red); }
.choice:disabled { cursor: default; }

.feedback { background: #fff; border-radius: 18px; padding: 14px; box-shadow: 0 5px 0 rgba(0,0,0,.15); display: none; text-align: left; width: 100%; max-width: 980px; color: var(--ink); }
.feedback.show { display: block; animation: krise .25s ease-out; }
.feedback .res { font-size: 1.25rem; font-weight: 900; margin-bottom: 4px; }
.feedback .res.ok { color: var(--green); }
.feedback .res.no { color: var(--red); }
.feedback p { line-height: 1.45; margin-bottom: 10px; }

.overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.92); color: #fff; display: none; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; z-index: 50; text-align: center; padding: 20px;
}
.overlay.show { display: flex; }
.overlay h2 { font-size: 2.4rem; }

/* results */
.res-card { text-align: center; color: var(--ink); }
.big-score { font-size: clamp(3.5rem, 18vw, 7rem); font-weight: 900; color: var(--green); line-height: 1; animation: kpop .5s ease-out; }
.stars { font-size: 2.6rem; letter-spacing: 6px; }
.stat-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.stat { background: #eef2ff; border-radius: 14px; padding: 8px 14px; font-weight: 900; }
.stat small { display: block; font-size: .72rem; color: #475569; text-transform: uppercase; letter-spacing: 1px; }
.review { text-align: left; max-height: 36vh; overflow-y: auto; margin-top: 8px; }
.rev { border-radius: 12px; padding: 8px 12px; margin-bottom: 6px; font-weight: 700; }
.rev.ok { background: #dcfce7; }
.rev.no { background: #fee2e2; }
.rev small { display: block; font-weight: 600; color: #334155; }

/* fixed buttons */
.kit-fab {
  position: fixed; width: 46px; height: 46px; border-radius: 50%; border: none; background: #fff; font-size: 1.3rem;
  cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.25); z-index: 40; display: flex; align-items: center; justify-content: center;
  text-decoration: none; color: var(--ink);
}
.kit-home { left: 12px; bottom: 12px; }
.kit-mute { right: 12px; bottom: 12px; }
.kit-speech { right: 66px; bottom: 12px; }
.kit-fab.off { opacity: .55; }

#kit-fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
#kit-install { position: fixed; left: 66px; bottom: 12px; z-index: 45; padding: 10px 14px; border: 0; border-radius: 14px; background: #ffd93d; color: #1f2a44; font: 900 15px "Trebuchet MS", Arial, sans-serif; box-shadow: 0 4px 0 rgba(0,0,0,.3); cursor: pointer; }

@media (max-width: 640px) {
  .choices { gap: 8px; }
}
