:root {
  --pink: #ff8aa1;
  --pink-dark: #e96f8a;
  --pink-soft: #fff0f4;
  --gold: #ffe25b;
  --gold-dark: #6f5b00;
  --gold-soft: #fff9d9;
  --white: #ffffff;
  --cream: #fffdf6;
  --ink: #342f31;
  --muted: #756e71;
  --line: #eadfe2;
  --shadow: 0 22px 65px rgba(100, 69, 78, 0.14);
  --shadow-soft: 0 12px 34px rgba(100, 69, 78, 0.09);
  --content-width: 980px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 8%, rgba(255, 138, 161, 0.17), transparent 28rem),
    radial-gradient(circle at 95% 18%, rgba(255, 226, 91, 0.22), transparent 28rem),
    linear-gradient(180deg, #fff8fa 0%, var(--cream) 62%, #fff 100%);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC",
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

.page-glow {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.page-glow-pink {
  top: 180px;
  left: -125px;
  width: 270px;
  height: 270px;
  border: 38px solid rgba(255, 138, 161, 0.08);
}

.page-glow-gold {
  right: -95px;
  bottom: 70px;
  width: 250px;
  height: 250px;
  background: rgba(255, 226, 91, 0.1);
}

.game-header {
  display: grid;
  width: min(calc(100% - 40px), 1160px);
  margin: 0 auto;
  padding: 22px 0;
  align-items: center;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
}

.back-link,
.text-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.back-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: start;
}

.text-button {
  justify-self: end;
}

.back-link:hover,
.text-button:hover {
  color: var(--pink-dark);
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(255, 138, 161, 0.28);
  outline-offset: 4px;
}

.mini-brand {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 850;
}

.pulse-dot {
  width: 11px;
  height: 11px;
  border: 3px solid rgba(255, 138, 161, 0.22);
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 6px rgba(255, 138, 161, 0.08);
}

.game-shell {
  width: min(calc(100% - 40px), var(--content-width));
  margin: 0 auto;
  padding: 50px 0 90px;
}

.setup-intro {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--pink-dark);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.setup-intro h1 {
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 5.15rem);
  line-height: 1;
  letter-spacing: -0.065em;
}

.setup-intro > p:last-child {
  max-width: 670px;
  margin: 24px auto 0;
  color: var(--muted);
}

.equipment-note {
  display: flex;
  width: min(100%, 610px);
  margin: 38px auto 58px;
  padding: 17px 20px;
  gap: 15px;
  align-items: center;
  border: 1px solid rgba(111, 91, 0, 0.14);
  border-radius: 20px;
  background: rgba(255, 249, 217, 0.75);
  box-shadow: var(--shadow-soft);
}

.equipment-note > span {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  background: var(--white);
  font-size: 1.45rem;
}

.equipment-note strong,
.equipment-note p {
  display: block;
  margin: 0;
}

.equipment-note p {
  color: var(--muted);
  font-size: 0.84rem;
}

.setup-section {
  margin-top: 45px;
}

.section-heading {
  display: flex;
  margin-bottom: 16px;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.section-heading span {
  color: var(--pink-dark);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.25rem;
}

.choice-grid {
  display: grid;
  gap: 15px;
}

.participant-grid,
.gameplay-grid,
.record-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scale-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.round-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-card {
  position: relative;
  cursor: pointer;
}

.choice-card input,
.wearer-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card-inner {
  position: relative;
  display: flex;
  min-height: 165px;
  padding: 25px 23px;
  align-items: flex-start;
  flex-direction: column;
  border: 1.5px solid var(--line);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-soft);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.choice-card:hover .choice-card-inner {
  transform: translateY(-3px);
}

.choice-card input:checked + .choice-card-inner {
  border-color: var(--pink);
  background:
    linear-gradient(
      135deg,
      rgba(255, 240, 244, 0.96),
      rgba(255, 249, 217, 0.72)
    );
  box-shadow: var(--shadow);
}

.choice-card input:focus-visible + .choice-card-inner,
.wearer-card input:focus-visible + span {
  outline: 3px solid rgba(255, 138, 161, 0.28);
  outline-offset: 4px;
}

.choice-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 15px;
  color: var(--pink-dark);
  background: var(--pink-soft);
  font-size: 0.86rem;
  font-weight: 900;
}

