:root {
  /* RIFF FIVE Build 1.2.1 */
  --ink: #171713;
  --paper: #f3f0e8;
  --acid: #e8ff3f;
  --orange: #ff5b35;
  --blue: #98c7ff;
  --line: 2px solid var(--ink);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 700;
}

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

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.site-header, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--line);
  padding: 16px clamp(20px, 4vw, 64px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font: 28px/.78 "Anton", sans-serif;
  letter-spacing: .03em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 51px;
  height: 51px;
  place-items: center;
  color: var(--paper);
  background: var(--ink);
  border-radius: 50%;
  font-size: 22px;
  transform: rotate(-8deg);
}

.tagline { margin: 0; font-size: 11px; line-height: 1.4; letter-spacing: .12em; }

.sound-toggle, .text-button {
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
}

.sound-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  background: var(--orange);
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.screen { display: none; min-height: calc(100vh - 150px); }
.screen.active { display: grid; }

.setup-screen {
  grid-template-columns: minmax(300px, .86fr) minmax(540px, 1.14fr);
  max-width: 1480px;
  margin: auto;
  border-inline: var(--line);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  padding: clamp(45px, 7vw, 100px) clamp(28px, 5vw, 80px);
  border-right: var(--line);
  background: var(--acid);
}

.hero-copy::after {
  content: "05";
  position: absolute;
  right: -20px;
  bottom: -90px;
  color: transparent;
  -webkit-text-stroke: 2px rgba(23, 23, 19, .14);
  font: 330px/1 "Anton", sans-serif;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 24px;
  font-size: 10px;
  letter-spacing: .16em;
}

.eyebrow span {
  padding: 6px 9px;
  color: var(--paper);
  background: var(--ink);
}

h1, h2 {
  margin: 0;
  font-family: "Anton", sans-serif;
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: .84;
}

h1 { font-size: clamp(74px, 9.3vw, 150px); }
h1 em { color: var(--orange); font-style: normal; -webkit-text-stroke: 2px var(--ink); }
.lead { position: relative; z-index: 1; margin: 34px 0 0; font-size: 14px; line-height: 2; }

.setup-panel { padding: clamp(30px, 5vw, 75px); background: var(--paper); }
fieldset { margin: 0; padding: 0; border: 0; }
legend { width: 100%; margin-bottom: 18px; font-size: 12px; letter-spacing: .12em; }
legend span { margin-right: 12px; color: var(--orange); font: 25px "Anton", sans-serif; }

.genre-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.genre-card { position: relative; min-height: 146px; padding: 22px; border: var(--line); cursor: pointer; transition: transform .18s, box-shadow .18s; }
.genre-card:hover { transform: translate(-3px, -3px); box-shadow: 5px 5px 0 var(--ink); }
.genre-card:has(input:checked) { background: var(--acid); box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 5px var(--ink); }
.genre-card input, .length-options input { position: absolute; opacity: 0; pointer-events: none; }
.genre-card strong { display: block; font: 29px/.9 "Anton", sans-serif; }
.genre-card small { display: block; margin-top: 12px; font-size: 9px; letter-spacing: .15em; }
.card-index { position: absolute; top: 10px; right: 12px; font: 13px "Anton"; }
.genre-icon { float: right; margin: 27px 4px 0 10px; font-size: 38px; }

.length-fieldset { margin-top: 34px; }
.length-options { display: grid; grid-template-columns: repeat(3, 1fr); border: var(--line); }
.length-options label { position: relative; cursor: pointer; }
.length-options label + label { border-left: var(--line); }
.length-options span { display: block; padding: 16px 6px; text-align: center; font-size: 9px; letter-spacing: .08em; }
.length-options b { margin-right: 5px; font: 24px "Anton", sans-serif; }
.length-options input:checked + span { color: var(--paper); background: var(--ink); }

.start-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
  padding: 9px 10px 9px 22px;
  border: var(--line);
  background: var(--orange);
  box-shadow: 6px 6px 0 var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  transition: transform .15s, box-shadow .15s;
}
.start-button:hover { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }
.start-button b { padding: 15px 19px; color: var(--paper); background: var(--ink); }
.youtube-note { margin: 18px 0 0; text-align: center; font-size: 9px; letter-spacing: .08em; }

