﻿:root {
  --bg: #0f172a;
  --bg-soft: #111827;
  --card: #1f2937;
  --accent: #22c55e;
  --accent-2: #06b6d4;
  --danger: #f43f5e;
  --text: #f8fafc;
  --muted: #94a3b8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, #0ea5e9 0%, transparent 25%),
    radial-gradient(circle at 80% 15%, #22c55e 0%, transparent 20%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-soft) 100%);
  display: grid;
  place-items: center;
  padding: 16px;
}

.app {
  width: min(720px, 100%);
  background: rgba(17, 24, 39, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  padding: 16px;
  backdrop-filter: blur(8px);
}

.top-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stat {
  background: rgba(31, 41, 55, 0.9);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
}

.stat span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.stat strong {
  font-size: 22px;
}

.challenge-banner {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.18);
  border: 1px solid rgba(6, 182, 212, 0.5);
}

.game-area {
  margin-top: 14px;
}

.track {
  position: relative;
  height: 84px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.target {
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 40%;
  width: 20%;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.35);
  border: 1px solid rgba(34, 197, 94, 0.9);
}

.runner {
  position: absolute;
  top: 12px;
  left: 0;
  width: 28px;
  height: 60px;
  border-radius: 8px;
  background: linear-gradient(180deg, #67e8f9, #06b6d4);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.5);
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.controls,
.social,
.retention,
.analytics,
.upgrades,
.log-panel {
  margin-top: 14px;
}

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

button {
  border: 0;
  border-radius: 10px;
  padding: 10px;
  font-weight: 700;
  cursor: pointer;
  color: #0b1220;
  background: #e2e8f0;
}

button.primary {
  background: var(--accent);
}

button:active {
  transform: translateY(1px);
}

.upgrades {
  background: rgba(31, 41, 55, 0.7);
  border-radius: 12px;
  padding: 12px;
}

.upgrades h2,
.log-panel h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.upgrade-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.upgrade-row + .upgrade-row {
  margin-top: 8px;
}

.log-panel {
  background: rgba(31, 41, 55, 0.7);
  border-radius: 12px;
  padding: 12px;
}

.log-panel small {
  color: var(--muted);
}

.social {
  background: rgba(31, 41, 55, 0.7);
  border-radius: 12px;
  padding: 12px;
}

.social h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.social-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.social-row + .social-row {
  margin-top: 8px;
}

.social input {
  flex: 1;
  min-width: 180px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
}

.leaderboard-list {
  margin: 10px 0 0;
  padding-left: 22px;
}

.leaderboard-list li {
  margin-bottom: 4px;
}

.retention {
  background: rgba(31, 41, 55, 0.7);
  border-radius: 12px;
  padding: 12px;
}

.retention h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.retention-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 10px;
}

.retention-card + .retention-card {
  margin-top: 8px;
}

.retention-card strong {
  display: block;
}

.retention-card p {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.analytics {
  background: rgba(31, 41, 55, 0.7);
  border-radius: 12px;
  padding: 12px;
}

.analytics h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.metric {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  font-size: 20px;
}

.muted-line {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
}

@media (max-width: 640px) {
  .top-bar {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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