/* ============ Diwali Lucky Draw — visual system ============ */

@font-face {
  font-family: 'Marcellus';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/marcellus-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/outfit-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Rozha One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/rozha-devanagari.woff2') format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC, U+A830-A839, U+A8E0-A8FF;
}

:root {
  --bg-0: #0b0208;
  --bg-1: #190411;
  --bg-2: #2a0720;
  --bg-3: #35113f;
  --gold-1: #fff5d3;
  --gold-2: #f6d891;
  --gold-3: #e2b356;
  --gold-4: #a9782f;
  --rose: #ff5f8f;
  --saffron: #ff9a2e;
  --marigold: #ffc94a;
  --cream: #ffeede;
  --muted: rgba(255, 230, 205, .58);
  --line: rgba(255, 214, 140, .22);
  --font-ui: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Marcellus', 'Times New Roman', serif;
  --font-hindi: 'Rozha One', 'Marcellus', serif;
  --ease-spring: cubic-bezier(.2, .9, .25, 1.25);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  background: var(--bg-0);
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-ui);
  color: var(--cream);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(255, 200, 120, .3); }

:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 3px;
}

.app {
  position: relative;
  min-height: 100dvh;
  isolation: isolate;
}

/* ============ ambient scene ============ */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.scene__wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 78% at 50% -12%, #641134 0%, rgba(74, 12, 40, .55) 34%, transparent 62%),
    radial-gradient(90% 60% at 6% 8%, #3c1256 0%, transparent 58%),
    radial-gradient(85% 65% at 102% 26%, #4d0a26 0%, transparent 55%),
    radial-gradient(120% 80% at 50% 108%, #46102f 0%, transparent 60%),
    linear-gradient(180deg, #1c0413 0%, #12030d 45%, #0a0207 100%);
}

.scene__mandala {
  position: absolute;
  left: 50%;
  top: -8%;
  width: min(168vw, 980px);
  height: auto;
  transform: translateX(-50%);
  color: var(--gold-3);
  opacity: .16;
  animation: spin 160s linear infinite;
  filter: drop-shadow(0 0 20px rgba(255, 190, 90, .18));
}

.scene__lights {
  position: absolute;
  inset: 0 0 auto 0;
  height: 148px;
  opacity: .95;
}

.lights__wire {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.bulb {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--marigold);
  box-shadow:
    0 0 8px 2px rgba(255, 190, 80, .75),
    0 0 20px 6px rgba(255, 140, 50, .22);
  animation: twinkle 3.4s ease-in-out infinite;
}

.bulb::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 1px;
  height: 7px;
  background: rgba(255, 214, 140, .35);
  transform: translateX(-50%);
}

.bulb--rose { background: #ff7ea6; box-shadow: 0 0 8px 2px rgba(255, 110, 150, .7), 0 0 20px 6px rgba(255, 90, 140, .18); }
.bulb--saffron { background: #ffb257; }

.scene__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: .5;
  animation: drift 18s ease-in-out infinite alternate;
}

.scene__orb--a {
  width: 220px;
  height: 220px;
  left: -70px;
  bottom: 12%;
  background: radial-gradient(circle, rgba(255, 140, 60, .38), transparent 70%);
}

.scene__orb--b {
  width: 260px;
  height: 260px;
  right: -90px;
  top: 26%;
  background: radial-gradient(circle, rgba(214, 60, 130, .3), transparent 70%);
  animation-delay: -6s;
}

.scene__dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene__fireworks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .82;
  mix-blend-mode: screen;
}

.scene__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(118% 82% at 50% 42%, transparent 38%, rgba(3, 0, 3, .62) 100%),
    linear-gradient(180deg, rgba(6, 0, 5, .35), transparent 22%, transparent 78%, rgba(4, 0, 4, .5));
}

/* ============ welcome ============ */

.screen { position: relative; z-index: 1; }

.screen--welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: calc(var(--safe-t) + 26px) 22px calc(var(--safe-b) + 26px);
}

.welcome {
  width: 100%;
  max-width: 430px;
  margin: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.welcome__diya {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  filter: drop-shadow(0 18px 34px rgba(255, 140, 60, .22));
  animation: fadeUp .9s var(--ease-spring) both;
}

.welcome__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeUp .9s var(--ease-spring) .08s both;
}

.eyebrow {
  font-size: 10.5px;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--gold-3);
  opacity: .95;
  font-family: var(--font-ui);
  font-weight: 500;
}

.eyebrow--gold { color: var(--gold-2); }
.eyebrow--sm { font-size: 9px; letter-spacing: .3em; }

.welcome__head .eyebrow {
  font-family: var(--font-hindi);
  font-size: 17px;
  letter-spacing: .08em;
  text-transform: none;
  color: #f6cf83;
  text-shadow: 0 0 24px rgba(255, 180, 80, .45);
}

