:root {
  color-scheme: dark;
  --bg: #05060e;
  --bg-alt: #0b0d1f;
  --card: rgba(15, 19, 43, 0.8);
  --card-alt: rgba(21, 24, 58, 0.9);
  --accent: #ff4d8f;
  --accent-2: #7cf9d2;
  --text: #f5f5ff;
  --muted: #9aa2c0;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 18px;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

main {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 4rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 3vw, 3rem);
  background: rgba(5, 6, 14, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-title {
  font-weight: 600;
  margin: 0;
}

.logo-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.site-nav a {
  font-size: 0.95rem;
  color: var(--muted);
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--text);
}

.sign-in-btn,
.primary-cta,
.secondary-cta,
.copy-btn {
  border: none;
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.sign-in-btn {
  background: linear-gradient(135deg, var(--accent), #ff8dd0);
  color: #05060e;
}

.primary-cta {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #05060e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary-cta {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.copy-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.85rem;
}

.sign-in-btn:hover,
.primary-cta:hover,
.secondary-cta:hover,
.copy-btn:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--accent-2);
}

.hero {
  margin-top: 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.lead {
  color: var(--muted);
  max-width: 38ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(5, 6, 14, 0.65);
}

.hero-card-title {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  color: var(--muted);
}

.treasury {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-block: 1.5rem;
}

.label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--muted);
}

.value {
  font-size: 2rem;
  margin: 0;
}

.unit {
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.8rem;
}

.hero-card-note {
  font-size: 0.85rem;
  color: var(--muted);
}

