:root {
  --ink: #000;
  --paper: #fff;
  --muted: #8a8a8a;
  --line: rgba(255, 255, 255, 0.16);
  --track: #2a2a2a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

*:focus,
*:focus-visible {
  outline: none;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--ink);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.site {
  position: relative;
  height: 100dvh;
  height: 100svh;
  min-height: 0;
  overflow: hidden;
}

.led-pane {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
}

.led-pane .stage,
.led-pane .web-saver {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.led-pane .stage {
  transform: scale(1.04);
  pointer-events: none;
}

.led-pane .stage .layer,
.led-pane .stage img,
.led-pane .stage video {
  filter: blur(2px);
}

.desk[hidden],
.result-card[hidden],
.start-actions[hidden],
.frame[hidden] {
  display: none !important;
}

.led-pane .web-saver {
  z-index: 3;
}

.led-pane .tag {
  display: none;
}

.site > .mark {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: max(24px, env(safe-area-inset-left));
  z-index: 50;
  color: var(--ink);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  background: transparent;
  pointer-events: auto;
}

.sound {
  position: absolute;
  top: 12px;
  right: max(24px, env(safe-area-inset-right));
  z-index: 10;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--ink);
  height: 36px;
  min-width: 120px;
  padding: 0 14px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
}

.sound[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.steps {
  position: absolute;
  top: 22px;
  right: max(160px, calc(env(safe-area-inset-right) + 136px));
  z-index: 6;
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps[hidden] {
  display: none;
}

.steps li {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  opacity: 0.35;
  list-style: none;
}

.steps li.on {
  background: var(--ink);
  border-color: var(--ink);
  opacity: 1;
}

.steps li.done {
  background: transparent;
  border-color: var(--ink);
  opacity: 0.7;
}

.desk {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  height: 30%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  min-height: 0;
  overflow: hidden;
  border-top: 0;
  background: transparent;
}

.lead-space {
  display: none;
}

.explain {
  min-width: 0;
  overflow: auto;
  padding: 16px 20px 16px max(24px, env(safe-area-inset-left));
  border-right: 1px solid rgba(0, 0, 0, 0.2);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}

.detail {
  display: contents;
}

.kicker {
  grid-row: 1;
}

.script {
  grid-row: 2;
}

.question {
  grid-row: 3;
}

.detail .next.voice {
  grid-row: 4;
  margin-top: 10px;
}

.explain .next.voice {
  margin-top: 10px;
}

.kicker {
  font-size: clamp(13px, 1.4vw, 18px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.kicker[hidden],
.question[hidden],
.script:empty {
  display: none;
}

.result-card {
  position: fixed;
  left: 50%;
  top: max(16px, env(safe-area-inset-top));
  z-index: 40;
  transform: translateX(-50%);
  width: min(42rem, calc(100vw - 64px));
  min-width: 280px;
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #fff;
  color: var(--ink);
  padding: 28px 28px 24px;
}

.result-card[hidden] {
  display: none;
}

html.result-open,
body.result-open {
  overflow: hidden;
}

html.result-open .result-card,
body.result-open .result-card {
  top: max(56px, calc(12px + env(safe-area-inset-top)));
}

.result-card .result-actions {
  margin-top: 18px;
}

.script {
  font-size: clamp(13px, 1.35vw, 17px);
  font-weight: 400;
  line-height: 1.35;
}

.question {
  margin-top: 8px;
  font-size: clamp(16px, 1.8vw, 24px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.result-lead {
  font-size: clamp(13px, 1.35vw, 17px);
  margin-bottom: 6px;
}

#persona-name {
  font-size: clamp(22px, 2.6vw, 36px);
  font-weight: 700;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  line-height: 0.95;
  margin-bottom: 8px;
}

#persona-name a {
  color: inherit;
  text-decoration: none;
}

#persona-name a:hover {
  text-decoration: underline;
}

.outro {
  font-size: clamp(12px, 1.2vw, 15px);
  line-height: 1.35;
}

.outro p,
.outro ul {
  margin: 0 0 8px;
}

.outro ul {
  padding-left: 1.1em;
}

.result-follow {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.result-mail-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.3;
}

.result-mail-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.result-mail input {
  width: 100%;
  min-width: 0;
  height: 52px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-family: inherit;
  font-size: 15px;
}

.result-mail-status {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.3;
}

.result-follow .next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

#result-mail-send {
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

#result-group {
  width: 100%;
}

#result-group[hidden] {
  display: none;
}

.play {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 12px max(24px, env(safe-area-inset-right)) 16px 24px;
}

.start-actions,
.result-actions,
.frame {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.start-actions[hidden],
.frame[hidden],
.result-actions[hidden],
.how[hidden],
.next.begin[hidden],
.slider-row[hidden],
.next.voice[hidden] {
  display: none;
}

.how {
  width: 100%;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
}

.slider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 16px;
  align-items: center;
  width: 100%;
}

.slider {
  min-width: 0;
  width: 100%;
  padding: 28px 8px;
  margin: 0 -8px;
  touch-action: none;
  cursor: pointer;
}

.bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  border-radius: 999px;
  background: var(--ink);
}

.thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
}

