:root {
  color-scheme: dark;
  --background: #07100e;
  --surface: #0b1714;
  --surface-2: #101f1b;
  --text: #eefcf5;
  --muted: #91aaa0;
  --border: #213c33;
  --accent: #5ee6a8;
  --accent-dark: #09271d;
  --danger: #ff8b8b;
  --max-width: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background-color: var(--background);
  background-image:
    linear-gradient(rgba(94, 230, 168, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 230, 168, .045) 1px, transparent 1px);
  background-size: 40px 40px;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(22px, calc((100% - var(--max-width)) / 2));
  border-bottom: 1px solid rgba(33, 60, 51, .8);
  background: rgba(7, 16, 14, .88);
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; letter-spacing: .05em; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: #07100e; background: var(--accent); }
.main-nav { display: flex; align-items: center; gap: 8px; }
.main-nav > a:not(.button) { padding: 10px 12px; color: var(--muted); }
.main-nav > a:hover { color: var(--text); }
.menu-button { display: none; color: var(--text); border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 9px 12px; }

.section { width: min(var(--max-width), calc(100% - 44px)); margin-inline: auto; padding: 88px 0; }
.hero { min-height: 690px; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 70px; }
.eyebrow { margin: 0 0 16px; color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 800; }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 6px rgba(94,230,168,.1); }
h1, h2, h3, p { text-wrap: balance; }
h1 { max-width: 760px; margin: 0; font-size: clamp(3rem, 7vw, 6rem); line-height: .98; letter-spacing: -.055em; }
h1 span { color: var(--accent); }
h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.035em; }
h3 { margin: 0; }
.lead { max-width: 700px; margin: 28px 0 0; color: var(--muted); font-size: 1.18rem; line-height: 1.7; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; border: 1px solid var(--accent); border-radius: 12px; padding: 12px 18px; color: #07100e; background: var(--accent); font-weight: 800; }
.button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button-secondary { color: var(--text); border-color: var(--border); background: var(--surface); }
.button-small { min-height: auto; padding: 10px 15px; }

.terminal { overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: rgba(11, 23, 20, .92); box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.terminal-bar { display: flex; gap: 7px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.terminal pre { overflow: auto; margin: 0; padding: 28px; font-size: .94rem; line-height: 1.75; }
.terminal-accent { color: var(--accent); }
.terminal-muted { color: var(--muted); }

.section-panel { width: 100%; padding-inline: max(22px, calc((100% - var(--max-width)) / 2)); border-block: 1px solid var(--border); background: rgba(11,23,20,.78); }
.section-heading { display: flex; justify-content: space-between; gap: 32px; align-items: end; margin-bottom: 34px; }
.section-heading > p, .section-heading > div > p:not(.eyebrow) { max-width: 540px; margin: 12px 0 0; color: var(--muted); line-height: 1.6; }
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.project-card { display: flex; min-height: 280px; flex-direction: column; padding: 25px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); transition: transform .18s ease, border-color .18s ease; }
.project-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.project-icon { font-size: 2rem; }
.project-top { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.project-status { border-radius: 999px; padding: 5px 9px; color: var(--accent); background: var(--accent-dark); font-size: .76rem; font-weight: 800; }
.project-card h3 { margin-top: 25px; font-size: 1.35rem; }
.project-card p { color: var(--muted); line-height: 1.55; }
.project-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.project-tags span { border: 1px solid var(--border); border-radius: 999px; padding: 5px 9px; color: var(--muted); font-size: .76rem; }
.project-joke { margin-top: 18px !important; padding-left: 13px; border-left: 2px solid var(--accent); color: var(--text) !important; font-style: italic; }
.loading-message { color: var(--muted); }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
.game-heading { align-items: start; }
.game-metrics { display: flex; gap: 12px; }
.metric { min-width: 105px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.metric span { display: block; color: var(--muted); font-size: .82rem; }
.metric strong { display: block; margin-top: 4px; color: var(--accent); font-size: 1.8rem; }
.game-zone { position: relative; min-height: 390px; overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: radial-gradient(circle at 15% 20%, rgba(94,230,168,.09), transparent 28%), var(--surface); cursor: crosshair; }
.game-message { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; padding: 24px; text-align: center; }
.game-message small { color: var(--muted); }
.radar-symbol { color: var(--accent); font-size: 3rem; }
.target { position: absolute; display: grid; width: 58px; height: 58px; place-items: center; border: 2px solid var(--accent); border-radius: 50%; color: var(--accent); background: var(--accent-dark); box-shadow: 0 0 0 9px rgba(94,230,168,.08); font-size: 1.5rem; transition: left .1s ease, top .1s ease, transform .08s ease; }
.target:active { transform: scale(.82); }
.game-controls { display: flex; align-items: end; gap: 14px; margin-top: 16px; }
.name-field { flex: 1; }
.name-field > span { display: block; margin-bottom: 7px; font-size: .88rem; font-weight: 750; }
.name-field input { width: 100%; border: 1px solid var(--border); border-radius: 11px; padding: 12px 13px; color: var(--text); outline: none; background: var(--surface); }
.name-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(94,230,168,.1); }
.name-field small { display: block; margin-top: 6px; color: var(--muted); }
.game-status { min-height: 24px; color: var(--muted); }
.game-status.error { color: var(--danger); }
.ranking-panel { padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.ranking-title { display: flex; align-items: center; justify-content: space-between; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--surface-2); }
.ranking { margin: 20px 0; padding: 0; list-style: none; counter-reset: rank; }
.ranking li { counter-increment: rank; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.ranking li::before { content: "#" counter(rank); color: var(--muted); font-size: .82rem; }
.ranking-score { color: var(--accent); font-weight: 800; }
.ranking-note { color: var(--muted); font-size: .82rem; line-height: 1.5; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 25px max(22px, calc((100% - var(--max-width)) / 2)); border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }

@media (max-width: 850px) {
  .hero { min-height: auto; grid-template-columns: 1fr; padding-top: 65px; }
  .project-grid { grid-template-columns: 1fr 1fr; }
  .game-layout { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .menu-button { display: block; }
  .main-nav { position: absolute; top: calc(100% + 1px); right: 0; left: 0; display: none; flex-direction: column; align-items: stretch; padding: 16px 22px 22px; border-bottom: 1px solid var(--border); background: var(--background); }
  .main-nav.open { display: flex; }
  .section { width: min(100% - 30px, var(--max-width)); padding: 65px 0; }
  .section-panel { width: 100%; padding-inline: 15px; }
  .project-grid { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .game-heading { display: flex; flex-direction: column; }
  .game-metrics { width: 100%; }
  .metric { flex: 1; }
  .game-controls { align-items: stretch; flex-direction: column; }
  .game-controls .button { width: 100%; }
  footer { flex-direction: column; }
}
