@import url('./fonts.css');

:root {
  --ink: #e9ffe8;
  --muted: #8ba69a;
  --paper: #07130f;
  --surface: #0c1d16;
  --line: #244035;
  --acid: #b8ff38;
  --hot: #ff6b35;
  --shadow: #020705;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(184,255,56,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184,255,56,.025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: 'IBM Plex Mono', monospace;
}
button, select { font: inherit; }
button { touch-action: manipulation; }

.topbar, footer {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-family: 'Archivo Black', sans-serif;
  letter-spacing: .06em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--paper);
  background: var(--acid);
  transform: rotate(-3deg);
}
.status { color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 12px var(--acid);
}

.shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  border-inline: 1px solid var(--line);
}
.game-column { padding: clamp(24px, 4vw, 52px); }
.game-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .18em; }
h1 {
  margin: 0;
  font: 400 clamp(54px, 9vw, 104px)/.82 'Archivo Black', sans-serif;
  letter-spacing: -.055em;
}
.accent { color: var(--acid); }
.speed-control { display: grid; gap: 8px; font-size: 10px; color: var(--muted); letter-spacing: .12em; }
select {
  min-width: 112px;
  padding: 10px 30px 10px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
}
select:focus-visible, button:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }

.score-strip {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 24px;
  align-items: end;
  margin: 32px 0 16px;
  padding: 14px 0;
  border-block: 1px solid var(--line);
}
.score-strip div { display: grid; gap: 3px; }
.score-strip span { color: var(--muted); font-size: 9px; letter-spacing: .15em; }
.score-strip strong { font-size: 20px; font-weight: 500; }
.control-hint { display: flex !important; flex-direction: row; align-items: center; gap: 6px !important; }
kbd { padding: 5px 7px; border: 1px solid var(--line); color: var(--muted); font-size: 9px; }

.cabinet { position: relative; overflow: hidden; border: 1px solid #38594c; background: #04100b; box-shadow: 12px 12px 0 var(--shadow); }
canvas { display: block; width: 100%; aspect-ratio: 1; }
.screen-shade {
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: .15;
  background: repeating-linear-gradient(0deg, transparent 0 3px, #000 4px);
}
.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: start;
  padding: clamp(28px, 7vw, 72px);
  background: rgba(4, 16, 11, .9);
}
.game-overlay[hidden] { display: none; }
.overlay-tag { margin: 0 0 14px; color: var(--acid); font-size: 11px; font-weight: 600; letter-spacing: .18em; }
.game-overlay h2 { margin: 0; max-width: 520px; font: 400 clamp(31px, 6vw, 64px)/.95 'Archivo Black', sans-serif; letter-spacing: -.035em; }
.game-overlay > p:not(.overlay-tag) { max-width: 430px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.primary-button {
  min-height: 48px;
  margin-top: 14px;
  padding: 0 18px;
  color: var(--paper);
  background: var(--acid);
  border: 0;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 5px 5px 0 #577c0d;
}
.primary-button:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 #577c0d; }
.primary-button span { margin-left: 20px; }

.side-panel { border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.panel-number { padding: 28px; color: var(--acid); font: 400 52px/1 'Archivo Black', sans-serif; border-bottom: 1px solid var(--line); }
.panel-block { padding: 30px 28px; border-bottom: 1px solid var(--line); }
.panel-block h2 { margin: 0 0 20px; font: 400 24px/1.15 'Archivo Black', sans-serif; letter-spacing: -.03em; }
.panel-block > p:last-child { color: var(--muted); font-size: 10px; }
.progress-track { height: 5px; background: #172b22; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--hot); transition: width .2s ease; }
.rules ol { margin: 0; padding: 0; list-style: none; }
.rules li { display: grid; grid-template-columns: 35px 1fr; padding: 10px 0; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }
.rules li span { color: var(--acid); }
.coming-next { margin-top: auto; min-height: 140px; padding: 28px; display: grid; align-content: center; gap: 5px; color: var(--muted); background: repeating-linear-gradient(-45deg, #0b1b15 0 8px, #0d2018 8px 16px); }
.coming-next span { font-size: 9px; letter-spacing: .15em; }
.coming-next strong { color: var(--ink); font: 400 26px/1 'Archivo Black', sans-serif; }
.coming-next .locked { color: var(--hot); }
.coming-next { text-decoration: none; }
.coming-next .unlocked { color: var(--acid); }
.back-link { color: var(--muted); text-decoration: none; font-size: 10px; letter-spacing: .13em; }
.back-link:hover, footer a:hover { color: var(--acid); }
footer a { color: var(--muted); text-decoration: none; }
.orange-dot { background: var(--hot); box-shadow: 0 0 12px var(--hot); }
.orange-text, .breakout-title span { color: var(--hot) !important; }
.orange-button { background: var(--hot); box-shadow: 5px 5px 0 #813118; }
.orange-button:hover { box-shadow: 3px 3px 0 #813118; }
.orange-track span { background: var(--hot); }
.breakout-title { font-size: clamp(42px, 7vw, 82px); }
.paddle-controls { display: none; grid-template-columns: repeat(2, 80px); justify-content: center; gap: 12px; margin-top: 22px; }
.paddle-controls button { min-height: 54px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); font-size: 20px; }
.blocks-title { font-size: clamp(38px, 6vw, 70px); line-height: .85; }
.blocks-title span { color: var(--acid); }
.blocks-cabinet { width: min(100%, 440px); margin-inline: auto; }
.blocks-cabinet canvas { aspect-ratio: 1 / 2; }
.block-controls { display: grid; width: min(100%, 440px); margin: 18px auto 0; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.block-controls button { min-height: 48px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); font-size: 16px; }
.block-controls button[data-block-action="down"] { grid-column: 1 / 2; }
.block-controls button[data-block-action="drop"] { grid-column: 2 / 4; color: var(--paper); background: var(--acid); border-color: var(--acid); font-size: 10px; font-weight: 600; }

.mobile-controls { display: none; margin-top: 22px; grid-template-columns: repeat(3, 54px); grid-template-rows: repeat(2, 54px); justify-content: center; gap: 8px; }
.mobile-controls button { color: var(--ink); background: var(--surface); border: 1px solid var(--line); font-size: 20px; }
.mobile-controls button[data-direction="up"] { grid-column: 2; }
.mobile-controls button[data-direction="left"] { grid-column: 1; grid-row: 2; }
.mobile-controls button[data-direction="down"] { grid-column: 2; grid-row: 2; }
.mobile-controls button[data-direction="right"] { grid-column: 3; grid-row: 2; }

footer { border-top: 1px solid var(--line); border-bottom: 0; color: var(--muted); font-size: 9px; letter-spacing: .12em; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; width: 100%; border-inline: 0; }
  .side-panel { border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 110px 1fr; }
  .panel-number { border-bottom: 0; border-right: 1px solid var(--line); }
  .rules, .coming-next { display: none; }
  .mobile-controls, .paddle-controls { display: grid; }
}
@media (max-width: 520px) {
  .topbar { min-height: 56px; padding-inline: 16px; }
  .status { font-size: 8px; }
  .game-column { padding: 24px 16px 32px; }
  .game-heading { align-items: start; }
  h1 { font-size: 55px; }
  .score-strip { grid-template-columns: 1fr 1fr; }
  .control-hint { display: none !important; }
  .side-panel { grid-template-columns: 80px 1fr; }
  .panel-number, .panel-block { padding: 22px 16px; }
  footer { padding: 18px 16px; gap: 20px; }
  footer span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
