:root {
  --ink: #15152a;
  --paper: #fff5df;
  --coral: #ff5d5d;
  --blue: #4f7cff;
  --butter: #ffd166;
  --mint: #58d6a9;
  --lilac: #b695ff;
  --room-blue: #a9d8e8;
  --paper-deep: #f4e9c3;
  --ink-soft: #6f5a75;
  --coral-dark: #d94e45;
  --aqua: #55c6b5;
  --white: #fffdf6;
  --danger: #bf3647;
  --shadow: 8px 8px 0 var(--ink);
  --small-shadow: 4px 4px 0 var(--ink);
  --display-font: Impact, Haettenschweiler, "Arial Narrow Bold", "Franklin Gothic Condensed", sans-serif;
  --body-font: "Arial Rounded MT Bold", "Avenir Next Rounded", "Trebuchet MS", ui-rounded, system-ui, sans-serif;
  font-family: var(--body-font);
  color: var(--ink);
  background: var(--room-blue);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  overflow-y: auto;
  background-color: var(--room-blue);
  background-image: radial-gradient(rgba(56, 38, 64, 0.13) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 8px var(--ink);
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: 0.75rem 1rem;
  color: var(--white);
  background: var(--ink);
  font-weight: 900;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.page-shell,
footer {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.2rem;
  border-bottom: 3px solid var(--ink);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  letter-spacing: -0.07em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark span:not(.wordmark__dial) {
  color: var(--coral-dark);
}

.wordmark__dial {
  width: 1.15em;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--butter);
  box-shadow: 2px 2px 0 var(--ink);
}

.wordmark__dial::after {
  display: block;
  width: 3px;
  height: 38%;
  margin: 10% auto 0;
  background: var(--ink);
  content: "";
  transform: rotate(38deg);
  transform-origin: bottom;
}

.header-note {
  margin: 0;
  color: var(--ink-soft);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
  align-items: end;
  gap: clamp(2rem, 6vw, 7rem);
  padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2.5rem, 6vw, 4.5rem);
}

.eyebrow,
.utility-label {
  margin: 0 0 0.75rem;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(3.5rem, 9vw, 7.8rem);
  letter-spacing: -0.075em;
  line-height: 0.82;
  text-transform: uppercase;
}

h1 em {
  display: inline-block;
  color: var(--coral-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82em;
  font-weight: 900;
  letter-spacing: -0.055em;
  text-transform: none;
  transform: rotate(-2deg);
}

.intro__copy {
  max-width: 32rem;
  padding-left: 1.5rem;
  border-left: 5px solid var(--ink);
  font-size: clamp(1rem, 2vw, 1.18rem);
  font-weight: 700;
}

.intro__copy > p:first-child {
  margin-top: 0;
}

.safety-note {
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
  margin: 1.5rem 0 0;
  color: var(--ink-soft);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 700;
}

.safety-note span {
  color: var(--aqua);
  text-shadow: 1px 1px 0 var(--ink);
}

.battle-stage {
  display: grid;
  grid-template-columns: minmax(21rem, 0.84fr) minmax(26rem, 1.16fr);
  min-height: 640px;
  overflow: hidden;
  border: 4px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.character-bay {
  position: relative;
  display: flex;
  min-height: 620px;
  align-items: center;
  justify-content: center;
  padding: 9rem 2rem 5.5rem;
  overflow: visible;
  border-right: 4px solid var(--ink);
  background-color: var(--butter);
  background-image: linear-gradient(rgba(56, 38, 64, 0.11) 2px, transparent 2px), linear-gradient(90deg, rgba(56, 38, 64, 0.11) 2px, transparent 2px);
  background-size: 34px 34px;
}

.taunt-wrap {
  position: absolute;
  z-index: 4;
  top: 1.7rem;
  right: 1.7rem;
  left: 1.7rem;
}

.taunt {
  position: relative;
  max-width: 28rem;
  min-height: 5.4rem;
  margin: 0 auto;
  padding: 1rem 1.2rem;
  border: 3px solid var(--ink);
  background: var(--white);
  box-shadow: var(--small-shadow);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 700;
  line-height: 1.2;
}

.taunt::after {
  position: absolute;
  bottom: -16px;
  left: 24%;
  width: 24px;
  height: 24px;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  background: var(--white);
  content: "";
  transform: rotate(45deg);
}

.speaker {
  position: relative;
  z-index: 2;
  width: min(100%, 430px);
  overflow: visible;
  filter: drop-shadow(7px 8px 0 rgba(56, 38, 64, 0.2));
}

.speaker * {
  vector-effect: non-scaling-stroke;
}

.speaker__shadow {
  fill: rgba(56, 38, 64, 0.22);
}

.speaker__cord {
  fill: none;
  stroke: var(--ink);
  stroke-width: 6;
}

.speaker__body {
  fill: var(--coral);
  stroke: var(--ink);
  stroke-width: 6;
}

.speaker__side {
  fill: var(--coral-dark);
  stroke: var(--ink);
  stroke-linejoin: round;
  stroke-width: 6;
}

.speaker__shine {
  fill: none;
  stroke: #ffaca0;
  stroke-linecap: round;
  stroke-width: 8;
}

.speaker__woofer {
  fill: var(--ink);
  stroke: var(--white);
  stroke-width: 6;
}

.speaker__woofer-ring {
  fill: var(--aqua);
  stroke: var(--ink);
  stroke-width: 5;
}

.speaker__woofer-core {
  fill: var(--butter);
  stroke: var(--ink);
  stroke-width: 5;
}

.speaker__tweeter {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 5;
}

.speaker__eye,
.speaker__bolts {
  fill: var(--ink);
}

.speaker__mouth,
.speaker__brow {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-width: 4;
}

.speaker-arm,
.speaker__legs {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 9;
}

.speaker__hand,
.speaker__shoe {
  fill: var(--white);
  stroke: var(--ink);
  stroke-width: 5;
}

.speaker-arm--right {
  transform-box: fill-box;
  transform-origin: left center;
  transition: transform 420ms cubic-bezier(0.2, 1.45, 0.5, 1);
}

.speaker__woofer-ring,
.speaker__woofer-core {
  transform-box: fill-box;
  transform-origin: center;
}

.is-running .speaker__woofer-ring,
.is-running .speaker__woofer-core {
  animation: woofer-pulse 550ms ease-in-out infinite alternate;
}

.is-grabbing .speaker-arm--right {
  transform: translate(6px, 7px) rotate(21deg) scaleX(1.55);
}

.is-grabbing .speaker__brow {
  transform: translateY(-2px) rotate(-4deg);
}

.music-bars {
  position: absolute;
  z-index: 3;
  right: 1.5rem;
  bottom: 2.25rem;
  left: 1.5rem;
  display: flex;
  height: 54px;
  align-items: end;
  justify-content: center;
  gap: 0.55rem;
}

.music-bars span {
  width: clamp(0.75rem, 3vw, 1.4rem);
  height: 18%;
  border: 3px solid var(--ink);
  background: var(--aqua);
  box-shadow: 2px 2px 0 var(--ink);
}

.is-running .music-bars span {
  animation: bar-dance 680ms ease-in-out infinite alternate;
}

.music-bars span:nth-child(2),
.music-bars span:nth-child(6) {
  animation-delay: -220ms;
}

.music-bars span:nth-child(3),
.music-bars span:nth-child(7) {
  animation-delay: -410ms;
}

.music-bars span:nth-child(4) {
  animation-delay: -560ms;
}

.is-bars-pushing .music-bars {
  animation: bars-shove 620ms cubic-bezier(0.25, 1.5, 0.5, 1) both;
}

.control-deck {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4.5rem);
  background: var(--paper);
}

.deck-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 3px solid var(--ink);
}

.deck-header .utility-label {
  margin-bottom: 0.1rem;
  color: var(--ink-soft);
}

.volume-readout {
  display: block;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(4.4rem, 8vw, 7.4rem);
  letter-spacing: -0.08em;
  line-height: 0.88;
  transition: color 180ms ease, transform 180ms ease;
}

.volume-readout.is-inflated {
  color: var(--danger);
  transform: rotate(-3deg) scale(1.06);
}

.sound-state {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.7rem;
  border: 2px solid var(--ink);
  background: var(--white);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sound-state span {
  width: 0.65rem;
  height: 0.65rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #cbbfbd;
}

.sound-state.is-on span {
  background: var(--aqua);
  box-shadow: 0 0 0 3px rgba(85, 198, 181, 0.3);
}

.slider-group,
.second-slider {
  padding-top: 2rem;
}

.second-slider {
  margin-top: 1.1rem;
  padding: 1rem;
  border: 3px dashed var(--danger);
  background: #ffdfd8;
  animation: second-slider-arrives 360ms cubic-bezier(0.2, 1.4, 0.5, 1) both;
}

.slider-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.slider-label-row label {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.slider-label-row span {
  color: var(--ink-soft);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 700;
}

.is-reversed .slider-label-row span {
  color: var(--danger);
}

.slider-shell {
  position: relative;
  min-height: 44px;
}

input[type="range"] {
  width: 100%;
  height: 44px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: grab;
}

input[type="range"]:active {
  cursor: grabbing;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 14px;
  border: 3px solid var(--ink);
  background: linear-gradient(to right, var(--coral) 0 var(--slider-position), var(--paper-deep) var(--slider-position) 100%);
  box-shadow: 3px 3px 0 var(--ink);
}

input[type="range"]::-moz-range-track {
  height: 10px;
  border: 3px solid var(--ink);
  background: linear-gradient(to right, var(--coral) 0 var(--slider-position), var(--paper-deep) var(--slider-position) 100%);
  box-shadow: 3px 3px 0 var(--ink);
}

input[type="range"]::-webkit-slider-thumb {
  width: 34px;
  height: 34px;
  margin-top: -13px;
  appearance: none;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--butter);
  box-shadow: 3px 3px 0 var(--ink);
}

input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--butter);
  box-shadow: 3px 3px 0 var(--ink);
}