.choice-icon-gold {
  color: var(--gold-dark);
  background: var(--gold-soft);
}

.choice-card strong {
  font-size: 1.04rem;
}

.choice-card small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.compact-card .choice-card-inner {
  min-height: 115px;
  justify-content: center;
}

.recommended-card .choice-card-inner {
  padding-top: 45px;
}

.recommend-badge {
  position: absolute;
  top: 17px;
  right: 18px;
  display: inline-flex;
  min-height: 25px;
  padding: 3px 10px;
  align-items: center;
  border-radius: 999px;
  color: var(--white);
  background: var(--pink);
  font-size: 0.68rem;
  font-weight: 900;
}

.wearer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.wearer-card {
  position: relative;
  cursor: pointer;
}

.wearer-card > span {
  display: grid;
  min-height: 145px;
  padding: 22px;
  align-items: center;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 16px;
  border: 1.5px solid var(--line);
  border-radius: 23px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-soft);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.wearer-card:hover > span {
  transform: translateY(-3px);
}

.wearer-card input:checked + span {
  border-color: var(--pink);
  box-shadow: var(--shadow);
}

.wearer-card img {
  width: 76px;
  height: 76px;
  grid-row: 1 / 3;
  border: 4px solid var(--white);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.wearer-card-pink img {
  outline: 4px solid var(--pink);
}

.wearer-card-gold img {
  outline: 4px solid var(--gold);
}

.wearer-card strong,
.wearer-card small {
  display: block;
}

.wearer-card small {
  color: var(--muted);
  font-size: 0.8rem;
}

.small-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.79rem;
}

.centered-note {
  text-align: center;
}

.dual-bank-note,
.dual-record-note {
  margin-top: 15px;
  padding: 17px 20px;
  border-left: 5px solid var(--gold);
  border-radius: 16px;
  background: rgba(255, 249, 217, 0.7);
}

.dual-bank-note strong,
.dual-bank-note p {
  display: block;
  margin: 0;
}

.dual-bank-note p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.dual-record-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.consent-note {
  margin-top: 38px;
  padding: 20px 22px;
  border-left: 5px solid var(--gold);
  border-radius: 16px;
  background: rgba(255, 249, 217, 0.66);
}

.consent-note strong,
.consent-note p {
  display: block;
  margin: 0;
}

.consent-note p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.button {
  display: inline-flex;
  min-height: 57px;
  padding: 13px 23px;
  gap: 8px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: var(--white);
  background: var(--pink);
  box-shadow: 0 13px 30px rgba(255, 138, 161, 0.32);
}

.button-secondary {
  border: 1.5px solid var(--line);
  color: var(--ink);
  background: var(--white);
}

.start-button {
  width: min(100%, 420px);
  margin: 40px auto 0;
}

.play-screen {
  max-width: 820px;
  margin: 0 auto;
}

.play-toolbar {
  display: flex;
  margin-bottom: 24px;
  align-items: center;
  justify-content: space-between;
}

.mode-pill {
  display: inline-flex;
  min-height: 31px;
  padding: 5px 13px;
  align-items: center;
  border-radius: 999px;
  color: var(--pink-dark);
  background: var(--pink-soft);
  font-size: 0.78rem;
  font-weight: 850;
}

.round-progress {
  margin-bottom: 18px;
}

.round-copy {
  display: flex;
  margin-bottom: 8px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 750;
}

.progress-track {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: rgba(52, 47, 49, 0.08);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--gold));
  transition: width 240ms ease;
}

