:root {
  --indigo: #24245f;
  --indigo-dark: #171746;
  --mint: #43d6b3;
  --mint-pale: #ddf8f0;
  --coral: #ff746d;
  --coral-pale: #ffe8e4;
  --gold: #f6c94b;
  --gold-pale: #fff5ce;
  --cream: #fff9ed;
  --white: #ffffff;
  --ink: #25243b;
  --muted: #716f80;
  --line: #eae3d7;
  --shadow: 0 18px 55px rgba(36, 36, 95, 0.12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body { margin: 0; min-height: 100%; color: var(--ink); font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 4px solid rgba(67, 214, 179, .42); outline-offset: 2px; }

#app { min-height: 100vh; }
[hidden] { display: none !important; }
.community-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.community-nav [aria-current] { background: var(--mint-pale); border-color: var(--mint); }
.community-shell { max-width: 850px; }
.community-shell h1 { color: var(--indigo); font-size: clamp(2rem,7vw,3rem); letter-spacing: -.04em; }
.community-shell p { line-height: 1.6; }
.account-form { display: grid; gap: 16px; }
.account-form label { display: grid; gap: 8px; font-weight: 700; }
.account-form .check-label { display: flex; align-items: flex-start; gap: 12px; }
.check-label input { width: 22px; height: 22px; flex-shrink: 0; }
.account-notice { background: var(--mint-pale); padding: 16px; border-radius: 14px; margin: 16px 0; line-height: 1.5; }
.account-notice.error { background: var(--gold-pale); }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); gap: 16px; margin: 20px 0; }
.pack-grid .panel { margin: 0; }
.pack-card h2 { margin-top: 24px; }
.rank-list { padding-left: 24px; }
.rank-list li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.rank-list span,.rank-list b { display: block; margin-top: 5px; }
.shell { width: min(100%, 1100px); min-height: 100vh; margin: 0 auto; padding: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--indigo-dark); font-size: 1.25rem; font-weight: 900; letter-spacing: -.03em; }
.brand-mark { width: 35px; height: 35px; border: 7px solid var(--indigo); border-radius: 50%; position: relative; background: var(--cream); }
.brand-mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.score-pill { padding: 8px 13px; border-radius: 999px; color: var(--indigo); background: var(--gold-pale); font-weight: 900; }
.back-button { min-width: 46px; min-height: 46px; border: 0; border-radius: 14px; background: var(--white); color: var(--indigo); font-size: 1.8rem; box-shadow: 0 5px 20px rgba(36,36,95,.08); }

.start-layout { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(32px, 6vw, 80px); min-height: calc(100vh - 100px); }
.start-copy h1 { margin: 0 0 8px; color: var(--indigo-dark); font-size: clamp(3rem, 8vw, 6.3rem); line-height: .92; letter-spacing: -.07em; }
.eyebrow { margin: 0 0 18px; color: var(--muted); font-weight: 900; letter-spacing: .18em; text-transform: uppercase; font-size: .78rem; }
.lede { max-width: 610px; margin: 0 0 26px; font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.55; font-weight: 650; }
.start-card { max-width: 580px; padding: 20px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.85); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.field-label { display: block; margin-bottom: 8px; color: var(--indigo-dark); font-weight: 850; }
.input { width: 100%; min-height: 54px; padding: 0 16px; border: 2px solid var(--line); border-radius: 15px; background: var(--white); color: var(--ink); font-size: 1rem; }
.textarea { min-height: 96px; padding-top: 14px; resize: vertical; }
.button-row { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.button { min-height: 54px; padding: 0 22px; border: 0; border-radius: 15px; background: var(--indigo); color: var(--white); font-weight: 900; transition: transform .16s ease, opacity .16s ease; }
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button.secondary { background: var(--white); color: var(--indigo); border: 2px solid var(--line); }
.button.gold { color: var(--indigo-dark); background: var(--gold); }
.button.small { min-height: 48px; padding: 0 18px; }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.dot-stage { position: relative; min-height: 610px; display: grid; place-items: center; }
.dot-stage::before { content: ""; position: absolute; width: 92%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(67,214,179,.26) 0 38%, transparent 39%), conic-gradient(from 40deg, transparent 0 30%, rgba(246,201,75,.22) 30% 44%, transparent 44% 100%); animation: turn 22s linear infinite; }
.dot-stage img { position: relative; width: min(92%, 460px); max-height: 560px; object-fit: contain; filter: drop-shadow(0 28px 30px rgba(36,36,95,.2)); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(1deg); } }
@keyframes turn { to { transform: rotate(360deg); } }