.title { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.title__main {
  font-family: var(--font-display);
  font-size: clamp(58px, 19vw, 82px);
  line-height: .92;
  letter-spacing: .01em;
  background: linear-gradient(180deg, #fffaea 4%, #ffe4a8 34%, #edbd60 56%, #f8d995 70%, #b9802f 100%);
  background-size: 100% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 26px rgba(255, 170, 60, .3));
  animation: shimmer 7s ease-in-out infinite;
}

.title__sub {
  font-family: var(--font-ui);
  font-size: clamp(11px, 3.5vw, 13px);
  font-weight: 500;
  letter-spacing: .46em;
  text-indent: .46em;
  text-transform: uppercase;
  color: #f5d8a4;
  opacity: .9;
}

.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--gold-3);
  opacity: .8;
  margin: 2px 0;
}
.rule i {
  display: block;
  width: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(247, 210, 130, .75));
}
.rule i:last-child { background: linear-gradient(270deg, transparent, rgba(247, 210, 130, .75)); }
.rule span { font-size: 9px; letter-spacing: 0; }

.welcome__lead {
  font-size: 15.5px;
  color: #ffe9d2;
  letter-spacing: .01em;
}
.welcome__hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.enter {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeUp .9s var(--ease-spring) .16s both;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 232, 195, .1), rgba(255, 220, 170, .04));
  border: 1px solid rgba(255, 215, 150, .24);
  box-shadow: inset 0 1px 0 rgba(255, 245, 215, .12), 0 14px 34px -20px rgba(0, 0, 0, .9);
  backdrop-filter: blur(10px);
  transition: border-color .25s, box-shadow .3s, background .3s;
}

.field:focus-within {
  border-color: rgba(255, 213, 132, .68);
  background: linear-gradient(180deg, rgba(255, 236, 200, .15), rgba(255, 220, 170, .06));
  box-shadow: 0 0 0 4px rgba(255, 195, 90, .12), 0 0 30px -6px rgba(255, 170, 60, .45);
}

.field__icon {
  position: absolute;
  left: 17px;
  width: 21px;
  height: 21px;
  color: var(--gold-3);
  pointer-events: none;
}
.field__icon svg { width: 100%; height: 100%; }

.field input {
  width: 100%;
  height: 100%;
  padding: 0 18px 0 50px;
  border: 0;
  background: transparent;
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .02em;
  outline: none;
}
.field input::placeholder { color: rgba(255, 228, 200, .42); }

.field__error {
  min-height: 16px;
  margin-top: -4px;
  font-size: 12px;
  color: #ff9ab2;
  letter-spacing: .01em;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .25s, transform .25s;
}
.field__error.is-on { opacity: 1; transform: none; }

.field.is-error { border-color: rgba(255, 110, 145, .7); animation: shake .4s ease; }

/* buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 54px;
  padding: 0 22px;
  border-radius: 999px;
  border: 0;
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  transition: transform .18s var(--ease-spring), filter .25s, box-shadow .3s;
  touch-action: manipulation;
}

.btn--play { height: 58px; font-size: 13px; letter-spacing: .2em; }

.btn--gold {
  color: #3d1704;
  background: linear-gradient(180deg, #fff1c4 0%, #ffda8c 28%, #e8b855 64%, #c98f36 100%);
  box-shadow:
    0 16px 34px -14px rgba(255, 168, 60, .75),
    0 2px 0 rgba(255, 246, 214, .7) inset,
    0 -3px 10px rgba(120, 60, 10, .45) inset;
}

.btn--gold::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 240, .5), transparent 46%);
  opacity: .8;
  pointer-events: none;
}

.btn__text { position: relative; z-index: 2; }

.btn__shine {
  position: absolute;
  top: -40%;
  bottom: -40%;
  width: 45%;
  left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent);
  transform: skewX(-18deg);
  animation: sweep 4.6s ease-in-out infinite;
  pointer-events: none;
}

.btn--gold:active { transform: scale(.972); filter: brightness(.97); }

.btn--ghost {
  color: var(--gold-2);
  background: rgba(255, 226, 180, .07);
  border: 1px solid rgba(255, 214, 140, .3);
  height: 50px;
  font-size: 11px;
  letter-spacing: .14em;
  box-shadow: inset 0 1px 0 rgba(255, 245, 215, .08);
  backdrop-filter: blur(6px);
}
.btn--ghost:active { transform: scale(.972); background: rgba(255, 226, 180, .12); }
.btn--warm { width: 100%; }
.btn--mini {
  height: 36px;
  padding: 0 16px;
  font-size: 10.5px;
  letter-spacing: .1em;
  color: #3d1704;
  background: linear-gradient(180deg, #ffe7af, #e5b25a);
  box-shadow: 0 8px 18px -10px rgba(255, 170, 60, .8);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  animation: fadeUp .9s var(--ease-spring) .24s both;
}
.pills li {
  padding: 6px 12px;
  font-size: 10.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: rgba(255, 236, 214, .62);
  border: 1px solid rgba(255, 210, 140, .16);
  border-radius: 999px;
  background: rgba(255, 225, 175, .04);
  backdrop-filter: blur(6px);
}

/* ============ game screen ============ */

