/*
 * 점심 5초왕 — Toss-inspired product polish
 *
 * 차용하는 것은 명료한 위계, 넉넉한 여백, 단일 주요 행동,
 * 의미 중심의 색과 피드백입니다. Toss의 브랜드 자산·폰트·레이아웃은
 * 사용하지 않고 점심 5초왕의 노랑·코랄·하늘색 정체성으로 변환합니다.
 */

:root {
  --ink: #26231d;
  --paper: #f8f5ed;
  --card: #fffdf8;
  --white: #ffffff;
  --muted: #625d52;
  --subtle: #70695d;
  --line-color: #e6dfd1;
  --surface-soft: #f2eee4;
  --surface-warm: #fcf9f1;
  --yellow: #ffcc3d;
  --yellow-strong: #dda711;
  --yellow-soft: #fff2bd;
  --orange: #ff745f;
  --orange-dark: #a83c2e;
  --coral-soft: #fff0e9;
  --lime: #e3f3e6;
  --success: #16765b;
  --sky: #e8f5f7;
  --sky-strong: #246b78;
  --focus: #1267c4;
  --line: 1px solid var(--line-color);
  --shadow: 0 18px 50px rgba(84, 65, 27, 0.1);
  --shadow-soft: 0 8px 28px rgba(84, 65, 27, 0.075);
  --radius-lg: 24px;
  --radius-md: 15px;
}

html {
  color-scheme: light;
  background: var(--paper);
  overflow-x: clip;
}

