/* Meiword Echo — game listening (dengar & tebak). Mandiri, pola sama seperti game Meiword lain. */
:root {
  --ink: #1e1b4b;
  --ink-soft: #44406e;
  --muted: #6d6a8f;
  --indigo: #4f46e5;
  --indigo-deep: #4338ca;
  --teal: #0d9488;
  --teal-deep: #0f766e;
  --gold: #f59e0b;
  --cream: #fffbf2;
  --card: #ffffff;
  --line: #e9e5f9;
  --good: #16a34a;
  --good-bg: #dcfce7;
  --bad: #dc2626;
  --bad-bg: #fee2e2;
  --shadow: 0 10px 30px rgba(30, 27, 75, .08);
  --emoji-font: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}
html.apple-emoji {
  --emoji-font: 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--cream);
  background-image: radial-gradient(#e7e2f7 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, .brand { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; }

/* ---------- nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 251, 242, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  max-width: 1060px; margin: 0 auto; padding: 12px 18px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.12rem; }
.brand .logo-badge {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  display: inline-flex; align-items: center; justify-content: center;
}
.brand .logo-badge svg { width: 20px; height: 20px; }
.brand em { font-style: normal; color: var(--teal-deep); }
.topnav .spacer { flex: 1; }
.nav-link { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .92rem; }
.nav-link:hover { color: var(--teal-deep); }
main { flex: 1; width: 100%; max-width: 1060px; margin: 0 auto; padding: 26px 18px 40px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 18px 0 26px; }
.kicker {
  display: inline-block; font-size: .74rem; font-weight: 800; letter-spacing: .16em;
  color: var(--teal-deep); background: #ccfbf1; border: 1px solid #99f6e4;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 14px;
}
.hero h1 { font-size: clamp(1.9rem, 5.4vw, 3rem); line-height: 1.08; font-weight: 800; }
.hero h1 .hl { color: var(--teal-deep); }
.hero p { color: var(--muted); max-width: 620px; margin: 14px auto 0; font-size: 1.02rem; line-height: 1.65; }
.hero .en-line { font-weight: 700; color: var(--ink-soft); letter-spacing: .02em; }

/* ---------- mode cards ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.mode-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 20px;
  padding: 20px; text-decoration: none; color: inherit; display: block;
  box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease;
}
.mode-card:hover { transform: translateY(-3px); border-color: #5eead4; }
.mode-top { display: flex; align-items: center; gap: 13px; }
.mode-dot {
  width: 52px; height: 52px; border-radius: 16px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.65rem; font-family: var(--emoji-font); color: #fff;
}
.mode-head-text { flex: 1; min-width: 0; }
.mode-head-text h2 { font-size: 1.18rem; font-weight: 800; }
.mode-kind { color: var(--muted); font-size: .84rem; font-weight: 600; margin-top: 2px; }
.lock-chip { font-size: .68rem; font-weight: 800; letter-spacing: .07em; padding: 5px 10px; border-radius: 999px; flex: none; }
.lock-chip.free { background: var(--good-bg); color: #15803d; }
.lock-chip.premium { background: #fef3c7; color: #b45309; }
.mode-sub { font-weight: 700; color: var(--ink-soft); margin-top: 14px; font-size: .97rem; }
.mode-desc { color: var(--muted); font-size: .9rem; line-height: 1.6; margin-top: 5px; }
.mode-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; align-items: center; }
.meta-chip { font-size: .76rem; font-weight: 700; background: #f1efff; color: var(--ink-soft); padding: 5px 10px; border-radius: 999px; }
.best-chip { font-size: .76rem; font-weight: 800; color: #b45309; }
.best-chip:empty { display: none; }
.note-strip {
  margin-top: 22px; background: #eef2ff; border: 1px solid #e0e7ff; color: var(--ink-soft);
  border-radius: 14px; padding: 13px 16px; font-size: .88rem; line-height: 1.6;
  display: flex; gap: 10px; align-items: flex-start;
}
.note-strip svg { flex: none; margin-top: 2px; }
footer.echo-footer {
  border-top: 1px solid var(--line); padding: 18px; text-align: center;
  color: var(--muted); font-size: .85rem; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
footer.echo-footer a { color: var(--teal-deep); font-weight: 600; text-decoration: none; }

/* ---------- play ---------- */
.play-wrap { max-width: 760px; margin: 0 auto; width: 100%; }
.card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow); padding: 26px 22px; text-align: center;
}
.start-dot {
  width: 92px; height: 92px; border-radius: 50%; margin: 4px auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.9rem; font-family: var(--emoji-font); color: #fff;
}
.start-dot svg { width: 46px; height: 46px; }
.card h1 { font-size: 1.65rem; font-weight: 800; }
.start-sub { color: var(--teal-deep); font-weight: 700; margin-top: 4px; }
.start-desc { color: var(--muted); line-height: 1.65; margin: 12px auto 20px; max-width: 480px; font-size: .96rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: inherit; font-weight: 800; font-size: 1rem; cursor: pointer;
  border: none; border-radius: 999px; padding: 14px 28px; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--teal), var(--teal-deep)); color: #fff; box-shadow: 0 8px 20px rgba(13, 148, 136, .3); }
