/* ============================================================
   MEIWORD WORD SPRINT — fast vocab game (Junior & Umum)
   Cream + indigo identity, mobile-first, tactile cards.
   ============================================================ */

:root {
  --ink: #1e1b4b;
  --indigo: #6366f1;
  --indigo-dark: #4338ca;
  --indigo-soft: #eef2ff;
  --gold: #f59e0b;
  --gold-soft: #fef3c7;
  --mint: #10b981;
  --mint-soft: #d1fae5;
  --rose: #f43f5e;
  --rose-soft: #ffe4e6;
  --bg: #fdfbf7;
  --card: #ffffff;
  --muted: #6b7280;
  --line: #e9e7f5;
  --nav-height: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  background-image: radial-gradient(#e7e4f7 1.1px, transparent 1.1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, .display { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; }

a { color: inherit; }

/* ---------- top nav ---------- */
.sprint-top-nav {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-height);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: rgba(253, 251, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 1.12rem; }
.brand-badge {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--indigo), var(--indigo-dark));
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-badge svg { width: 18px; height: 18px; }
.nav-link { font-size: 0.88rem; font-weight: 600; color: var(--indigo-dark); text-decoration: none; }
.nav-link:hover { text-decoration: underline; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.92rem; color: var(--ink); text-decoration: none; }
.back-link svg { width: 18px; height: 18px; }

/* ---------- layout ---------- */
.wrap { max-width: 620px; margin: 0 auto; padding: 26px 16px 56px; position: relative; z-index: 1; }
.wrap-play { max-width: 560px; }

/* ---------- hero / index ---------- */
.kicker {
  display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em;
  color: var(--indigo-dark); background: var(--indigo-soft);
  padding: 5px 11px; border-radius: 999px; margin-bottom: 12px;
}
.hero h1 { font-size: clamp(2.1rem, 7vw, 3rem); font-weight: 800; line-height: 1.05; }
.hero h1 .hl { color: var(--indigo); }
.hero p { margin-top: 10px; color: var(--muted); font-size: 1rem; line-height: 1.55; max-width: 46ch; }

.mode-grid { display: grid; gap: 16px; margin-top: 26px; }
@media (min-width: 560px) { .mode-grid { grid-template-columns: 1fr 1fr; } }

.mode-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px; box-shadow: 0 10px 28px rgba(30, 27, 75, 0.06);
  display: flex; flex-direction: column; gap: 10px;
}
.mode-visual { height: 64px; display: flex; align-items: center; }
.mode-visual .big-emoji { font-size: 52px; line-height: 1; }
.mode-visual .big-svg { width: 54px; height: 54px; }
.mode-card h2 { font-size: 1.35rem; font-weight: 800; }
.mode-card p { color: var(--muted); font-size: 0.92rem; line-height: 1.5; flex: 1; }
.best-chip {
  align-self: flex-start; font-size: 0.78rem; font-weight: 700;
  background: var(--gold-soft); color: #92400e;
  padding: 4px 10px; border-radius: 999px;
}
.best-chip:empty { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 0.95rem; text-decoration: none;
  border-radius: 13px; padding: 13px 16px; border: 2px solid transparent;
  cursor: pointer; touch-action: manipulation; transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--indigo); color: #fff; box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35); }
