:root {
  --bg-grad: linear-gradient(135deg, #eef3ff 0%, #f5eefc 45%, #fdeef8 100%);
  --card-bg: #ffffff;
  --text-main: #1b1f3b;
  --text-muted: #6b7280;
  --border-soft: #eef0f6;
  --accent-blue: #3b6df3;
  --accent-blue-dark: #1e2a5e;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-orange: #ff7a00;
  --accent-green: #16c784;
  --accent-red: #ef4444;
  --shadow-soft: 0 20px 45px -20px rgba(30, 42, 94, 0.25);
  --shadow-card: 0 10px 30px -15px rgba(30, 42, 94, 0.15);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

[data-theme='dark'] {
  --bg-grad: linear-gradient(135deg, #0c0f1f 0%, #14152b 50%, #1b1330 100%);
  --card-bg: #171a2e;
  --text-main: #f4f5fb;
  --text-muted: #a2a6c4;
  --border-soft: #2a2d47;
  --shadow-soft: 0 20px 45px -20px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 10px 30px -15px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-grad);
  color: var(--text-main);
  min-height: 100vh;
  transition: background 0.35s ease, color 0.35s ease;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

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

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  box-shadow: var(--shadow-card);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-links a.active {
  color: var(--accent-blue);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: white;
  box-shadow: 0 12px 24px -10px rgba(59, 109, 243, 0.55);
}

.btn-dark {
  background: var(--accent-blue-dark);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-main);
}

.btn-danger {
  background: var(--accent-red);
  color: white;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.hero {
  padding: 60px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--card-bg);
  box-shadow: var(--shadow-card);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: 46px;
  line-height: 1.15;
  margin: 0 0 18px;
  font-weight: 800;
}

.hero p {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 0 28px;
}

.hero-actions {
  display: flex;
  gap: 14px;
}

.hero-stats {
  display: flex;
  gap: 30px;
  margin-top: 40px;
}

.hero-stat h3 {
  font-size: 26px;
  margin: 0;
}

.hero-stat span {
  font-size: 13px;
  color: var(--text-muted);
}

.hero-visual {
  position: relative;
}

.floating-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  position: relative;
}

.floating-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.floating-card-header span {
  font-size: 13px;
  color: var(--text-muted);
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.mini-badge.blue {
  background: rgba(59, 109, 243, 0.12);
  color: var(--accent-blue);
}

.mini-badge.green {
  background: rgba(22, 199, 132, 0.12);
  color: var(--accent-green);
}

.mini-badge.orange {
  background: rgba(255, 122, 0, 0.12);
  color: var(--accent-orange);
}

.mini-badge.purple {
  background: rgba(168, 85, 247, 0.12);
  color: var(--accent-purple);
}

.section {
  padding: 50px 0;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-title h2 {
  font-size: 28px;
  margin: 0 0 6px;
  font-weight: 800;
}

.section-title p {
  margin: 0;
  color: var(--text-muted);
}

.game-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.game-tab {
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--card-bg);
  box-shadow: var(--shadow-card);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
}

.game-tab.is-active {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-soft);
}

.product-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.product-card .price {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-blue);
}

.product-card .sku {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px;
  border: 1px solid var(--border-soft);
}

.card + .card {
  margin-top: 22px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-soft);
}

.stat-card .label {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--card-bg);
  border-right: 1px solid var(--border-soft);
  padding: 26px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 34px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
}

.sidebar-nav a.is-active {
  background: var(--accent-blue-dark);
  color: white;
}

.sidebar-nav .divider {
  height: 1px;
  background: var(--border-soft);
  margin: 14px 0;
}

.main-content {
  padding: 28px 36px 60px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.page-header h1 {
  font-size: 24px;
  margin: 0;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}

tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--border-soft);
}

tbody tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.success {
  background: rgba(22, 199, 132, 0.14);
  color: var(--accent-green);
}

.badge.pending {
  background: rgba(255, 122, 0, 0.14);
  color: var(--accent-orange);
}

.badge.failed {
  background: rgba(239, 68, 68, 0.14);
  color: var(--accent-red);
}

.badge.on {
  background: rgba(59, 109, 243, 0.14);
  color: var(--accent-blue);
}

.badge.off {
  background: rgba(107, 114, 128, 0.14);
  color: var(--text-muted);
}

.toggle-form {
  display: inline-block;
}

.toggle-switch {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  border: none;
  position: relative;
  background: var(--border-soft);
  transition: background 0.2s ease;
}

.toggle-switch.on {
  background: var(--accent-blue);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s ease;
}

.toggle-switch.on::after {
  transform: translateX(20px);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--card-bg);
  color: var(--text-main);
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
}

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

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 40px;
}

.auth-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
}

.auth-card p.subtitle {
  color: var(--text-muted);
  margin: 0 0 26px;
  font-size: 14px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 18px;
}

.alert.error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-red);
}

.alert.success {
  background: rgba(22, 199, 132, 0.12);
  color: var(--accent-green);
}

.footer {
  border-top: 1px solid var(--border-soft);
  padding: 30px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.code-block {
  background: var(--accent-blue-dark);
  color: #d7e3ff;
  border-radius: var(--radius-md);
  padding: 18px;
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  overflow-x: auto;
  white-space: pre;
}

.api-key-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-grad);
  border: 1px dashed var(--accent-blue);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-family: 'Fira Code', monospace;
  font-size: 13px;
}

.tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--border-soft);
  font-size: 12px;
  font-weight: 600;
}

.deco-cube {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  opacity: 0.85;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
  }
}