.screen--game {
  min-height: 100dvh;
  padding-bottom: calc(96px + var(--safe-b));
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: linear-gradient(180deg, rgba(12, 2, 9, .94), rgba(12, 2, 9, .55) 70%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 9px; }
.brand__mark { width: 26px; height: 26px; display: block; }
.brand__mark svg { width: 100%; height: 100%; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__text b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 15.5px;
  letter-spacing: .05em;
  color: var(--gold-1);
}
.brand__text i {
  font-style: normal;
  font-size: 8px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(255, 224, 178, .5);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 210, 145, .22);
  background: rgba(255, 226, 180, .06);
  color: var(--gold-2);
  backdrop-filter: blur(8px);
  transition: transform .18s, background .25s;
}
.icon-btn:active { transform: scale(.9); background: rgba(255, 226, 180, .14); }
.icon-btn svg { width: 19px; height: 19px; }

.ico--off { display: none; }
body.is-muted .ico--on { display: none; }
body.is-muted .ico--off { display: block; }
body.is-muted .icon-btn { color: rgba(255, 226, 180, .5); }

.game {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 16px 26px;
  animation: screenIn .5s ease both;
}

.greeting { padding: 10px 4px 16px; }
.greeting__hi {
  font-family: var(--font-hindi);
  font-size: 15px;
  color: #f0c579;
  opacity: .9;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.greeting__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 6.6vw, 31px);
  line-height: 1.16;
  color: #fff0dc;
  letter-spacing: .005em;
}
.greeting__title span {
  background: linear-gradient(180deg, #fff6d8, #f4c96f 70%, #d59c3d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.greeting__sub {
  margin-top: 9px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(255, 226, 190, .55);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.stat {
  padding: 10px 4px 9px;
  text-align: center;
  border-radius: 16px;
  border: 1px solid rgba(255, 210, 145, .14);
  background: linear-gradient(180deg, rgba(255, 232, 195, .08), rgba(255, 220, 170, .02));
  box-shadow: inset 0 1px 0 rgba(255, 245, 215, .08);
  backdrop-filter: blur(8px);
}
.stat b {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  color: #ffe9c6;
  line-height: 1.1;
}
.stat span {
  font-size: 8.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255, 226, 190, .48);
}
.stat--gold {
  border-color: rgba(255, 205, 120, .38);
  background: linear-gradient(180deg, rgba(255, 210, 140, .16), rgba(255, 180, 90, .04));
  box-shadow: inset 0 1px 0 rgba(255, 245, 215, .18), 0 0 26px -12px rgba(255, 180, 80, .9);
}
.stat--gold b {
  background: linear-gradient(180deg, #fffbe8, #f7cd72);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats--two { grid-template-columns: repeat(2, 1fr); }
.stat b.is-text {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .01em;
  padding: 3px 0 2px;
}

.recap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 13px 15px;
  border-radius: 20px;
  border: 1px solid rgba(255, 208, 130, .34);
  background:
    radial-gradient(120% 130% at 0% 0%, rgba(255, 200, 110, .16), transparent 62%),
    linear-gradient(100deg, rgba(96, 20, 52, .8), rgba(32, 6, 20, .9));
  box-shadow: inset 0 1px 0 rgba(255, 240, 208, .14), 0 18px 40px -28px rgba(0, 0, 0, .9);
  animation: fadeUp .5s var(--ease-spring) both;
}

.recap__number {
  flex: 0 0 auto;
  min-width: 74px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 214, 145, .4);
  background: linear-gradient(180deg, rgba(255, 226, 170, .16), rgba(255, 190, 110, .03));
}
.recap__number span {
  display: block;
  font-size: 7.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 228, 195, .55);
}
.recap__number b {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 27px;
  line-height: 1;
  color: var(--gold-1);
  text-shadow: 0 0 18px rgba(255, 180, 80, .5);
}

.recap__body { min-width: 0; }
.recap__result {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.25;
  color: #ffeac2;
}
.recap--lose .recap__result {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 238, 220, .85);
}
.recap__note {
  margin-top: 4px;
  font-size: 10.5px;
  line-height: 1.5;
  color: rgba(255, 230, 205, .5);
}