.btn-primary:hover { background: var(--indigo-dark); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--indigo); color: var(--indigo-dark); }
.btn-gold { background: var(--gold); color: #451a03; box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35); }
.btn svg { width: 17px; height: 17px; flex: none; }
.mode-actions { display: grid; gap: 9px; }

.howto { margin-top: 30px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.howto h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 12px; }
.howto ol { list-style: none; display: grid; gap: 11px; }
.howto li { display: flex; gap: 11px; align-items: flex-start; font-size: 0.93rem; line-height: 1.5; color: #374151; }
.step-n {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--indigo); color: #fff; font-weight: 800; font-size: 0.8rem;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 1px;
}
.marathon-note {
  margin-top: 16px; display: flex; gap: 11px; align-items: flex-start;
  background: var(--indigo-soft); border-radius: 16px; padding: 15px 17px;
  font-size: 0.9rem; line-height: 1.5; color: var(--ink);
}
.marathon-note svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.foot { margin-top: 30px; text-align: center; color: var(--muted); font-size: 0.82rem; }

/* ---------- play ---------- */
.hud { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.hud-pill {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px; font-weight: 800; font-size: 0.9rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.hud-pill svg { width: 15px; height: 15px; }
.hud-score { margin-left: auto; background: var(--ink); color: #fff; border-color: var(--ink); }
.hud-combo { background: var(--gold-soft); border-color: #fde68a; color: #92400e; }

.timer-track { height: 10px; border-radius: 999px; background: #e9e7f5; overflow: hidden; margin-bottom: 16px; }
.timer-fill {
  height: 100%; width: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--indigo), var(--gold));
  transition: width 0.1s linear;
}
.timer-fill.danger { background: var(--rose); animation: pulse 0.5s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.55; } }

.hearts { display: flex; gap: 5px; align-items: center; margin-bottom: 16px; }
.hearts .lbl { font-size: 0.82rem; font-weight: 700; color: var(--muted); margin-right: 3px; }
.heart { width: 24px; height: 24px; }
.heart path { fill: var(--rose); }
.heart.off path { fill: #e5e7eb; }

.word-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 12px 30px rgba(30, 27, 75, 0.07);
  padding: 26px 20px 22px; text-align: center; margin-bottom: 16px;
  position: relative;
}
.word-emoji { font-size: 76px; line-height: 1.15; }
.word-text { font-size: clamp(2.1rem, 9vw, 3.2rem); font-weight: 800; letter-spacing: -0.01em; margin-top: 2px; }
.speak-btn {
  margin-top: 12px; display: inline-flex; align-items: center; gap: 7px;
  background: var(--indigo-soft); color: var(--indigo-dark); border: none; cursor: pointer;
  font-weight: 700; font-size: 0.86rem; padding: 9px 15px; border-radius: 999px;
  touch-action: manipulation;
}
.speak-btn svg { width: 16px; height: 16px; }
.speak-btn:hover { background: #e0e7ff; }

.options { display: grid; gap: 11px; }
.opt-btn {
  width: 100%; text-align: left; background: var(--card);
  border: 2px solid var(--line); border-radius: 15px;
  padding: 16px 17px; font-size: 1.05rem; font-weight: 600; color: var(--ink);
  cursor: pointer; touch-action: manipulation; font-family: inherit;
  transition: border-color 0.1s ease, background 0.1s ease, transform 0.08s ease;
}
.opt-btn:hover { border-color: var(--indigo); }
.opt-btn:active { transform: scale(0.99); }
.opt-btn.ok { background: var(--mint-soft); border-color: var(--mint); color: #065f46; }
.opt-btn.bad { background: var(--rose-soft); border-color: var(--rose); color: #881337; animation: shake 0.32s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ---------- overlays & result ---------- */
.overlay-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 12px 30px rgba(30, 27, 75, 0.07);
  padding: 30px 22px; text-align: center;
}
.overlay-card h2 { font-size: 1.6rem; font-weight: 800; }
.overlay-card p { color: var(--muted); line-height: 1.55; margin: 10px auto 20px; max-width: 40ch; }
.overlay-card .btn { min-width: 190px; }
.result-score { font-family: 'Bricolage Grotesque', sans-serif; font-size: 3.6rem; font-weight: 800; line-height: 1; color: var(--indigo-dark); }
.result-stats { color: #374151; font-weight: 600; margin-top: 8px; }
.result-best { color: var(--muted); font-size: 0.9rem; margin-top: 5px; }
.result-actions { display: grid; gap: 9px; margin-top: 22px; }
.cta-card {
  display: block; margin-top: 14px; text-align: left; text-decoration: none;
  background: var(--gold-soft); border: 1px solid #fde68a; border-radius: 16px; padding: 15px 17px;
}
.cta-card b { display: block; font-size: 0.97rem; margin-bottom: 3px; }
.cta-card span { font-size: 0.88rem; color: #78716c; line-height: 1.45; }

/* emoji rendering: one Android set via webfont; Apple devices use their
   native set (class set by the <head> detect script — see sprint pages). */
.sprint-emoji, .word-emoji, .mode-visual .big-emoji {
  font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}
html.apple-emoji .sprint-emoji,
html.apple-emoji .word-emoji,
html.apple-emoji .mode-visual .big-emoji {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}
