/* Baca Yuk! — design system, mobile-first, zero framework */
:root {
  --c-sun: #FFC93C; --c-orange: #FF9F45; --c-blue: #4D96FF;
  --c-green: #6BCB77; --c-red: #FF6B6B; --c-cream: #FFF8EC;
  --c-ink: #3D3B4A; --c-white: #FFFFFF;
  --radius: 20px; --radius-sm: 12px;
  --space: 16px; --space-lg: 24px;
  --shadow: 0 4px 14px rgba(61, 59, 74, .12);
  --font: "Baloo 2", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font); background: var(--c-cream); color: var(--c-ink);
  min-height: 100vh; display: flex; flex-direction: column; line-height: 1.5;
}
main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: var(--space); }

/* ---- Header ---- */
.topbar {
  position: sticky; top: 0; z-index: 10; background: var(--c-cream);
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px var(--space); box-shadow: 0 2px 8px rgba(61,59,74,.06);
}
.brand { border: 0; background: none; font: 800 1.35rem var(--font); color: var(--c-ink); cursor: pointer; display: flex; gap: 8px; align-items: center; }
.score-pill { background: var(--c-blue); color: #fff; font-weight: 700; font-size: .85rem; padding: 4px 14px; border-radius: 999px; }

/* ---- Views ---- */
.view { display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* ---- Hero ---- */
.hero { text-align: center; padding: 28px 0 8px; }
.hero h1 { font-size: clamp(2rem, 8vw, 3rem); line-height: 1.15; }
.hero .hl { color: var(--c-orange); }
.hero p { margin: 12px auto 20px; max-width: 480px; font-size: 1.05rem; color: #6a6878; }

/* ---- Buttons ---- */
.btn-primary {
  font: 800 1.1rem var(--font); color: #fff; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--c-orange), var(--c-sun));
  padding: 14px 32px; border-radius: 999px; box-shadow: var(--shadow);
  transition: transform .15s;
}
.btn-primary:hover { transform: scale(1.04); }
.btn-primary:active { transform: scale(.97); }
.btn-lg { font-size: 1.25rem; padding: 16px 40px; }
.btn-ghost {
  font: 700 1rem var(--font); color: var(--c-blue); background: none;
  border: 2px solid var(--c-blue); border-radius: 999px; padding: 8px 18px; cursor: pointer;
}
.btn-ghost:hover { background: rgba(77,150,255,.08); }

/* ---- Cards ---- */
.card {
  background: var(--c-white); border: 0; border-radius: var(--radius);
  box-shadow: var(--shadow); cursor: pointer; font-family: var(--font);
  transition: transform .15s;
}
.card:hover { transform: translateY(-3px); }
.card:active { transform: scale(.97); }

.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space); margin: var(--space) 0; }
.mode-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px; }
.mode-icon { font-size: 2.6rem; }
.mode-title { font-size: 1.05rem; font-weight: 800; }
.mode-desc { font-size: .85rem; color: #6a6878; text-align: center; }

.sec-title { margin: 28px 0 12px; font-size: 1.3rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.chip {
  font: 700 1rem var(--font); border: 0; cursor: pointer; border-radius: 999px;
  padding: 10px 18px; color: #fff; box-shadow: var(--shadow); transition: transform .15s;
}
.chip:hover { transform: scale(1.05); }
.cat-chip:nth-child(6n+1) { background: var(--c-orange); }
.cat-chip:nth-child(6n+2) { background: var(--c-blue); }
.cat-chip:nth-child(6n+3) { background: var(--c-green); }
.cat-chip:nth-child(6n+4) { background: var(--c-red); }
.cat-chip:nth-child(6n+5) { background: #9B5DE5; }
.cat-chip:nth-child(6n+6) { background: var(--c-ink); }

/* ---- Category ---- */
.cat-head { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.btn-reset { color: var(--c-red); border-color: var(--c-red); }
.btn-reset:hover { background: rgba(255,107,107,.08); }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space); margin-top: var(--space); }
.cat-card { padding: 26px 16px; text-align: center; }
.cat-name { display: block; font-size: 1.25rem; font-weight: 800; }
.cat-count { display: block; font-size: .85rem; color: #6a6878; margin-top: 4px; }

/* ---- Game ---- */
.game-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 20px; }
.progress-wrap { flex: 1; background: #eee; border-radius: 999px; height: 14px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--c-green), var(--c-blue)); border-radius: 999px; transition: width .3s; }
.q-progress { font-weight: 800; font-size: .95rem; }
.q-emoji { text-align: center; font-size: clamp(3.5rem, 18vw, 5.5rem); line-height: 1.1; min-height: 1.2em; }
.q-word {
  text-align: center; font-size: clamp(2.6rem, 12vw, 4rem); font-weight: 800;
  letter-spacing: .08em; margin: 8px 0 20px; min-height: 1.2em;
}
.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.option-card {
  font-size: clamp(2.2rem, 10vw, 3.4rem); padding: 18px 8px; text-align: center;
  display: flex; align-items: center; justify-content: center; min-height: 110px;
  border: 3px solid transparent;
}
.opt-emoji { font-size: clamp(3rem, 14vw, 4.5rem); }
.option-card.correct { border-color: var(--c-green); background: #E8F9EC; animation: pop .3s; }
.option-card.wrong { border-color: var(--c-red); background: #FFEDED; animation: shake .3s; }
@keyframes pop { 50% { transform: scale(1.1); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.feedback { text-align: center; font-weight: 800; font-size: 1.3rem; min-height: 2.2em; margin-top: 14px; }
.feedback.good { color: var(--c-green); }
.feedback.bad { color: var(--c-red); }

/* ---- Result ---- */
.result-card { text-align: center; padding: 40px 16px; background: var(--c-white); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 30px; }
.res-stars { font-size: clamp(2.6rem, 12vw, 4rem); letter-spacing: .15em; }
.result-card h2 { font-size: 1.7rem; margin: 8px 0; }
.result-card p { color: #6a6878; margin-bottom: 20px; }
.result-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* ---- Footer ---- */
footer { text-align: center; padding: 24px var(--space) 30px; color: #6a6878; font-size: .95rem; }
footer a { color: var(--c-blue); text-decoration: none; font-weight: 700; }
.foot-small { font-size: .8rem; margin-top: 6px; }

/* ---- A11y ---- */
:focus-visible { outline: 3px solid var(--c-blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (min-width: 720px) {
  .option-grid { grid-template-columns: repeat(4, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
