:root {
  --bg-deep: #071018;
  --bg-hero: #0b1a28;
  --navy: #0e2438;
  --accent: #d4a017;
  --accent-2: #2ec4b6;
  --cyan: #3de7d4;
  --text: #f3f6f9;
  --muted: #9bb0c3;
  --chart-bg: #e8f0e6;
  --chart-row: #dce8d9;
  --chart-header: #1a5f9e;
  --ink: #12202c;
  --danger: #e85d5d;
  --ok: #2f9e6a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font-display: "Rajdhani", "Segoe UI", sans-serif;
  --font-ui: "DM Sans", "Segoe UI", sans-serif;
  --safe-x: max(0.75rem, env(safe-area-inset-left));
  --safe-r: max(0.75rem, env(safe-area-inset-right));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: #dfe9dc;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: relative;
  isolation: isolate;
  min-height: auto;
  background:
    linear-gradient(180deg, rgba(8, 6, 4, 0.55) 0%, rgba(12, 8, 5, 0.35) 40%, rgba(8, 6, 4, 0.72) 100%),
    radial-gradient(ellipse at 50% 70%, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.55)),
    url("../images/casino-floor-bg.jpg") center 40% / cover no-repeat;
  color: var(--text);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 1rem;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.35)),
    radial-gradient(ellipse at 50% 55%, transparent 30%, rgba(0, 0, 0, 0.4) 100%);
  z-index: 0;
  pointer-events: none;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 110px;
  background: linear-gradient(180deg, transparent, rgba(20, 12, 6, 0.55) 35%, #dfe9dc 92%);
  z-index: 0;
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.85rem var(--safe-x) 0.4rem var(--safe-r);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.brand img {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.45);
  object-fit: cover;
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 4.2vw, 1.9rem);
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.brand-text p {
  margin: 0.15rem 0 0;
  color: #d7c7a8;
  font-size: clamp(0.7rem, 2.5vw, 0.85rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(61, 231, 212, 0.35);
  background: rgba(14, 36, 56, 0.65);
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.live-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.hero-stage {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0.5rem var(--safe-x) 2.25rem var(--safe-r);
}

/* ===== Jackpot Slot Machine ===== */
.slot-machine {
  --gold: #e6b422;
  --gold-deep: #a67c00;
  width: min(440px, 100%);
  max-width: 100%;
  position: relative;
  z-index: 2;
  animation: boardIn 0.85s ease both;
  filter: drop-shadow(0 28px 40px rgba(0, 0, 0, 0.75));
  transform-origin: center bottom;
}

/* subtle floor contact shadow under machine */
.slot-machine::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -14px;
  height: 28px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

@keyframes boardIn {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.slot-marquee {
  background:
    radial-gradient(ellipse at 50% 30%, #ff3b3b 0%, #8b0000 55%, #4a0000 100%);
  border: 3px solid var(--gold);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow:
    inset 0 0 30px rgba(255, 215, 0, 0.25),
    0 0 0 2px #6b4a10;
  text-align: center;
  padding: 0.7rem 0.75rem 0.55rem;
  position: relative;
}

.slot-crown {
  font-size: 1.2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.45));
}

.slot-stars {
  color: var(--gold);
  letter-spacing: 0.28em;
  font-size: 0.62rem;
  margin: 0.15rem 0 0.1rem;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.7);
}

.slot-title {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  font-weight: 900;
  font-size: clamp(1.45rem, 7vw, 2.45rem);
  letter-spacing: 0.1em;
  color: #ffe566;
  text-shadow:
    0 2px 0 #8a6a00,
    0 0 18px rgba(255, 200, 40, 0.65),
    0 4px 12px rgba(0, 0, 0, 0.45);
}

.slot-brand-line {
  margin: 0.2rem 0 0;
  font-size: clamp(0.58rem, 2.4vw, 0.72rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffd7a0;
  opacity: 0.9;
  padding: 0 0.25rem;
  word-break: break-word;
}

.slot-body {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 0.35rem;
  align-items: stretch;
  background: linear-gradient(180deg, #f0c14b, #c9921a 40%, #8a6410);
  border-left: 3px solid #f5d76e;
  border-right: 3px solid #f5d76e;
  padding: 0.5rem 0.4rem;
  box-shadow: inset 0 0 0 2px #6b4a10;
}

.slot-side {
  background: linear-gradient(180deg, #2a1808, #140c06);
  border: 2px solid #e0b23a;
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #ffd76a;
  font-family: "Cinzel", Georgia, serif;
  font-weight: 700;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  line-height: 1.2;
  padding: 0.3rem 0.1rem;
  box-shadow: inset 0 0 12px rgba(0,0,0,.45);
}

.slot-side span {
  display: block;
}

.slot-window {
  background: linear-gradient(180deg, #1a120c, #0c0806);
  border: 3px solid #5c3d12;
  border-radius: 12px;
  padding: 0.45rem 0.35rem 0.55rem;
  position: relative;
  min-width: 0;
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.75),
    0 0 0 2px #e6b422;
}

.slot-status {
  text-align: center;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffcf5a;
  margin-bottom: 0.1rem;
}

.slot-meta {
  text-align: center;
  font-size: 0.68rem;
  color: #c9b48a;
  margin-bottom: 0.35rem;
  min-height: 1em;
  word-break: break-word;
}

.reels {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  --reel-h: 88px;
  --cell-h: 88px;
}

.reel {
  width: min(32vw, 110px);
  flex: 1 1 0;
  max-width: 118px;
  height: var(--reel-h);
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 3px solid #c9a227;
  box-shadow:
    inset 0 10px 18px rgba(0, 0, 0, 0.18),
    inset 0 -10px 18px rgba(0, 0, 0, 0.12),
    0 0 0 1px #7a5a14;
}

.reel::before,
.reel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 28%;
  z-index: 2;
  pointer-events: none;
}

.reel::before {
  top: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.35), transparent);
}

.reel::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.35), transparent);
}