.next {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--ink);
  height: 52px;
  min-width: 140px;
  padding: 0 20px;
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.slider-row .next {
  position: relative;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
}

.next.voice {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.slider-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: 28%;
  z-index: 9;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0 24px;
  color: #000;
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(32px, 4.5vw, 64px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
}

.slider-hint[hidden] {
  display: none !important;
}

.slider-hint.say {
  text-transform: none;
  letter-spacing: 0.02em;
  line-height: 1.1;
  font-size: clamp(26px, 3.6vw, 48px);
}

@media (max-width: 1024px) {
  html,
  body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
  }

  .site {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .led-pane {
    position: fixed;
    inset: 0;
    height: 100dvh;
    z-index: 0;
    isolation: isolate;
    pointer-events: none;
  }

  .led-pane .stage,
  .led-pane .web-saver {
    position: absolute;
    z-index: 0;
  }

  .site > .mark {
    position: fixed;
    z-index: 50;
    pointer-events: auto;
  }

  .sound,
  .steps {
    position: fixed;
  }

  .desk {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
    pointer-events: none;
  }

  .kicker,
  .question,
  .play,
  .slider-row,
  .slider,
  .next,
  .detail {
    pointer-events: auto;
  }

  .lead-space {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    pointer-events: none;
  }

  .explain {
    display: contents;
    border-right: 0;
    padding: 0;
    overflow: visible;
  }

  .kicker {
    order: 1;
    padding: 0 16px;
    margin: 0;
  }

  .question {
    order: 2;
    margin: 6px 0 0;
    padding: 0 16px 8px;
    font-size: 18px;
  }

  .play {
    order: 3;
    padding: 8px 16px 16px;
    background: transparent;
  }

  .detail {
    order: 4;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fff;
    color: #000;
    padding: 28px 20px calc(48px + env(safe-area-inset-bottom));
    min-height: 70dvh;
  }

  .detail .next.voice {
    margin-top: 0;
    width: auto;
    min-width: 108px;
  }

  .script {
    font-size: 16px;
    line-height: 1.45;
  }

  .how {
    display: none !important;
  }

  .frame {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .slider-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  .slider {
    width: 100%;
    padding: 18px 0;
    margin: 0;
  }

  .thumb {
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
  }

  .next {
    min-width: 0;
    width: 100%;
    height: 48px;
    font-size: 13px;
  }

  .steps {
    left: 50%;
    right: auto;
    top: 52px;
    transform: translateX(-50%);
  }

  .sound {
    min-width: 0;
    height: 32px;
    padding: 0 10px;
    font-size: 11px;
  }

  .slider-hint {
    position: fixed;
    top: 34%;
    font-size: clamp(28px, 9vw, 52px);
    padding: 0 12px;
  }

  .slider-hint.say {
    font-size: clamp(22px, 6.5vw, 36px);
  }

  .result-card {
    width: calc(100vw - 32px);
    min-width: 0;
    max-width: none;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 22px 20px 18px;
  }

  .result-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
