:root {
  color-scheme: dark;
  --ink: #070a0d;
  --panel: #0e1317;
  --panel-2: #12191e;
  --line: #293239;
  --muted: #8d989e;
  --paper: #f2f4ef;
  --acid: #c9ff3d;
  --acid-dark: #92c900;
  --coral: #ff735d;
  --cyan: #52e8e1;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--ink); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  background: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .01em;
}

button, input { font: inherit; }
button { color: inherit; }

.site-header {
  width: min(900px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--paper);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand-accent { color: var(--acid); }

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--acid);
  transform: skew(-6deg);
}

.brand-mark i { display: block; background: var(--acid); }
.brand-mark i:nth-child(1) { height: 42%; }
.brand-mark i:nth-child(2) { height: 100%; }
.brand-mark i:nth-child(3) { height: 68%; }

.header-meta {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font: 700 .67rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .13em;
}

.header-meta span:last-child { color: var(--paper); }
main { width: min(760px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 72px; }

.card-label, .result-kicker {
  color: var(--acid);
  font: 800 .69rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .18em;
}

.game-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: clamp(24px, 5vw, 54px);
  overflow: hidden;
}

.game-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 84px;
  height: 4px;
  background: var(--acid);
  box-shadow: 84px 0 0 var(--cyan), 168px 0 0 var(--coral);
}