.reel-strip {
  will-change: transform;
  transition: none;
}

.reel-cell {
  height: var(--cell-h);
  display: grid;
  place-items: center;
  font-family: "Cinzel", Georgia, serif;
  font-weight: 900;
  font-size: clamp(2.4rem, 11vw, 4.2rem);
  color: #d41919;
  text-shadow:
    2px 2px 0 #3a0000,
    0 0 1px #000;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7f7f7 45%, #ececec 100%);
  border-bottom: 1px solid #ddd;
  line-height: 1;
}

.reel.spinning {
  box-shadow:
    inset 0 10px 18px rgba(0, 0, 0, 0.18),
    0 0 18px rgba(255, 200, 60, 0.55),
    0 0 0 1px #7a5a14;
}

.reel.locked .reel-cell {
  animation: winPulse 0.55s ease;
}

@keyframes winPulse {
  0% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.slot-machine.is-win .slot-marquee {
  animation: marqueeFlash 0.9s ease;
}

@keyframes marqueeFlash {
  0%, 100% { filter: brightness(1); }
  40% { filter: brightness(1.25); }
}

.slot-lever {
  display: none;
  position: absolute;
  right: -34px;
  top: 18%;
  width: 40px;
  height: 130px;
  pointer-events: none;
  z-index: 6;
}

/* Entire handle (stick + ball) rotates together from the hinge */
.lever-pivot {
  position: absolute;
  left: 10px;
  top: 0;
  width: 28px;
  height: 110px;
  transform-origin: 14px 8px;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lever-pivot::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5d76e, #a67c00);
  border: 2px solid #6b4a10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.lever-stick {
  position: absolute;
  left: 11px;
  top: 10px;
  width: 7px;
  height: 72px;
  border-radius: 8px;
  background: linear-gradient(90deg, #f0d060, #d4af37 45%, #8a6a12);
  box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.35);
}

.lever-knob {
  position: absolute;
  left: 0;
  top: 72px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff7a7a, #c41212 55%, #7a0000);
  border: 2px solid #f0c14b;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  /* never animate knob alone — only parent .lever-pivot moves */
  transition: none !important;
}

.slot-machine.is-spinning .lever-pivot {
  transform: rotate(52deg);
}

.slot-machine:not(.is-spinning) .lever-pivot {
  transform: rotate(0deg);
}

.slot-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: linear-gradient(180deg, #f0c14b, #b8860b);
  border: 3px solid #f5d76e;
  border-top: 0;
  border-radius: 0 0 18px 18px;
  padding: 0.5rem 0.55rem 0.6rem;
  color: #3b2200;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(0.62rem, 2.8vw, 0.78rem);
  letter-spacing: 0.06em;
  box-shadow: inset 0 0 0 2px #6b4a10;
  text-align: center;
}

.slot-footer strong {
  font-weight: 900;
}

.main {
  position: relative;
  z-index: 1;
  padding: 0 var(--safe-x) 2rem var(--safe-r);
  margin-top: -0.75rem;
  width: 100%;
}

.panel {
  max-width: 1100px;
  margin: 0 auto;
  background: rgba(232, 240, 230, 0.96);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(18, 32, 44, 0.12);
  padding: 0.9rem;
  backdrop-filter: blur(8px);
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #456074;
  margin-bottom: 0.3rem;
}

.field select {
  width: 100%;
  appearance: none;
  border: 1px solid #b7c8b4;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23456074' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") right 12px center/12px no-repeat;
  border-radius: 12px;
  padding: 0.7rem 2rem 0.7rem 0.8rem;
  font: inherit;
  font-size: 16px; /* prevent iOS zoom */
  color: var(--ink);
  min-height: 44px;
}

.chart-hint {
  display: none;
  font-size: 0.75rem;
  color: #5d7268;
  margin: -0.35rem 0 0.55rem;
}

.chart-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid #b9cbb5;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  max-width: 100%;
  touch-action: pan-x pan-y;
}