.grid-shell {
  position: relative;
  padding: 11px;
  transition: opacity .35s ease;
  border-radius: 24px;
  border: 1px solid rgba(255, 208, 140, .13);
  background:
    radial-gradient(120% 58% at 50% 0%, rgba(255, 214, 150, .1), transparent 60%),
    linear-gradient(180deg, rgba(255, 235, 200, .035), rgba(20, 3, 13, .25));
  box-shadow: inset 0 1px 0 rgba(255, 245, 215, .09), 0 32px 60px -44px #000;
  backdrop-filter: blur(6px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 205, 130, .3);
  background:
    radial-gradient(120% 110% at 50% 0%, rgba(255, 218, 155, .2), transparent 58%),
    linear-gradient(160deg, rgba(96, 22, 52, .92), rgba(45, 9, 32, .96));
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 208, .22),
    inset 0 -8px 16px -10px rgba(0, 0, 0, .8),
    0 7px 16px -10px rgba(0, 0, 0, .95);
  color: #ffedcd;
  font-family: var(--font-display);
  font-size: clamp(17px, 5vw, 22px);
  line-height: 1;
  overflow: hidden;
  isolation: isolate;
  transition: transform .2s var(--ease-spring), border-color .3s, box-shadow .3s, color .3s;
  animation: tileIn .6s var(--ease-spring) backwards;
  animation-delay: calc(var(--i, 0) * 13ms);
  touch-action: manipulation;
}

.tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 60% at 50% 100%, rgba(255, 170, 80, .16), transparent 70%);
  pointer-events: none;
}

.tile::after {
  content: '';
  position: absolute;
  top: -60%;
  bottom: -60%;
  left: -120%;
  width: 55%;
  background: linear-gradient(100deg, transparent, rgba(255, 245, 215, .42), transparent);
  transform: skewX(-16deg);
  animation: sheen 7.5s ease-in-out infinite;
  animation-delay: calc(600ms + var(--i, 0) * 120ms);
  opacity: .8;
  pointer-events: none;
}

.tile__num { position: relative; z-index: 2; }

.tile:active {
  transform: scale(.93);
  border-color: rgba(255, 220, 150, .7);
}

.tile.is-picked {
  border-color: rgba(255, 214, 145, .66);
  background:
    radial-gradient(120% 110% at 50% 0%, rgba(255, 214, 150, .32), transparent 62%),
    linear-gradient(160deg, #5d1436, #2a0720);
  box-shadow:
    0 0 0 2px rgba(255, 200, 110, .2),
    0 0 28px -4px rgba(255, 170, 70, .75),
    inset 0 1px 0 rgba(255, 240, 208, .28);
  color: #fff4d8;
  text-shadow: 0 0 14px rgba(255, 185, 85, .8);
  cursor: default;
}
.tile.is-picked::after { display: none; }
.tile.is-picked .tile__num { opacity: 1; }
.tile.is-picked::before {
  background: radial-gradient(60% 55% at 50% 100%, rgba(255, 190, 100, .24), transparent 72%);
}
/* Number already taken by another player in this game: closed, but tappable. */
.tile.is-taken {
  border-color: rgba(255, 205, 130, .14);
  background:
    repeating-linear-gradient(135deg, rgba(255, 214, 150, .045) 0 6px, transparent 6px 12px),
    linear-gradient(160deg, rgba(56, 13, 33, .92), rgba(27, 6, 19, .97));
  box-shadow: inset 0 1px 0 rgba(255, 240, 208, .05);
  color: rgba(255, 234, 208, .4);
  cursor: pointer;
  text-decoration: line-through;
  text-decoration-color: rgba(255, 170, 90, .5);
}
.tile.is-taken::before { background: none; }
.tile.is-taken::after { display: none; }
.tile.is-taken:active { transform: scale(.95); }

.tile__seal {
  position: absolute;
  top: 5px;
  right: 6px;
  z-index: 3;
  font-size: 8px;
  line-height: 1;
  color: #ffdc96;
  font-size: 9px;
  text-shadow: 0 0 10px rgba(255, 180, 70, .95);
}

.tile.is-choosing {
  border-color: rgba(255, 226, 160, .95);
  box-shadow: 0 0 0 2px rgba(255, 200, 110, .4), 0 0 30px -2px rgba(255, 170, 70, .75);
  animation: choosePulse .9s ease-in-out infinite;
}

.grid.is-complete .tile { cursor: default; }

.grid.is-locked .tile:not(.is-picked) {
  opacity: .46;
  filter: saturate(.78);
  pointer-events: none;
}
.grid.is-locked .tile:not(.is-picked)::after { display: none; }

.game__note {
  margin: 14px auto 0;
  max-width: 340px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
  color: rgba(255, 232, 208, .42);
  letter-spacing: .015em;
}

/* tab bar */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  gap: 4px;
  padding: 5px;
  width: calc(100% - 28px);
  max-width: 340px;
  border-radius: 22px;
  border: 1px solid rgba(255, 210, 145, .2);
  background: rgba(26, 5, 17, .82);
  box-shadow: 0 22px 50px -22px #000, inset 0 1px 0 rgba(255, 240, 205, .12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.tab {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 7px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: rgba(255, 228, 198, .5);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  transition: color .25s, background .3s, transform .18s;
}
.tab svg { width: 20px; height: 20px; }
.tab:active { transform: scale(.96); }
.tab.is-active {
  color: #3d1704;
  background: linear-gradient(180deg, #ffeec1, #e8b859);
  box-shadow: 0 8px 20px -10px rgba(255, 170, 60, .8), inset 0 1px 0 rgba(255, 250, 225, .8);
}
.tab__badge {
  position: absolute;
  top: 4px;
  right: 18%;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff7d9d, #e4366a);
  color: #fff;
  font-style: normal;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px rgba(26, 5, 17, .9);
}

/* ============ reveal ============ */

.reveal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-t) + 16px) 16px calc(var(--safe-b) + 16px);
}

