:root {
  color-scheme: light;
  --ink: #18201d;
  --muted: #69716d;
  --paper: #f6f1e8;
  --card: #fffdf9;
  --green: #166b4c;
  --green-dark: #0f5038;
  --mint: #dceade;
  --coral: #eb624c;
  --line: #d9d7ce;
  font-family: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 18%, rgba(22, 107, 76, .06), transparent 25rem),
    radial-gradient(circle at 92% 62%, rgba(235, 98, 76, .06), transparent 22rem),
    var(--paper);
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(22, 107, 76, .3); outline-offset: 3px; }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(24, 32, 29, .12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.04em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: white;
}

.brand-mark svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark svg path:first-child { fill: currentColor; stroke: none; }

.how-button {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.how-button span { display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid #a9aca7; border-radius: 50%; font: 500 12px "DM Mono"; }

.hero { max-width: 720px; margin: 84px auto 46px; text-align: center; }
.eyebrow { display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--green); font: 500 11px "DM Mono"; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow span { width: 23px; height: 1px; background: var(--green); }
.hero h1 { margin: 17px 0 18px; font-size: clamp(42px, 5.2vw, 66px); line-height: .98; letter-spacing: -.055em; font-weight: 600; }
.hero h1 em { color: var(--green); font-family: Georgia, serif; font-weight: 400; }
.hero-copy { max-width: 560px; margin: auto; color: var(--muted); font-size: 15px; line-height: 1.75; }

.game-card {
  max-width: 830px;
  min-height: 480px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #d4d2ca;
  border-radius: 8px;
  background: rgba(255, 253, 249, .9);
  box-shadow: 0 20px 60px rgba(55, 48, 36, .08);
}

.card-topline { display: flex; justify-content: space-between; padding: 20px 25px; border-bottom: 1px solid var(--line); font: 500 10px "DM Mono"; letter-spacing: .1em; }
.round-label { display: flex; align-items: center; gap: 10px; }
.round-label span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--ink); color: white; letter-spacing: 0; }
.private-label { display: flex; align-items: center; gap: 7px; color: #757c78; letter-spacing: .03em; text-transform: none; }
.private-label svg { width: 16px; fill: none; stroke: var(--green); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.stage { text-align: center; padding: 40px 9% 42px; }
.prompt-icon { display: grid; place-items: center; width: 57px; height: 57px; margin: 0 auto 19px; border-radius: 50%; background: var(--mint); color: var(--green); }
.prompt-icon svg { width: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.stage h2 { margin: 0 0 7px; font-size: 23px; letter-spacing: -.035em; }
.stage > p { margin: 0; color: var(--muted); font-size: 13px; }

.visualizer-wrap { position: relative; height: 78px; margin: 28px 0 4px; overflow: hidden; }
#visualizer { display: block; width: 100%; height: 76px; }
.idle-line { position: absolute; inset: 0; display: flex; align-items: center; }
.idle-line::before, .idle-line::after { content: ""; height: 1px; flex: 1; background: #d7d6d0; }
.idle-line span { width: 5px; height: 5px; margin: 0 7px; border-radius: 50%; background: var(--coral); }
.is-recording .idle-line { display: none; }

.timer { margin: 1px 0 18px; color: #8a8e8b; font: 400 11px "DM Mono"; }
.record-button, .primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-width: 196px;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 4px;
  background: var(--green);
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(22, 107, 76, .16);
  transition: transform .15s, background .15s;
}
.record-button:hover, .primary-action:hover { background: var(--green-dark); transform: translateY(-1px); }
.record-button:disabled { cursor: wait; opacity: .7; }
.record-dot { width: 10px; height: 10px; border: 2px solid white; border-radius: 50%; background: var(--coral); }
.is-recording .record-dot { border-radius: 1px; background: white; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.stage .permission-note { margin-top: 11px; color: #9a9c98; font-size: 10px; }

.stage-result { padding-top: 33px; }
.result-icon { margin-bottom: 13px; }
.stage .result-kicker { margin-bottom: 5px; color: var(--coral); font: 500 10px "DM Mono"; letter-spacing: .12em; }
.player-card { display: flex; align-items: center; gap: 16px; max-width: 610px; margin: 26px auto 23px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 5px; background: #faf8f3; }
.play-button { flex: 0 0 auto; display: grid; place-items: center; width: 43px; height: 43px; border: 0; border-radius: 50%; background: var(--green); color: white; cursor: pointer; }
.play-button svg { grid-area: 1 / 1; width: 19px; fill: currentColor; }
.pause-icon { display: none; }
.is-playing .play-icon { display: none; }
.is-playing .pause-icon { display: block; }
.track-wrap { position: relative; flex: 1; height: 43px; }
.waveform-bars { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; gap: 2px; overflow: hidden; }
.waveform-bars i { width: 2px; min-height: 3px; border-radius: 2px; background: #adc3b8; }
.waveform-bars i.played { background: var(--green); }
.seek-bar { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.player-time { color: #767c79; font: 400 10px "DM Mono"; }
.action-row { display: flex; justify-content: center; gap: 10px; }
.primary-action { min-width: 145px; min-height: 42px; padding: 10px 18px; box-shadow: none; }
.primary-action svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.secondary-action { min-width: 145px; min-height: 42px; padding: 10px 18px; border: 1px solid #bcbdb7; border-radius: 4px; background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.secondary-action:hover { background: #f1eee7; }
.reveal-panel { max-width: 610px; margin: 20px auto 0; padding: 15px 18px; align-items: center; justify-content: space-between; border: 1px dashed #b9b8af; border-radius: 5px; text-align: left; background: #f7f4ed; }
.reveal-panel:not([hidden]) { display: flex; }
.reveal-panel div { display: flex; flex-direction: column; gap: 2px; }
.reveal-panel div span { color: var(--coral); font: 500 9px "DM Mono"; letter-spacing: .11em; }
.reveal-panel strong { font-size: 12px; }
.reveal-play { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 700; cursor: pointer; }
.reveal-play svg { width: 16px; fill: currentColor; }
.new-round { margin-top: 21px; border: 0; background: transparent; color: #6f7471; font-size: 11px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

.error-panel { margin: 35px; padding: 22px; border: 1px solid rgba(235, 98, 76, .35); border-radius: 5px; background: rgba(235, 98, 76, .06); text-align: center; }
.error-panel strong, .error-panel span { display: block; }
.error-panel span { margin: 5px 0 14px; color: var(--muted); font-size: 12px; }
.error-panel button { border: 0; border-bottom: 1px solid; background: none; color: var(--green); font-weight: 700; cursor: pointer; }

.steps { display: flex; align-items: center; justify-content: center; gap: 34px; margin: 48px auto 82px; }
.steps article { display: flex; align-items: center; gap: 13px; min-width: 170px; }
.steps article > span { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border: 1px solid #b9bcb6; border-radius: 50%; color: var(--green); font: 500 11px "DM Mono"; }
.steps h3 { margin: 0 0 3px; font-size: 12px; }
.steps p { margin: 0; color: #7a7e7b; font-size: 10px; }
.steps > i { color: #aaa; font: normal 16px "DM Mono"; }
footer { display: flex; justify-content: space-between; padding: 25px 0 32px; border-top: 1px solid rgba(24, 32, 29, .12); color: #8b8d89; font: 400 9px "DM Mono"; letter-spacing: .02em; }
footer p:last-child span { color: var(--green); }

dialog { width: min(500px, calc(100% - 32px)); padding: 34px 38px; border: 1px solid #cfcdc5; border-radius: 8px; background: var(--card); color: var(--ink); box-shadow: 0 25px 80px rgba(24, 32, 29, .22); }
dialog::backdrop { background: rgba(24, 32, 29, .46); backdrop-filter: blur(3px); }
dialog .eyebrow { justify-content: flex-start; }
dialog h2 { margin: 14px 0 25px; font-size: 27px; letter-spacing: -.04em; }
dialog ol { margin: 0; padding: 0; list-style: none; }
dialog li { display: flex; gap: 15px; margin: 18px 0; }
dialog li > span { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--mint); color: var(--green); font: 500 10px "DM Mono"; }
dialog li p { margin: 3px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
dialog li strong { color: var(--ink); }
.dialog-close { position: absolute; top: 14px; right: 17px; border: 0; background: none; color: #777; font-size: 26px; cursor: pointer; }

[hidden] { display: none !important; }

@media (max-width: 720px) {
  .page-shell { width: min(100% - 24px, 600px); }
  .site-header { height: 70px; }
  .hero { margin: 58px auto 35px; }
  .hero h1 { font-size: clamp(40px, 13vw, 58px); }
  .hero-copy { max-width: 430px; }
  .card-topline { padding: 16px; }
  .stage { padding: 32px 18px 35px; }
  .steps { gap: 15px; align-items: flex-start; }
  .steps article { min-width: 0; flex-direction: column; text-align: center; }
  .steps > i { padding-top: 7px; }
  .steps p { display: none; }
}

@media (max-width: 450px) {
  .private-label { font-size: 0; }
  .private-label svg { width: 18px; }
  .hero { margin-top: 44px; }
  .hero-copy br { display: none; }
  .player-card { gap: 11px; padding: 14px; }
  .action-row { flex-direction: column; }
  .action-row button { width: 100%; }
  .reveal-panel:not([hidden]) { align-items: flex-start; gap: 14px; flex-direction: column; }
  footer { gap: 18px; flex-direction: column; }
}

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