.chart {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: 0.85rem;
}

.chart th,
.chart td {
  border-right: 1px solid #c5d4c2;
  border-bottom: 1px solid #c5d4c2;
  text-align: center;
  padding: 0.5rem 0.35rem;
  min-width: 38px;
}

.chart thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--chart-header);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.chart th.corner {
  left: 0;
  z-index: 4;
  min-width: 84px;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.chart tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #eef5ec;
  color: #1a5f9e;
  font-weight: 700;
  text-align: left;
  padding-left: 0.55rem;
  white-space: nowrap;
  font-size: 0.78rem;
}

.chart tbody tr:nth-child(even) td {
  background: var(--chart-row);
}

.chart tbody tr:nth-child(odd) td {
  background: var(--chart-bg);
}

.chart td.today-col {
  box-shadow: inset 0 0 0 2px rgba(212, 160, 23, 0.45);
}

.chart td.just-opened {
  animation: cellFlash 1.2s ease;
  font-weight: 800;
  color: #0b6b5e;
}

@keyframes cellFlash {
  0% { background: #ffe08a !important; transform: scale(1.08); }
  100% { transform: scale(1); }
}

.footer {
  text-align: center;
  padding: 0.5rem var(--safe-x) calc(1.5rem + env(safe-area-inset-bottom)) var(--safe-r);
  color: #5d7268;
  font-size: 0.82rem;
}

.footer a {
  color: #1a5f9e;
  font-weight: 600;
}

.maintenance {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: var(--bg-deep);
  color: var(--text);
  text-align: center;
  padding: 2rem var(--safe-x);
}

/* ---- Breakpoints ---- */
@media (max-width: 480px) {
  .chart-hint {
    display: block;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .slot-body {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .slot-side {
    display: none;
  }

  .reels {
    --reel-h: 96px;
    --cell-h: 96px;
  }

  .panel {
    border-radius: 14px;
    padding: 0.75rem;
  }

  .chart th.corner,
  .chart tbody th {
    min-width: 76px;
  }
}

@media (min-width: 481px) and (max-width: 767px) {
  .reels {
    --reel-h: 100px;
    --cell-h: 100px;
  }

  .slot-side {
    font-size: 0.62rem;
  }
}

@media (min-width: 768px) {
  .brand img {
    width: 56px;
    height: 56px;
  }

  .live-pill {
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
  }

  .site-header {
    min-height: min(72vh, 620px);
    background-position: center 35%;
  }

  .slot-marquee {
    border-width: 4px;
    border-radius: 28px 28px 0 0;
    padding: 0.85rem 1rem 0.7rem;
  }

  .slot-body {
    grid-template-columns: 52px 1fr 52px;
    gap: 0.45rem;
    border-left-width: 4px;
    border-right-width: 4px;
    padding: 0.65rem 0.55rem;
  }

  .slot-side {
    font-size: 0.72rem;
    border-radius: 10px;
  }

  .slot-lever {
    display: block;
  }

  .slot-footer {
    border-width: 4px;
    border-radius: 0 0 22px 22px;
    font-size: 0.78rem;
  }

  .reels {
    --reel-h: 108px;
    --cell-h: 108px;
    gap: 0.55rem;
  }

  .panel {
    padding: 1.15rem;
  }

  .chart {
    font-size: 0.92rem;
  }

  .chart th,
  .chart td {
    min-width: 42px;
    padding: 0.55rem 0.45rem;
  }

  .chart th.corner {
    min-width: 96px;
  }
}

@media (min-width: 900px) {
  .filters {
    grid-template-columns: 220px 220px;
  }

  .panel {
    padding: 1.4rem;
  }

  .reels {
    --reel-h: 124px;
    --cell-h: 124px;
  }

  .reel {
    width: 130px;
    flex: 0 0 130px;
  }

  .slot-side {
    font-size: 0.8rem;
  }
}

@media (min-width: 1100px) {
  .main {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