.reveal__scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(96% 62% at 50% 40%, rgba(84, 12, 48, .88), rgba(8, 1, 6, .98) 72%);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  animation: fadeIn .35s ease both;
}

.reveal__fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
}

.spinner {
  position: relative;
  z-index: 3;
  width: min(86vw, 350px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.spinner__halo {
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 90, .34), rgba(255, 110, 90, .1) 44%, transparent 68%);
  filter: blur(14px);
  animation: breathe 2.6s ease-in-out infinite;
}

.spinner__mandala {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--gold-2);
  opacity: .7;
  animation: spin 30s linear infinite;
}

.spinner__ring {
  position: absolute;
  inset: 0;
  animation: spin 5.2s linear infinite;
}
.spinner.is-settled .spinner__ring { animation-duration: 22s; }

.spinner__ring span {
  position: absolute;
  inset: 0;
  display: block;
  transform: rotate(var(--a));
}

.spinner__ring span i {
  position: absolute;
  top: 3%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin-left: -16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 210, 140, .3);
  background: rgba(40, 8, 26, .9);
  color: rgba(255, 232, 195, .78);
  font-style: normal;
  font-family: var(--font-display);
  font-size: 11.5px;
  box-shadow: 0 0 16px -6px rgba(255, 180, 80, .6);
  transform: rotate(calc(-1 * var(--a)));
}

.spinner__core {
  position: relative;
  z-index: 4;
  text-align: center;
  padding: 26px;
  width: 66%;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 226, 170, .16), transparent 58%),
    radial-gradient(circle at 50% 50%, rgba(60, 10, 36, .94), rgba(22, 4, 15, .97));
  border: 1px solid rgba(255, 210, 140, .32);
  box-shadow: inset 0 1px 0 rgba(255, 240, 205, .18), 0 0 60px -12px rgba(255, 160, 60, .55);
}
.spinner__core::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 208, 135, .18);
  animation: spin 40s linear infinite reverse;
}

.spinner__hint {
  font-size: 8.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(255, 224, 184, .6);
  text-align: center;
  line-height: 1.5;
}
.spinner__hint--sm { color: rgba(255, 224, 184, .38); }

.spinner__num {
  font-family: var(--font-display);
  font-size: clamp(62px, 21vw, 86px);
  line-height: 1;
  background: linear-gradient(180deg, #fffcef, #ffe2a1 45%, #e0ac4b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 175, 70, .55));
  font-variant-numeric: tabular-nums;
}

.spinner.is-settled .spinner__num { animation: settlePop .6s var(--ease-spring) both; }

/* result card */
.card {
  position: relative;
  z-index: 4;
  width: min(92vw, 396px);
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 212, 140, .4);
  background: linear-gradient(168deg, #4b0e2b 0%, #25051a 46%, #2f0723 100%);
  box-shadow:
    0 44px 90px -34px #000,
    0 0 0 1px rgba(255, 235, 195, .1) inset,
    0 0 70px -16px rgba(255, 165, 65, .38);
  animation: cardIn .78s cubic-bezier(.16, 1.06, .3, 1) both;
}

.card::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 24px;
  border: 1px solid rgba(255, 222, 155, .22);
  pointer-events: none;
  z-index: 5;
}

.card__inner {
  position: relative;
  z-index: 3;
  padding: 26px 22px 22px;
  text-align: center;
}

.card__rays {
  position: absolute;
  inset: -55%;
  z-index: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255, 210, 130, .18) 0deg 2deg, transparent 2deg 16deg);
  -webkit-mask: radial-gradient(circle, #000 12%, rgba(0, 0, 0, .5) 34%, transparent 64%);
  mask: radial-gradient(circle, #000 12%, rgba(0, 0, 0, .5) 34%, transparent 64%);
  animation: spin 28s linear infinite;
  opacity: .42;
}

.card__halo {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(70% 45% at 50% 0%, rgba(255, 205, 130, .18), transparent 62%),
    radial-gradient(60% 40% at 50% 100%, rgba(255, 120, 80, .12), transparent 60%);
}

.card__slot {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 213, 140, .35);
  background: rgba(255, 224, 175, .08);
  font-size: 8.5px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(255, 233, 205, .6);
}
.card__slot b {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--gold-1);
}

.card__eyebrow {
  position: relative;
  z-index: 2;
  margin-top: 16px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: #f4c470;
  animation: fadeUp .6s ease .18s both;
}