body {
  color: var(--ink);
  font-weight: 400;
  overflow-x: clip;
  background:
    radial-gradient(circle at 10% -12%, rgba(255, 204, 61, 0.28), transparent 34rem),
    radial-gradient(circle at 102% 24%, rgba(232, 245, 247, 0.94), transparent 29rem),
    linear-gradient(180deg, #fff 0, var(--paper) 42rem);
  background-attachment: scroll;
  background-size: auto;
}

button,
input,
summary,
a {
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease,
    transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  color: var(--white);
  background: var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

/* Shared brand and navigation */
.app-shell {
  width: min(1160px, calc(100% - 64px));
  padding: 24px 0 48px;
}

.page-shell {
  width: min(1000px, calc(100% - 64px));
  padding: 24px 0 48px;
}

.site-header {
  min-height: 56px;
  margin-bottom: 48px;
}

.page-shell .site-header {
  margin-bottom: clamp(48px, 7vw, 78px);
}

.brand {
  gap: 11px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 40px;
  height: 40px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  background: var(--yellow);
  border: 1px solid rgba(25, 31, 40, 0.08);
  border-radius: 14px;
  box-shadow: 0 7px 16px rgba(181, 137, 17, 0.18);
  transform: none;
}

.header-chip {
  min-height: 34px;
  padding: 7px 0 7px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  background: transparent;
  border: 0;
  border-left: 2px solid var(--yellow);
  border-radius: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.hub-return-card {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 9px;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 720;
  line-height: 1.3;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line-color);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.hub-return-card:hover {
  color: var(--ink);
  text-decoration: none;
  border-color: #d7cba9;
  box-shadow: 0 12px 30px rgba(84, 65, 27, 0.12);
  transform: translateY(-1px);
}

.hub-brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  background: var(--yellow);
  border: 1px solid rgba(25, 31, 40, 0.08);
  border-radius: 9px;
}

.hub-return-arrow {
  color: var(--subtle);
  font-size: 15px;
}

.site-nav {
  gap: 6px 22px;
}

.site-nav a {
  position: relative;
  min-height: 44px;
  padding: 13px 0 11px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.site-nav a[aria-current="page"]::after {
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--focus);
  border-radius: 99px;
}

/* Home entry */
.screen.is-active {
  animation: theme-screen-in 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.setup-layout {
  grid-template-columns: minmax(0, 1.04fr) minmax(390px, 0.96fr);
  gap: clamp(48px, 7vw, 80px);
  align-items: start;
}

.setup-intro {
  padding-top: clamp(12px, 4vw, 42px);
}

.eyebrow {
  min-height: auto;
  margin-bottom: 18px;
  padding: 0;
  color: var(--sky-strong);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  background: transparent;
  border: 0;
  border-radius: 0;
  transform: none;
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  margin-right: 8px;
  content: "";
  background: var(--yellow);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(244, 200, 74, 0.16);
}

.hero-title {
  max-width: 620px;
  margin-bottom: 22px;
  font-size: clamp(50px, 6vw, 68px);
  font-weight: 800;
  line-height: 1.07;
  letter-spacing: -0.065em;
}

.hero-title .highlight::after {
  right: -3px;
  bottom: 4px;
  left: -3px;
  height: 20%;
  background: rgba(244, 200, 74, 0.72);
  border-radius: 5px;
  transform: none;
}

.hero-title-context {
  margin-top: 18px;
  color: var(--muted);
  font-size: clamp(17px, 1.8vw, 20px);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.025em;
}

.hero-copy {
  max-width: 530px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 450;
  line-height: 1.72;
  letter-spacing: -0.02em;
}

.rule-strip {
  gap: 0;
  max-width: 570px;
  border-top: 1px solid var(--line-color);
  border-bottom: 1px solid var(--line-color);
}

.rule-item {
  min-height: 112px;
  padding: 18px 18px 19px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.rule-item + .rule-item {
  border-left: 1px solid var(--line-color);
}

.rule-number {
  margin-bottom: 12px;
  color: var(--sky-strong);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.rule-item strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.48;
  letter-spacing: -0.03em;
}

.setup-card {
  padding: clamp(26px, 4vw, 36px);
  overflow: hidden;
  background: rgba(255, 253, 248, 0.96);
  border: var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.setup-card::before {
  display: block;
  top: 0;
  right: auto;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(
    90deg,
    var(--yellow) 0 28%,
    var(--orange) 28% 46%,
    #87d7e5 46% 64%,
    var(--yellow) 64% 82%,
    var(--orange) 82% 100%
  );
  transform: none;
}

.card-kicker {
  margin-bottom: 8px;
  color: var(--sky-strong);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.setup-card h2 {
  margin-bottom: 9px;
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 780;
  letter-spacing: -0.055em;
}

.section-hint {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.form-section + .form-section {
  margin-top: 30px;
  padding-top: 28px;
  border-top: 1px solid var(--line-color);
}

.form-title-row {
  margin-bottom: 12px;
}

.form-label {
  font-size: 14px;
  font-weight: 750;
}

.form-meta {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 550;
}

.player-list {
  gap: 10px;
}

.player-row {
  grid-template-columns: 34px minmax(0, 1fr) 44px;
  gap: 9px;
}

.player-index {
  width: 32px;
  height: 32px;
  color: #6a5314;
  font-size: 12px;
  font-weight: 750;
  background: var(--yellow-soft);
  border: 0;
}

.name-input,
.custom-input {
  height: 52px;
  padding: 0 16px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 550;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 14px;
}

.name-input:hover,
.custom-input:hover {
  background: #eef0f2;
}

.name-input:focus,
.custom-input:focus {
  background: var(--white);
  border-color: var(--focus);
  box-shadow: 0 0 0 4px rgba(36, 110, 233, 0.12);
}

.name-input::placeholder,
.custom-input::placeholder {
  color: var(--subtle);
  font-weight: 450;
}

.name-input[aria-invalid="true"],
.custom-input[aria-invalid="true"] {
  background: var(--coral-soft);
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 107, 87, 0.1);
}

.remove-player {
  color: var(--subtle);
  border: 0;
  border-radius: 12px;
}

.remove-player:hover:not(:disabled) {
  color: var(--orange-dark);
  background: var(--coral-soft);
  border-color: transparent;
}

.add-player {
  width: calc(100% - 43px);
  min-height: 46px;
  margin: 10px 0 0 43px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  background: var(--surface-soft);
  border: 0;
  border-radius: 13px;
}

.add-player:hover:not(:disabled) {
  color: var(--ink);
  background: var(--sky);
  border-color: transparent;
}

.wager-grid {
  gap: 10px;
}

.wager-option span {
  min-height: 50px;
  padding: 11px 13px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 14px;
  box-shadow: none;
}

.wager-symbol {
  display: inline-grid;
  width: 25px;
  height: 25px;
  margin-right: 8px;
  flex: 0 0 auto;
  place-items: center;
  color: #5f4810;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
  background: var(--yellow-soft);
  border-radius: 8px;
}

.wager-option:nth-child(2) .wager-symbol {
  color: #81382f;
  background: #ffe1da;
}

.wager-option:nth-child(3) .wager-symbol {
  color: #24606b;
  background: #dff2f5;
}

.wager-option:nth-child(4) .wager-symbol {
  color: #4e5a42;
  background: #e7f0df;
}

.wager-option input:checked + span {
  color: var(--ink);
  background: var(--yellow-soft);
  border-color: var(--yellow-strong);
  box-shadow: inset 0 0 0 1px rgba(233, 185, 40, 0.16);
  transform: none;
}

.wager-option input:focus-visible + span {
  outline-color: var(--focus);
}

.custom-wrap {
  margin-top: 12px;
}

.custom-help {
  color: var(--subtle);
  font-size: 12px;
}

.form-error {
  margin-left: 43px;
  color: var(--orange-dark);
  font-size: 13px;
  font-weight: 650;
}

.primary-button,
.secondary-button,
.game-button {
  border: 0;
  border-radius: 16px;
  box-shadow: none;
}

.primary-button,
.secondary-button {
  min-height: 56px;
  padding: 15px 22px;
  font-weight: 750;
}

.primary-button {
  color: var(--ink);
  font-size: 16px;
  background: var(--yellow);
  box-shadow: 0 8px 18px rgba(194, 147, 18, 0.18);
}

.primary-button:hover {
  background: #f0c13a;
  box-shadow: 0 11px 24px rgba(194, 147, 18, 0.22);
  transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active,
.game-button:active {
  box-shadow: none;
  transform: translateY(1px) scale(0.995);
}

.privacy-note {
  margin-top: 15px;
  color: var(--subtle);
  font-size: 11px;
}

/* Core game */
.game-wrap,
.result-wrap {
  width: min(680px, 100%);
}

.game-meta {
  margin-bottom: 14px;
}

.turn-progress,
.target-chip {
  min-height: 38px;
  padding: 9px 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line-color);
  border-radius: 999px;
}

.target-chip {
  color: #655016;
  background: var(--yellow-soft);
  border-color: rgba(233, 185, 40, 0.34);
}

.turn-card {
  min-height: 590px;
  padding: clamp(32px, 5vw, 50px);
  background: rgba(255, 255, 255, 0.96);
  border: var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.turn-card::before,
.turn-card::after {
  display: none;
}

.player-pill {
  min-height: 34px;
  margin-bottom: 18px;
  padding: 8px 13px;
  color: #25617e;
  font-size: 13px;
  font-weight: 700;
  background: var(--sky);
  border: 0;
  border-radius: 999px;
}

.turn-title {
  margin-bottom: 11px;
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
  text-wrap: balance;
  word-break: keep-all;
}

.turn-copy {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 450;
  line-height: 1.65;
}

.timer-stage {
  width: clamp(224px, 43vw, 270px);
  height: clamp(224px, 43vw, 270px);
  margin-bottom: 30px;
  background:
    radial-gradient(circle at 38% 32%, #fff 0 18%, transparent 42%),
    var(--surface-soft);
  border: 1px solid var(--line-color);
  box-shadow:
    inset 0 0 0 10px rgba(255, 255, 255, 0.78),
    0 18px 38px rgba(25, 31, 40, 0.08);
  transition:
    color 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.timer-stage::before,
.timer-stage::after {
  display: block;
  content: "";
  pointer-events: none;
}

.timer-stage::before {
  top: 20px;
  right: auto;
  left: 50%;
  z-index: 2;
  width: 7px;
  height: 7px;
  background: var(--yellow);
  border-radius: 50%;
  box-shadow:
    -34px 0 0 var(--orange),
    -17px 0 0 #87d7e5,
    17px 0 0 #87d7e5,
    34px 0 0 var(--orange);
  transform: translateX(-50%);
}

.timer-stage::after {
  inset: 10px;
  z-index: 0;
  width: auto;
  height: auto;
  background: repeating-conic-gradient(
    from -90deg,
    rgba(38, 35, 29, 0.2) 0 1.8deg,
    transparent 1.8deg 29.8deg
  );
  border-radius: 50%;
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
  transform: none;
}

.timer-readout,
.timer-caption {
  position: relative;
  z-index: 3;
}

.timer-readout {
  font-size: clamp(52px, 9vw, 72px);
  font-weight: 800;
  letter-spacing: -0.065em;
}

.timer-caption {
  margin-top: 11px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 650;
}

.timer-stage.is-running {
  color: var(--white);
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.12), transparent 35%),
    var(--ink);
  border-color: var(--ink);
  box-shadow:
    0 0 0 8px rgba(244, 200, 74, 0.18),
    0 20px 42px rgba(25, 31, 40, 0.2);
  transform: scale(1.018);
}

.timer-stage.is-running .timer-caption {
  color: var(--yellow);
}

.timer-stage.is-running::after {
  background: repeating-conic-gradient(
    from -90deg,
    rgba(255, 255, 255, 0.28) 0 1.8deg,
    transparent 1.8deg 29.8deg
  );
}

.timer-stage.is-sealed {
  color: var(--success);
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.72), transparent 36%),
    var(--lime);
  border-color: rgba(22, 133, 101, 0.2);
  box-shadow:
    0 0 0 8px rgba(22, 133, 101, 0.08),
    0 18px 38px rgba(25, 31, 40, 0.07);
}

.game-button {
  width: min(340px, 100%);
  min-height: 62px;
  padding: 16px 24px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 780;
  background: var(--yellow);
  box-shadow: 0 9px 22px rgba(194, 147, 18, 0.2);
}

.game-button:hover {
  box-shadow: 0 12px 27px rgba(194, 147, 18, 0.24);
  transform: translateY(-1px);
}

.game-button.is-stop {
  color: var(--ink);
  background: var(--orange);
  box-shadow: 0 9px 22px rgba(184, 63, 49, 0.19);
}

.game-button.is-next {
  color: var(--white);
  background: var(--ink);
  box-shadow: 0 9px 22px rgba(25, 31, 40, 0.16);
}

.dot-progress {
  gap: 8px;
  margin-top: 28px;
}

.progress-dot {
  width: 9px;
  height: 9px;
  background: #d1d6db;
  border: 0;
}

.progress-dot.is-done {
  width: 18px;
  height: 18px;
  color: var(--success);
  background: var(--lime);
}

.progress-dot.is-current {
  width: 28px;
  background: var(--yellow);
}

/* Results */
.result-hero {
  isolation: isolate;
  margin-bottom: 16px;
  padding: clamp(48px, 7vw, 66px) clamp(34px, 6vw, 56px) clamp(34px, 6vw, 56px);
  background:
    radial-gradient(circle at 50% -5%, rgba(255, 204, 61, 0.48), transparent 52%),
    var(--card);
  border: var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.result-hero::before {
  position: absolute;
  top: 23px;
  left: 50%;
  z-index: 3;
  width: 8px;
  height: 8px;
  content: "";
  background: var(--yellow);
  border-radius: 50%;
  box-shadow:
    -38px 0 0 var(--orange),
    -19px 0 0 #87d7e5,
    19px 0 0 #87d7e5,
    38px 0 0 var(--orange);
  transform: translateX(-50%);
}

.result-hero > :not(.confetti) {
  position: relative;
  z-index: 2;
}

.result-hero:focus,
.result-hero:focus-visible {
  outline: none;
}

.result-hero .eyebrow {
  color: #6a5314;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.result-hero .eyebrow::before {
  display: none;
}

.result-hero h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 780;
  letter-spacing: -0.055em;
}

.winner-name {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: clamp(40px, 8vw, 70px);
  font-weight: 820;
  line-height: 1.08;
  letter-spacing: -0.065em;
}

.winner-record {
  color: var(--muted);
  font-size: 16px;
  font-weight: 650;
}

.wager-result {
  gap: 16px;
  margin-bottom: 16px;
  padding: 20px 22px;
  color: var(--ink);
  background: var(--coral-soft);
  border: 1px solid rgba(255, 107, 87, 0.2);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.wager-icon {
  width: 52px;
  height: 52px;
  color: #5f4810;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: var(--yellow);
  border: 1px solid rgba(95, 72, 16, 0.12);
  border-radius: 50%;
  box-shadow: 0 7px 18px rgba(184, 63, 49, 0.09);
}

.wager-result small {
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 750;
}

.wager-result strong {
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 750;
}

.ranking-card {
  margin-bottom: 16px;
  padding: clamp(20px, 4vw, 30px);
  background: var(--white);
  border: var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.ranking-header h2 {
  font-size: 21px;
  font-weight: 780;
}

.ranking-header span {
  color: var(--subtle);
  font-weight: 550;
}

.ranking-list {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line-color);
  border-radius: 15px;
}

.ranking-row {
  min-height: 62px;
  padding: 9px 14px;
  background: var(--white);
  border: 0;
  border-radius: 0;
}

.ranking-row + .ranking-row {
  border-top: 1px solid var(--line-color);
}

.ranking-row.is-winner {
  background: var(--yellow-soft);
}

.ranking-row.is-loser {
  background: var(--coral-soft);
}

.rank-number {
  color: var(--muted);
  background: var(--surface-soft);
  border: 0;
  font-weight: 750;
}

.rank-person strong {
  font-weight: 720;
}

.rank-person small {
  color: var(--subtle);
  font-weight: 550;
}

.rank-time {
  font-size: 17px;
  font-weight: 780;
}

.secondary-button {
  color: var(--ink);
  background: var(--surface-soft);
  box-shadow: none;
}

.secondary-button:hover {
  background: #e9ecef;
  transform: translateY(-1px);
}

.confetti {
  z-index: 1;
  width: 8px;
  height: 14px;
  border: 0;
  border-radius: 3px;
  opacity: 0.72;
}

/* Helpful home content */
.content-hub {
  margin-top: clamp(84px, 11vw, 132px);
  padding-top: 32px;
  border-top: 1px solid var(--line-color);
}

.content-nav {
  gap: 8px;
  margin-bottom: 72px;
}

.content-nav a {
  min-height: 40px;
  padding: 9px 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 620;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line-color);
}

.content-nav a:hover {
  color: var(--ink);
  background: var(--yellow-soft);
  border-color: rgba(233, 185, 40, 0.35);
}

.content-section + .content-section {
  margin-top: clamp(84px, 11vw, 132px);
}

.content-kicker {
  margin-bottom: 12px;
  color: var(--sky-strong);
  font-size: 12px;
  font-weight: 750;
}

.content-title {
  margin-bottom: 18px;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.06em;
}

.content-lead {
  margin-bottom: 38px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 450;
  line-height: 1.78;
}

.answer-grid,
.content-grid {
  gap: 16px;
}

.answer-item,
.content-card {
  padding: clamp(22px, 4vw, 30px);
  background: var(--surface-warm);
  border: 1px solid var(--line-color);
  border-left: 4px solid var(--yellow);
  border-radius: 6px var(--radius-md) var(--radius-md) 6px;
  box-shadow: none;
}

.answer-item dt {
  margin-bottom: 11px;
  font-size: 18px;
  font-weight: 760;
}

.answer-item dd,
.content-card p,
.plain-list li,
.method-list dd {
  color: var(--muted);
  font-weight: 430;
}

.brand-figure img {
  background: var(--white);
  border: 1px solid var(--line-color);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.brand-figure figcaption {
  color: var(--subtle);
  font-weight: 500;
}

.content-card:nth-child(n) {
  box-shadow: none;
}

.content-card-number {
  margin-bottom: 26px;
  color: var(--sky-strong);
  font-weight: 750;
}

.content-card h3 {
  font-size: 21px;
  font-weight: 760;
}

.method-list {
  background: var(--white);
  border: 1px solid var(--line-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.method-list > div + div {
  border-top: 1px solid var(--line-color);
}

.method-list dt {
  font-weight: 760;
}

.example-card {
  color: var(--white);
  background:
    radial-gradient(circle at 100% 0, rgba(244, 200, 74, 0.2), transparent 38%),
    var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.example-card h3 {
  color: var(--yellow);
}

.plain-list {
  gap: 10px;
}

.plain-list li {
  padding: 18px 20px 18px 50px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line-color);
  border-radius: 15px;
}

.plain-list li::before {
  color: var(--success);
  background: var(--lime);
}

.safety-note {
  color: #6a3b31;
  background: var(--coral-soft);
  border: 1px solid rgba(255, 107, 87, 0.18);
  border-left-width: 1px;
  border-radius: 16px;
}

.faq-list details {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line-color);
  border-radius: 15px;
}

.faq-list summary {
  font-weight: 700;
}

.faq-list details p {
  color: var(--muted);
}

.content-byline {
  color: var(--subtle);
}

body:not([data-screen="setup"]) .content-hub,
body:not([data-screen="setup"]) .site-footer {
  display: none;
}

/* Secondary pages */
.page-shell a {
  color: #1f63c7;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.page-shell .brand {
  color: var(--ink);
}

.page-shell .site-nav a,
.page-shell .footer-links a {
  color: var(--muted);
}

.page-shell .site-nav a:hover,
.page-shell .site-nav a[aria-current="page"],
.page-shell .footer-links a:hover {
  color: var(--ink);
}

.breadcrumb {
  margin-bottom: 32px;
}

.breadcrumb li {
  color: var(--subtle);
  font-size: 13px;
  font-weight: 550;
}

.breadcrumb li + li::before {
  color: #b0b8c1;
  content: "›";
}

.breadcrumb a {
  color: var(--muted);
  font-weight: 650;
}

.breadcrumb [aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
}

.page-shell .hero {
  margin-bottom: 48px;
}

.page-shell .hero .eyebrow {
  color: var(--sky-strong);
}

.page-shell h1 {
  max-width: 840px;
  margin-bottom: 22px;
  font-size: clamp(40px, 6vw, 62px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.065em;
}

.page-shell .hero-copy {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 450;
  line-height: 1.75;
}

.meta-strip {
  gap: 8px;
  margin-top: 26px;
}

.meta-strip span {
  padding: 0 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line-color);
  border-radius: 0;
}

.meta-strip span:last-child {
  padding-right: 0;
  border-right: 0;
}

.article-card {
  padding: clamp(30px, 6vw, 62px);
  background: transparent;
  border: 0;
  border-top: 4px solid var(--yellow);
  border-radius: 0;
  box-shadow: none;
}

.article-section {
  max-width: 780px;
  margin-inline: auto;
}

.article-section + .article-section {
  margin-top: 58px;
  padding-top: 52px;
  border-top: 1px solid var(--line-color);
}

.page-shell h2 {
  margin-bottom: 17px;
  font-size: clamp(27px, 4vw, 36px);
  font-weight: 780;
  line-height: 1.22;
  letter-spacing: -0.05em;
}

.page-shell h3 {
  font-size: 18px;
  font-weight: 730;
}

.article-card p,
.article-card li,
.definition-list dd {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: -0.01em;
}

.info-grid {
  gap: 12px;
  margin-top: 24px;
}

.info-box {
  padding: 22px;
  background: var(--surface-soft);
  border: 0;
  border-radius: 16px;
}

.definition-list {
  border: 1px solid var(--line-color);
  border-radius: 16px;
}

.definition-list > div {
  background: var(--white);
}

.definition-list > div + div {
  border-top: 1px solid var(--line-color);
}

.definition-list dt {
  color: var(--ink);
  font-weight: 730;
}

.notice {
  color: #6d4b20;
  background: #fff5e6;
  border: 1px solid #ffe3b4;
  border-left-width: 1px;
  border-radius: 16px;
}

.notice.is-blue {
  color: #24516b;
  background: #eef7ff;
  border: 1px solid #d8ecfb;
}

.contact-card {
  padding: 22px;
  color: var(--white);
  background: var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}

.contact-card strong {
  color: var(--yellow);
}

.contact-card span {
  color: #d8dee5;
}

.contact-card a {
  min-height: 44px;
  padding: 12px 15px;
  color: var(--ink);
  background: var(--yellow);
  border-radius: 12px;
}

.contact-feature {
  padding: clamp(32px, 6vw, 54px);
  color: var(--white);
  background:
    radial-gradient(circle at 85% 20%, rgba(244, 200, 74, 0.16), transparent 33%),
    var(--ink);
  border: 0;
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.contact-feature h2 {
  color: var(--white);
}

.contact-feature-copy > p:not(.contact-kicker, .copy-status) {
  color: #d8dee5;
}

.contact-kicker {
  color: var(--yellow);
  font-weight: 750;
}

.contact-address-label {
  color: #b0b8c1;
}

.contact-address code {
  color: var(--white);
  border-bottom: 3px solid var(--yellow);
}

.copy-email-button {
  min-height: 48px;
  color: var(--ink);
  font-weight: 750;
  background: var(--yellow);
  border: 0;
  border-radius: 13px;
  box-shadow: none;
}

.copy-email-button:hover {
  background: #f0c13a;
  box-shadow: none;
  transform: translateY(-1px);
}

.copy-email-button:active {
  box-shadow: none;
  transform: translateY(1px);
}

.copy-status {
  color: #c8d0d9;
}

.contact-mark {
  width: 112px;
  color: var(--ink);
  background: var(--yellow);
  border: 0;
  border-radius: 32px;
  box-shadow: 0 14px 30px rgba(244, 200, 74, 0.17);
  transform: none;
}

.report-list {
  gap: 10px;
}

.report-list li {
  background: var(--surface-soft);
  border: 0;
  border-radius: 15px;
}

.report-list li::before {
  color: #6a5314;
  background: var(--yellow-soft);
  border: 0;
}

.report-list strong {
  font-weight: 720;
}

.report-list span {
  color: var(--muted);
}

/* Ads and footer: keep SDK dimensions and placement intact */
.ad-zone {
  min-height: 84px;
  padding: 11px 0 13px;
  background: rgba(255, 255, 255, 0.58);
  border-top: 1px solid var(--line-color);
  border-bottom: 1px solid var(--line-color);
}

.ad-label {
  color: var(--subtle);
  font-weight: 600;
}

.ad-status {
  min-height: 16px;
  margin: 8px 12px 0;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 550;
  line-height: 1.45;
}

.result-hub-link {
  display: block;
  width: fit-content;
  min-height: 44px;
  margin: 18px auto 0;
  padding: 12px 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  text-underline-offset: 4px;
}

.result-hub-link:hover {
  color: var(--ink);
}

.site-footer {
  margin-top: 82px;
  padding-top: 30px;
  border-top: 1px solid var(--line-color);
}

.footer-copy strong {
  font-weight: 720;
}

.footer-copy span {
  color: var(--subtle);
}

.footer-links a {
  color: var(--muted);
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--ink);
}

@keyframes theme-screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: hover) and (pointer: fine) {
  .answer-item:hover,
  .content-card:hover,
  .info-box:hover {
    border-color: #d6dbe0;
    box-shadow: 0 12px 32px rgba(25, 31, 40, 0.055);
    transform: translateY(-1px);
  }
}

@media (max-width: 840px) {
  .app-shell {
    width: min(100% - 40px, 720px);
  }

  .setup-layout {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .setup-intro {
    padding-top: 4px;
  }

  .hero-title {
    max-width: 700px;
    font-size: clamp(48px, 11vw, 66px);
  }

  .setup-card {
    width: min(590px, 100%);
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 40px, 680px);
  }

  .page-shell .site-header {
    display: grid;
    gap: 14px;
    margin-bottom: 48px;
  }

  .site-nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 20px;
    padding-bottom: 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    flex: 0 0 auto;
  }

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

  .contact-feature {
    grid-template-columns: 1fr;
  }

  .contact-mark {
    width: 96px;
  }

  .definition-list > div {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}

@media (max-width: 560px) {
  .app-shell,
  .page-shell {
    width: auto;
    margin-inline: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }

  .site-header {
    min-height: 44px;
    margin-bottom: 32px;
  }

  .brand {
    font-size: 16px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .header-chip {
    max-width: 126px;
    min-height: 32px;
    padding: 6px 9px;
    font-size: 11px;
    text-align: center;
  }

  .app-shell .site-header {
    display: grid;
    gap: 12px;
  }

  .header-actions {
    width: 100%;
  }

  .header-chip {
    display: none;
  }

  .hub-return-card {
    width: 100%;
    min-height: 50px;
    justify-content: center;
  }

  .eyebrow {
    margin-bottom: 16px;
  }

  .setup-layout {
    gap: 54px;
  }

  .setup-card {
    order: 1;
  }

  .setup-intro {
    order: 2;
    padding-top: 0;
  }

  .hero-title {
    margin-bottom: 18px;
    font-size: clamp(40px, 12.7vw, 52px);
    line-height: 1.08;
  }

  .hero-title-context {
    margin-top: 14px;
    font-size: 16px;
  }

  .hero-copy {
    margin-bottom: 26px;
    font-size: 16px;
    line-height: 1.65;
  }

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

  .rule-item {
    min-height: 96px;
    padding: 14px 10px;
  }

  .rule-number {
    margin-bottom: 9px;
  }

  .rule-item strong {
    font-size: 12px;
    line-height: 1.45;
  }

  .setup-card {
    padding: 26px 20px;
    border-radius: 24px;
    box-shadow: 0 12px 34px rgba(25, 31, 40, 0.07);
  }

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

  .turn-card {
    min-height: calc(100dvh - 160px);
    min-height: 560px;
    padding: 30px 18px;
    border-radius: 24px;
    box-shadow: 0 12px 34px rgba(25, 31, 40, 0.07);
  }

  .game-meta {
    gap: 8px;
  }

  .turn-progress,
  .target-chip {
    padding-inline: 10px;
    font-size: 11px;
  }

  .turn-title {
    font-size: clamp(30px, 9.5vw, 40px);
    line-height: 1.18;
  }

  .timer-stage {
    width: min(64vw, 226px);
    height: min(64vw, 226px);
    margin-bottom: 26px;
  }

  .game-button {
    min-height: 60px;
  }

  .result-hero {
    padding: 52px 20px 32px;
    border-radius: 24px;
    box-shadow: 0 12px 34px rgba(25, 31, 40, 0.07);
  }

  .winner-name {
    font-size: clamp(38px, 12vw, 52px);
  }

  .wager-result {
    padding: 18px;
  }

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

  .ranking-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    padding-right: 10px;
  }

  .rank-time {
    font-size: 15px;
  }

  .content-hub {
    margin-top: 78px;
  }

  .content-nav {
    gap: 7px;
    margin-bottom: 60px;
  }

  .content-section + .content-section {
    margin-top: 88px;
  }

  .content-grid,
  .answer-grid {
    grid-template-columns: 1fr;
  }

  .content-title {
    font-size: clamp(32px, 10vw, 42px);
  }

  .method-layout {
    grid-template-columns: 1fr;
  }

  .page-shell .site-header {
    margin-bottom: 42px;
  }

  .page-shell h1 {
    font-size: clamp(36px, 11.5vw, 48px);
  }

  .article-card {
    padding: 28px 20px;
    border-radius: 0;
    box-shadow: none;
  }

  .article-section + .article-section {
    margin-top: 46px;
    padding-top: 42px;
  }

  .contact-card,
  .site-footer {
    display: grid;
  }

  .contact-feature {
    padding: 28px 20px;
    border-radius: 22px;
  }

  .contact-address,
  .report-list li {
    grid-template-columns: 1fr;
  }

  .copy-email-button {
    width: 100%;
  }

  .report-list li {
    gap: 6px;
    padding-left: 54px;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .ad-zone {
    margin-left: calc(50% - 160px);
  }
}

@media (max-width: 370px) {
  .app-shell,
  .page-shell {
    margin-inline: 12px;
  }

  .brand {
    gap: 8px;
    font-size: 15px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .header-chip {
    max-width: 112px;
    font-size: 10px;
  }

  .hub-return-card {
    padding-inline: 8px;
    font-size: 13px;
  }

  .rule-item {
    padding-inline: 7px;
  }

  .rule-item strong {
    font-size: 11px;
  }

  .timer-stage {
    width: 210px;
    height: 210px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .timer-stage.is-running {
    transform: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line-color: #b0b8c1;
    --muted: #333d4b;
    --subtle: #4e5968;
  }

  .name-input,
  .custom-input,
  .wager-option span,
  .content-nav a {
    border-color: var(--line-color);
  }
}