.ready-panel,
.waiting-panel,
.experiment-panel,
.rest-panel,
.live-baseline-panel,
.live-task-panel,
.live-result-input-panel,
.result-card {
  border: 1.5px solid rgba(255, 138, 161, 0.27);
  border-radius: 30px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 240, 244, 0.95),
      rgba(255, 255, 255, 0.97)
    );
  box-shadow: var(--shadow);
}

.ready-panel,
.waiting-panel,
.experiment-panel,
.rest-panel,
.live-baseline-panel,
.live-task-panel,
.live-result-input-panel {
  padding: 34px 38px;
}

.ready-panel,
.waiting-panel,
.rest-panel,
.live-baseline-panel,
.live-result-input-panel {
  text-align: center;
}

.ready-panel h1,
.waiting-panel h2,
.rest-panel h2,
.live-baseline-panel h2,
.live-result-input-panel h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.ready-panel > p:not(.eyebrow),
.waiting-panel > p:not(.eyebrow),
.rest-panel > p:not(.eyebrow),
.live-baseline-panel > p:not(.eyebrow),
.live-result-input-panel > p:not(.eyebrow) {
  margin: 14px auto 0;
  color: var(--muted);
}

.role-box {
  display: grid;
  margin-top: 24px;
  padding: 17px 20px;
  border: 1px solid rgba(52, 47, 49, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.role-item {
  padding: 11px;
  border-radius: 13px;
}

.role-item span,
.role-item strong {
  display: block;
}

.role-item span {
  color: var(--muted);
  font-size: 0.7rem;
}

.role-item strong {
  margin-top: 2px;
}

.role-item-pink {
  background: var(--pink-soft);
}

.role-item-gold {
  background: var(--gold-soft);
}

.ready-actions {
  display: grid;
  margin-top: 26px;
  grid-template-columns: minmax(170px, 0.65fr) minmax(250px, 1.35fr);
  gap: 12px;
}

.large-countdown {
  display: block;
  margin: 18px 0 4px;
  color: var(--pink-dark);
  font-size: clamp(4rem, 14vw, 7.5rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.support-copy {
  max-width: 560px;
}

.waiting-panel .button {
  margin-top: 25px;
}

.experiment-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.experiment-top span {
  color: var(--muted);
  font-size: 0.8rem;
}

.experiment-top > strong {
  display: grid;
  flex: 0 0 auto;
  width: 83px;
  height: 83px;
  place-items: center;
  border: 6px solid var(--white);
  border-radius: 50%;
  color: var(--white);
  background: var(--pink);
  box-shadow: var(--shadow-soft);
  font-size: 2rem;
}

.task-card {
  margin-top: 24px;
  padding: 29px;
  border: 1px solid rgba(52, 47, 49, 0.07);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
}

.task-type {
  display: inline-flex;
  min-height: 27px;
  padding: 3px 10px;
  align-items: center;
  border-radius: 999px;
  color: var(--pink-dark);
  background: var(--pink-soft);
  font-size: 0.68rem;
  font-weight: 900;
}

.task-card h2 {
  margin: 13px 0 0;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.18;
  letter-spacing: -0.045em;
}

.task-card p {
  margin: 13px 0 0;
  color: var(--muted);
}

.phase-card {
  margin-top: 16px;
  padding: 19px 22px;
  border-radius: 19px;
  color: var(--gold-dark);
  background: var(--gold-soft);
}

.phase-card span,
.phase-card strong,
.phase-card p {
  display: block;
}

.phase-card span {
  font-size: 0.68rem;
  font-weight: 850;
}

.phase-card strong {
  margin-top: 2px;
  font-size: 1.2rem;
}

.phase-card p {
  margin: 3px 0 0;
  font-size: 0.82rem;
}

.timeline-bar {
  overflow: hidden;
  height: 11px;
  margin-top: 18px;
  border-radius: 999px;
  background: rgba(52, 47, 49, 0.08);
}

.timeline-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--gold));
}

.abort-button {
  width: 100%;
  margin-top: 20px;
}

.rest-icon {
  display: grid;
  width: 66px;
  height: 66px;
  margin: 0 auto 18px;
  place-items: center;
  border: 5px solid var(--white);
  border-radius: 50%;
  color: var(--pink-dark);
  background: var(--gold);
  box-shadow: var(--shadow-soft);
  font-size: 1.8rem;
}

.rest-panel .button {
  margin-top: 24px;
}

.bpm-input-label {
  display: grid;
  max-width: 350px;
  margin: 24px auto 0;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
  text-align: left;
}

.bpm-input-wrap {
  display: flex;
  min-height: 65px;
  padding: 0 17px;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}

.bpm-input-wrap input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 1.45rem;
  font-weight: 900;
}

