﻿:root {
  --bg-0: #090d17;
  --bg-1: #0f1627;
  --bg-2: #15233d;
  --panel: rgba(13, 22, 39, 0.86);
  --panel-border: #2d4268;
  --text: #eef4ff;
  --muted: #9fb4d9;
  --accent: #57b1ff;
  --accent-2: #8d63ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 5%, #22345a 0%, rgba(34, 52, 90, 0.15) 30%, transparent 50%),
    radial-gradient(circle at 90% 10%, #3b2d68 0%, rgba(59, 45, 104, 0.08) 30%, transparent 58%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1) 45%, #0f172a);
  min-height: 100vh;
  overflow: hidden;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  padding: 1rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.utility-toggle {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  width: 44px;
  height: 44px;
  border: 1px solid #45639a;
  border-radius: 12px;
  background: linear-gradient(180deg, #28426c, #1b2f4f);
  color: #e8f1ff;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 32;
}

.utility-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: min(360px, 90vw);
  height: 100%;
  padding: 1rem 0.9rem 1rem 1rem;
  background: linear-gradient(180deg, rgba(8, 14, 24, 0.98), rgba(9, 18, 33, 0.98));
  border-right: 1px solid #2c4371;
  transform: translateX(-102%);
  transition: transform 220ms ease;
  z-index: 40;
  overflow-y: auto;
}

.utility-panel.is-open {
  transform: translateX(0);
}

.utility-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.utility-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.utility-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #3b5688;
  background: #172845;
  color: #eaf2ff;
  cursor: pointer;
}

.utility-block {
  border: 1px solid #2c4269;
  border-radius: 12px;
  background: rgba(20, 31, 54, 0.45);
  padding: 0.65rem;
  margin-bottom: 0.6rem;
}

.utility-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #d8e7ff;
}

.utility-note p {
  margin: 0;
  color: #adc3e8;
  font-size: 0.82rem;
  line-height: 1.4;
}

.hero {
  margin-left: 0;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 0.9rem;
  background:
    linear-gradient(120deg, rgba(22, 35, 60, 0.9), rgba(18, 30, 52, 0.78)),
    linear-gradient(180deg, rgba(108, 155, 255, 0.08), rgba(141, 99, 255, 0.05));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 0.8rem;
  align-items: center;
}

.hero-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #9dc0f3;
}

