*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d0d0f;
  --bg-2: #141418;
  --bg-3: #1c1c22;
  --border: #2a2a32;
  --text: #e4e4e7;
  --text-muted: #71717a;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.15);
  --green: #4ade80;
  --orange: #fb923c;
  --red: #f87171;
  --radius: 10px;
  --radius-lg: 14px;
  --font: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar styling ── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg-2);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: var(--bg-2);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

*::-webkit-scrollbar-corner {
  background: var(--bg-2);
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  height: 64px;
  background: rgba(13, 13, 15, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo span { color: var(--accent); }

nav ul {
  display: flex;
  gap: 28px;
  list-style: none;
}

nav ul a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

nav ul a:hover { color: var(--accent); }

/* ── HERO ── */
.hero {
  padding: 120px 5vw 64px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

/* ── SECTIONS ── */
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 520px;
}

/* ── GAME TABS ── */
.games {
  padding: 48px 5vw 32px;
  max-width: 900px;
  margin: 0 auto;
}

.game-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.game-tab {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.game-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}

.game-tab.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.game-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.game-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
  padding: 12px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, background 0.2s;
}

.game-link:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ── UPLOAD ── */
/* ── OUTPUT / JSON ── */
.output-section {
  padding: 32px 5vw 80px;
  max-width: 1000px;
  margin: 0 auto;
}

.output-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.output-header .section-title { margin-bottom: 0; }

.output-actions {
  display: flex;
  gap: 8px;
}

.btn-outline {
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.json-container {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
  max-width: 100%;
}

.json-view {
  margin: 0;
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-muted);
  overflow-x: auto;
  overflow-y: visible;
  min-height: 120px;
  max-width: 100%;
  display: block;
}

.json-view.has-content {
  color: var(--text);
}

.json-view code {
  font-family: inherit;
  font-size: inherit;
  white-space: pre;
}

.json-key { color: var(--accent); }
.json-string { color: var(--green); }
.json-number { color: var(--orange); }
.json-bool { color: #a78bfa; }
.json-null { color: var(--text-muted); }

.output-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 16px;
  max-width: 560px;
}

.output-note code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.output-warn {
  color: var(--orange);
  margin-top: 12px;
}

/* ── File viewer (view.html) ── */
.view-section {
  padding: 100px 5vw 80px;
  max-width: 1100px;
  margin: 0 auto;
}

.view-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.view-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.file-view-container {
  margin-top: 0;
}

.file-view {
  white-space: pre;
  word-break: normal;
}

.hero code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--accent);
  border: 1px solid var(--border);
}

/* ── FOOTER ── */
footer {
  padding: 32px 5vw;
  text-align: center;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  nav { padding: 0 4vw; }
  .hero { padding: 100px 4vw 48px; }
  .output-section { padding-left: 4vw; padding-right: 4vw; }
  .json-view { padding: 16px; font-size: 0.8rem; }
}