.game-layout { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(300px, .78fr); gap: 20px; align-items: start; padding: 22px 0 44px; }
.panel { background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 24px; padding: 22px; box-shadow: 0 12px 34px rgba(36,36,95,.08); }
.panel + .panel { margin-top: 18px; }
.dot-message { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.dot-message img { width: 96px; height: 105px; object-fit: contain; }
.speech { position: relative; padding: 16px 18px; border-radius: 18px; background: var(--indigo); color: var(--white); font-weight: 750; line-height: 1.45; }
.speech::before { content: ""; position: absolute; left: -10px; top: 32px; border-width: 8px 11px 8px 0; border-style: solid; border-color: transparent var(--indigo) transparent transparent; }
.section-title { margin: 0 0 14px; color: var(--indigo-dark); font-size: 1.1rem; }
.examples { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.example-card { border-radius: 18px; padding: 17px; }
.example-card.allowed { background: var(--mint-pale); }
.example-card.rejected { background: var(--coral-pale); }
.example-card h3 { margin: 0 0 11px; font-size: .78rem; letter-spacing: .08em; }
.example-card.allowed h3 { color: #126851; }
.example-card.rejected h3 { color: #953934; }
.example-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-weight: 800; text-transform: capitalize; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.history { display: grid; gap: 8px; margin-top: 15px; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.history-row strong { text-transform: capitalize; }
.verdict { font-size: .75rem; font-weight: 950; letter-spacing: .04em; }
.verdict.yes { color: #126851; }
.verdict.no { color: #953934; }
.hint-box { background: var(--gold-pale); }
.hint-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hint-list { display: grid; gap: 8px; margin: 10px 0 0; }
.hint { margin: 0; line-height: 1.45; }
.muted { color: var(--muted); }
.tiny { font-size: .82rem; line-height: 1.45; }
.guess-status { min-height: 24px; margin: 10px 0 0; color: #953934; font-weight: 750; }

.result { width: min(100%, 760px); margin: 26px auto 60px; text-align: center; }
.result-dot { width: 175px; height: 190px; object-fit: contain; }
.result h1 { margin: 4px 0 8px; color: var(--indigo-dark); font-size: clamp(2.3rem, 7vw, 4.2rem); letter-spacing: -.055em; }
.stars { color: var(--gold); font-size: 2.6rem; letter-spacing: .15em; }
.rule-reveal { margin: 22px 0; padding: 24px; border-radius: 24px; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); }
.rule-reveal small { color: var(--muted); font-weight: 900; letter-spacing: .12em; }
.rule-reveal h2 { margin: 10px 0; color: var(--indigo-dark); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.stat { padding: 15px; border-radius: 17px; background: var(--indigo); color: var(--white); }
.stat strong { display: block; font-size: 1.6rem; }
.stat span { font-size: .72rem; font-weight: 800; color: #d7d7f2; letter-spacing: .08em; }
.feedback { text-align: left; }
.clarity { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice { min-height: 48px; padding: 8px; border: 2px solid var(--line); border-radius: 13px; background: var(--white); color: var(--indigo); font-weight: 800; }
.choice.selected { border-color: var(--mint); background: var(--mint-pale); }

.summary { width: min(100%, 820px); margin: 30px auto 60px; }
.summary h1 { color: var(--indigo-dark); font-size: clamp(2.2rem, 6vw, 4rem); letter-spacing: -.05em; }
.summary-card { padding: 22px; border-radius: 22px; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); }
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table th, .summary-table td { padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.summary-table th { color: var(--muted); font-size: .78rem; letter-spacing: .06em; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 12px 18px; border-radius: 999px; background: var(--indigo-dark); color: var(--white); font-weight: 800; box-shadow: var(--shadow); z-index: 20; }

@media (max-width: 800px) {
  .shell { padding: 16px; }
  .start-layout { grid-template-columns: 1fr; padding-top: 28px; }
  .dot-stage { grid-row: 1; min-height: 280px; }
  .dot-stage img { height: 300px; width: auto; }
  .start-copy h1 { font-size: clamp(3.2rem, 18vw, 5.4rem); }
  .game-layout { grid-template-columns: 1fr; }
  .game-side { display: contents; }
  .hint-box { order: 3; }
  .guess-panel { order: 4; }
}

@media (max-width: 520px) {
  .topbar .brand span:last-child { display: none; }
  .examples { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  .button.small { width: 100%; }
  .dot-message { grid-template-columns: 72px 1fr; }
  .dot-message img { width: 72px; height: 82px; }
  .clarity { grid-template-columns: 1fr; }
  .summary-table thead { display: none; }
  .summary-table tr { display: grid; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .summary-table td { border: 0; padding: 3px 0; }
}

.turn-stage { scroll-margin-top: 12px; overflow: hidden; }
.turn-heading { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .875rem; font-weight: 750; margin-bottom: 18px; }
.active-dot { padding: 10px 0; }
.active-dot .speech { padding: 18px; }
.active-dot .speech p { font-weight: 500; margin: 8px 0; }
.latest-purchase { display: block; font-size: clamp(1.5rem, 5vw, 2.1rem); color: #9ff4de; overflow-wrap: anywhere; line-height: 1.2; }
.latest-verdict { display: flex; gap: 12px; align-items: center; border-radius: 16px; padding: 14px; margin-bottom: 16px; overflow-wrap: anywhere; }
.latest-verdict.yes { background: #def7ef; color: #145844; border: 1px solid #9bd8c5; }
.latest-verdict.no { background: #fde7e3; color: #843d36; border: 1px solid #edb2a9; }
.latest-verdict p { margin: 4px 0 0; font-weight: 800; }
.latest-verdict span { font-size: .95rem; }
.latest-verdict .verdict-symbol { font-size: 1.65rem; font-weight: 900; }
.turn-handover { display: flex; align-items: center; gap: 14px; margin: 20px 0 16px; }
.turn-handover span { height: 2px; background: var(--mint); flex: 1; }
.turn-handover h2 { margin: 0; font-size: 1rem; padding: 7px 16px; background: var(--mint-pale); color: var(--indigo); border-radius: 30px; }
.previous-turns { margin-top: 18px; box-shadow: none; }
.previous-turns summary { cursor: pointer; font-weight: 800; color: var(--indigo); min-height: 28px; }
summary:focus-visible { outline: 3px solid var(--mint); outline-offset: 4px; }
.clue-pair { padding: 12px 0; border-bottom: 1px solid var(--line); }
.clue-pair > div { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: baseline; gap: 10px; padding: 9px 10px; border-radius: 10px; }
.clue-pair strong { overflow-wrap: anywhere; }
.clue-label { font-size: .875rem; font-weight: 800; color: var(--muted); }
.dot-history { background: #f0f7ff; }
.opening-clue { font-size: .95rem; color: var(--muted); }
.new-turn .latest-verdict { animation: reply-in .3s ease-out both; }
.new-turn .active-dot .speech { animation: reply-in .45s .18s ease-out both; }
.new-turn .active-dot img { animation: dot-nod .65s .15s ease-in-out both; }
.new-turn .turn-handover { animation: reply-in .35s .45s ease-out both; }
.result-dot { animation: dot-nod .7s ease-in-out; }
.stars { animation: reply-in .5s .15s ease-out both; }
@keyframes reply-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dot-nod { 0%,100% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-8px) rotate(-5deg); } 65% { transform: translateY(-3px) rotate(4deg); } }
.shopping-form { display: grid; gap: 14px; }
.purchase-feedback { padding: 14px; border: 2px solid var(--gold); border-radius: 14px; background: var(--gold-pale); }
.shopping-form .purchase-feedback p { font-size: 1rem; font-weight: 500; line-height: 1.5; }
.purchase-feedback .button { margin: 10px 8px 0 0; }
.shopping-form label, .shopping-form p { font-size: 1.1rem; font-weight: 600; margin: 0; }
.shopping-form .button { justify-self: start; min-width: 130px; }
.speech p { margin: 12px 0; }
.speech small { opacity: .85; }
.shopping-turn { padding: 16px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.shopping-turn p { margin: 0 0 10px; line-height: 1.6; }
.dot-reply { padding: 12px 16px; border-radius: 16px; }
.dot-reply.yes { background: #def7ef; color: #216756; }
.dot-reply.no { background: #fde7e3; color: #88443d; }
.rule-option { margin-top: 22px; }
.rule-option summary { cursor: pointer; font-weight: 700; padding: 10px 0; }

/* iPhone-first welcome, with safe-area space for the notch and home indicator. */
body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", system-ui, sans-serif; }
button, summary { touch-action: manipulation; }
.shell { padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); min-height: 100svh; }
.welcome-shell { width: min(100%, 480px); padding-top: max(22px, env(safe-area-inset-top)); }
.welcome-brand { text-align: center; }
.welcome-brand .brand { justify-content: center; font-size: 1.3rem; }
.welcome-brand .brand-mark { width: 27px; height: 27px; border-width: 5px; flex-shrink: 0; }
.welcome-brand p { color: var(--muted); font-size: .875rem; margin: 5px 0 0; }
.welcome-hero { text-align: center; margin: 12px 0 20px; }
.welcome-dot { display: flex; align-items: center; justify-content: center; height: 200px; height: clamp(160px, 26svh, 210px); overflow: hidden; pointer-events: none; background: radial-gradient(ellipse at center, var(--mint-pale) 0 42%, transparent 43%); }
/* Explicit image dimensions avoid intrinsic grid sizing expanding the artwork. */
.welcome-dot img { display: block; flex: 0 0 auto; width: 160px; height: 174px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 8px 8px rgba(36,36,95,.12)); animation: float 4s ease-in-out infinite; }
.welcome-hero h1 { font-size: clamp(1.6rem, 6vw, 2rem); letter-spacing: -.04em; line-height: 1.15; margin: 12px 0 8px; color: var(--indigo); }
.welcome-hero p { font-size: 1rem; line-height: 1.5; margin: 0; color: var(--muted); }
.play-primary { width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 60px; font-size: 1.125rem; border-radius: 20px; box-shadow: 0 7px 0 #171746, 0 12px 20px #24245f19; text-align: left; }
.play-primary span { font-size: 1.8rem; font-weight: 500; }
.play-primary:active { transform: translateY(3px); box-shadow: 0 4px 0 #171746; }
.welcome-play > p { text-align: center; font-size: .875rem; line-height: 1.5; color: var(--muted); margin: 17px 0 18px; }
.welcome-options button { color: var(--indigo); background: white; border: 1px solid var(--line); border-radius: 18px; }
.welcome-friends { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 15px; text-align: left; }
.welcome-friends strong { display: block; font-size: 1rem; }
.welcome-friends small { display: block; color: var(--muted); font-size: .875rem; margin-top: 4px; line-height: 1.4; }
.coming-label { font-size: .75rem; font-weight: 700; padding: 6px 8px; background: var(--gold-pale); border-radius: 8px; flex-shrink: 0; }
.welcome-shortcuts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 10px 0 16px; }
.welcome-shortcuts button { min-height: 72px; padding: 10px 4px; display: grid; justify-items: center; align-content: center; gap: 4px; }
.welcome-shortcuts button > span { font-size: 1.4rem; line-height: 1; }
.welcome-shortcuts strong { font-size: .875rem; }
.welcome-help { border-top: 1px solid var(--line); font-size: .9375rem; color: var(--indigo); }
.welcome-help summary { display: list-item; cursor: pointer; min-height: 44px; padding: 12px 0; font-weight: 650; }
.welcome-help p { line-height: 1.6; }
.welcome-help .button { margin-top: 12px; }
.community-shell { max-width: 640px; }
.community-shell .panel { margin: 18px 0; }
.community-shell a { overflow-wrap: anywhere; }
.legal-footer { display:flex;justify-content:center;gap:22px;padding:20px 0;font-size:.875rem; }
.legal-footer a { color:var(--indigo);min-height:44px;display:flex;align-items:center; }
.results-list { padding:0;list-style:none; }
.results-list li { display:flex;justify-content:space-between;gap:16px;padding:16px 0;border-bottom:1px solid var(--line); }
.results-list strong { white-space:nowrap; }
.button.danger { background:#9e3131;color:#fff; }
button:focus-visible,a:focus-visible,summary:focus-visible { outline:3px solid #20836d;outline-offset:4px; }
.input { font-size: max(16px,1rem); }
.legal-page { max-width:700px;margin:auto;line-height:1.7; }
.legal-page h1 { font-size:2rem; }
.legal-page h2 { font-size:1.25rem;margin-top:28px; }
/* Menu styling is scoped so the shopping rounds keep their original layout. */
.community-shell { font-size: .9375rem; line-height: 1.5; }
.community-shell .menu-topbar { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; align-items: center; gap: 8px; min-height: 48px; }
.menu-topbar > strong { text-align: center; font-size: .9375rem; font-weight: 700; color: var(--indigo); letter-spacing: -.02em; }
.menu-back { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; color: var(--indigo); background: transparent; }
.menu-back:hover { background: var(--mint-pale); }
.menu-back:active { background: #c8eee3; }
.community-shell > h1 { font-size: clamp(1.5rem, 5.5vw, 1.875rem); line-height: 1.2; font-weight: 750; letter-spacing: -.035em; margin: 24px 0 8px; text-align: center; }
.community-shell > [data-cloud-status] { text-align: center; font-size: .8125rem; margin: 0 0 24px; }
.community-shell h2 { font-size: 1.125rem; line-height: 1.3; font-weight: 700; letter-spacing: -.02em; margin: 0 0 10px; color: var(--indigo); }
.community-shell p { line-height: 1.55; margin: 0 0 16px; }
.community-shell p:last-child { margin-bottom: 0; }
.community-shell .panel { padding: 20px; margin: 16px 0; border-radius: 20px; box-shadow: 0 6px 22px rgba(36,36,95,.035); }
.community-shell .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 12px; font-size: .9375rem; line-height: 1.35; font-weight: 650; letter-spacing: 0; text-align: center; text-decoration: none; white-space: normal; }
.community-shell .button.secondary { border-width: 1px; }
.community-shell .button:hover { transform: none; filter: brightness(.97); }
.community-shell .button:disabled { filter: none; }
.community-shell .button-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,150px),1fr)); gap: 10px; margin-top: 16px; }
.community-shell .account-form { gap: 14px; }
.community-shell .account-form label { font-size: .875rem; font-weight: 600; gap: 7px; }
.community-shell .input { min-height: 48px; padding: 11px 13px; border-width: 1px; border-radius: 12px; font-size: 1rem; line-height: 1.4; font-family: inherit; }
.community-shell .check-label { line-height: 1.5; align-items: flex-start; }
.community-shell .check-label input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--indigo); }
.community-shell .tiny { font-size: .8125rem; }
.community-shell .rule-option { margin-top: 16px; }
.community-shell .rule-option summary { min-height: 44px; font-size: .875rem; line-height: 1.5; font-weight: 600; padding: 12px 0; }
.community-shell .account-notice { font-size: .875rem; padding: 14px; }
.community-shell #logout { margin-top: 12px; }
.community-shell .pack-grid { gap: 14px; margin: 16px 0; }
.community-shell .pack-grid .panel { margin: 0; display: flex; flex-direction: column; }
.community-shell .pack-card .button { margin-top: auto; }
.support-contact { display: flex; align-items: center; gap: 12px; min-height: 64px; margin: 4px 0 16px; padding: 12px; border-radius: 14px; background: #f1f9f6; color: var(--indigo); text-decoration: none; }
.support-contact:hover { background: var(--mint-pale); }
.support-icon { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; background: #fff; }
.support-copy { display: grid; gap: 3px; min-width: 0; }
.support-copy strong { font-size: .9375rem; font-weight: 650; line-height: 1.3; }
.support-copy small { font-size: .8125rem; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.support-arrow { margin-left: auto; flex-shrink: 0; }
.welcome-shell .play-primary { position: relative; justify-content: center; min-height: 56px; padding: 14px 44px; border-radius: 16px; font-size: 1rem; line-height: 1.4; font-weight: 700; text-align: center; }
.welcome-shell .play-primary > span { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; line-height: 1; }
.welcome-shortcuts button { min-height: 68px; gap: 6px; text-align: center; }
.welcome-shortcuts strong { font-size: .875rem; line-height: 1.35; font-weight: 650; }
@media (max-width: 360px) {
  .welcome-friends { flex-wrap: wrap; }
  .welcome-dot { height: 160px; }
  .welcome-dot img { width: 125px; height: 136px; }
  .welcome-hero { margin-bottom: 16px; }
}

/* Quiet secondary actions; generous touch targets on iPhone. */
.skip-round,.text-button { display:block; margin:12px auto; min-height:44px; border:0; background:transparent; color:var(--muted); font:inherit; font-size:.875rem; text-decoration:underline; text-underline-offset:4px; padding:10px; }
.skip-round:hover,.text-button:hover { color:var(--indigo); }
.rule-feedback:not(:empty) { border-radius:12px; padding:14px; background:var(--mint-pale); font-size:.9375rem; line-height:1.5; }
.race-entry { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; min-height:72px; width:100%; margin:18px 0 12px; font-size:1rem; }
.race-entry small { font-size:.8125rem; font-weight:400; color:var(--muted); }
.achievement-list { display:grid; gap:16px; padding:12px 0; }
.achievement-list p { margin:5px 0; }
.achievement-list small { font-size:.8125rem; line-height:1.5; }
.race-intro { text-align:center; }
.community-shell .account-notice.answer-yes { background:#def7ef; color:#145844; border:1px solid #9bd8c5; }
.community-shell .account-notice.answer-no { background:#fde7e3; color:#843d36; border:1px solid #edb2a9; }
.community-shell .account-notice.answer-unsure { background:#fff4cc; color:#665116; border:1px solid #e3cb7c; }
.race-lobby .eyebrow,.race-finish { text-align:center; }
.room-code { text-align:center; font-size:clamp(1.5rem,7vw,2rem); font-weight:750; letter-spacing:.13em; font-variant-numeric:tabular-nums; padding:8px 0 20px; }
.room-code-input { text-transform:uppercase; letter-spacing:.1em; text-align:center; }
.community-shell #join-room,.community-shell #race-rule-form { display:grid; gap:12px; }
.race-players { list-style:none; margin:12px 0 20px; padding:0; display:grid; gap:8px; }
.race-player { display:flex; align-items:center; gap:12px; border-radius:12px; padding:12px 10px; background:#f7f6f2; }
.race-player.is-me { background:var(--mint-pale); }
.race-player>span:nth-child(2) { min-width:0; flex:1; text-align:left; }
.race-player strong { font-size:.875rem; display:block; }
.race-player small { display:block; font-size:.75rem; font-weight:400; color:var(--muted); }
.race-player>b { text-align:right; font-size:1rem; }
.race-avatar { display:grid; place-items:center; flex-shrink:0; width:36px; height:36px; border-radius:50%; background:#fff; color:var(--indigo); font-size:1.25rem; }
.slot-0 { background:#c9f5e9; }.slot-1 { background:#fff0b3; }.slot-2 { background:#ffddd7; }.slot-3 { background:#e5e2fc; }.slot-4 { background:#e2edf2; }.slot-5 { background:#ffe8d0; }
.race-round { display:flex; justify-content:space-between; gap:8px; font-size:.8125rem; margin-bottom:20px; }
#race-clock { font-variant-numeric:tabular-nums; }
.race-dot { display:flex; align-items:center; gap:16px; margin-bottom:16px; }
.race-dot img { width:64px; height:70px; object-fit:contain; flex-shrink:0; }
.race-dot>div { min-width:0; }
.race-dot p { font-size:.875rem; margin-bottom:4px; }
#race-latest { color:var(--indigo); font-size:1.375rem; overflow-wrap:anywhere; }
#race-round-message:not(:empty) { border-radius:12px; padding:14px; background:var(--mint-pale); margin:14px 0; }
.race-input-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; margin-top:8px; }
.community-shell .race-input-row .button { width:auto; }
.race-footer { display:flex; align-items:center; justify-content:space-between; color:var(--muted); font-size:.75rem; }
.race-footer .text-button { margin:0; }
@media(max-width:360px){.race-input-row { grid-template-columns:1fr; }.race-input-row .button { width:100%; }}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .new-turn * { animation-delay: 0ms !important; }
}
/* Deduction rounds: visible evidence, separate intentions, and keyboard-safe flow. */
:root { --keyboard-inset: 0px; }
html { scroll-padding-top: calc(16px + env(safe-area-inset-top, 0px)); scroll-padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px) + var(--keyboard-inset)); }
#app, .shell { min-height: 100dvh; }
.shell { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px) + var(--keyboard-inset)); }
.input, .button { scroll-margin-block: 16px; }
.toast { bottom: calc(20px + env(safe-area-inset-bottom, 0px) + var(--keyboard-inset)); max-width: calc(100vw - 32px); border-radius: 16px; }
.deduction-layout { align-items: start; gap: 20px; margin-top: 16px; }
.game-main { min-width: 0; }
.deduction-layout .panel { padding: 18px; margin: 0 0 16px; border-radius: 20px; }
.compact-turn .turn-heading { margin-bottom: 10px; font-size: .8125rem; }
.compact-turn .dot-message { grid-template-columns: 60px minmax(0,1fr); gap: 12px; padding: 0; }
.compact-turn .dot-message img { width: 60px; height: 66px; object-fit: contain; }
.compact-turn .speech { padding: 12px 14px; }
.compact-turn .speech p { font-size: .875rem; margin: 4px 0; }
.compact-turn .latest-purchase { font-size: clamp(1.2rem,4vw,1.5rem); }
.compact-turn .latest-verdict { margin-bottom: 12px; padding: 10px 12px; font-size: .875rem; }
.compact-turn .latest-verdict p { margin-top: 3px; }
.ledger-dock { position: sticky; top: max(8px, env(safe-area-inset-top, 0px)); z-index: 4; margin-bottom: 14px; }
.shopping-ledger { background: var(--cream); padding: 8px 0; }
.ledger-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 8px; font-size: .8125rem; color: var(--indigo); }
.ledger-caption span { font-size: .6875rem; color: var(--muted); text-align: right; }
.ledger-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }
.ledger-column { min-width: 0; border: 1px solid; border-radius: 14px; overflow: hidden; }
.ledger-yes { color: #185c4a; background: var(--mint-pale); border-color: #9ad9c8; }
.ledger-no { color: #813c36; background: var(--coral-pale); border-color: #efb7ae; }
.ledger-column h3 { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; padding: 9px 10px 6px; font-size: .75rem; line-height: 1.25; }
.ledger-column h3 small { margin-left: auto; font-size: .6875rem; }
.ledger-items { max-height: 120px; min-height: 34px; overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; padding: 0 10px 8px; }
.ledger-items:focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
.ledger-items ul { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; padding: 0; margin: 0; }
.ledger-items li { max-width: 100%; overflow-wrap: anywhere; padding: 4px 7px; background: #ffffffb3; border-radius: 7px; font-size: .8125rem; line-height: 1.3; font-weight: 600; }
.ledger-empty { margin: 4px 0; font-size: .75rem; }
.guess-modes { display: grid; grid-template-columns: 1fr 1.2fr; gap: 6px; padding: 5px; border: 1px solid var(--line); border-radius: 15px; background: var(--cream); margin-bottom: 18px; }
.guess-modes button { border: 0; min-height: 48px; padding: 10px 8px; border-radius: 10px; color: var(--indigo); background: transparent; font-weight: 700; font-size: .875rem; line-height: 1.25; }
.guess-modes button[aria-pressed="true"] { background: var(--indigo); color: white; }
.deduction-composer .shopping-form { gap: 10px; }
.deduction-composer .shopping-form label { font-size: .9375rem; line-height: 1.4; }
.deduction-composer .shopping-form p { font-size: .875rem; line-height: 1.45; }
.deduction-composer .shopping-form .tiny { font-size: .75rem; font-weight: 400; }
.deduction-composer .button { width: 100%; min-height: 48px; font-size: .9375rem; }
.deduction-composer .guess-status { margin: 16px 0 0; font-size: .75rem; }
.deduction-composer .rule-feedback { margin: 12px 0 0; background: var(--gold-pale); font-size: .875rem; }
.deduction-layout .game-side { display: grid; gap: 12px; }
.deduction-layout .game-side .panel { margin: 0; }
.deduction-layout .game-side .button { width: 100%; }
.result-actions { display: grid; gap: 12px; margin-top: 20px; padding-bottom: env(safe-area-inset-bottom, 0px); }
.result-actions .button { width: 100%; }
#share-status { margin-top: 16px; font-size: .875rem; line-height: 1.5; }
#share-copy { display: block; margin-top: 8px; width: 100%; }
.daily-entry { display: grid; width: 100%; text-align: left; gap: 4px; margin-bottom: 10px; padding: 14px 16px; }
.daily-entry span { font-size: 1rem; }
.daily-entry small { font-size: .75rem; color: var(--muted); font-weight: 400; }
.keyboard-open .ledger-items { max-height: 46px; }
.keyboard-open .ledger-caption { display: none; }
.keyboard-open .ledger-column h3 { padding-top: 6px; }
.keyboard-open .ledger-dock { top: 0; }
.keyboard-open .shopping-ledger { padding: 4px 0; }
@media (max-width: 800px) {
 .deduction-shell { max-width: 620px; }
 .deduction-layout { grid-template-columns: minmax(0,1fr); }
 .deduction-layout .game-side { display: grid; }
 .deduction-layout .hint-box { order: 0; }
}
@media (max-width: 360px) {
 .deduction-layout .panel { padding: 12px; }
 .guess-modes button { font-size: .8125rem; }
 .ledger-caption span { max-width: 120px; }
}
@media (prefers-reduced-motion: reduce) {
 *, *::before, *::after { scroll-behavior: auto !important; }
}