.card__headline {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(27px, 8vw, 33px);
  line-height: 1.1;
  letter-spacing: .01em;
  background: linear-gradient(180deg, #fffdf2 6%, #ffe8b2 42%, #f0bf62 74%, #c9963f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 18px rgba(255, 175, 70, .45));
  animation: fadeUp .6s ease .26s both;
}

.card__prize {
  position: relative;
  z-index: 2;
  margin: 18px auto 4px;
  padding: 15px 16px;
  max-width: 300px;
  border-radius: 18px;
  border: 1px solid rgba(255, 214, 145, .42);
  background:
    linear-gradient(180deg, rgba(255, 231, 180, .17), rgba(255, 190, 110, .05));
  box-shadow: inset 0 1px 0 rgba(255, 250, 230, .3), 0 12px 30px -18px rgba(255, 170, 70, .8);
  font-family: var(--font-display);
  font-size: clamp(21px, 6.2vw, 26px);
  line-height: 1.24;
  color: #fff6dc;
  text-shadow: 0 0 26px rgba(255, 190, 90, .5);
  overflow: hidden;
  animation: fadeUp .6s ease .34s both;
}
.card__prize::after {
  content: '';
  position: absolute;
  top: -60%;
  bottom: -60%;
  left: -140%;
  width: 60%;
  background: linear-gradient(100deg, transparent, rgba(255, 250, 225, .5), transparent);
  transform: skewX(-16deg);
  animation: prizeShine 3.8s ease-in-out infinite;
}

.card__diya {
  position: relative;
  z-index: 2;
  width: 46px;
  height: 46px;
  margin: 14px auto 0;
  animation: fadeUp .6s ease .42s both;
}
.card__diya svg { width: 100%; height: 100%; }

.card__note {
  position: relative;
  z-index: 2;
  margin: 12px auto 0;
  max-width: 274px;
  font-size: 11.5px;
  line-height: 1.6;
  color: rgba(255, 233, 210, .58);
  animation: fadeUp .6s ease .46s both;
}

.card__actions {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 9px;
  margin-top: 20px;
  animation: fadeUp .6s ease .52s both;
}

.card--lose {
  border-color: rgba(255, 220, 160, .25);
  background: linear-gradient(168deg, #33102f 0%, #1c0617 48%, #22081e 100%);
  box-shadow: 0 44px 90px -34px #000, inset 0 1px 0 rgba(255, 245, 215, .12), 0 0 60px -20px rgba(220, 120, 160, .3);
}
.card--lose .card__rays { opacity: .22; animation-duration: 60s; }
.card--lose .card__headline {
  font-size: clamp(23px, 6.6vw, 27px);
  background: linear-gradient(180deg, #fff7ea 10%, #ffdfc0 46%, #e0a98d 90%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 2px 16px rgba(255, 150, 120, .3));
}
.card--lose .card__eyebrow { color: #e9b3a0; }
.card--lose .card__prize { display: none; }
.card--lose .card__inner { padding-top: 30px; }

/* ============ results sheet ============ */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet__scrim {
  position: absolute;
  inset: 0;
  background: rgba(5, 0, 5, .72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn .3s ease both;
}

.sheet__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 480px);
  max-height: 88dvh;
  padding-bottom: var(--safe-b);
  border-radius: 28px 28px 0 0;
  border: 1px solid rgba(255, 210, 145, .24);
  border-bottom: 0;
  background: linear-gradient(180deg, #2c0719 0%, #170310 58%, #12020c 100%);
  box-shadow: 0 -30px 80px -30px #000, inset 0 1px 0 rgba(255, 240, 205, .16);
  animation: sheetUp .44s cubic-bezier(.2, .92, .24, 1) both;
}

.sheet__grip {
  width: 42px;
  height: 4px;
  margin: 10px auto 2px;
  border-radius: 99px;
  background: rgba(255, 210, 145, .3);
}

.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px 6px;
}
.sheet__head h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 23px;
  color: var(--gold-1);
  letter-spacing: .02em;
  margin-top: 2px;
}

.sheet__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 6px 18px 10px;
}
.sheet__summary span {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 232, 205, .62);
  border: 1px solid rgba(255, 210, 145, .16);
  background: rgba(255, 225, 175, .05);
}
.sheet__summary b { color: var(--gold-1); font-weight: 600; }

.sheet__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 14px 12px;
  scrollbar-width: thin;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  margin-bottom: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 220, 170, .1);
  background: rgba(255, 230, 195, .035);
  animation: rowIn .4s ease both;
}
.row__n {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 210, 145, .26);
  background: rgba(255, 220, 170, .07);
  font-family: var(--font-display);
  font-size: 16px;
  color: #ffe8c3;
}
.row__body { flex: 1; min-width: 0; }
.row__body b {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 240, 220, .82);
  letter-spacing: .01em;
  line-height: 1.35;
}
.row__body span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: .08em;
  color: rgba(255, 226, 195, .38);
}
.row.is-win {
  border-color: rgba(255, 208, 130, .34);
  background: linear-gradient(100deg, rgba(255, 205, 120, .14), rgba(255, 180, 100, .04));
}
.row.is-win .row__n {
  border-color: rgba(255, 220, 150, .55);
  background: rgba(255, 205, 120, .18);
  box-shadow: 0 0 20px -6px rgba(255, 180, 80, .9);
}
.row.is-win .row__body b {
  color: #ffe9b7;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
}