.hero-brand h1 {
  margin: 0.2rem 0 0;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.hero-stats {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.stat-card {
  min-width: 95px;
  padding: 0.44rem 0.64rem;
  border-radius: 12px;
  border: 1px solid #3d5682;
  background: rgba(12, 21, 36, 0.72);
  text-align: center;
}

.stat-card span {
  display: block;
  font-size: 0.68rem;
  color: #9eb2d5;
  margin-bottom: 0.08rem;
}

.stat-card strong {
  font-size: 1.02rem;
}

.stat-card-prize {
  min-width: 340px;
  padding: 0.95rem 1.25rem;
  border-color: #6fb8ff;
  background: linear-gradient(180deg, rgba(32, 56, 94, 0.9), rgba(24, 41, 70, 0.88));
  box-shadow: 0 0 0 1px rgba(111, 184, 255, 0.25), 0 10px 24px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card-prize span {
  font-size: 0.8rem;
  color: #b9d8ff;
}

.stat-card-prize strong {
  font-size: 2.75rem;
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.hero-controls {
  display: flex;
  gap: 0.45rem;
}

.icon-btn {
  border: 1px solid #3e5682;
  border-radius: 12px;
  padding: 0.5rem 0.74rem;
  background: linear-gradient(180deg, #22395e, #1a2f4f);
  color: #edf4ff;
  font-weight: 700;
  cursor: pointer;
}

.icon-btn-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  filter: brightness(1.08);
}

.icon-btn-primary {
  background: linear-gradient(180deg, #6db8ff, #407dce);
  border-color: #78b9ff;
}

.bonus-active {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.45rem;
}

.bonus-badge {
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  border: 1px solid #364d75;
  background: #1f2d47;
  color: #dbe7ff;
}

.play-area {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(340px, 1fr) minmax(430px, 540px);
  gap: 0.9rem;
  align-items: stretch;
}

.reveal-panel,
.board-wrap {
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(6px);
}

.reveal-panel {
  padding: 0.85rem;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.reveal-header h2 {
  margin: 0;
  font-size: 1.03rem;
}

.reveal-header p {
  margin: 0.24rem 0 0.82rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.reveal-stage {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #3f5277;
  width: auto;
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
  aspect-ratio: var(--reveal-ratio, 4 / 3);
  background: transparent;
}

.reveal-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.reveal-mask {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  grid-template-rows: repeat(20, 1fr);
  gap: 1px;
  background: rgba(6, 9, 16, 0.24);
}

.reveal-tile {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(10, 12, 20, 0.96),
      rgba(10, 12, 20, 0.96) 12px,
      rgba(20, 25, 37, 0.96) 12px,
      rgba(20, 25, 37, 0.96) 24px
    );
  transition: opacity 180ms ease;
  outline: 1px solid rgba(120, 145, 190, 0.25);
}

.reveal-tile.is-revealed {
  background: transparent;
  outline: 1px solid rgba(86, 211, 146, 0.55);
}

.reveal-percent {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  background: rgba(7, 11, 18, 0.76);
  border: 1px solid #466290;
  border-radius: 999px;
  padding: 0.24rem 0.55rem;
  font-weight: 700;
  font-size: 0.84rem;
}

.reveal-stage.is-complete {
  box-shadow: 0 0 0 2px rgba(102, 219, 255, 0.4), 0 0 40px rgba(74, 188, 255, 0.35);
}

.reveal-complete-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #8ecfff;
  background: rgba(8, 21, 42, 0.86);
  color: #f3fbff;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(154, 210, 255, 0.35), 0 8px 28px rgba(0, 0, 0, 0.45);
  animation: reveal-pop 900ms ease;
}

.reveal-confetti {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -8%;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.95;
  animation: confetti-fall 1600ms linear forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translate3d(0, -10%, 0) rotate(0deg);
    opacity: 0.95;
  }
  100% {
    transform: translate3d(var(--drift, 0px), 120vh, 0) rotate(720deg);
    opacity: 0;
  }
}

@keyframes reveal-pop {
  0% { transform: translate(-50%, -50%) scale(0.86); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.game-panel {
  width: 100%;
  min-height: 0;
}

.board-wrap {
  position: relative;
  overflow: hidden;
}

#board {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  display: block;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(10, 15, 26, 0.74);
  text-align: center;
  padding: 1rem;
  font-size: 1.12rem;
  font-weight: 700;
}

.overlay--blocked {
  background: rgba(4, 7, 13, 0.94);
  align-items: center;
  justify-items: center;
}

.overlay-card {
  width: min(92%, 680px);
  border: 1px solid #3e5682;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20, 31, 51, 0.96), rgba(14, 23, 39, 0.96));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  padding: 1rem;
}

.overlay-title {
  margin: 0;
  font-size: 1.32rem;
  color: #f3f7ff;
}

.overlay-subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  color: #c8d9f7;
  line-height: 1.45;
  font-weight: 500;
}

.overlay-actions {
  margin-top: 0.8rem;
  margin-bottom: 0.55rem;
  display: flex;
  justify-content: center;
}

.overlay-share-row {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.overlay-share-row .share-link {
  font-size: 0.8rem;
  padding: 0.34rem 0.64rem;
}

.overlay small {
  display: block;
  font-size: 0.9rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-weight: 500;
}

.overlay-action {
  margin-top: 0.75rem;
}

.hidden {
  display: none;
}

.help {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.72rem;
}

.touchpad {
  margin: 0.8rem auto 0;
  width: min(100%, 320px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 56px);
  gap: 0.45rem;
}

.pad {
  border-radius: 12px;
  border: 1px solid #3b4d70;
  background: #2a3957;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
}

.pad:active {
  transform: translateY(1px);
  background: #33466a;
}

.up { grid-column: 2; grid-row: 1; }
.left { grid-column: 1; grid-row: 2; }
.down { grid-column: 2; grid-row: 2; }
.right { grid-column: 3; grid-row: 2; }

.share-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.auth-status-text {
  font-size: 0.84rem;
  color: #cfe0ff;
  margin-bottom: 0.45rem;
}

.referral-card {
  margin-top: 0.6rem;
  border: 1px solid #3e5682;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(24, 39, 64, 0.96), rgba(18, 31, 53, 0.96));
  padding: 0.65rem;
}

.referral-card-head {
  font-size: 0.86rem;
  font-weight: 800;
  color: #e8f2ff;
}

.referral-card-sub {
  margin-top: 0.22rem;
  font-size: 0.74rem;
  color: #aecaef;
}

.referral-link-row {
  margin-top: 0.48rem;
  display: flex;
  gap: 0.42rem;
  align-items: center;
}

.referral-link-pill {
  flex: 1;
  min-width: 0;
  border: 1px solid #4f6c99;
  border-radius: 999px;
  background: rgba(11, 20, 35, 0.9);
  color: #a9d1ff;
  padding: 0.36rem 0.58rem;
  font-size: 0.74rem;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.referral-link-pill:hover,
.referral-link-pill:focus-visible {
  border-color: #78b7ff;
  color: #d4e9ff;
}

.referral-share-links {
  margin-top: 0.48rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.auth-form {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.42rem;
}

.auth-switch {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  padding: 0.28rem;
  border: 1px solid #6f562b;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(25, 20, 12, 0.95), rgba(17, 14, 9, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 223, 157, 0.14);
}

.auth-switch-btn {
  flex: 1;
  border: 1px solid #4f3f24;
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  background: linear-gradient(180deg, #2d2312, #1d170c);
  color: #e2cca0;
  font-family: "Rajdhani", "Trebuchet MS", sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.auth-switch-btn:hover,
.auth-switch-btn:focus-visible {
  filter: brightness(1.06);
  border-color: #9e7a3b;
  box-shadow: 0 0 0 2px rgba(199, 157, 75, 0.2);
  outline: none;
}

.auth-switch-btn.is-active {
  border-color: #e3b35e;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 241, 197, 0.72), rgba(255, 241, 197, 0) 42%),
    linear-gradient(180deg, #f0c978, #c88f33 68%, #b37927);
  color: #241607;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.auth-switch-btn:active {
  transform: translateY(1px);
}

.auth-pane[hidden] {
  display: none !important;
}

#auth-modal .auth-form .share-link,
#auth-modal #logout-btn,
#auth-modal #watch-replays-link {
  width: 100%;
  justify-content: center;
  text-align: center;
  border-radius: 11px;
  border: 1px solid #e0b35f;
  background:
    radial-gradient(circle at 24% 16%, rgba(255, 242, 201, 0.45), rgba(255, 242, 201, 0) 42%),
    linear-gradient(180deg, #efc777, #c88f33 68%, #b27725);
  color: #241607;
  font-family: "Rajdhani", "Trebuchet MS", sans-serif;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.36);
}

#auth-modal .auth-form .share-link:hover,
#auth-modal .auth-form .share-link:focus-visible,
#auth-modal #logout-btn:hover,
#auth-modal #logout-btn:focus-visible,
#auth-modal #watch-replays-link:hover,
#auth-modal #watch-replays-link:focus-visible {
  filter: brightness(1.05);
  border-color: #f2c56f;
  outline: none;
}

.slot-modal-card {
  width: min(540px, 96vw);
}

.slot-pot {
  margin-bottom: 0.6rem;
  border: 1px solid #8a6a31;
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  background: rgba(31, 24, 12, 0.65);
  color: #f2ddad;
  text-align: center;
}

.slot-pot strong {
  font-family: "Cinzel", serif;
  font-size: 1.4rem;
  color: #fff1c8;
  margin-left: 0.25rem;
}

.slot-reels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin: 0.35rem 0 0.7rem;
}

.slot-reel {
  height: 86px;
  border: 1px solid #b99043;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: "Cinzel", serif;
  font-size: 2rem;
  color: #f6e0a6;
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 242, 201, 0.26), rgba(255, 242, 201, 0) 40%),
    linear-gradient(180deg, #2d2212, #171108);
  box-shadow: inset 0 0 0 1px rgba(255, 219, 144, 0.2), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.slot-reel.slot-reel-win {
  border-color: #f0cb74;
  color: #fff7de;
  box-shadow: inset 0 0 0 1px rgba(255, 243, 202, 0.32), 0 0 22px rgba(243, 200, 106, 0.45);
}

.slot-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.slot-actions .share-link {
  min-width: 110px;
}

#slot-message.is-error {
  color: #ffb0b0;
}

.slot-voucher-wrap {
  margin: 0.3rem 0 0.55rem;
  border: 1px solid #6f582c;
  border-radius: 12px;
  background: rgba(24, 19, 11, 0.54);
  padding: 0.55rem;
}

.slot-voucher-wrap h3 {
  margin: 0 0 0.3rem;
  color: #f5d58b;
  font-size: 0.95rem;
}

#slot-voucher-status.is-error {
  color: #ffb0b0;
}

.slot-voucher-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.slot-voucher-card {
  border: 1px solid #7a6232;
  border-radius: 10px;
  background: rgba(15, 12, 8, 0.68);
  padding: 0.5rem;
}

.slot-voucher-card h4 {
  margin: 0;
  color: #ffe6aa;
  font-size: 0.92rem;
}

.slot-voucher-card p {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #ebd6a5;
}

.slot-voucher-provider {
  font-weight: 700;
  color: #f8df9e;
}

.slot-voucher-distance {
  color: #c6dfb8;
}

.slot-voucher-pick-btn {
  margin-top: 0.35rem;
}

.slot-voucher-card.is-selected {
  border-color: #f0cb74;
  box-shadow: 0 0 0 1px rgba(240, 203, 116, 0.35);
}

.auth-modal [hidden],
.auth-form[hidden],
#logout-btn[hidden],
#watch-replays-link[hidden] {
  display: none !important;
}

.auth-form input {
  width: 100%;
  border: 1px solid #3a4f76;
  border-radius: 10px;
  background: #17253e;
  color: #e8f2ff;
  padding: 0.5rem 0.6rem;
  font-size: 0.82rem;
}

.auth-form input::placeholder {
  color: #9fb2d3;
}

.auth-form input:focus-visible {
  outline: 2px solid #58adff;
  outline-offset: 0;
  border-color: #58adff;
}

.auth-message {
  min-height: 1.1rem;
  font-size: 0.78rem;
  color: #8ee0b3;
}

.auth-message.is-error {
  color: #ff9fa3;
}

.auth-indicator {
  justify-self: end;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid #3f567f;
  padding: 0.24rem 0.6rem;
  color: #dbe8ff;
  background: #1c2d48;
}

.auth-indicator.is-logged-in {
  border-color: #2f8a5a;
  background: rgba(22, 87, 56, 0.38);
  color: #b6f5d5;
}

.auth-indicator.is-logged-out {
  border-color: #5a6f92;
  background: rgba(44, 60, 92, 0.4);
  color: #d8e6ff;
}

.share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #3b4d70;
  background: #25324d;
  color: #dbe9ff;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.share-link:hover,
.share-link:focus-visible {
  background: #2f4062;
  border-color: #5070a2;
}

.bonus-key-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.bonus-key-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #c5d3ef;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #2e4268;
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-slow { background: #56a8ff; box-shadow: 0 0 0 2px rgba(86, 168, 255, 0.24); }
.dot-reveal { background: #ba67ff; box-shadow: 0 0 0 2px rgba(186, 103, 255, 0.24); }
.dot-double { background: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.24); }
.dot-red { background: #ef4444; box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.26); }
.dot-orange { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.28); }

.powered-by {
  margin: 0.8rem 0 0;
}

.powered-by a {
  color: #8fc8ff;
  text-decoration: none;
  font-weight: 700;
}

.powered-by a:hover,
.powered-by a:focus-visible {
  color: #b7ddff;
  text-decoration: underline;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    min-height: 100vh;
  }

  .hero {
    margin-left: 0;
    grid-template-columns: 1fr;
  }

  .hero-controls,
  .hero-stats,
  .bonus-active {
    justify-content: flex-start;
  }

  .play-area {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero {
    margin-left: 0;
    margin-top: 2.9rem;
  }

  .utility-toggle {
    bottom: 0.7rem;
    left: 0.7rem;
  }

  .stat-card {
    flex: 1;
    min-width: 82px;
  }
}

@media (min-width: 981px) {
  .touchpad {
    display: none;
  }
}

/* Premium Casino Theme Overrides */
:root {
  --bg-0: #070a08;
  --bg-1: #0d1310;
  --bg-2: #152117;
  --panel: rgba(16, 21, 17, 0.86);
  --panel-border: #b89142;
  --text: #f7f1df;
  --muted: #d2c49b;
  --accent: #f3c86a;
  --accent-2: #5a8f6d;
}

body {
  font-family: "Rajdhani", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 8% 6%, rgba(244, 190, 74, 0.18) 0%, rgba(244, 190, 74, 0.04) 28%, transparent 55%),
    radial-gradient(circle at 88% 12%, rgba(66, 125, 87, 0.2) 0%, rgba(66, 125, 87, 0.04) 28%, transparent 55%),
    linear-gradient(165deg, var(--bg-0), var(--bg-1) 42%, #101811);
}

.utility-toggle {
  width: 52px;
  height: 52px;
  border: 1px solid #f0c96e;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 247, 214, 0.95) 0%, rgba(255, 247, 214, 0.08) 22%, transparent 40%),
    linear-gradient(180deg, #f1cb73, #b78733);
  color: #2f2208;
  font-size: 1.5rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 0 26px rgba(243, 200, 106, 0.45);
}

.utility-panel {
  background:
    linear-gradient(165deg, rgba(8, 12, 10, 0.98), rgba(13, 18, 14, 0.98)),
    radial-gradient(circle at 20% 6%, rgba(243, 200, 106, 0.14), transparent 40%);
  border-right: 1px solid #a9853b;
  box-shadow: 22px 0 50px rgba(0, 0, 0, 0.55);
}

.utility-head h2 {
  font-size: 1.15rem;
  color: #f3c86a;
  font-family: "Cinzel", serif;
}

.utility-close {
  border: 1px solid #d5af5a;
  background: linear-gradient(180deg, #32240b, #1f180b);
  color: #f4dfad;
}

.utility-block {
  border: 1px solid #7e6430;
  background: rgba(31, 26, 14, 0.45);
}

.utility-block h3 {
  color: #f5d58b;
  letter-spacing: 0.03em;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  background:
    linear-gradient(120deg, rgba(22, 28, 21, 0.94), rgba(17, 24, 19, 0.9)),
    radial-gradient(circle at 15% 8%, rgba(243, 200, 106, 0.13), transparent 42%);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(243, 200, 106, 0.12) inset;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -1px auto auto -20%;
  width: 40%;
  height: 140%;
  background: linear-gradient(120deg, rgba(255, 244, 214, 0.16), rgba(255, 244, 214, 0));
  transform: rotate(9deg);
  pointer-events: none;
}

.hero-kicker {
  font-size: 0.75rem;
  color: #f5d283;
}

.hero-brand h1 {
  font-size: clamp(1.4rem, 2.15vw, 1.95rem);
  font-family: "Cinzel", serif;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff3d2 0%, #f1c76a 70%, #cc9737 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 8px 22px rgba(221, 169, 70, 0.22);
}

.stat-card {
  padding: 0.5rem 0.7rem;
  border: 1px solid #806431;
  background: linear-gradient(180deg, rgba(24, 30, 24, 0.94), rgba(17, 22, 18, 0.94));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(243, 200, 106, 0.08) inset;
}

.stat-card span {
  color: #dbc188;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-card strong {
  font-size: 1.14rem;
  font-family: "Cinzel", serif;
  color: #fff2cf;
}

.stat-card-prize {
  border-color: #e0b95f;
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 240, 204, 0.18), transparent 44%),
    linear-gradient(180deg, rgba(55, 40, 14, 0.95), rgba(27, 23, 12, 0.95));
  box-shadow: 0 0 0 1px rgba(224, 185, 95, 0.34), 0 16px 34px rgba(0, 0, 0, 0.42), 0 0 32px rgba(243, 200, 106, 0.2);
}

.stat-card-prize span {
  font-size: 0.86rem;
  color: #f5dc9f;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat-card-prize strong {
  font-size: 2.9rem;
  color: #fff4d4;
  text-shadow: 0 0 22px rgba(243, 200, 106, 0.28);
}

.icon-btn {
  border: 1px solid #b08c46;
  background: linear-gradient(180deg, #372b12, #20190c);
  color: #f8e8be;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}

.icon-btn:hover {
  transform: translateY(-1px);
}

.icon-btn-primary {
  background: linear-gradient(180deg, #f1cb73, #c08f3a);
  border-color: #f0ca72;
  color: #2b1d08;
}

.bonus-badge {
  border: 1px solid #8b6f37;
  background: linear-gradient(180deg, #30220f, #1d160a);
  color: #f5d488;
}

.reveal-panel,
.board-wrap {
  background: linear-gradient(180deg, rgba(20, 24, 20, 0.9), rgba(13, 16, 13, 0.9));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(243, 200, 106, 0.1) inset;
}

.reveal-stage {
  border: 1px solid #866a35;
}

.reveal-percent {
  background: rgba(18, 15, 9, 0.8);
  border: 1px solid #b68f47;
}

.overlay {
  background: rgba(9, 12, 9, 0.82);
}

.pad {
  border: 1px solid #896d38;
  background: linear-gradient(180deg, #382a12, #221b0f);
}

.pad:active {
  background: linear-gradient(180deg, #2f240f, #1e170d);
}

.auth-status-text {
  color: #f1dcab;
}

.auth-form input {
  border: 1px solid #7f6432;
  background: #1f1a0e;
  color: #f8ebcc;
}

.auth-form input::placeholder {
  color: #b9a374;
}

.auth-form input:focus-visible {
  outline: 2px solid #f0c96e;
  border-color: #f0c96e;
}

.auth-indicator {
  border: 1px solid #8a6e39;
  color: #f5dc9d;
  background: #261e0f;
}

.auth-indicator.is-logged-in {
  border-color: #63a577;
  background: rgba(31, 78, 47, 0.42);
  color: #c7ffd8;
}

.auth-indicator.is-logged-out {
  border-color: #977739;
  background: rgba(43, 33, 17, 0.5);
  color: #f0d39a;
}

.share-link {
  border: 1px solid #8e7139;
  background: linear-gradient(180deg, #342711, #1f190d);
  color: #f4db9f;
}

.share-link:hover,
.share-link:focus-visible {
  background: linear-gradient(180deg, #412f14, #251c0e);
  border-color: #c89f4f;
}

.bonus-key-item {
  color: #ead5a5;
  background: rgba(255, 223, 154, 0.05);
  border: 1px solid #6f582c;
}

.powered-by a {
  color: #f2cd74;
}

.powered-by a:hover,
.powered-by a:focus-visible {
  color: #ffe4a4;
}

.app {
  max-width: 1880px;
  margin: 0 auto;
  padding: 0.95rem 1rem 1rem;
}

.hero {
  grid-template-columns: minmax(260px, 0.9fr) minmax(560px, 1.65fr) auto;
  grid-template-areas:
    "brand stats controls"
    "brand stats auth"
    "bonus bonus bonus";
  align-items: start;
  gap: 0.9rem 1rem;
}

.hero-brand {
  grid-area: brand;
  min-height: 136px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 0.2rem;
}

.hero-stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: minmax(260px, 1.8fr) repeat(4, minmax(90px, 1fr));
  gap: 0.55rem;
  align-items: stretch;
}

.stat-card {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card-prize {
  min-width: 0;
  min-height: 96px;
  align-items: flex-start;
  text-align: left;
  padding-left: 1.25rem;
}

.hero-controls {
  grid-area: controls;
  justify-content: flex-end;
  align-self: center;
}

.auth-indicator {
  grid-area: auth;
  justify-self: end;
  align-self: start;
  margin-top: 0.2rem;
}

.bonus-active {
  grid-area: bonus;
  margin-top: 0.1rem;
  flex-wrap: wrap;
}

.reveal-mobile-progress {
  display: none;
  width: 100%;
  margin-top: 0.55rem;
  border: 1px solid #876b34;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(30, 24, 13, 0.9), rgba(20, 16, 9, 0.9));
  padding: 0.5rem 0.58rem;
}

.reveal-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  color: #f2d596;
  font-size: 0.78rem;
  font-weight: 700;
}

.reveal-mobile-head strong {
  color: #fff0c6;
  font-family: "Cinzel", serif;
  font-size: 0.76rem;
}

.reveal-mobile-bar {
  margin-top: 0.4rem;
  height: 10px;
  border-radius: 999px;
  border: 1px solid #7b6330;
  background: #20170d;
  overflow: hidden;
}

.reveal-mobile-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f1bc5a, #8ed8ff);
  box-shadow: 0 0 14px rgba(242, 198, 98, 0.42);
  transition: width 180ms ease;
}

.play-area {
  grid-template-columns: minmax(340px, 1fr) minmax(430px, 540px);
  gap: 0.9rem;
}

.reveal-panel {
  padding: 1rem;
}

.game-panel {
  width: 100%;
  min-height: 0;
}

.board-wrap {
  position: relative;
  overflow: hidden;
}

#board {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  display: block;
}

@media (max-width: 1400px) {
  .hero {
    grid-template-columns: minmax(220px, 0.85fr) minmax(520px, 1.5fr);
    grid-template-areas:
      "brand controls"
      "stats stats"
      "auth bonus";
  }

  .hero-stats {
    grid-template-columns: minmax(250px, 1.8fr) repeat(4, minmax(84px, 1fr));
  }

  .hero-controls {
    justify-self: end;
  }

  .bonus-active {
    justify-content: flex-end;
  }
}

@media (max-width: 980px) {
  .app {
    max-width: none;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "stats"
      "controls"
      "auth"
      "bonus";
    gap: 0.7rem;
  }

  .hero-brand {
    min-height: auto;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card-prize {
    grid-column: 1 / -1;
  }

  .hero-controls,
  .auth-indicator,
  .bonus-active {
    justify-self: start;
  }

  .reveal-mobile-progress { display: block; }

  .play-area {
    grid-template-columns: 1fr;
  }
}

.auth-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 42;
  border: 1px solid #e0b862;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  background:
    radial-gradient(circle at 28% 16%, rgba(255, 244, 208, 0.9), rgba(255, 244, 208, 0) 34%),
    linear-gradient(180deg, #f3ce7b, #c6923d);
  color: #241807;
  font-family: "Rajdhani", "Trebuchet MS", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 26px rgba(243, 200, 106, 0.36);
}

.auth-fab:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5, 7, 6, 0.72);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-modal.hidden {
  display: none;
}

#auth-modal.auth-logged-in #login-form,
#auth-modal.auth-logged-in #register-form {
  display: none !important;
}

#auth-modal.auth-logged-out #logout-btn,
#auth-modal.auth-logged-out #watch-replays-link {
  display: none !important;
}

.auth-modal-card {
  width: min(460px, 96vw);
  border: 1px solid #8a6a31;
  border-radius: 16px;
  background:
    linear-gradient(165deg, rgba(11, 15, 12, 0.98), rgba(17, 23, 18, 0.98)),
    radial-gradient(circle at 24% 8%, rgba(243, 200, 106, 0.15), transparent 42%);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(243, 200, 106, 0.2) inset;
  padding: 1rem;
}

.auth-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.auth-modal-head h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #f4ce79;
  font-family: "Cinzel", serif;
}

.auth-logout-btn {
  width: 100%;
  margin: 0.2rem 0 0.4rem;
}

@media (max-width: 640px) {
  .auth-fab {
    right: 0.7rem;
    bottom: 0.7rem;
    padding: 0.6rem 0.9rem;
  }
}

/* Auth modal premium overrides (kept last to beat earlier theme rules) */
#auth-modal .auth-switch {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  padding: 0.28rem;
  border: 1px solid #6f562b;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(25, 20, 12, 0.95), rgba(17, 14, 9, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 223, 157, 0.14);
}

#auth-modal .auth-switch-btn {
  flex: 1;
  border: 1px solid #4f3f24;
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  background: linear-gradient(180deg, #2d2312, #1d170c);
  color: #e2cca0;
  font-family: "Rajdhani", "Trebuchet MS", sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

#auth-modal .auth-switch-btn:hover,
#auth-modal .auth-switch-btn:focus-visible {
  filter: brightness(1.06);
  border-color: #9e7a3b;
  box-shadow: 0 0 0 2px rgba(199, 157, 75, 0.2);
  outline: none;
}

#auth-modal .auth-switch-btn.is-active {
  border-color: #e3b35e;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 241, 197, 0.72), rgba(255, 241, 197, 0) 42%),
    linear-gradient(180deg, #f0c978, #c88f33 68%, #b37927);
  color: #241607;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

#auth-modal .auth-switch-btn:active {
  transform: translateY(1px);
}

#auth-modal .auth-form .share-link,
#auth-modal #logout-btn,
#auth-modal #watch-replays-link {
  width: 100%;
  justify-content: center;
  text-align: center;
  border-radius: 11px;
  border: 1px solid #e0b35f;
  background:
    radial-gradient(circle at 24% 16%, rgba(255, 242, 201, 0.45), rgba(255, 242, 201, 0) 42%),
    linear-gradient(180deg, #efc777, #c88f33 68%, #b27725);
  color: #241607;
  font-family: "Rajdhani", "Trebuchet MS", sans-serif;
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.36);
}

#auth-modal .auth-form .share-link:hover,
#auth-modal .auth-form .share-link:focus-visible,
#auth-modal #logout-btn:hover,
#auth-modal #logout-btn:focus-visible,
#auth-modal #watch-replays-link:hover,
#auth-modal #watch-replays-link:focus-visible {
  filter: brightness(1.05);
  border-color: #f2c56f;
  outline: none;
}

