:root {
  --ember: #ff4d2e;
  --orange: #ff7a59;
  --gold: #ffd36a;
  --violet: #4b2c6f;
  --night: #120d1e;
  --night2: #24132d;
  --text: #fff4dc;
  --muted: #d8c8dd;
  --green: #71ffc4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 145, 73, .28), transparent 20%),
    radial-gradient(circle at 86% 14%, rgba(118, 74, 255, .30), transparent 24%),
    radial-gradient(circle at 15% 85%, rgba(255, 211, 106, .15), transparent 22%),
    radial-gradient(circle at 80% 80%, rgba(255, 77, 46, .20), transparent 22%),
    linear-gradient(135deg, #1c1027 0%, #2a153a 35%, #140d22 72%, #0d0916 100%);
  overflow-x: hidden;
}

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

.decor.emoji {
  position: absolute;
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 24px;
  background: rgba(255,244,220,.10);
  border: 1px solid rgba(255,211,106,.22);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 44px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,255,255,.06);
  font-size: 36px;
  animation: floaty 6s ease-in-out infinite;
}

.decor.emoji.a { left: 3%; top: 14%; transform: rotate(-8deg); }
.decor.emoji.b { right: 5%; top: 15%; transform: rotate(8deg); animation-delay: .8s; }
.decor.emoji.c { left: 7%; bottom: 16%; transform: rotate(7deg); animation-delay: 1.3s; }
.decor.emoji.d { right: 8%; bottom: 18%; transform: rotate(-10deg); animation-delay: .5s; }
.decor.emoji.e { left: 18%; top: 54%; animation-delay: 1.8s; }
.decor.emoji.f { left: 48%; top: 8%; width: 60px; height: 60px; font-size: 28px; animation-delay: 2s; }
.decor.emoji.g { right: 26%; top: 52%; width: 64px; height: 64px; font-size: 30px; animation-delay: 2.6s; }
.decor.emoji.h { right: 17%; top: 36%; width: 70px; height: 70px; font-size: 34px; animation-delay: 1.6s; }
.decor.emoji.i { left: 28%; top: 20%; animation-delay: 2.3s; }
.decor.emoji.j { right: 34%; bottom: 11%; animation-delay: .9s; }
.decor.emoji.k { left: 38%; bottom: 10%; animation-delay: 1.2s; }
.decor.emoji.l { right: 12%; top: 63%; animation-delay: 2.1s; }
.decor.emoji.m { left: 58%; top: 22%; animation-delay: 1.1s; }
.decor.emoji.n { left: 72%; bottom: 21%; animation-delay: .7s; }
.decor.emoji.o { left: 11%; top: 33%; width: 62px; height: 62px; font-size: 28px; animation-delay: 2.8s; }
.decor.emoji.p { right: 22%; bottom: 35%; animation-delay: 1.9s; }

.decor.blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(24px);
  opacity: .32;
}

.decor.blob.one { width: 280px; height: 280px; left: -90px; top: 110px; background: #ff4d2e; }
.decor.blob.two { width: 340px; height: 340px; right: -130px; bottom: 50px; background: #7a4dff; }
.decor.blob.three { width: 210px; height: 210px; left: 38%; bottom: -50px; background: #ffcb5b; }
.decor.blob.four { width: 180px; height: 180px; right: 24%; top: 38%; background: #ff2f72; }

.main-game {
  position: relative;
  z-index: 3;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  min-height: calc(100vh - 110px);
  padding: 28px 0 16px;
  display: grid;
  place-items: center;
}

.game-card {
  width: 100%;
  padding: clamp(18px, 3vw, 34px);
  border-radius: 38px;
  background: rgba(24, 16, 35, .74);
  border: 1px solid rgba(255, 211, 106, .30);
  box-shadow: 0 34px 110px rgba(0,0,0,.36), 0 0 70px rgba(255, 94, 49, .10), inset 0 0 0 1px rgba(255,255,255,.07);
  backdrop-filter: blur(14px);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 280px;
  gap: clamp(18px, 3vw, 34px);
  align-items: center;
}

.fire-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  width: min(540px, 100%);
  margin: 0 auto;
  padding: 14px;
  border-radius: 30px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 211, 106, .10), transparent 58%), linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,100,65,.08));
  border: 1px solid rgba(255, 211, 106, .25);
  box-shadow: inset 0 0 28px rgba(255, 93, 51, .10), 0 18px 54px rgba(0,0,0,.20);
}

.side-panel {
  min-height: 100%;
  padding: 20px;
  border-radius: 30px;
  background: rgba(255, 244, 220, .08);
  border: 1px solid rgba(255, 211, 106, .24);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.badge, .extinguished {
  padding: 12px 15px;
  border-radius: 22px;
  font-weight: 900;
  font-size: 14px;
  text-align: center;
}

.badge {
  background: rgba(255, 211, 106, .13);
  border: 1px solid rgba(255, 211, 106, .28);
  color: var(--text);
}

.extinguished {
  background: rgba(255, 244, 220, .10);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--muted);
}

