:root {
  --bg: #0a0e17;
  --surface: #121a2b;
  --accent: #22d3ee;
  --accent-dim: #0891b2;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --gold: #fbbf24;
  --danger: #f87171;
  --ok: #34d399;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: system-ui, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(ellipse 120% 80% at 50% -20%, #1e3a5f 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.shell {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  width: 100%;
  box-sizing: border-box;
}

/* Keeps class for markup; avoid flex-stretch issues that broke layout */
.shell--main {
  display: block;
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 100%;
}

.logo {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.nav-link {
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-link.active {
  background: rgba(34, 211, 238, 0.2);
  color: var(--accent);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.email {
  color: var(--muted);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  max-width: 100%;
}

.card {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 26, 43, 0.85);
  padding: 1.5rem 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  max-width: 100%;
  box-sizing: border-box;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.muted {
  color: var(--muted);
  font-size: 0.875rem;
}

.jackpot {
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  font-weight: 600;
  color: var(--gold);
  margin: 0.25rem 0 0;
}

.countdown {
  font-family: ui-monospace, monospace;
  font-size: 2rem;
  letter-spacing: 0.15em;
  color: var(--gold);
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.9375rem;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-dim);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text);
}

.alert {
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.alert-warn {
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
}

.alert-err {
  color: var(--danger);
}

.alert-ok {
  color: var(--ok);
}

label {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
  width: 100%;
  max-width: 20rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th,
td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

th {
  color: var(--muted);
  font-weight: 500;
}

.mono {
  font-family: ui-monospace, monospace;
  color: var(--accent);
}

.legal {
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 3rem;
}

.grid2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Color lights game */
.cl-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cl-bulb {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  box-shadow: 0 0 1rem rgba(255, 255, 255, 0.15);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.cl-bulb.cl-dim {
  opacity: 0.35;
}

.cl-red {
  background: radial-gradient(circle at 35% 30%, #fca5a5, #dc2626 60%, #7f1d1d);
}
.cl-blue {
  background: radial-gradient(circle at 35% 30%, #93c5fd, #2563eb 60%, #1e3a8a);
}
.cl-green {
  background: radial-gradient(circle at 35% 30%, #86efac, #16a34a 60%, #14532d);
}
.cl-yellow {
  background: radial-gradient(circle at 35% 30%, #fef08a, #ca8a04 60%, #713f12);
}

.cl-blink {
  opacity: 1 !important;
  animation: cl-pulse 0.9s ease-in-out 3;
  box-shadow: 0 0 1.5rem currentColor;
}

.cl-red.cl-blink {
  color: #f87171;
}
.cl-blue.cl-blink {
  color: #60a5fa;
}
.cl-green.cl-blink {
  color: #4ade80;
}
.cl-yellow.cl-blink {
  color: #facc15;
}

@keyframes cl-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.12);
    filter: brightness(1.35);
  }
}

.cl-pick-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .cl-pick-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cl-pick {
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.cl-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cl-pick-face {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cl-pick-red .cl-pick-face {
  background: radial-gradient(circle at 35% 30%, #fca5a5, #dc2626 65%);
}
.cl-pick-blue .cl-pick-face {
  background: radial-gradient(circle at 35% 30%, #93c5fd, #2563eb 65%);
}
.cl-pick-green .cl-pick-face {
  background: radial-gradient(circle at 35% 30%, #86efac, #16a34a 65%);
}
.cl-pick-yellow .cl-pick-face {
  background: radial-gradient(circle at 35% 30%, #fef08a, #ca8a04 65%);
}

.cl-pick input:focus-visible + .cl-pick-face {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cl-pick input:checked + .cl-pick-face {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.35);
}

.cl-pick-label {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Dice roller */
.dice-pick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
}

.dice-pick {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.dice-pick input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.dice-face {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 2px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.65rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dice-face-sm {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.1rem;
}

.dice-pick input:focus-visible + .dice-face {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dice-pick input:checked + .dice-face {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.35), inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.dice-show-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.dice-face-lg {
  width: 2.35rem;
  height: 2.35rem;
  font-size: 1rem;
}

.dice-face-dim {
  opacity: 0.28;
  filter: grayscale(0.4);
}

.dice-face-landed {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.35), inset 0 2px 4px rgba(0, 0, 0, 0.35);
  animation: dice-pop 0.35s ease-out;
}

@keyframes dice-pop {
  0% {
    transform: scale(0.85);
  }
  60% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.dice-roll-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 9.5rem;
  margin-bottom: 0.25rem;
}

.dice-roll-active {
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 200px;
}

.dice-face-roll {
  width: 5.5rem;
  height: 5.5rem;
  font-size: 2.35rem;
  border-radius: 0.9rem;
}

.dice-shaking {
  animation: dice-shake 0.12s ease-in-out infinite;
}

@keyframes dice-shake {
  0% {
    transform: rotate(-14deg) translateX(-2px);
  }
  50% {
    transform: rotate(14deg) translateX(2px);
  }
  100% {
    transform: rotate(-14deg) translateX(-2px);
  }
}

/* Games hub */
.games-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.game-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.25rem 1.35rem;
}

.game-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.game-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.game-card-summary {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.game-card-how {
  flex: 1;
  margin-top: 0;
}

.game-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.45rem;
  border-radius: 0.35rem;
  white-space: nowrap;
}

.game-badge-live {
  background: rgba(52, 211, 153, 0.2);
  color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.game-badge-soon {
  background: rgba(148, 163, 184, 0.15);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Game graphics — vector heroes & hub cards */
.game-card--has-art {
  padding: 0;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.game-card--has-art:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.5);
  border-color: rgba(34, 211, 238, 0.28);
}

.game-card-art {
  line-height: 0;
  margin: 0;
  background: #0a0e17;
}

.game-card-art .game-card-svg {
  width: 100%;
  height: auto;
  max-height: 176px;
  display: block;
}

.game-card-inner {
  padding: 1.1rem 1.35rem 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.game-card--has-art .game-card-cta {
  margin-top: auto;
}

.games-hero--premium {
  position: relative;
  overflow: hidden;
  border-color: rgba(34, 211, 238, 0.22);
}

.games-hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 120% at 20% -20%, rgba(34, 211, 238, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 70% 100% at 90% 100%, rgba(251, 191, 36, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.games-hero--premium h1,
.games-hero--premium > p {
  position: relative;
}

/* ----- Admin panel tabs ----- */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.25rem;
  padding: 0;
}

.admin-tab {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 26, 43, 0.5);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.admin-tab:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

.admin-tab--active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.admin-tab--active:hover {
  color: var(--bg);
}

.card--jackpot-home {
  padding-top: 0;
  overflow: hidden;
}

.home-jackpot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.25rem;
  margin: 0.25rem 0 0;
}

.home-jackpot-row__amount {
  margin: 0;
}

.home-jackpot-row__price {
  margin: 0;
  font-size: 0.95rem;
}

.home-jackpot-row__price-value {
  color: var(--accent);
  font-weight: 600;
}

.home-jackpot-blurb {
  font-size: 0.8rem;
  margin: 0.5rem 0 0;
  line-height: 1.45;
}

.home-jackpot-visual {
  margin: 0 -2rem 1rem;
  line-height: 0;
}

@media (max-width: 520px) {
  .home-jackpot-visual {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
  }
}

.home-jackpot-visual .home-jackpot-svg {
  width: 100%;
  height: auto;
  display: block;
  max-height: 96px;
}

.buy-ticket-banner {
  line-height: 0;
  margin: 0;
}

.buy-ticket-banner .buy-banner-svg {
  width: 100%;
  height: auto;
  display: block;
  max-height: 76px;
}

.play-page-hero {
  line-height: 0;
  margin: 0;
}

.play-hero-svg {
  width: 100%;
  height: auto;
  display: block;
  max-height: 104px;
}

.play-page-hero--color {
  animation: play-hero-glow 5s ease-in-out infinite;
}

@keyframes play-hero-glow {
  0%,
  100% {
    opacity: 1;
    filter: saturate(1);
  }
  50% {
    opacity: 0.97;
    filter: saturate(1.12);
  }
}

.play-page-hero--dice {
  animation: play-dice-float 6s ease-in-out infinite;
}

.play-page-card,
.card--buy-tickets {
  padding: 0;
}

@keyframes play-dice-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

/* ----- Site footer (reference-style columns + graphics) ----- */
.site-footer {
  position: relative;
  width: 100%;
  margin-top: 2.5rem;
  box-sizing: border-box;
  background: linear-gradient(165deg, rgba(18, 32, 56, 0.92) 0%, rgba(10, 14, 23, 0.98) 45%, #070a10 100%);
  border-top: 1px solid rgba(34, 211, 238, 0.12);
  box-shadow: 0 -24px 48px rgba(0, 0, 0, 0.35);
}

.site-footer__wave {
  line-height: 0;
  margin-top: -1px;
  opacity: 0.95;
}

.site-footer__wave-svg {
  width: 100%;
  height: 40px;
  display: block;
}

.site-footer__warning {
  background: rgba(30, 58, 95, 0.45);
  border-bottom: 1px solid rgba(34, 211, 238, 0.15);
}

.site-footer__warning-inner {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.site-footer__info-icon {
  flex-shrink: 0;
  color: #38bdf8;
  margin-top: 0.1rem;
}

.site-footer__warning-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.site-footer__warning-link {
  color: #7dd3fc;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.site-footer__warning-link:hover {
  color: #e0f2fe;
}

.site-footer__art {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0.5rem 1rem 0;
  opacity: 0.85;
}

.site-footer__balls {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.site-footer__inner {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.site-footer__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem 2rem;
}

@media (max-width: 720px) {
  .site-footer__cols {
    grid-template-columns: 1fr;
  }
}

.site-footer__heading {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #94a3b8;
}

.site-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__links li {
  margin-bottom: 0.4rem;
}

.site-footer__links a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s ease;
}

.site-footer__links a:hover {
  color: var(--accent);
}

.site-footer__legal {
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.5;
  text-align: center;
}

.site-page .site-page__body {
  max-width: 42rem;
}
