:root {
  --bg: #060913;
  --bg-soft: rgba(10, 16, 34, 0.78);
  --panel: rgba(13, 20, 42, 0.86);
  --panel-strong: rgba(10, 14, 28, 0.96);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f5f7ff;
  --muted: #9aa7c7;
  --primary: #a855f7;
  --primary-2: #6366f1;
  --accent: #22d3ee;
  --gold: #f59e0b;
  --success: #22c55e;
  --danger: #f43f5e;
  --shadow: 0 30px 80px rgba(4, 8, 20, 0.55);
  --neon: 0 0 0 1px rgba(168, 85, 247, 0.28), 0 12px 45px rgba(99, 102, 241, 0.18), 0 0 90px rgba(34, 211, 238, 0.1);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(168,85,247,0.2), transparent 32%),
    radial-gradient(circle at bottom right, rgba(34,211,238,0.16), transparent 28%),
    linear-gradient(180deg, #0a1021 0%, #05070e 100%);
  color: var(--text);
}

a { color: #89e3ff; text-decoration: none; }
a:hover { color: white; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.page-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.8), rgba(0,0,0,0.2));
}

.panel {
  position: relative;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15,20,39,0.93), rgba(8,11,22,0.95));
  border-radius: 28px;
  box-shadow: var(--shadow), var(--neon);
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent 25%, transparent 70%, rgba(34,211,238,0.07));
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
}
.badge-hot { color: #ffd8ff; border-color: rgba(236,72,153,0.35); background: rgba(236,72,153,0.09); }
.badge-blue { color: #d9f8ff; border-color: rgba(34,211,238,0.3); background: rgba(34,211,238,0.08); }

.auth-wrap, .dashboard-shell {
  position: relative;
  min-height: 100vh;
  padding: 28px;
}

.auth-grid {
  position: relative;
  z-index: 1;
  max-width: 1380px;
  margin: 0 auto;
  min-height: calc(100vh - 56px);
  display: grid;
  gap: 24px;
  grid-template-columns: 1.1fr 0.9fr;
}

.auth-showcase, .auth-panel {
  padding: 38px;
}

.auth-showcase {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 760px;
  background:
    radial-gradient(circle at top left, rgba(168,85,247,0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(34,211,238,0.16), transparent 24%),
    linear-gradient(180deg, rgba(14,18,38,0.94), rgba(9,12,24,0.95));
}

.hero-title, .dashboard-title {
  margin: 20px 0 0;
  max-width: 14ch;
  font-size: clamp(42px, 6vw, 86px);
  line-height: 0.96;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero-copy, .dashboard-copy {
  max-width: 720px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.6;
}

.chip-row, .quick-pills, .tag-row, .link-list, .tab-row, .toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chip, .meta-pill, .tag {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: #e5eeff;
  font-size: 13px;
  font-weight: 700;
}
.chip-blue { color: #d9f8ff; border-color: rgba(34,211,238,0.28); }
.chip-pink { color: #ffd8ff; border-color: rgba(236,72,153,0.28); }
.chip-green { color: #d2ffe8; border-color: rgba(34,197,94,0.28); }
.chip-gold { color: #ffe8bf; border-color: rgba(245,158,11,0.28); }
.meta-pill { background: rgba(255,255,255,0.06); }
.tag { font-size: 12px; }
.tag-alt { border-color: rgba(34,211,238,0.22); }

.showcase-cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 34px;
}
.mini-card {
  border-radius: 22px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(10px);
}
.mini-card-title { font-weight: 800; font-size: 16px; }
.mini-card-copy { margin-top: 10px; color: var(--muted); line-height: 1.55; font-size: 14px; }

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 620px;
  width: 100%;
  justify-self: center;
}
.panel-title {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.04em;
}
.panel-copy {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 17px;
}
.auth-body { position: relative; z-index: 1; margin-top: 24px; }
.auth-form { display: grid; gap: 18px; }
.auth-footer { position: relative; z-index: 1; margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.08); color: var(--muted); }
.inline-links { color: var(--muted); }

.field { display: grid; gap: 9px; }
.field-label {
  color: #b5c2e0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.field-control {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(4,8,20,0.65);
  color: white;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.field-control:focus {
  border-color: rgba(34,211,238,0.4);
  box-shadow: 0 0 0 4px rgba(34,211,238,0.12);
  transform: translateY(-1px);
}
.field-control::placeholder { color: #6f7b99; }
.company-field { position: relative; }
.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 10;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(6,10,21,0.98);
  box-shadow: var(--shadow);
}
.suggestion-item {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  color: white;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.suggestion-item:hover { background: rgba(255,255,255,0.06); }
.suggestion-item:last-child { border-bottom: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  color: white;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.22);
}
.btn:disabled { opacity: .65; cursor: wait; }
.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  border-color: rgba(168,85,247,0.4);
  box-shadow: 0 15px 40px rgba(99,102,241,0.25);
}
.btn-secondary {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
}
.btn-ghost { background: rgba(255,255,255,0.04); }
.btn-gold {
  background: linear-gradient(90deg, rgba(245,158,11,0.92), rgba(234,88,12,0.92));
  border-color: rgba(245,158,11,0.35);
}

.alert {
  position: relative;
  z-index: 2;
  padding: 16px 18px;
  border-radius: 18px;
  margin-top: 18px;
  font-weight: 600;
}
.alert-error { background: rgba(244,63,94,0.12); border: 1px solid rgba(244,63,94,0.25); color: #ffc9d4; }
.alert-success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.24); color: #ccffde; }
.debug-box {
  margin-top: 18px;
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.debug-link { margin-top: 10px; color: #bfeaff; word-break: break-all; }

.loading-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.loading-panel {
  max-width: 420px;
  width: 100%;
  padding: 40px;
  text-align: center;
}
.loading-orb {
  width: 92px;
  height: 92px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,211,238,0.95) 0%, rgba(168,85,247,0.7) 55%, rgba(168,85,247,0.04) 100%);
  box-shadow: 0 0 60px rgba(34,211,238,0.35);
  animation: pulse 1.7s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: .8; }
}

.dashboard-wrap {
  position: relative;
  z-index: 1;
  max-width: 1460px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}
.dashboard-hero {
  padding: 34px;
  display: grid;
  gap: 24px;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: stretch;
  background:
    radial-gradient(circle at top left, rgba(236,72,153,0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(34,211,238,0.14), transparent 24%),
    linear-gradient(180deg, rgba(10,14,28,0.96), rgba(7,10,18,0.98));
}
.hero-stats {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat-card {
  position: relative;
  z-index: 1;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
}
.stat-label { color: #b8c4df; text-transform: uppercase; letter-spacing: .18em; font-size: 11px; font-weight: 800; }
.stat-value { margin-top: 14px; font-size: clamp(24px, 2vw, 34px); font-weight: 900; line-height: 1.12; word-break: break-word; }
.stat-meta { margin-top: 10px; color: var(--muted); font-size: 14px; }

.filters-panel {
  padding: 24px;
}
.filters-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}
.filter-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.results-panel {
  display: grid;
  gap: 18px;
}
.section-heading { display: grid; gap: 10px; }
.section-eyebrow {
  color: #8be8ff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.section-title {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
  letter-spacing: -0.03em;
}
.section-subtitle { margin: 0; color: var(--muted); line-height: 1.65; max-width: 780px; }
.dashboard-alert { margin-top: 0; }
.inline-loader, .empty-state, .load-more-row {
  border-radius: 24px;
  padding: 24px;
}
.inline-loader, .empty-state {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}
.load-more-row { display: flex; justify-content: center; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.game-card {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.1);
  background: linear-gradient(180deg, rgba(15,20,40,0.92), rgba(9,12,23,0.96));
  box-shadow: 0 15px 40px rgba(2,6,18,0.34);
}
.game-cover {
  position: relative;
  aspect-ratio: 4 / 5;
  background: linear-gradient(180deg, rgba(33,41,80,0.9), rgba(15,18,30,0.96));
  background-size: cover;
  background-position: center;
}
.cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,10,22,0.04), rgba(8,10,22,0.66));
}
.score-pill {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
  min-width: 58px;
  padding: 10px 14px;
  text-align: center;
  border-radius: 999px;
  background: rgba(7,12,24,0.82);
  border: 1px solid rgba(255,255,255,0.12);
  font-weight: 900;
}
.game-body { padding: 20px; }
.game-title { margin: 0; font-size: 22px; line-height: 1.08; letter-spacing: -0.03em; }
.game-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.game-summary { margin: 14px 0 0; color: var(--muted); line-height: 1.65; min-height: 78px; }
.game-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 30px;
  background: rgba(3,6,14,0.76);
  backdrop-filter: blur(8px);
  overflow: auto;
}
.detail-panel {
  max-width: 1340px;
  margin: 0 auto;
}
.detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: rgba(4,8,20,0.8);
  font-size: 30px;
}
.detail-hero {
  position: relative;
  min-height: 360px;
  background: linear-gradient(180deg, rgba(18,25,51,0.85), rgba(6,10,20,0.96));
  background-size: cover;
  background-position: center;
}
.detail-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6,10,20,0.18), rgba(6,10,20,0.92));
}
.detail-hero-content {
  position: relative;
  z-index: 1;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 360px;
}
.detail-title {
  margin: 18px 0 0;
  font-size: clamp(36px, 4vw, 66px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}
.detail-meta, .detail-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.detail-body {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  padding: 30px;
}
.detail-main, .detail-aside { display: grid; gap: 22px; }
.detail-paragraph {
  margin: 0;
  line-height: 1.8;
  color: #d7e0f5;
  font-size: 16px;
}
.detail-storyline { color: #aef2ff; }
.detail-block, .info-group {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  border-radius: 22px;
  padding: 20px;
}
.block-title, .info-title {
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #cde7ff;
}
.gallery-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.gallery-item {
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,0.08);
}
.link-list { display: grid; gap: 10px; }
.link-list a {
  color: #b8f5ff;
  word-break: break-word;
}

@media (max-width: 1280px) {
  .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-stats { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .auth-grid, .dashboard-hero, .detail-body { grid-template-columns: 1fr; }
  .auth-showcase { min-height: auto; }
  .showcase-cards { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .auth-wrap, .dashboard-shell { padding: 16px; }
  .auth-showcase, .auth-panel, .dashboard-hero, .filters-panel, .detail-hero-content, .detail-body { padding: 22px; }
  .games-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-grid { grid-template-columns: 1fr; }
  .hero-title, .dashboard-title { max-width: none; }
}

@media (max-width: 640px) {
  .games-grid, .gallery-grid { grid-template-columns: 1fr; }
  .detail-overlay { padding: 12px; }
  .btn { width: 100%; }
  .game-actions, .detail-actions, .tab-row, .filter-actions { flex-direction: column; }
}