.sheet__empty {
  padding: 34px 20px 40px;
  text-align: center;
  color: rgba(255, 230, 205, .5);
  font-size: 12.5px;
  line-height: 1.7;
}
.sheet__empty b {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  color: rgba(255, 237, 210, .8);
  margin-bottom: 6px;
}

.sheet__foot {
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(255, 210, 145, .12);
}

/* ============ toast / install / misc ============ */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-b));
  z-index: 90;
  transform: translate(-50%, 14px);
  max-width: 88vw;
  padding: 10px 17px;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 145, .3);
  background: rgba(32, 6, 20, .96);
  box-shadow: 0 18px 40px -18px #000;
  color: var(--cream);
  font-size: 12px;
  letter-spacing: .02em;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s var(--ease-spring);
  backdrop-filter: blur(10px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* bottom install popup */
.install {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safe-b));
  z-index: 80;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  width: calc(100% - 26px);
  max-width: 430px;
  padding: 11px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 210, 145, .34);
  background: #1e0512;
  box-shadow: 0 24px 55px -22px #000, inset 0 1px 0 rgba(255, 240, 205, .1);
}
.install.is-open { align-items: flex-start; }

.install__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 205, 140, .28);
  background: radial-gradient(circle at 50% 30%, rgba(255, 200, 110, .3), rgba(255, 170, 70, .08));
  font-size: 19px;
}

.install__copy { flex: 1 1 140px; display: flex; flex-direction: column; gap: 3px; }
.install__copy b { font-size: 12.5px; font-weight: 600; color: var(--gold-1); }
.install__copy span { font-size: 10.5px; line-height: 1.4; color: rgba(255, 230, 205, .55); }

.install .install__hint {
  flex: 1 1 100%;
  margin-top: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 215, 150, .08);
  border: 1px solid rgba(255, 210, 145, .16);
  color: var(--gold-2);
}