.bpm-input-wrap > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.live-result-input-panel .button {
  min-width: min(100%, 320px);
  margin-top: 24px;
}

.play-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.data-entry-screen {
  max-width: 900px;
  margin: 0 auto;
}

.data-entry-heading {
  text-align: center;
}

.data-entry-heading h1 {
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 4.2rem);
  line-height: 1.06;
  letter-spacing: -0.055em;
}

.data-entry-heading > p:last-child {
  max-width: 680px;
  margin: 18px auto 0;
  color: var(--muted);
}

.health-path {
  display: flex;
  margin: 30px 0;
  padding: 17px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid rgba(111, 91, 0, 0.12);
  border-radius: 18px;
  background: var(--gold-soft);
}

.health-path span {
  display: inline-flex;
  min-height: 31px;
  padding: 5px 11px;
  align-items: center;
  border-radius: 999px;
  background: var(--white);
  font-size: 0.78rem;
  font-weight: 850;
}

.health-path i {
  color: var(--gold-dark);
  font-style: normal;
}

.data-entry-list {
  display: grid;
  gap: 13px;
}

.data-entry-card {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.data-entry-single-grid {
  display: grid;
  margin-top: 14px;
  grid-template-columns: repeat(2, minmax(0, 125px));
  gap: 13px;
}

.dual-entry-grid {
  display: grid;
  margin-top: 15px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.dual-player-entry {
  padding: 15px;
  border: 1px solid rgba(52, 47, 49, 0.07);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.dual-player-entry-pink {
  box-shadow: inset 0 4px 0 var(--pink);
}

.dual-player-entry-gold {
  box-shadow: inset 0 4px 0 var(--gold);
}

.dual-player-entry > strong {
  display: block;
  margin-bottom: 10px;
}

.dual-number-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.data-entry-copy span,
.data-entry-copy strong,
.data-entry-copy small {
  display: block;
}

.data-entry-copy span {
  color: var(--pink-dark);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.data-entry-copy strong {
  margin-top: 3px;
}

.data-entry-copy small {
  margin-top: 3px;
  color: var(--muted);
}

.data-number-label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.data-number-label span {
  display: flex;
  min-height: 48px;
  padding: 0 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
}

.data-number-label input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 900;
}

.data-number-label em {
  color: var(--muted);
  font-size: 0.64rem;
  font-style: normal;
}

.calculate-button {
  width: min(100%, 360px);
  margin: 28px auto 0;
}

.result-screen {
  max-width: 850px;
  margin: 0 auto;
}

.result-card {
  padding: 39px 42px;
  text-align: center;
  background:
    linear-gradient(
      145deg,
      rgba(255, 240, 244, 0.96),
      rgba(255, 249, 217, 0.82)
    );
}

.result-heart {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  place-items: center;
  border: 6px solid var(--white);
  border-radius: 50%;
  color: var(--white);
  background: var(--pink);
  box-shadow: var(--shadow-soft);
  font-size: 1.9rem;
}

.result-card h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

#resultSubtitle {
  max-width: 620px;
  margin: 17px auto 0;
  color: var(--muted);
}

.result-highlights {
  display: grid;
  margin-top: 29px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 13px;
}

.highlight-card {
  padding: 22px;
  border: 1px solid rgba(52, 47, 49, 0.07);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.72);
}

.highlight-card-pink {
  box-shadow: inset 0 5px 0 var(--pink);
}

.highlight-card-gold {
  box-shadow: inset 0 5px 0 var(--gold);
}

.highlight-card-shared {
  box-shadow:
    inset 0 5px 0 var(--pink),
    inset 0 10px 0 var(--gold);
}

.highlight-card span,
.highlight-card strong,
.highlight-card p {
  display: block;
}

.highlight-card span {
  color: var(--muted);
  font-size: 0.73rem;
}

.highlight-card strong {
  margin-top: 5px;
  font-size: 2rem;
}

.highlight-card p {
  margin: 6px 0 0;
  font-size: 0.86rem;
}

.result-table-wrap {
  overflow-x: auto;
  margin-top: 20px;
  border: 1px solid rgba(52, 47, 49, 0.08);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.72);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.result-table th,
.result-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(52, 47, 49, 0.07);
  font-size: 0.78rem;
}

