:root {
  --bg: #0a0f1c;
  --bg-2: #101830;
  --panel: #131b31;
  --panel-2: #18213b;
  --line: rgba(160, 190, 230, .16);
  --text: #eef3ff;
  --muted: #8b97b5;
  --teal-1: #3cbad9;
  --teal-2: #137a93;
  --blue-1: #3d8bff;
  --blue-2: #2556c7;
  --orange-1: #ffb15c;
  --orange-2: #e5582a;
  --red-1: #ff5d6c;
  --red-2: #b3263a;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(60, 140, 220, .18), transparent 60%),
    radial-gradient(600px 400px at 100% 100%, rgba(60, 186, 217, .08), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- background sparkles ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.sky i {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: #6fe3f0; box-shadow: 0 0 12px 3px rgba(111, 227, 240, .55);
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }

/* ---------- board ---------- */
.board {
  position: relative;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 3.2%;
  padding: 5%;
  aspect-ratio: 1;
  width: 100%;
  border-radius: 26px;
  background: linear-gradient(180deg, #0f1629, #0c1222);
  border: 2px solid rgba(140, 175, 220, .28);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .6) inset,
    0 0 40px rgba(60, 140, 220, .12),
    0 30px 60px rgba(0, 0, 0, .45);
}
.board::before {
  content: ""; position: absolute; left: 12%; right: 12%; top: -2px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(150, 200, 255, .9), transparent);
  border-radius: 2px;
}
.tile {
  position: relative; aspect-ratio: 1; width: 100%;
  border-radius: 22%;
  background: linear-gradient(180deg, var(--teal-1), var(--teal-2));
  border: 2px solid rgba(200, 230, 255, .28);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .25),
    inset 0 -4px 10px rgba(0, 40, 60, .35),
    0 4px 10px rgba(0, 0, 0, .35);
  transition: transform .15s ease, filter .2s ease;
  display: grid; place-items: center;
}
.tile::after { /* subtle emblem like the reference */
  content: ""; position: absolute; width: 34%; height: 34%; left: 33%; top: 33%;
  border-radius: 50%; background: radial-gradient(circle, rgba(0, 50, 70, .16), transparent 70%);
}
.tile svg { position: absolute; inset: 6%; width: 88%; height: 88%; z-index: 1; }
.tile.is-star, .tile.is-trap { background: transparent; border-color: transparent; box-shadow: none; }
.tile.is-star::after, .tile.is-trap::after { display: none; }
.tile.is-star svg { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) both; filter: drop-shadow(0 6px 10px rgba(229, 88, 42, .35)); }
.tile.is-trap {
  background: linear-gradient(180deg, rgba(255, 93, 108, .12), rgba(179, 38, 58, .12));
  border: 2px solid rgba(255, 93, 108, .28);
}
.tile.is-trap svg { inset: 24%; width: 52%; height: 52%; animation: pop .35s ease-out both; }
.board.is-dim .tile:not(.is-star):not(.is-trap) { filter: saturate(.75) brightness(.8); }
@keyframes pop {
  0% { transform: scale(0) rotate(-25deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.tile.is-flip { animation: flip .3s ease-in both; }
@keyframes flip { to { transform: scale(.2); opacity: 0; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 28px; border-radius: 14px;
  font-weight: 700; font-size: 18px; letter-spacing: .2px; text-decoration: none;
  background: linear-gradient(180deg, var(--blue-1), var(--blue-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 24px rgba(37, 86, 199, .35);
  transition: transform .12s ease, filter .2s ease;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { filter: grayscale(.6) brightness(.7); cursor: default; }
.btn--wide { width: 100%; }
.btn--orange { background: linear-gradient(180deg, var(--orange-1), var(--orange-2)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 26px rgba(229, 88, 42, .38); }
.btn--ghost { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--line); font-size: 16px; min-height: 48px; }