.timer {
  padding: 16px 22px;
  border-radius: 999px;
  text-align: center;
  font-size: 34px;
  font-weight: 950;
  color: #211536;
  background: linear-gradient(135deg, #ffe08c, #ff6a3a);
  box-shadow: 0 14px 38px rgba(255, 92, 48, .25);
}

.flame-cell {
  aspect-ratio: 1 / 1;
  border: none;
  cursor: pointer;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 58%, rgba(255,255,255,.7), transparent 15%), radial-gradient(circle at 50% 40%, #ffd36a 0%, #ff8a3d 38%, #e6482e 70%, transparent 72%);
  position: relative;
  min-width: 0;
  box-shadow: 0 8px 18px rgba(255, 74, 43, .22), inset 0 -4px 9px rgba(101, 34, 25, .10);
  transition: transform .12s ease, opacity .16s ease, filter .16s ease;
  animation: flameWiggle .75s infinite alternate ease-in-out;
}

.flame-cell:before, .hidden-flame:before {
  content: "🔥";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform: translateY(-1px);
}

.flame-cell:before { font-size: clamp(14px, 1.9vw, 22px); }

.flame-cell:hover, .hidden-flame:hover {
  transform: translateY(-2px) scale(1.08);
  filter: saturate(1.18);
}

.flame-cell.out, .hidden-flame.out {
  pointer-events: none;
  opacity: .22;
  background: radial-gradient(circle at 50% 55%, rgba(255,255,255,.8), transparent 22%), linear-gradient(145deg, #d8e4e2, #aab8b6);
  box-shadow: inset 0 0 12px rgba(47, 35, 87, .08);
  animation: none;
}

.flame-cell.out:before, .hidden-flame.out:before {
  content: "💧";
  opacity: .92;
}

.hidden-flames-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hidden-flame {
  position: absolute;
  width: 54px;
  height: 54px;
  border: none;
  cursor: pointer;
  border-radius: 18px;
  pointer-events: auto;
  background: radial-gradient(circle at 50% 58%, rgba(255,255,255,.7), transparent 15%), radial-gradient(circle at 50% 40%, #ffd36a 0%, #ff8a3d 38%, #e6482e 70%, transparent 72%);
  box-shadow: 0 12px 28px rgba(255, 74, 43, .25), 0 0 0 1px rgba(255, 211, 106, .20);
  animation: hiddenFloat 4.4s ease-in-out infinite, flameWiggle .75s infinite alternate ease-in-out;
}

.hidden-flame:before { font-size: 26px; }

.hidden-flame.h1 { left: 18px; top: 34px; }
.hidden-flame.h2 { right: 18px; top: 34px; animation-delay: .8s; }
.hidden-flame.h3 { left: 18px; bottom: 78px; animation-delay: 1.4s; }
.hidden-flame.h4 { right: 18px; bottom: 78px; animation-delay: 2s; }

.result-panel {
  min-height: 130px;
  text-align: center;
  font-size: 19px;
  line-height: 1.44;
  color: var(--text);
  display: grid;
  align-content: center;
}

.result-panel strong { color: var(--gold); }
.success { color: var(--green); font-weight: 950; }
.fail { color: #ff8c74; font-weight: 950; }

.small-note {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.actions {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn, button.reset-btn {
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 14px 24px;
  color: #211536;
  background: linear-gradient(135deg, #ffe08c, #ff6a3a);
  box-shadow: 0 14px 34px rgba(255, 92, 48, .22);
  font-weight: 950;
  font-size: 15px;
  text-decoration: none;
  display: inline-block;
  transition: transform .16s ease;
}

.btn:hover, button.reset-btn:hover { transform: translateY(-2px); }

button.reset-btn.secondary {
  width: 100%;
  background: rgba(255,244,220,.12);
  color: var(--text);
  border: 1px solid rgba(255, 211, 106, .24);
}

.bottom-brand {
  position: relative;
  z-index: 4;
  width: min(1080px, calc(100% - 32px));
  margin: 4px auto 0;
  display: flex;
  justify-content: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 950;
  letter-spacing: .5px;
  font-size: 18px;
  text-shadow: 0 8px 28px rgba(0,0,0,.24);
}

.logo-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #211536;
  background: linear-gradient(135deg, #ffe08c, #ff6a3a);
  box-shadow: 0 16px 44px rgba(255, 90, 46, .22);
}

.footer {
  position: relative;
  z-index: 4;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 34px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  opacity: .88;
}

.footer a:hover { opacity: 1; color: var(--gold); }

.content-wrap {
  position: relative;
  z-index: 4;
  width: min(900px, calc(100% - 32px));
  margin: 34px auto 60px;
}

.content-card {
  padding: 34px;
  border-radius: 32px;
  background: rgba(24,16,35,.78);
  border: 1px solid rgba(255, 211, 106, .28);
  box-shadow: 0 24px 80px rgba(0,0,0,.26);
  color: var(--muted);
  line-height: 1.72;
  backdrop-filter: blur(14px);
}

.content-card h1, .content-card h2 { color: var(--text); }
.content-card h1 { margin-top: 0; font-size: clamp(32px, 4vw, 48px); }
.content-card a { color: var(--gold); font-weight: 900; }

@keyframes flameWiggle {
  from { transform: rotate(-4deg) scale(.98); }
  to { transform: rotate(4deg) scale(1.04); }
}

@keyframes floaty {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes hiddenFloat {
  0% { margin-top: 0; }
  50% { margin-top: -10px; }
  100% { margin-top: 0; }
}

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    min-height: auto;
  }

  button.reset-btn.secondary {
    width: auto;
  }
}

@media (max-width: 760px) {
  .main-game {
    min-height: auto;
    padding-top: 18px;
  }

  .fire-grid {
    max-width: 100%;
    gap: 6px;
    padding: 12px;
  }

  .decor.emoji {
    width: 62px;
    height: 62px;
    font-size: 28px;
  }

  .hidden-flame {
    width: 46px;
    height: 46px;
  }

  .hidden-flame:before {
    font-size: 23px;
  }

  .hidden-flame.h1, .hidden-flame.h2 {
    top: 14px;
  }

  .hidden-flame.h3, .hidden-flame.h4 {
    bottom: 74px;
  }
}