:root {
  --ink: #1e293b; --muted: #64748b; --accent: #0ea5e9; --ok: #059669; --bad: #dc2626;
  --font: "Nunito", "Noto Sans Myanmar", "Padauk", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: var(--font); color: var(--ink); background: #bae6fd; }
.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle at 20% 0%, #fef9c3, transparent 40%),
    linear-gradient(180deg, #e0f2fe, #7dd3fc 55%, #38bdf8);
}
.shell { position: relative; z-index: 1; max-width: 440px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 16px 36px; animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hero { text-align: center; margin-bottom: 14px; }
.badge { display: inline-block; padding: .28rem .7rem; border-radius: 999px; background: rgba(255,255,255,.75); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
h1 { margin: 0; font-size: clamp(1.6rem, 6vw, 2.1rem); font-weight: 800; }
.sub { margin: .45rem auto .85rem; color: var(--muted); font-weight: 600; max-width: 28em; line-height: 1.4; }
.meta { display: flex; justify-content: center; }
.chip { display: inline-flex; gap: .35rem; align-items: center; padding: .4rem .75rem; border-radius: 999px; background: rgba(255,255,255,.85); font-weight: 700; font-size: .86rem; }
.chip b { color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.card {
  aspect-ratio: 1; border: 0; border-radius: 16px; perspective: 800px; background: transparent; padding: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.card .inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .4s ease; border-radius: 16px; }
.card.flipped .inner, .card.done .inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; display: grid; place-items: center;
  border-radius: 16px; font-size: 1.6rem; font-weight: 800;
}
.back {
  background: linear-gradient(145deg, #0284c7, #0369a1);
  color: #fff; box-shadow: 0 8px 18px rgba(3,105,161,.28);
}
.front {
  transform: rotateY(180deg); background: #fff; box-shadow: 0 8px 18px rgba(15,23,42,.12);
}
.card.done .front { background: #dcfce7; }
.msg { min-height: 1.4em; text-align: center; font-weight: 800; margin: 12px 0 8px; }
.msg.ok { color: var(--ok); } .msg.bad { color: var(--bad); }
.btn {
  display: block; width: 100%; border: 0; border-radius: 999px; padding: 13px 18px;
  background: rgba(255,255,255,.85); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 0 rgba(15,23,42,.1);
}
body.lang-my { --font: "Noto Sans Myanmar", "Padauk", "Nunito", system-ui, sans-serif; }
