:root {
  --bg: #06110c;
  --bg-2: #0c1d15;
  --panel: rgba(13, 30, 22, 0.78);
  --panel-2: rgba(19, 42, 31, 0.72);
  --line: rgba(169, 255, 202, 0.18);
  --text: #eefdf4;
  --muted: #a7c8b3;
  --green: #72f2a0;
  --green-2: #39c873;
  --danger: #ff8e8e;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Parkinsans', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(78, 255, 147, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(117, 240, 204, 0.12), transparent 25%),
    linear-gradient(135deg, var(--bg), #08150e 45%, #04100a 100%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
}

.bg-grid {
  position: fixed;
  inset: 0;
  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: 24px 24px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
  pointer-events: none;
}

.auth-shell, .dashboard-shell, .topbar {
  position: relative;
  z-index: 2;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0;
}

.hero-card, .auth-card, .stat-card, .game-panel, .leaderboard-card, .info-card, .action-card, .log-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-card {
  padding: 42px;
}

.badge {
  display: inline-flex;
  background: rgba(114, 242, 160, 0.14);
  border: 1px solid rgba(114, 242, 160, 0.28);
  color: var(--green);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  margin-bottom: 18px;
}

.hero-card h1 {
  margin: 0 0 14px;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 0.95;
}

.hero-card p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  max-width: 720px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.hero-stats div, .stat-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}

.hero-stats span, .stat-card span, .micro-text, .topbar-sub, .action-card p, .info-card p, .log-item small {
  color: var(--muted);
}

.hero-stats strong, .stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
}

.auth-card {
  padding: 24px;
}

.tabs {
  display: flex;
  background: rgba(255,255,255,0.04);
  border-radius: 18px;
  padding: 6px;
  gap: 6px;
  margin-bottom: 18px;
}

.tab-btn, .primary-btn, .secondary-btn, .ghost-btn {
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: 0.25s ease;
}

.tab-btn {
  flex: 1;
  padding: 14px 18px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(114,242,160,0.2), rgba(57,200,115,0.25));
  color: var(--text);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

label {
  display: block;
  margin: 14px 0 8px;
  font-size: 14px;
}

input[type="text"], input[type="password"], input[type="file"] {
  width: 100%;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  outline: none;
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.primary-btn, .secondary-btn, .ghost-btn {
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 15px;
}

.primary-btn {
  width: 100%;
  margin-top: 18px;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #042010;
  font-weight: 700;
}

.secondary-btn {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--line);
}

.ghost-btn {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.primary-btn:hover, .secondary-btn:hover, .ghost-btn:hover, .tab-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.alert {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 14px;
}
.alert.error { background: rgba(255, 77, 77, 0.12); border: 1px solid rgba(255, 77, 77, 0.28); color: #ffc1c1; }
.alert.success { background: rgba(87, 255, 133, 0.12); border: 1px solid rgba(87, 255, 133, 0.28); color: #bfffd0; }

.topbar {
  width: min(1320px, calc(100% - 34px));
  margin: 18px auto 0;
  padding: 20px 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: rgba(7, 22, 15, 0.82);
  border: 1px solid var(--line);
  border-radius: 24px;
  backdrop-filter: blur(10px);
}

.logo {
  font-size: 26px;
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.earth-warning {
  max-width: 580px;
  color: #d8f9e5;
  background: rgba(114, 242, 160, 0.08);
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(114, 242, 160, 0.18);
}

.dashboard-shell {
  width: min(1320px, calc(100% - 34px));
  margin: 18px auto 32px;
}

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

.stat-card {
  padding: 22px;
}

.stat-card.highlight {
  background: linear-gradient(135deg, rgba(114,242,160,0.18), rgba(57,200,115,0.12));
}

.stat-card strong {
  font-size: clamp(26px, 3vw, 40px);
}

.main-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr;
  gap: 18px;
  margin-top: 18px;
}

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

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

.section-title-row h2, .leaderboard-card h2, .info-card h2, .log-box h3, .action-card h3 { margin: 0; }

.action-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.action-card {
  padding: 22px;
  background: rgba(18, 39, 29, 0.78);
}

.action-result {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  min-height: 52px;
  display: flex;
  align-items: center;
}

.fake-video {
  margin-top: 10px;
}

.fake-video-screen {
  height: 180px;
  border-radius: 22px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #173224, #0d1d15 45%, #1a4a31);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.scan-line {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateY(-100%);
  animation: scan 3s linear infinite;
}

@keyframes scan {
  to { transform: translateY(100%); }
}

.video-text {
  position: relative;
  z-index: 1;
  font-size: 22px;
  text-align: center;
  width: min(88%, 420px);
}

.video-progress {
  height: 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  margin-top: 12px;
  overflow: hidden;
}

.video-progress div {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), #dcff86);
  transition: width 0.9s linear;
}

.download-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.log-box {
  margin-top: 18px;
  padding: 22px;
}

#logList {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.log-item {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  align-items: center;
}

.leaderboard {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.leader-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}

.leader-row.current {
  background: rgba(114, 242, 160, 0.12);
  border-color: rgba(114, 242, 160, 0.28);
}

.info-card {
  margin-top: 18px;
}

.info-card.danger {
  background: linear-gradient(135deg, rgba(255,150,150,0.11), rgba(255,199,120,0.08));
}

@media (max-width: 1050px) {
  .auth-shell, .main-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .action-cards { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-right { flex-direction: column; align-items: stretch; }
}

@media (max-width: 700px) {
  .auth-shell, .dashboard-shell, .topbar { width: min(100% - 20px, 1000px); }
  .hero-card, .auth-card, .game-panel, .leaderboard-card, .info-card, .log-box, .stat-card, .action-card { border-radius: 22px; }
  .hero-card { padding: 28px; }
  .stats-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; }
  .log-item { grid-template-columns: 1fr; }
  .download-row { flex-direction: column; }
}
