:root {
  --ink: #f4f0ff;
  --muted: #c4b8f0;
  --card: #2a1f5c;
  --accent: #7c6cff;
  --accent-2: #4fc3f7;
  --danger: #ff6b8a;
  --ok: #69f0ae;
  --shadow: 0 16px 40px rgba(20, 10, 60, 0.45);
  --font: "Noto Sans Myanmar", "Nunito", "Padauk", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: #1a1040;
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    url(a/bg.webp) center/cover no-repeat,
    linear-gradient(180deg, #3d2a8a 0%, #1a1040 55%, #0d0828 100%);
}
.bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(26,16,64,0.35) 0%, rgba(26,16,64,0.55) 40%, rgba(13,8,40,0.82) 100%);
}
.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(124,108,255,0.28);
  border: 1px solid rgba(255,255,255,0.18);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
h1 {
  margin: 0;
  font-size: clamp(1.55rem, 5.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 12px rgba(80, 60, 200, 0.55);
}
.sub {
  margin: 0.45rem auto 0.9rem;
  max-width: 28em;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  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(42, 31, 92, 0.78);
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(10, 5, 40, 0.35);
}
.chip b { color: #b8a9ff; font-variant-numeric: tabular-nums; }
.board {
  position: relative;
  height: min(360px, 54vh);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(80,60,180,0.35), rgba(30,20,80,0.45));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.tile {
  position: absolute;
  width: 58px; height: 58px;
  border: 0;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #3d2f7a, #24185a);
  box-shadow:
    0 0 0 2px rgba(180, 160, 255, 0.55),
    0 5px 0 #1a1048,
    0 10px 18px rgba(10, 5, 40, 0.4);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.18s ease;
}
.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.tile:active { transform: scale(0.92) translateY(2px); }
.tile.blocked {
  filter: brightness(0.55) saturate(0.75);
  cursor: not-allowed;
  box-shadow: 0 3px 0 rgba(0,0,0,0.2);
}
.slot-wrap { margin-top: 14px; }
.slot-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  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(30, 20, 70, 0.72);
  border: 1.5px dashed rgba(160, 140, 255, 0.4);
  overflow-x: auto;
}
.slot .tile {
  position: static;
  width: 50px; height: 50px;
  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, #8b7cff, var(--accent));
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 8px 0 #3d2fa0, 0 12px 24px rgba(20, 10, 60, 0.35);
  transition: transform 0.12s ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 4px 0 #3d2fa0; }
.btn.ghost {
  margin-top: 10px;
  background: rgba(42, 31, 92, 0.85);
  color: var(--ink);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 4px 0 rgba(20, 10, 50, 0.5);
}
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(12, 8, 36, 0.62);
  backdrop-filter: blur(4px);
  padding: 16px;
}
.card {
  width: min(340px, 100%);
  background: linear-gradient(180deg, #3a2a7a, #24185a);
  border: 2px solid rgba(180, 160, 255, 0.45);
  border-radius: 22px;
  padding: 22px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0,0,0,0.4);
}
.card h2 { margin: 0 0 8px; color: #e8e0ff; font-size: 1.35rem; }
.card p { margin: 0 0 14px; color: var(--muted); line-height: 1.55; }
.card .btn { width: auto; min-width: 180px; margin: 0 auto; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .shell, .slot .tile { animation: none; }
}