.card-topline { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.card-topline h2 { margin: 9px 0 0; font-size: clamp(1.45rem, 3vw, 2.2rem); letter-spacing: -.03em; }

.attempt-counter { display: flex; align-items: baseline; gap: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.attempt-counter strong { color: var(--acid); font-size: 2rem; }
.attempt-counter span { color: var(--muted); font-size: .8rem; }

.attempt-track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 29px 0 38px; }
.attempt-segment { height: 4px; background: #303940; transition: background .25s, box-shadow .25s; }
.attempt-segment.current { background: var(--acid); box-shadow: 0 0 12px rgb(201 255 61 / 40%); }
.attempt-segment.wrong { background: var(--coral); }
.attempt-segment.skip { background: #a76cff; }
.attempt-segment.correct { background: var(--cyan); }

.player {
  position: relative;
  min-height: 210px;
  display: grid;
  place-items: center;
  border: 1px solid #283238;
  background:
    linear-gradient(rgb(201 255 61 / 3%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(201 255 61 / 3%) 1px, transparent 1px),
    #0a0e11;
  background-size: 24px 24px;
}

.waveform { position: absolute; inset: 28px 34px; display: flex; gap: 4px; align-items: center; opacity: .48; overflow: hidden; }
.wave-bar { flex: 1 1 3px; min-width: 2px; height: var(--height); background: linear-gradient(var(--cyan), var(--acid)); transform: scaleY(.7); transition: transform .18s, opacity .18s; }
.player.playing .wave-bar { animation: pulse .55s ease-in-out infinite alternate; animation-delay: var(--delay); opacity: 1; }

@keyframes pulse { to { transform: scaleY(1.16); } }

.play-button {
  position: relative;
  z-index: 2;
  width: 88px;
  height: 88px;
  border: 1px solid var(--acid);
  border-radius: 50%;
  background: rgb(7 10 13 / 90%);
  cursor: pointer;
  transition: transform .18s, background .18s, box-shadow .18s;
}

.play-button:hover { transform: scale(1.05); background: rgb(201 255 61 / 8%); box-shadow: 0 0 34px rgb(201 255 61 / 16%); }
.play-button:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.play-button:disabled { cursor: wait; opacity: .55; }
.play-icon { position: absolute; top: 50%; left: 53%; transform: translate(-50%, -50%); width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 16px solid var(--acid); }
.playing .play-icon { width: 15px; height: 17px; border: 0; border-left: 5px solid var(--acid); border-right: 5px solid var(--acid); left: 50%; }

.clip-readout { position: absolute; right: 19px; bottom: 16px; display: flex; flex-direction: column; align-items: end; gap: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.clip-readout span { color: var(--muted); font-size: .55rem; letter-spacing: .14em; }
.clip-readout strong { font-size: .7rem; color: var(--acid); }
.play-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: #1c2429; }
.play-progress span { display: block; width: 0; height: 100%; background: var(--acid); box-shadow: 0 0 10px var(--acid); }

.status-line { min-height: 24px; margin: 18px 0 27px; color: var(--muted); font-size: .86rem; }
.status-line.error { color: var(--coral); }
.status-line.success { color: var(--cyan); }

.guess-form label { display: block; margin-bottom: 9px; color: var(--muted); font: 700 .62rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; }
.guess-row { display: grid; grid-template-columns: 1fr auto; }
.guess-row input { min-width: 0; height: 58px; padding: 0 18px; border: 1px solid #3b454b; border-right: 0; color: var(--paper); background: #090d10; border-radius: 0; }
.guess-row input::placeholder { color: #657178; }
.guess-row input:disabled { opacity: .55; }
.submit-button, .share-button { border: 0; color: #0a0d0f; background: var(--acid); font-weight: 900; letter-spacing: .08em; cursor: pointer; transition: background .16s, transform .16s; }
.submit-button { min-width: 154px; padding: 0 24px; }
.submit-button:hover, .share-button:hover { background: #ddff83; }
.submit-button:active, .share-button:active { transform: translateY(1px); }

.secondary-actions { display: flex; justify-content: space-between; gap: 18px; margin-top: 17px; }
.text-button { padding: 5px 0; border: 0; border-bottom: 1px solid #465158; color: var(--muted); background: transparent; font: 800 .63rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; cursor: pointer; }
.text-button:hover { color: var(--paper); border-color: var(--paper); }
.text-button.danger:hover { color: var(--coral); border-color: var(--coral); }
.text-button:disabled, .submit-button:disabled { cursor: not-allowed; opacity: .35; }

.demo-note { margin-top: 24px; padding: 13px 15px; border-left: 3px solid var(--cyan); color: var(--muted); background: rgb(82 232 225 / 6%); font-size: .76rem; line-height: 1.55; }
.demo-note strong { display: block; color: var(--cyan); font: 800 .62rem/1.5 ui-monospace, monospace; letter-spacing: .13em; }

.result-panel { margin-top: 31px; padding: 28px; border: 1px solid #354249; background: #090d10; }
.result-panel h3 { margin: 8px 0 7px; font-family: "Arial Narrow", Impact, sans-serif; font-size: clamp(2rem, 5vw, 3.7rem); text-transform: uppercase; letter-spacing: -.02em; }
.result-panel > p { color: var(--muted); margin: 0 0 22px; }
.result-actions { display: flex; align-items: center; gap: 14px; }
.share-button { padding: 13px 18px; font-size: .7rem; }
#share-status { color: var(--muted); font-size: .72rem; }
.credit-details { margin-top: 25px; border-top: 1px solid #273037; padding-top: 18px; color: var(--muted); font-size: .78rem; }
.credit-details summary { color: var(--paper); cursor: pointer; font-weight: 700; }
.credit-details p { line-height: 1.55; }
.credit-links { display: flex; gap: 18px; }
.credit-links a { color: var(--cyan); text-underline-offset: 3px; }

footer { min-height: 78px; padding: 0 max(24px, calc((100% - 900px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); color: var(--muted); font: 700 .63rem/1 ui-monospace, monospace; letter-spacing: .12em; }
footer strong { color: var(--paper); }
footer a { color: var(--muted); text-underline-offset: 3px; }
footer a:hover { color: var(--paper); }

.legal-page { max-width: 760px; padding: 90px 0 120px; }
.legal-page h1 { margin: 17px 0 28px; font-family: "Arial Narrow", Impact, sans-serif; font-size: clamp(3rem, 8vw, 6rem); line-height: .9; text-transform: uppercase; }
.legal-page p { color: var(--muted); font-size: 1rem; line-height: 1.75; }
.legal-back { display: inline-block; margin-top: 30px; color: var(--acid); font: 800 .7rem/1.5 ui-monospace, monospace; letter-spacing: .12em; text-underline-offset: 4px; }

[hidden] { display: none !important; }

@media (max-width: 720px) {
  .site-header, main { width: min(100% - 28px, 760px); }
  .site-header { min-height: 72px; }
  main { padding-top: 28px; }
  .game-card { padding: 28px 20px; }
  .card-topline { align-items: center; }
  .player { min-height: 180px; }
  .waveform { inset: 25px 18px; gap: 2px; }
  .guess-row { grid-template-columns: 1fr; gap: 10px; }
  .guess-row input { border-right: 1px solid #3b454b; }
  .submit-button { min-height: 52px; }
  .secondary-actions { align-items: start; }
  footer { padding: 22px 18px; flex-direction: column; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
