:root {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #ffffff;
  background: #222222;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

#app {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  background: #222222;
  color: #ffffff;
}

.narrow-device-warning {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  padding: 28px;
  color: #ffffff;
  background: #222222;
  text-align: center;
}

.narrow-device-warning-card {
  display: grid;
  gap: 18px;
  width: min(100%, 34rem);
  border: 2px solid #ffffff;
  padding: 28px;
}

.narrow-device-warning-title,
.narrow-device-warning-copy {
  margin: 0;
}

.narrow-device-warning-title {
  font-size: clamp(32px, 10vw, 56px);
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
}

.narrow-device-warning-copy {
  font-size: clamp(18px, 5vw, 24px);
  line-height: 1.35;
  font-weight: 600;
}

.screen {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  padding: clamp(28px, 5vw, 80px);
  place-items: center;
  text-align: center;
}

.content {
  display: grid;
  justify-items: center;
  width: min(100%, 86rem);
  gap: clamp(22px, 4vh, 48px);
}

.setup-content {
  width: min(100%, 72rem);
}

.meter-content {
  width: min(100%, 78rem);
  gap: clamp(10px, 2vh, 24px);
}

.welcome-content {
  width: min(100%, 70rem);
}

.consent-content {
  width: min(100%, 76rem);
  gap: clamp(18px, 3vh, 34px);
}

.title {
  margin: 0;
  font-size: clamp(44px, 5vw, 76px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0;
}

.phrase-title {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(48px, 6vw, 88px);
  line-height: 1.02;
  font-weight: 850;
  letter-spacing: 0;
  text-wrap: balance;
}

.body-copy {
  margin: 0;
  max-width: 60ch;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.5;
  font-weight: 400;
  white-space: pre-line;
}

.instruction-content {
  gap: clamp(14px, 2.6vh, 30px);
}

.script-preview {
  display: grid;
  gap: 8px;
  max-width: 76ch;
}

.script-preview-label,
.script-preview-lines {
  margin: 0;
}

.script-preview-label {
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.2;
  font-weight: 800;
}

.script-preview-lines {
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.35;
  font-weight: 450;
  white-space: pre-line;
  text-wrap: balance;
}

.script-lines {
  margin: 0;
  max-width: 70ch;
  font-size: clamp(28px, 3vw, 56px);
  line-height: 1.5;
  font-weight: 500;
  color: #000000;
  white-space: pre-line;
  text-wrap: balance;
}

.performing-instructions {
  position: absolute;
  top: 24px;
  left: 50%;
  width: min(48rem, calc(100% - 48px));
  margin: 0;
  transform: translateX(-50%);
  color: #68717d;
  font-size: clamp(16px, 1.25vw, 20px);
  line-height: 1.3;
  font-weight: 650;
  text-align: center;
}

.counter {
  position: absolute;
  top: 24px;
  left: 24px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 400;
  color: currentColor;
}

@media (max-width: 1100px) {
  .performing-instructions {
    top: 56px;
    right: clamp(24px, 4vw, 56px);
    left: clamp(24px, 4vw, 56px);
    width: auto;
    transform: none;
  }
}

.bottom-hint {
  position: absolute;
  right: clamp(24px, 4vw, 56px);
  bottom: clamp(24px, 4vw, 56px);
  left: clamp(24px, 4vw, 56px);
  margin: 0;
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.3;
  font-weight: 550;
}

.start-button {
  min-width: 12rem;
  border: 2px solid #ffffff;
  border-radius: 0;
  padding: 18px 34px;
  color: #ffffff;
  background: transparent;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
}

.start-button:disabled {
  border-color: #8b8b8b;
  color: #8b8b8b;
  cursor: not-allowed;
}

.start-button:focus-visible {
  outline: 4px solid #ffffff;
  outline-offset: 6px;
}

.guide-card {
  display: grid;
  gap: 12px;
  max-width: 56rem;
  border: 2px solid rgb(255 255 255 / 0.35);
  padding: clamp(16px, 2vw, 24px);
  text-align: left;
}

.guide-card h2,
.guide-card ul {
  margin: 0;
}

.guide-card h2 {
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1.2;
}

.guide-card ul {
  display: grid;
  gap: 8px;
  padding-left: 1.2em;
  font-size: clamp(16px, 1.3vw, 20px);
  line-height: 1.35;
}

.meter-panel {
  display: grid;
  justify-items: center;
  width: min(100%, 36rem);
  gap: 18px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: center;
}

.meter-screen {
  transition: background-color 180ms linear;
}

.meter-screen .title {
  font-size: clamp(36px, 5vw, 68px);
}

.meter-screen .body-copy {
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.35;
}

.meter-screen .bottom-hint {
  display: none;
}

.room-tone-warning {
  margin: 0;
  max-width: 16ch;
  color: #ffffff;
  font-size: clamp(42px, 6vw, 82px);
  line-height: 0.95;
  font-weight: 900;
  text-transform: uppercase;
}

.vertical-meter-shell {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: clamp(18px, 4vw, 34px);
  align-items: end;
}

.meter-scale {
  display: grid;
  height: clamp(150px, 34vh, 320px);
  align-content: space-between;
  color: rgb(255 255 255 / 0.86);
  font-size: 17px;
  line-height: 1;
  text-align: right;
}

.meter-scale span:nth-child(-n + 3) {
  color: #ff9c9c;
}

.meter-scale span:nth-child(n + 4):nth-child(-n + 6) {
  color: #fff08a;
}

.vertical-meter {
  position: relative;
  width: 80px;
  height: clamp(150px, 34vh, 320px);
  border-right: 2px solid rgb(255 255 255 / 0.82);
  border-left: 2px solid rgb(255 255 255 / 0.82);
}

.meter-ticks {
  position: absolute;
  inset: 0 -10px;
  display: grid;
  align-content: space-between;
  pointer-events: none;
}

.meter-ticks span {
  height: 1px;
  background: linear-gradient(
    to right,
    rgb(255 255 255 / 0.85) 0 10px,
    transparent 10px calc(100% - 10px),
    rgb(255 255 255 / 0.85) calc(100% - 10px)
  );
}

.vertical-meter-fill {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  min-height: 2px;
  background: #62d8cd;
  transition: height 35ms linear;
}

.meter-stats {
  display: grid;
  align-self: center;
  gap: 28px;
  min-width: 92px;
  text-align: left;
}

.meter-stats div {
  display: grid;
  gap: 8px;
}

.meter-stats dt,
.meter-stats dd,
.meter-note,
.meter-small-hint {
  margin: 0;
}

.meter-stats dt {
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1;
  font-weight: 500;
  text-transform: uppercase;
}

.meter-stats dd {
  font-size: clamp(22px, 2.5vw, 32px);
  line-height: 1;
  font-weight: 500;
}

.room-tone-badge {
  min-width: min(100%, 18rem);
  border-radius: 999px;
  padding: 12px 26px;
  color: #ffffff;
  background: #62d8cd;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
  font-weight: 500;
}

.room-tone-badge.is-too-loud {
  background: #ff8585;
}

.meter-note {
  max-width: 38rem;
  color: rgb(255 255 255 / 0.9);
  font-size: clamp(17px, 2vw, 30px);
  line-height: 1.15;
  font-weight: 800;
  text-transform: uppercase;
}

.meter-small-hint {
  max-width: 56ch;
  color: rgb(255 255 255 / 0.78);
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 1.4;
  font-weight: 500;
}

.meter-button {
  min-width: 16rem;
}

.meter-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  align-items: center;
}