.player-panel {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.session-chip {
  display: inline-flex;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.session-chip.signed-in {
  background: rgba(124, 249, 210, 0.2);
  color: var(--accent-2);
}

.session-email {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.player-balance {
  margin-bottom: 1.5rem;
}

.balance-readout {
  font-size: 1.4rem;
  margin: 0.25rem 0 0;
}

.stats {
  margin-block: 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  background: var(--card-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
}

.stat-value {
  font-size: 2rem;
  margin: 0;
}

.stat-label {
  margin: 0;
  color: var(--muted);
}

.game-lobby {
  margin-bottom: 4rem;
}

.game-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.game-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  background: rgba(9, 11, 28, 0.9);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.game-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.game-provider {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.status-pill {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.status-pill.status-available {
  border-color: rgba(124, 249, 210, 0.6);
  color: var(--accent-2);
}

.status-pill.status-coming-soon {
  border-color: rgba(255, 77, 143, 0.4);
  color: var(--accent);
}

.game-summary {
  margin: 0;
  color: var(--muted);
}

.game-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.game-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.launch-game[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.how-it-works {
  margin-bottom: 4rem;
}

.how-it-works h2 {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
}

.steps {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.steps article {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
}

.step-number {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

.deposit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: center;
  margin-bottom: 4rem;
}

.wallet-cards {
  display: grid;
  gap: 1.5rem;
}

.wallet-card {
  background: var(--card-alt);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
}

.wallet-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.confirmations {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.wallet-type {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.wallet-address {
  word-break: break-all;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  margin: 0 0 0.75rem;
  color: var(--accent-2);
}

.wallet-note {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.deposit-form {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}

.deposit-form label {
  font-size: 0.85rem;
  display: grid;
  gap: 0.3rem;
}

.deposit-form input {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font: inherit;
}

.deposit-form button {
  justify-self: flex-start;
}

.security {
  margin-bottom: 4rem;
}

.security-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.security-grid article {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.quote {
  font-style: italic;
}

.quote-author {
  color: var(--muted);
  font-size: 0.85rem;
}

.cta {
  margin-bottom: 4rem;
  background: linear-gradient(135deg, rgba(255, 77, 143, 0.18), rgba(124, 249, 210, 0.18));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.faq details {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem clamp(1rem, 3vw, 3rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
  transition: opacity 0.2s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 14, 0.7);
  backdrop-filter: blur(4px);
  z-index: 40;
}

.modal-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  width: min(480px, calc(100% - 2rem));
  background: #070816;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 2rem;
  position: relative;
}

.modal-lead {
  color: var(--muted);
  margin-top: 0.5rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
}

.sign-in-form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.stage-section {
  display: grid;
  gap: 0.75rem;
}

.stage-section.hidden {
  display: none;
}

.sign-in-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.sign-in-form input {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.75rem 1rem;
  color: var(--text);
  font: inherit;
}

.form-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  text-align: center;
}

.deposit-form .form-note {
  text-align: left;
}

.deposit-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cancel-check {
  border: none;
  background: transparent;
  color: #ff6b6b;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}

.cancel-check:hover {
  color: #ff8a8a;
}

.poll-timer {
  font-size: 0.8rem;
  color: var(--muted);
}

.game-room {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
}

.game-room.hidden {
  opacity: 0;
  pointer-events: none;
}

.game-room-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 14, 0.75);
}

.game-room-panel {
  position: relative;
  width: min(1100px, calc(100% - 2rem));
  max-height: 90vh;
  overflow: auto;
  background: #070816;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  z-index: 1;
}

.game-room-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.75rem;
  cursor: pointer;
}

.game-room-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.game-room-balance {
  text-align: right;
}

.game-room-balance .value {
  font-size: 1.5rem;
  font-weight: 600;
}

.game-room-content {
  display: grid;
  gap: 2rem;
}

.game-view.hidden {
  display: none;
}

.game-table,
.blackjack-table {
  display: grid;
  gap: 2rem;
}

.game-table {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.roulette-display {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
}

.roulette-wheel-wrap {
  position: relative;
  width: min(260px, 70vw);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  --roulette-radius: clamp(78px, 20vw, 130px);
}

.roulette-wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #0d1020;
  border: 10px solid #0d1020;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.04),
    0 24px 40px rgba(0, 0, 0, 0.35);
  transition: transform 3s cubic-bezier(0.16, 1, 0.3, 1);
}

.roulette-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.roulette-segment.red {
  fill: #b73c3c;
}

.roulette-segment.black {
  fill: #0b0d1c;
}

.roulette-segment.green {
  fill: #19a08f;
}

.roulette-inner {
  fill: #10152a;
  stroke: rgba(255, 255, 255, 0.08);
}

.roulette-cap {
  fill: #0b0d1c;
  stroke: rgba(255, 255, 255, 0.12);
}

.roulette-svg-numbers text {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-anchor: middle;
  dominant-baseline: middle;
  fill: rgba(255, 255, 255, 0.8);
  text-rendering: geometricPrecision;
}

.roulette-number-text.red {
  fill: #ffd1d1;
}

.roulette-number-text.black {
  fill: rgba(255, 255, 255, 0.82);
}

.roulette-number-text.zero {
  fill: #7feee0;
}

.roulette-ball-track {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: transform 3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.roulette-ball {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: #f7f8ff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}


.roulette-last {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.roulette-number {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  font-size: 1.25rem;
  font-weight: 600;
}

.roulette-number[data-color="red"] {
  background: rgba(255, 107, 107, 0.2);
  color: #ff8a8a;
}

.roulette-number[data-color="black"] {
  background: rgba(255, 255, 255, 0.12);
}

.roulette-number[data-color="green"] {
  background: rgba(79, 209, 197, 0.2);
  color: #7feee0;
}

.roulette-history {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.roulette-chip {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
}

.roulette-chip.red {
  background: rgba(255, 107, 107, 0.2);
  color: #ff8a8a;
}

.roulette-chip.black {
  background: rgba(255, 255, 255, 0.16);
}

.roulette-chip.green {
  background: rgba(79, 209, 197, 0.2);
  color: #7feee0;
}

.game-controls {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
}

.game-controls input {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.6rem 0.8rem;
  color: var(--text);
  font: inherit;
}

.bet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.5rem;
}

.bet-grid button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 0.6rem;
  cursor: pointer;
}

.bet-grid button.is-active {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.roulette-number-input.is-hidden {
  display: none;
}

.blackjack-table {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}

.hand-section {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 1rem;
}

.hand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hand-total {
  font-weight: 600;
}

.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.card {
  width: 56px;
  height: 78px;
  border-radius: 10px;
  background: #f4f5fa;
  color: #0b0d1c;
  display: grid;
  place-items: center;
  font-weight: 700;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.card-rank,
.card-suit {
  position: absolute;
  font-size: 0.7rem;
  font-weight: 700;
}

.card-rank {
  top: 6px;
  left: 6px;
}

.card-suit {
  bottom: 6px;
  right: 6px;
}

.card-center {
  font-size: 1.25rem;
}

.card-red {
  color: #d64545;
}

.card-black {
  color: #0b0d1c;
}

.card-hidden {
  background: linear-gradient(135deg, #1a1f3a, #0c0f1f);
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.form-status {
  min-height: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.form-status[data-status-type="error"] {
  color: #ff8da1;
}

.form-status[data-status-type="success"] {
  color: var(--accent-2);
}

.wallet-stage {
  gap: 0.5rem;
}

.wallet-input {
  display: grid;
  gap: 0.3rem;
}

.wallet-input.hidden {
  display: none;
}

.is-hidden {
  display: none;
}

.text-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  justify-self: flex-start;
  font-size: 0.85rem;
  padding: 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  display: block;
}

@media (max-width: 900px) {
  .site-nav {
    position: absolute;
    top: 72px;
    right: 1rem;
    flex-direction: column;
    background: rgba(5, 6, 14, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: none;
  }

  .site-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .hero {
    margin-top: 2rem;
  }

  .cta {
    flex-direction: column;
    align-items: flex-start;
  }
}