.result-table th {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.75);
  font-weight: 850;
}

.result-table tr:last-child td {
  border-bottom: 0;
}

.result-disclaimer {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.result-actions {
  display: grid;
  margin-top: 27px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.help-dialog {
  width: min(calc(100% - 30px), 640px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
}

.help-dialog::backdrop {
  background: rgba(52, 47, 49, 0.36);
  backdrop-filter: blur(5px);
}

.dialog-content {
  padding: 30px;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 1.7rem;
}

.dialog-content h3 {
  margin: 24px 0 4px;
}

.dialog-content p,
.dialog-content li {
  color: var(--muted);
}

.dialog-content ul {
  padding-left: 21px;
}

.dialog-close {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--pink-soft);
  font-size: 1.45rem;
  cursor: pointer;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 20px;
  bottom: 20px;
  max-width: min(380px, calc(100% - 40px));
  padding: 13px 17px;
  border: 1px solid rgba(52, 47, 49, 0.08);
  border-radius: 14px;
  color: var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 760px) {
  .game-header {
    width: min(calc(100% - 28px), 1160px);
    grid-template-columns: 1fr auto;
  }

  .mini-brand {
    display: none;
  }

  .game-shell {
    width: min(calc(100% - 28px), var(--content-width));
    padding-top: 38px;
  }

  .participant-grid,
  .gameplay-grid,
  .record-grid,
  .scale-grid,
  .round-grid,
  .wearer-grid {
    grid-template-columns: 1fr;
  }

  .choice-card-inner {
    min-height: 130px;
  }

  .compact-card .choice-card-inner {
    min-height: 105px;
  }

  .ready-panel,
  .waiting-panel,
  .experiment-panel,
  .rest-panel,
  .live-baseline-panel,
  .live-task-panel,
  .live-result-input-panel,
  .result-card {
    padding: 28px 23px;
  }

  .ready-actions {
    grid-template-columns: 1fr;
  }

  .role-box {
    grid-template-columns: 1fr;
  }

  .dual-entry-grid {
    grid-template-columns: 1fr;
  }

  .result-highlights {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .back-link,
  .text-button {
    font-size: 0.84rem;
  }

  .setup-intro h1 {
    font-size: clamp(2.65rem, 14vw, 4rem);
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .wearer-card > span {
    grid-template-columns: 64px 1fr;
  }

  .wearer-card img {
    width: 60px;
    height: 60px;
  }

  .experiment-top > strong {
    width: 68px;
    height: 68px;
    font-size: 1.65rem;
  }

  .task-card {
    padding: 23px 19px;
  }

  .task-card h2 {
    font-size: clamp(1.85rem, 9vw, 2.7rem);
  }

  .data-entry-single-grid,
  .dual-number-grid {
    grid-template-columns: 1fr;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    max-width: calc(100% - 28px);
  }
}