.skip-mic-button {
  min-width: 12rem;
  border: 2px solid rgb(255 255 255 / 0.7);
  padding: 18px 24px;
  color: #ffffff;
  background: transparent;
  font-size: clamp(18px, 1.4vw, 24px);
  font-weight: 800;
  cursor: pointer;
}

.skip-mic-button:hover,
.skip-mic-button:focus-visible {
  color: #ffffff;
  border-color: #ffffff;
}

.skip-mic-button:focus-visible {
  outline: 4px solid #ffffff;
  outline-offset: 6px;
}

.consent-label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  max-width: 68rem;
  text-align: left;
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.4;
}

.consent-checkbox {
  width: 32px;
  height: 32px;
  margin-top: 3px;
  accent-color: #ffffff;
}

.notice {
  margin: 0;
  color: #ffd166;
  font-size: clamp(18px, 1.5vw, 22px);
  font-weight: 700;
}

.mode-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.mode-button {
  min-width: min(20rem, 100%);
  border: 2px solid #ffffff;
  border-radius: 0;
  padding: 20px 28px;
  color: #ffffff;
  background: transparent;
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 800;
  cursor: pointer;
}

.mode-button.is-selected {
  color: #222222;
  background: #ffffff;
}

.mode-button:focus-visible {
  outline: 4px solid #ffffff;
  outline-offset: 6px;
}

.url {
  display: block;
  color: #ffffff;
  font-size: clamp(24px, 2.5vw, 38px);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.check-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  max-width: 58ch;
  list-style: none;
  text-align: left;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.45;
}

.check-list li::before {
  content: "- ";
}

.error {
  color: #ffffff;
  background: #222222;
}

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .narrow-device-warning {
    display: grid;
  }

  #app {
    pointer-events: none;
    user-select: none;
  }
}