.install__x {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 225, 180, .08);
  color: rgba(255, 235, 210, .7);
  font-size: 16px;
  line-height: 1;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  background: radial-gradient(80% 60% at 50% 44%, #2a0720, #0a0207 72%);
  transition: opacity .55s ease, visibility .55s;
}
.splash.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.splash__glow {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 190, 90, .3), transparent 68%);
  filter: blur(20px);
  animation: breathe 2.4s ease-in-out infinite;
}
.splash__diya { position: relative; width: 84px; height: 84px; animation: splashIn .8s var(--ease-spring) both; }
.splash__diya svg, .diya svg { width: 100%; height: 100%; overflow: visible; }
.splash__word {
  position: relative;
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: .14em;
  background: linear-gradient(180deg, #fffbe8, #f8d68d 60%, #c99440);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fadeUp .8s ease .2s both;
}
.splash__sub {
  position: relative;
  font-size: 8.5px;
  letter-spacing: .44em;
  text-transform: uppercase;
  color: rgba(255, 226, 186, .55);
  animation: fadeUp .8s ease .34s both;
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  padding: 14px;
  border-radius: 14px;
  background: #2a0714;
  border: 1px solid #a9782f;
  color: #ffeede;
  font-size: 13px;
  z-index: 300;
  text-align: center;
}

/* ============ diya artwork ============ */

/* Flame: sways from the wick, the core breathes faster, the halo pulses. */
.diya__flame {
  transform-box: fill-box;
  transform-origin: 50% 92%;
  animation: flameSway 2.7s cubic-bezier(.37, .01, .63, 1) infinite;
  filter: drop-shadow(0 1px 6px rgba(255, 168, 70, .55));
}
.diya__flame--inner {
  transform-box: fill-box;
  transform-origin: 50% 88%;
  animation: flameCore 1.25s ease-in-out infinite;
}
.diya--sm .diya__flame { animation-duration: 2.2s; }
.diya--sm .diya__flame--inner { animation-duration: 1.05s; }
.diya__glow {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: diyaGlow 2.6s ease-in-out infinite;
}

/* shimmer over the flame, flickering wick light, rising embers */
.diya__shimmer {
  transform-box: fill-box;
  transform-origin: 50% 72%;
  animation: flameShimmer 1.35s ease-in-out infinite;
}
.diya__rim { animation: rimGlow 2.1s ease-in-out infinite; }

.diya__ember {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: emberRise 2.6s ease-out infinite;
}
.diya__ember--a { --dx: -2px; animation-delay: .15s; }
.diya__ember--b { --dx: 2.6px; animation-delay: .95s; animation-duration: 3.1s; }
.diya__ember--c { --dx: -.6px; animation-delay: 1.75s; animation-duration: 2.2s; }
.diya--sm .diya__ember { animation-duration: 2.2s; }

/* ============ keyframes ============ */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe {
  0%, 100% { opacity: .75; transform: scale(.97); }
  50% { opacity: 1; transform: scale(1.05); }
}
@keyframes twinkle {
  0%, 100% { opacity: .22; filter: brightness(.5); transform: scale(.78); }
  45% { opacity: 1; filter: brightness(1.7); transform: scale(1.18); }
  70% { opacity: .85; filter: brightness(1.25); transform: scale(1.02); }
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(18px, -30px, 0) scale(1.12); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes screenIn {
  from { opacity: 0; transform: scale(.985) translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes tileIn {
  from { opacity: 0; transform: translateY(14px) scale(.82) rotateX(-24deg); }
  to { opacity: 1; transform: none; }
}
@keyframes sheen {
  0%, 62% { left: -120%; }
  86%, 100% { left: 160%; }
}
@keyframes sweep {
  0%, 55% { left: -60%; }
  85%, 100% { left: 130%; }
}
@keyframes shimmer {
  0%, 100% { background-position: 50% 0%; }
  50% { background-position: 50% 100%; }
}
@keyframes prizeShine {
  0%, 60% { left: -140%; }
  85%, 100% { left: 180%; }
}
@keyframes flameSway {
  0% { transform: rotate(-4.2deg) skewX(2deg) scale(.93, 1.07) translateX(-1.2px); }
  14% { transform: rotate(3.4deg) skewX(-2.4deg) scale(1.07, .93) translateX(1.4px); }
  29% { transform: rotate(-2deg) skewX(1.4deg) scale(.9, 1.11) translateX(-.9px); }
  43% { transform: rotate(4.4deg) skewX(-2deg) scale(1.09, .91) translateX(1.6px); }
  58% { transform: rotate(-3.1deg) skewX(2.2deg) scale(.96, 1.05) translateX(-.6px); }
  72% { transform: rotate(2.4deg) skewX(-1.2deg) scale(1.05, .95) translateX(1px); }
  86% { transform: rotate(-1.4deg) skewX(1.8deg) scale(.98, 1.06) translateX(-.4px); }
  100% { transform: rotate(-4.2deg) skewX(2deg) scale(.93, 1.07) translateX(-1.2px); }
}
@keyframes flameShimmer {
  0%, 100% { opacity: .08; transform: scale(.9, 1.04) translateY(1px); }
  40% { opacity: .24; transform: scale(1.02, .97) translateY(-1.5px); }
  65% { opacity: .14; transform: scale(.96, 1.01); }
}
@keyframes rimGlow {
  0%, 100% { opacity: .45; }
  50% { opacity: .9; }
}
@keyframes emberRise {
  0% { opacity: 0; transform: translate(0, 5px) scale(.45); }
  14% { opacity: .95; }
  55% { opacity: .7; transform: translate(var(--dx, 1px), -9px) scale(.95); }
  100% { opacity: 0; transform: translate(calc(var(--dx, 1px) * 2.2), -24px) scale(.15); }
}
@keyframes flameCore {
  0%, 100% { transform: scale(.86, 1.1) translateY(1px); opacity: .82; }
  45% { transform: scale(1.12, .9) translateY(-1.4px); opacity: 1; }
  70% { transform: scale(.95, 1.04) translateY(.4px); opacity: .92; }
}
@keyframes diyaGlow {
  0%, 100% { opacity: .7; transform: scale(.95); }
  38% { opacity: 1; transform: scale(1.05); }
  66% { opacity: .82; transform: scale(.99); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}
@keyframes choosePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes cardIn {
  0% { opacity: 0; transform: scale(.78) translateY(24px); filter: blur(6px); }
  60% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: none; }
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: none; }
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes settlePop {
  0% { transform: scale(.7); filter: brightness(2) drop-shadow(0 0 40px rgba(255, 200, 100, .9)); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); filter: none; }
}
@keyframes splashIn {
  from { opacity: 0; transform: scale(.6); }
  to { opacity: 1; transform: none; }
}
@keyframes floatY {
  from { transform: translateY(0); }
  to { transform: translateY(-7px); }
}

/* ============ larger screens ============ */

@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(10, 1fr); gap: 9px; }
  .tile { border-radius: 16px; }
  .game { max-width: 780px; }
  .grid-shell { padding: 14px; }
  .welcome { gap: 30px; }
}

@media (min-width: 900px) {
  .screen--welcome { padding-top: calc(var(--safe-t) + 40px); }
  .tabbar { max-width: 380px; }
}

@media (max-height: 680px) {
  .welcome { gap: 18px; }
  .title__main { font-size: clamp(48px, 16vw, 66px); }
  .welcome__diya .diya { transform: scale(.86); }
}

/* ============ reduced motion ============ */

/* the festival page keeps its animations even when the OS asks for less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
