:root {
  color-scheme: dark;
  --bg: #060816;
  --bg-elevated: #0d1326;
  --bg-soft: rgba(14, 22, 43, 0.78);
  --surface: rgba(11, 18, 36, 0.84);
  --surface-strong: rgba(17, 28, 53, 0.94);
  --surface-highlight: rgba(99, 102, 241, 0.16);
  --text: #f8fafc;
  --muted: #a5b4d4;
  --muted-strong: #cad5f5;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(251, 191, 36, 0.35);
  --primary: #8b5cf6;
  --primary-strong: #6d28d9;
  --secondary: #ec4899;
  --secondary-strong: #be185d;
  --gold: #fbbf24;
  --gold-soft: rgba(251, 191, 36, 0.18);
  --success: #22c55e;
  --danger: #f87171;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.28), transparent 30%),
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.18), transparent 26%),
    radial-gradient(circle at bottom left, rgba(236, 72, 153, 0.12), transparent 24%),
    linear-gradient(180deg, #050816 0%, #09101f 50%, #060816 100%);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

button:hover,
.button:hover,
.interactive:hover {
  transform: translateY(-1px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.95);
  outline-offset: 2px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 30%);
  opacity: 0.4;
}

.page-shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 28px 0 48px;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.9), rgba(236, 72, 153, 0.85));
  color: #120812;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 30px rgba(236, 72, 153, 0.2);
}

.brand-copy h1,
.brand-copy h2,
.brand-copy p {
  margin: 0;
}

.brand-eyebrow,
.kicker,
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.24);
  background: rgba(251, 191, 36, 0.1);
  color: #fde68a;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-panel,
.panel,
.card,
.game-card,
.info-card,
.admin-card,
.auth-shell,
.modal-card {
  background: linear-gradient(180deg, rgba(17, 28, 53, 0.94), rgba(8, 13, 28, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel,
.panel,
.card,
.game-card,
.info-card,
.admin-card {
  padding: 24px;
}

.hero-grid,
.stats-grid,
.action-grid,
.content-grid,
.detail-grid,
.admin-grid {
  display: grid;
  gap: 20px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
  margin-bottom: 24px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.action-grid,
.content-grid,
.detail-grid,
.admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.title-xl {
  margin: 16px 0 10px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
}

.title-lg {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

.title-md {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.lead,
.muted,
.panel p,
.card p,
.game-card p,
.info-card p,
.admin-card p {
  color: var(--muted);
  line-height: 1.65;
}

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

.metric-value {
  margin-top: 10px;
  font-size: clamp(1.4rem, 4vw, 2.3rem);
  font-weight: 800;
}

.metric-note,
.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.22);
  color: #ddd6fe;
  font-weight: 700;
  font-size: 0.82rem;
}

.status-success {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.26);
  color: #bbf7d0;
}

.status-warning {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.26);
  color: #fde68a;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.button,
button[type="submit"],
.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}

.button-primary,
button[type="submit"],
.primary-button {
  background: linear-gradient(135deg, var(--gold), #fb7185 50%, var(--primary));
  color: #fff;
  box-shadow: 0 16px 30px rgba(139, 92, 246, 0.22);
}

.button-secondary,
.secondary-button {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
  color: var(--text);
}

.button-ghost,
.ghost-button {
  background: transparent;
  border-color: rgba(251, 191, 36, 0.28);
  color: #fde68a;
}

.list-reset {
  margin: 0;
  padding: 0;
  list-style: none;
}

.key-value {
  display: grid;
  gap: 14px;
}

.key-value div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.key-value dt,
.key-value dd,
.key-label,
.key-value-text {
  margin: 0;
}

.key-label {
  color: var(--muted);
}

.key-value-text {
  text-align: right;
  font-weight: 700;
}

.grid-span-2 {
  grid-column: span 2;
}

.table-shell {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.table th,
.table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field,
input,
select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 14px 16px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(255, 255, 255, 0.05);
  background-image:
    linear-gradient(45deg, transparent 50%, #fde68a 50%),
    linear-gradient(135deg, #fde68a 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
  padding-right: 44px;
}

select option {
  background: #0d1326;
  color: var(--text);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 0.86rem;
  font-weight: 700;
}

.message {
  min-height: 24px;
  font-size: 0.95rem;
}

.message.success {
  color: #86efac;
}

.message.error {
  color: #fca5a5;
}

.empty-state {
  padding: 24px;
  text-align: center;
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: var(--muted);
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .grid-span-2 {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--max-width));
    padding: 20px 0 32px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .hero-panel,
  .panel,
  .card,
  .game-card,
  .info-card,
  .admin-card,
  .auth-shell,
  .modal-card {
    padding: 20px;
    border-radius: 22px;
  }

  .button-row {
    flex-direction: column;
  }

  .button,
  button[type="submit"],
  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .key-value div {
    align-items: flex-start;
    flex-direction: column;
  }

  .key-value-text {
    text-align: left;
  }
}

@media (max-width: 540px) {
  .stats-grid,
  .action-grid,
  .content-grid,
  .detail-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .brand-badge {
    width: 46px;
    height: 46px;
    border-radius: 16px;
  }
}
