:root {
  --accent: #70ff9d;
  --accent-2: #7b61ff;
  --accent-3: #35c7ff;
  --bg: #060811;
  --bg-soft: #0d1220;
  --card: rgba(15, 23, 42, 0.82);
  --card-strong: rgba(15, 23, 42, 0.96);
  --text: #f8fafc;
  --muted: #aab4c3;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f8ff;
  --bg-soft: #eaf0ff;
  --card: rgba(255, 255, 255, 0.82);
  --card-strong: rgba(255, 255, 255, 0.96);
  --text: #101827;
  --muted: #526071;
  --border: rgba(16, 24, 39, 0.12);
  --shadow: 0 24px 80px rgba(56, 74, 112, 0.18);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 26%, transparent), transparent 34rem),
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent-2) 28%, transparent), transparent 30rem),
    linear-gradient(135deg, var(--bg), var(--bg-soft));
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 72%);
}

a {
  color: inherit;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(20px);
}

.navbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent);
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, transparent), color-mix(in srgb, var(--accent-2) 24%, transparent));
  box-shadow: 0 12px 40px color-mix(in srgb, var(--accent) 20%, transparent);
}

.logo-mark svg {
  width: 25px;
  height: 25px;
}

.brand-title {
  display: block;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 1.18rem;
}

.brand-subtitle {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 1px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link, .icon-button, .primary-button, .ghost-button, .danger-button {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--card);
  border-radius: 999px;
  padding: 11px 15px;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.nav-link:hover, .icon-button:hover, .primary-button:hover, .ghost-button:hover, .danger-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
}

.primary-button {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-3) 72%, var(--accent)));
  color: #06110c;
  font-weight: 800;
  box-shadow: 0 16px 42px color-mix(in srgb, var(--accent) 22%, transparent);
}

.danger-button {
  border-color: rgba(255, 91, 91, 0.45);
  color: #ffd5d5;
  background: rgba(255, 91, 91, 0.12);
}

:root[data-theme="light"] .danger-button {
  color: #851919;
}

.icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.hero {
  padding: 74px 0 42px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 26px;
  align-items: stretch;
}

.hero-copy, .featured-card, .control-panel, .game-card, .admin-card, .login-card {
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
}

.hero-copy {
  padding: 36px;
  position: relative;
  overflow: hidden;
}

.hero-copy::after {
  content: "79";
  position: absolute;
  right: -12px;
  bottom: -48px;
  font-size: 12rem;
  font-weight: 1000;
  color: color-mix(in srgb, var(--accent) 10%, transparent);
  letter-spacing: -0.08em;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: color-mix(in srgb, var(--accent) 88%, var(--text));
  font-weight: 800;
  font-size: 0.88rem;
}

.hero h1 {
  margin: 20px 0 14px;
  max-width: 820px;
  font-size: clamp(2.4rem, 8vw, 5.8rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.hero p {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
  position: relative;
  z-index: 1;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 34px;
  position: relative;
  z-index: 1;
}

.stat {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card-strong) 74%, transparent);
}

.stat strong {
  display: block;
  font-size: 1.5rem;
}

.stat span {
  color: var(--muted);
  font-size: .86rem;
}

.featured-card {
  overflow: hidden;
}

.featured-image {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b0f17;
}

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

.featured-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.72), transparent 60%);
}

.featured-badge {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 1;
}

.featured-body {
  padding: 20px;
}

.featured-body h2 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.featured-body p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 18px;
}

.section {
  padding: 30px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
}

.section h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  letter-spacing: -0.06em;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.tabs-wrap {
  overflow: auto;
  padding: 6px 2px 20px;
  scrollbar-width: thin;
}

.game-tabs {
  display: flex;
  gap: 14px;
  min-width: max-content;
}

.game-tab {
  width: 228px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 22px;
  padding: 8px;
  text-align: left;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.game-tab:hover, .game-tab.is-active {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, var(--card));
}

.game-tab img {
  width: 72px;
  height: 52px;
  object-fit: cover;
  border-radius: 15px;
  background: #0b0f17;
}

.game-tab strong {
  display: block;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-tab span {
  color: var(--muted);
  font-size: .78rem;
}

.control-panel {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 12px;
  border-radius: 24px;
  margin-bottom: 20px;
}

.search-field, .select-field, .input-field, textarea.input-field {
  width: 100%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card-strong) 86%, transparent);
  color: var(--text);
  border-radius: 16px;
  padding: 13px 14px;
  outline: none;
}

.search-field:focus, .select-field:focus, .input-field:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.game-card {
  overflow: hidden;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform .18s ease, border-color .18s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.game-card-image {
  aspect-ratio: 16 / 9;
  background: #0b0f17;
}

.game-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.game-card-body {
  padding: 16px;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.game-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.chip {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 5px 9px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}

.chip.hot {
  color: #06110c;
  border-color: transparent;
  background: var(--accent);
}

.game-card h3 {
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}

.game-card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.45;
  font-size: .94rem;
}

.game-card .primary-button {
  margin-top: auto;
  text-align: center;
}

.notice {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--muted);
  background: color-mix(in srgb, var(--card) 80%, transparent);
}

.footer {
  padding: 44px 0 30px;
  color: var(--muted);
}

.footer-inner {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.admin-page {
  padding: 42px 0 70px;
}

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

.admin-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #05070d;
  font-weight: 1000;
}

.bubble {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  color: color-mix(in srgb, var(--accent) 88%, var(--text));
  font-weight: 900;
}

.admin-layout {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 18px;
  align-items: start;
}

.admin-card, .login-card {
  padding: 20px;
}

.login-wrap {
  min-height: calc(100vh - 78px);
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: min(460px, 100%);
}

.admin-card h2, .login-card h1 {
  margin: 0 0 16px;
  letter-spacing: -0.05em;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
  font-size: .9rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

textarea.input-field {
  min-height: 96px;
  resize: vertical;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-game-row {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: color-mix(in srgb, var(--card-strong) 78%, transparent);
  padding: 12px;
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 12px;
  align-items: center;
}

.admin-game-row img {
  width: 92px;
  height: 62px;
  object-fit: cover;
  border-radius: 14px;
  background: #0b0f17;
}

.admin-game-row h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.admin-game-row p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.small-button {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
}

.status-message {
  margin-top: 12px;
  color: var(--muted);
  min-height: 22px;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .hero-grid, .admin-layout {
    grid-template-columns: 1fr;
  }

  .games-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .navbar, .admin-top, .section-head, .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 38px;
  }

  .hero-copy {
    padding: 24px;
  }

  .stat-strip, .control-panel, .games-grid, .form-row, .admin-game-row {
    grid-template-columns: 1fr;
  }

  .admin-game-row img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}