.btn-primary:hover { box-shadow: 0 10px 24px rgba(13, 148, 136, .38); }
.btn-ghost { background: #f1efff; color: var(--ink); }
.btn-ghost:hover { background: #e6e2fb; }
.btn-gold { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; box-shadow: 0 8px 20px rgba(245, 158, 11, .3); }

.hud { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.hud-stat { font-size: .78rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.hud-stat b { display: block; font-size: 1.12rem; color: var(--ink); letter-spacing: 0; font-family: 'Bricolage Grotesque', sans-serif; }
.hud-stat.streak b { color: #ea580c; }
.progress { flex: 1; min-width: 110px; height: 10px; background: #eceafd; border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; width: 0%; background: linear-gradient(90deg, var(--teal), #2dd4bf); border-radius: 999px; transition: width .4s ease; }

.listen-stage { padding: 8px 0 2px; }
.btn-listen {
  width: 118px; height: 118px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #14b8a6, #0f766e); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 30px rgba(13, 148, 136, .35);
  transition: transform .12s ease;
}
.btn-listen:hover { transform: scale(1.04); }
.btn-listen:active { transform: scale(.96); }
.btn-listen svg { width: 54px; height: 54px; }
.eq { display: flex; gap: 5px; justify-content: center; align-items: flex-end; height: 26px; margin-top: 16px; }
.eq span { width: 6px; border-radius: 3px; background: #99f6e4; height: 8px; }
.eq.playing span { background: var(--teal); animation: eqBounce .7s ease-in-out infinite; }
.eq.playing span:nth-child(2) { animation-delay: .12s; }
.eq.playing span:nth-child(3) { animation-delay: .24s; }
.eq.playing span:nth-child(4) { animation-delay: .36s; }
.eq.playing span:nth-child(5) { animation-delay: .48s; }
@keyframes eqBounce { 0%, 100% { height: 8px; } 50% { height: 24px; } }
.btn-replay {
  margin-top: 12px; background: none; border: none; cursor: pointer; font-family: inherit;
  color: var(--teal-deep); font-weight: 800; font-size: .92rem; display: inline-flex; gap: 7px; align-items: center;
}
.btn-replay:hover { text-decoration: underline; }
.prompt-text { font-weight: 700; color: var(--ink-soft); margin: 18px 0 14px; font-size: 1rem; }
.feedback-line { min-height: 26px; font-weight: 800; margin-top: 14px; font-size: .98rem; }
.feedback-line.good { color: var(--good); }
.feedback-line.bad { color: var(--bad); }

.options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.opt-card {
  background: #fff; border: 2px solid var(--line); border-radius: 18px; cursor: pointer;
  padding: 16px 10px 13px; font-family: inherit; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  transition: border-color .12s ease, transform .12s ease, background .12s ease;
}
.opt-card:hover:not(:disabled) { border-color: #5eead4; transform: translateY(-2px); }
.opt-card:disabled { cursor: default; opacity: .92; }
.opt-emoji { font-size: 2.9rem; line-height: 1.1; font-family: var(--emoji-font); }
.opt-word { font-weight: 800; font-size: 1rem; min-height: 1.25em; }
.opt-meaning { font-size: .8rem; color: var(--muted); font-weight: 600; min-height: 1.1em; }
.opt-card.correct { border-color: var(--good); background: var(--good-bg); }
.opt-card.wrong { border-color: var(--bad); background: var(--bad-bg); animation: shake .35s ease; }
.opt-card.dim { opacity: .45; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.options.text-mode { grid-template-columns: 1fr; }
.opt-card.text { align-items: flex-start; text-align: left; padding: 15px 17px; }
.opt-card.text .opt-meaning { font-size: 1rem; color: var(--ink); font-weight: 700; min-height: 0; }

/* ---------- end ---------- */
.end-stars { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.end-stars svg { width: 44px; height: 44px; }
.end-stars .off { opacity: .18; }
.end-stats { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0 6px; }
.stat-box { background: #f7f6ff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; min-width: 96px; }
.stat-box b { display: block; font-size: 1.25rem; font-family: 'Bricolage Grotesque', sans-serif; }
.stat-box span { font-size: .72rem; font-weight: 800; letter-spacing: .07em; color: var(--muted); }
.review-list { text-align: left; margin: 18px 0 6px; display: flex; flex-direction: column; gap: 9px; }
.review-item {
  display: flex; align-items: center; gap: 12px; background: #fbfbfe;
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 13px;
}
.review-item .r-emoji { font-size: 1.7rem; font-family: var(--emoji-font); flex: none; }
.review-item .r-main { flex: 1; min-width: 0; }
.review-item .r-word { font-weight: 800; font-size: .97rem; }
.review-item .r-meaning { color: var(--muted); font-size: .85rem; font-weight: 600; }
.review-item .r-badge { font-size: .7rem; font-weight: 800; padding: 4px 9px; border-radius: 999px; flex: none; }
.r-badge.first { background: var(--good-bg); color: #15803d; }
.r-badge.second { background: #fef3c7; color: #b45309; }
.r-badge.missed { background: var(--bad-bg); color: #b91c1c; }
.btn-mini-listen {
  flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid #99f6e4;
  background: #f0fdfa; color: var(--teal-deep); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-mini-listen:hover { background: #ccfbf1; }
.cta-card {
  margin-top: 20px; background: linear-gradient(135deg, #1e1b4b, #312e81); color: #fff;
  border-radius: 18px; padding: 20px; text-align: center;
}
.cta-card h3 { font-size: 1.15rem; }
.cta-card p { color: #c7d2fe; font-size: .9rem; margin: 6px 0 14px; }
.end-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.hidden { display: none !important; }

@media (max-width: 560px) {
  .options { grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .opt-emoji { font-size: 2.3rem; }
  .opt-word { font-size: .88rem; }
  .btn-listen { width: 104px; height: 104px; }
  .card { padding: 22px 15px; }
  .hud { gap: 10px; }
}