.grab-hand {
  position: absolute;
  z-index: 6;
  top: -35px;
  left: calc(var(--slider-position, 72%) - 28px);
  display: none;
  width: 62px;
  overflow: visible;
  filter: drop-shadow(3px 3px 0 var(--ink));
  pointer-events: none;
}

.grab-hand path {
  fill: var(--white);
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.is-grabbing .grab-hand {
  display: block;
  animation: hand-grab 660ms cubic-bezier(0.2, 1.5, 0.5, 1) both;
}

.slider-help {
  margin: 0.9rem 0 0;
  color: var(--ink-soft);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.69rem;
  line-height: 1.45;
}

.deck-actions {
  display: flex;
  min-height: 54px;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.8rem 1.1rem;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  box-shadow: var(--small-shadow);
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.button:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

.button:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.button:disabled {
  opacity: 0.48;
  box-shadow: 2px 2px 0 var(--ink-soft);
  cursor: not-allowed;
}

.button--mute {
  background: var(--coral);
}

.button--mute svg {
  width: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.button--primary {
  background: var(--butter);
}

.button--secondary {
  background: var(--aqua);
}

.button--text {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.button--text:hover:not(:disabled) {
  box-shadow: none;
}

.play-icon {
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid var(--ink);
}

.stop-icon {
  width: 13px;
  height: 13px;
  background: var(--ink);
}

.attempt-card {
  margin-top: 1.6rem;
  padding-top: 1.25rem;
  border-top: 3px solid var(--ink);
}

.attempt-card__copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.attempt-card__copy strong {
  color: var(--danger);
}

.attempt-meter {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.attempt-meter span {
  height: 12px;
  border: 2px solid var(--ink);
  background: var(--paper-deep);
}

.attempt-meter span.is-filled {
  background: var(--coral);
}

.is-unlocked .attempt-meter span.is-filled {
  background: var(--aqua);
}

.battle-status {
  min-height: 2.8rem;
  margin: 1rem 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 700;
}

.is-unlocked .battle-status {
  color: #17695e;
}

.battle-stage[data-reaction="push-back"] .control-deck,
.battle-stage[data-reaction="fake-mute"] .control-deck {
  animation: deck-jolt 430ms ease-in-out both;
}

.is-fake-muting .sound-state {
  animation: fake-mute-flash 620ms step-end both;
}

.transport {
  display: grid;
  grid-template-columns: minmax(15rem, 0.7fr) minmax(24rem, 1.3fr);
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
  padding: 1.5rem;
  border: 3px solid var(--ink);
  background: var(--white);
  box-shadow: var(--small-shadow);
}

.transport__copy p {
  margin-top: 0;
  margin-bottom: 0;
}

.transport__copy .utility-label {
  margin-bottom: 0.35rem;
}

.transport__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.85rem;
}

footer {
  padding-block: 3rem 2rem;
  color: var(--ink-soft);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.tinychaos-credit {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.tinychaos-credit a {
  color: var(--ink);
  font-weight: 900;
}

.noscript {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  z-index: 50;
  padding: 1rem;
  border: 3px solid var(--ink);
  background: var(--coral);
  box-shadow: var(--small-shadow);
  font-weight: 900;
  text-align: center;
}

@keyframes woofer-pulse {
  from { transform: scale(0.96); }
  to { transform: scale(1.055); }
}

@keyframes bar-dance {
  from { height: 18%; }
  to { height: 96%; }
}

@keyframes bars-shove {
  0% { transform: translateX(-20%); }
  55% { transform: translateX(17%); }
  100% { transform: translateX(0); }
}

@keyframes hand-grab {
  0% { opacity: 0; transform: translate(45px, -35px) rotate(30deg) scale(0.7); }
  55% { opacity: 1; transform: translate(0, 5px) rotate(-8deg) scale(1.1); }
  100% { opacity: 1; transform: translate(0, 0) rotate(0) scale(1); }
}

@keyframes second-slider-arrives {
  from { opacity: 0; transform: translateX(30px) rotate(2deg); }
  to { opacity: 1; transform: translateX(0) rotate(-0.5deg); }
}

@keyframes deck-jolt {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(8px) rotate(0.4deg); }
  55% { transform: translateX(-6px) rotate(-0.3deg); }
  75% { transform: translateX(3px); }
}

@keyframes fake-mute-flash {
  0%, 40% { background: var(--danger); color: var(--white); }
  41%, 100% { background: var(--aqua); color: var(--ink); }
}

@media (max-width: 900px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .intro__copy {
    max-width: 42rem;
  }

  .battle-stage {
    grid-template-columns: 1fr;
  }

  .character-bay {
    min-height: 560px;
    border-right: 0;
    border-bottom: 4px solid var(--ink);
  }

  .control-deck {
    min-height: 580px;
  }

  .transport {
    grid-template-columns: 1fr;
  }

  .transport__buttons {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .site-header,
  .page-shell,
  footer {
    width: min(100% - 1rem, 1180px);
  }

  .header-note {
    max-width: 15ch;
    text-align: right;
  }

  .intro {
    padding-block: 2.8rem;
  }

  h1 {
    font-size: clamp(3.25rem, 17vw, 5rem);
  }

  .battle-stage {
    box-shadow: 5px 5px 0 var(--ink);
  }

  .character-bay {
    min-height: 475px;
    padding: 8.5rem 0.5rem 3.5rem;
  }

  .taunt-wrap {
    top: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .speaker {
    width: min(100%, 350px);
  }

  .music-bars {
    bottom: 1.1rem;
  }

  .control-deck {
    min-height: auto;
    padding: 2rem 1.15rem;
  }

  .deck-header {
    align-items: end;
  }

  .volume-readout {
    font-size: clamp(4rem, 22vw, 6rem);
  }

  .sound-state {
    margin-bottom: 0.35rem;
  }

  .slider-label-row {
    align-items: start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .button {
    min-height: 52px;
  }

  .transport__buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .transport__buttons .button--text {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .is-running .speaker__woofer-ring,
  .is-running .speaker__woofer-core,
  .is-running .music-bars span {
    animation: none;
  }

  .is-running .music-bars span:nth-child(2n) {
    height: 68%;
  }
}