.quiz-screen, .result-screen { padding: 24px clamp(20px, 5vw, 76px) 60px; }
.quiz-screen.active, .result-screen.active { display: block; }
.quiz-topline { display: flex; align-items: center; justify-content: space-between; max-width: 1350px; margin: auto; }
.progress-copy { font: 30px "Anton"; letter-spacing: .05em; }
.progress-copy span:first-child { color: var(--orange); }
.score-chip { padding: 9px 12px; border: var(--line); font-size: 10px; letter-spacing: .08em; }
.score-chip b { margin-left: 12px; font: 21px "Anton"; }
.progress-track { max-width: 1350px; height: 5px; margin: 15px auto 40px; background: #d4d0c7; }
.progress-track span { display: block; width: 10%; height: 100%; background: var(--orange); transition: width .35s; }

.quiz-layout { display: grid; grid-template-columns: minmax(340px, .9fr) minmax(470px, 1.1fr); max-width: 1200px; margin: auto; border: var(--line); }
.player-panel { position: relative; display: flex; min-height: 620px; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; padding: 35px; border-right: var(--line); background: var(--acid); }
.record-wrap { position: relative; width: min(340px, 80vw); height: min(340px, 80vw); transition: opacity .2s; }
.record { position: relative; display: grid; width: 100%; height: 100%; place-items: center; border: 3px solid var(--ink); border-radius: 50%; background: repeating-radial-gradient(circle, var(--ink) 0, var(--ink) 4px, #292923 5px, #292923 7px); box-shadow: 12px 12px 0 rgba(23,23,19,.18); }
.record.spinning { animation: spin 2s linear infinite; }
.record-ring { position: absolute; width: 57%; height: 57%; border: 2px solid #48483e; border-radius: 50%; }
.record-label { display: grid; width: 32%; height: 32%; place-items: center; color: var(--paper); background: var(--orange); border: 3px solid var(--ink); border-radius: 50%; font: 35px/.6 "Anton"; text-align: center; }
.record-label small { font-size: 10px; letter-spacing: .1em; }
.tonearm { position: absolute; top: -15px; right: 5px; width: 22%; height: 60%; border-right: 7px solid var(--ink); border-radius: 50%; transform: rotate(-16deg); transform-origin: top; }
@keyframes spin { to { transform: rotate(360deg); } }
.youtube-player { position: absolute; width: 1px; height: 1px; opacity: .001; pointer-events: none; }
.play-clip { display: flex; min-width: 245px; align-items: center; gap: 14px; margin-top: 28px; padding: 10px 18px; border: var(--line); background: var(--paper); box-shadow: 4px 4px 0 var(--ink); cursor: pointer; text-align: left; }
.play-clip:disabled { opacity: .55; cursor: wait; }
.play-icon { display: grid; width: 35px; height: 35px; place-items: center; color: var(--paper); background: var(--ink); border-radius: 50%; font-size: 12px; }
.play-clip b, .play-clip small { display: block; }
.play-clip b { font-size: 12px; }
.play-clip small { margin-top: 2px; font-size: 8px; letter-spacing: .1em; }
.timer { width: 245px; height: 4px; margin-top: 20px; background: rgba(23,23,19,.2); }
.timer span { display: block; width: 0; height: 100%; background: var(--ink); }
.timer span.running { animation: countdown 5s linear forwards; }
@keyframes countdown { to { width: 100%; } }
.status { margin: 11px 0 0; font-size: 8px; letter-spacing: .12em; }

.answer-panel { padding: clamp(35px, 5vw, 72px); background: var(--paper); }
.answer-panel h2 { margin-bottom: 36px; font-size: clamp(62px, 7vw, 100px); }
.answers { display: grid; gap: 10px; }
.answer {
  display: grid;
  grid-template-columns: 43px 1fr;
  align-items: stretch;
  padding: 0;
  border: var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.answer-key { display: grid; place-items: center; border-right: var(--line); font: 20px "Anton"; }
.answer-copy { padding: 13px 17px; }
.answer-copy b, .answer-copy small { display: block; }
.answer-copy b { font-size: 13px; }
.answer-copy small { margin-top: 3px; color: #6f6c65; font-size: 9px; }
.answer:hover:not(:disabled) { background: #fff; }
.answer.correct { background: var(--acid); }
.answer.wrong { color: var(--paper); background: var(--orange); }
.answer:disabled { cursor: default; }
.track-reveal {
  display: grid;
  grid-template-columns: 92px 1fr 25px;
  align-items: center;
  gap: 13px;
  margin-top: 16px;
  overflow: hidden;
  border: var(--line);
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.track-reveal[hidden] { display: none; }
.track-reveal:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.track-reveal img { display: block; width: 92px; height: 62px; object-fit: cover; border-right: var(--line); }
.track-reveal small, .track-reveal b, .track-reveal span span { display: block; }
.track-reveal small { margin-bottom: 3px; color: var(--orange); font-size: 8px; letter-spacing: .12em; }
.track-reveal b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.track-reveal span span { margin-top: 2px; color: #6f6c65; font-size: 9px; }
.track-reveal > strong { font-size: 18px; }
.next-button { width: 100%; margin-top: 16px; padding: 15px; border: var(--line); color: var(--paper); background: var(--ink); cursor: pointer; font-size: 12px; letter-spacing: .1em; }
.next-button span { float: right; font-size: 18px; }

.result-screen { max-width: 1150px; margin: auto; }
.result-screen > .eyebrow { margin-top: 35px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; border: var(--line); }
.result-grid > div { min-height: 355px; padding: clamp(35px, 6vw, 75px); }
.result-grid > div:first-child { background: var(--acid); border-right: var(--line); }
.result-kicker { margin: 0; font-size: 11px; letter-spacing: .15em; }
.big-score { margin-top: 15px; font: clamp(135px, 20vw, 230px)/.8 "Anton"; }
.big-score small { font-size: .25em; }
.result-copy h2 { font-size: clamp(60px, 8vw, 105px); color: var(--orange); -webkit-text-stroke: 1.5px var(--ink); }
.result-copy p { font-size: 13px; line-height: 1.8; }
.result-stat { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 18px; border-top: var(--line); font-size: 11px; letter-spacing: .1em; }
.result-stat b { font: 30px "Anton"; }
.share-block { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 0; }
.share-block > p { font-size: 10px; letter-spacing: .14em; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-buttons button { padding: 10px 13px; border: var(--line); background: var(--paper); cursor: pointer; font: 18px "Anton"; }
.share-buttons button:hover { background: var(--blue); }
.share-buttons span { margin-left: 6px; font: 9px "Noto Sans JP"; letter-spacing: .08em; }
.retry-button { max-width: 440px; margin: 10px auto 0; }

footer { border-top: var(--line); border-bottom: 0; font-size: 8px; letter-spacing: .13em; }

@media (max-width: 900px) {
  .setup-screen { grid-template-columns: 1fr; border-inline: 0; }
  .hero-copy { min-height: 500px; border-right: 0; border-bottom: var(--line); }
  .quiz-layout { grid-template-columns: 1fr; }
  .player-panel { min-height: 520px; border-right: 0; border-bottom: var(--line); }
  .result-grid { grid-template-columns: 1fr; }
  .result-grid > div:first-child { border-right: 0; border-bottom: var(--line); }
}

@media (max-width: 560px) {
  .site-header { padding: 12px 16px; }
  .tagline { display: none; }
  .brand { font-size: 23px; }
  .brand-mark { width: 43px; height: 43px; }
  .hero-copy { min-height: 430px; padding: 48px 24px; }
  h1 { font-size: 75px; }
  .setup-panel { padding: 36px 18px; }
  .genre-card { min-height: 130px; padding: 16px; }
  .genre-card strong { font-size: 23px; }
  .genre-icon { font-size: 26px; }
  .quiz-screen { padding-inline: 12px; }
  .quiz-topline { gap: 10px; }
  .player-panel { min-height: 460px; padding: 24px; }
  .record-wrap { width: 260px; height: 260px; }
  .answer-panel { padding: 35px 20px; }
  .answer-panel h2 { font-size: 65px; }
  .result-screen { padding-inline: 15px; }
  .result-grid > div { min-height: 285px; padding: 38px 25px; }
  .share-block { align-items: flex-start; flex-direction: column; }
  footer span:nth-child(2) { display: none; }
}
