:root {
  --ink: #14352a;
  --muted: #3d6b58;
  --card: #fffdf7;
  --accent: #2f9e6b;
  --accent-2: #f4b942;
  --danger: #c62828;
  --ok: #1b7a4a;
  --shadow: 0 14px 40px rgba(20, 53, 42, 0.18);
  --font: "Nunito", "Noto Sans Myanmar", "Padauk", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: #8fd6a8;
  overflow-x: hidden;
}
.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #fff3b0 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, #b8f0d0 0%, transparent 50%),
    linear-gradient(180deg, #c8efd4 0%, #7ec995 48%, #4f9d72 100%);
}
.bg::after {
  content: "";
  position: absolute; inset: auto 0 0 0; height: 28%;
  background:
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(255,255,255,0.08) 28px 30px),
    linear-gradient(180deg, transparent, rgba(20,53,42,0.12));
}
.shell {
  position: relative; z-index: 1;
  max-width: 440px;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 36px;
  animation: rise 0.55s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.hero { text-align: center; margin-bottom: 14px; }
.badge {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,253,247,0.75);
  border: 1px solid rgba(20,53,42,0.12);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
h1 {
  margin: 0;
  font-size: clamp(1.7rem, 6vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 0 rgba(255,255,255,0.35);
}
.sub {
  margin: 0.45rem auto 0.9rem;
  max-width: 28em;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 600;
}
.meta {
  display: flex; justify-content: center; gap: 0.55rem; flex-wrap: wrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(255,253,247,0.82);
  border: 1px solid rgba(20,53,42,0.1);
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(20,53,42,0.08);
}
.chip b { color: var(--accent); font-variant-numeric: tabular-nums; }
.board {
  position: relative;
  height: min(360px, 58vh);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255,253,247,0.55), rgba(255,253,247,0.28));
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(6px);
}
.tile {
  position: absolute;
  width: 58px; height: 58px;
  border: 0;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 1.55rem;
  background: var(--card);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 6px 0 rgba(20,53,42,0.12),
    0 10px 18px rgba(20,53,42,0.12);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.18s ease;
}
.tile:active { transform: scale(0.92) translateY(2px); }
.tile.blocked {
  filter: brightness(0.72) saturate(0.85);
  cursor: not-allowed;
  box-shadow: 0 3px 0 rgba(0,0,0,0.08);
}
.slot-wrap { margin-top: 14px; }
.slot-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.slot {
  min-height: 72px;
  display: flex; gap: 8px; align-items: center;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,253,247,0.7);
  border: 1.5px dashed rgba(20,53,42,0.22);
  overflow-x: auto;
}
.slot .tile {
  position: static;
  width: 50px; height: 50px;
  font-size: 1.3rem;
  flex: 0 0 auto;
  animation: pop 0.22s ease;
}
@keyframes pop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.msg {
  min-height: 1.5em;
  text-align: center;
  font-weight: 800;
  margin: 12px 0 8px;
}
.msg.bad { color: var(--danger); }
.msg.ok { color: var(--ok); }
.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  background: linear-gradient(180deg, #3cb87f, var(--accent));
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 8px 0 #1f7a52, 0 12px 24px rgba(20,53,42,0.2);
  transition: transform 0.12s ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 4px 0 #1f7a52; }
.btn.ghost {
  margin-top: 10px;
  background: rgba(255,253,247,0.85);
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(20,53,42,0.12);
}
body.lang-my { --font: "Noto Sans Myanmar", "Padauk", "Nunito", system-ui, sans-serif; }
