:root {
  color-scheme: light;
  --ink: #29243a;
  --muted: #716b80;
  --paper: #fffdfb;
  --surface: #ffffff;
  --line: #eee8f3;
  --purple: #7c3aed;
  --purple-dark: #6127c9;
  --lilac: #f2eaff;
  --pink: #fff0f4;
  --shadow: 0 14px 40px rgba(59, 36, 89, .08);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top left, #f7efff 0, transparent 45%), linear-gradient(160deg, #fffaf7, #fff7fb 60%, #f8f5ff);
  color: var(--ink);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #c4a5ff; outline-offset: 2px; }
.app-shell { width: min(100% - 28px, 540px); margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 0 max(26px, env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; gap: 12px; margin: 8px 2px 22px; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px; background: linear-gradient(135deg, #8b5cf6, #ec4899); color: white; font-size: 25px; box-shadow: 0 7px 18px #a778d533; }
.brand-copy { flex: 1; }
.eyebrow { margin: 0 0 4px; color: #8d70b8; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-size: 21px; letter-spacing: -.04em; }
h2 { margin: 0; font-size: clamp(25px, 7vw, 34px); line-height: 1.1; letter-spacing: -.05em; }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--ink); font-size: 20px; }
.panel { border: 1px solid rgba(255,255,255,.9); border-radius: 26px; background: rgba(255,255,255,.87); box-shadow: var(--shadow); }
.intro { padding: 25px 23px 23px; margin-bottom: 15px; background: linear-gradient(135deg, #fff 10%, #fff7fb); }
.intro h2 { margin-bottom: 12px; }
.intro h2 span { color: var(--purple); }
.muted { color: var(--muted); line-height: 1.55; margin: 0; }
.intro .muted { font-size: 14px; max-width: 390px; }
.game-panel { padding: 22px; }
.turn-label { color: #9478b5; font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.partner-picker { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0; font-weight: 700; }
select, input, textarea { width: 100%; border: 1px solid #e5dceb; border-radius: 13px; background: #fff; color: var(--ink); padding: 12px 13px; }
.partner-picker select { width: auto; min-width: 135px; }
.primary-button, .secondary-button { min-height: 48px; padding: 12px 16px; border-radius: 15px; border: 0; font-weight: 800; }
.primary-button { background: var(--purple); color: white; box-shadow: 0 6px 16px #7c3aed2e; }
.primary-button:active { background: var(--purple-dark); transform: translateY(1px); }
.primary-button span { margin-left: 8px; }
.secondary-button { border: 1px solid #e6d9f5; background: #faf7ff; color: #5d3c89; }
#start-game { width: 100%; }
.microcopy { color: #968da1; font-size: 11px; line-height: 1.5; text-align: center; margin: 15px 0 0; }
.turn-topline { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.direction-pill { border-radius: 999px; padding: 7px 10px; background: var(--lilac); color: #6941a5; font-size: 11px; font-weight: 800; }
.action-kicker { color: #a17dbd; font-size: 10px; letter-spacing: .12em; font-weight: 900; margin: 27px 0 9px; }
.action-title { font-size: clamp(27px, 8vw, 38px); line-height: 1.12; overflow-wrap: anywhere; }
.duration-line { margin-top: 15px; color: var(--muted); font-size: 13px; }
.duration-line strong { color: var(--ink); margin-left: 4px; }
.timer-wrap { margin: 23px 0 18px; padding: 20px 12px; border: 1px solid #f0e7fa; border-radius: 21px; background: linear-gradient(145deg, #fcf8ff, #fff7fa); text-align: center; }
.timer-display { font-size: clamp(52px, 15vw, 72px); font-weight: 850; letter-spacing: -.07em; font-variant-numeric: tabular-nums; line-height: 1.05; color: #5e2aa8; }
.timer-status { margin: 7px 0 0; font-size: 12px; color: var(--muted); }
.timer-controls { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.turn-controls { display: flex; justify-content: space-between; gap: 8px; margin-top: 13px; }
.text-button { border: 0; background: transparent; padding: 9px 4px; color: #7447a6; font-size: 13px; font-weight: 800; }
.footer-note { display: flex; gap: 10px; align-items: flex-start; padding: 18px 8px 0; color: #8a8194; font-size: 11px; line-height: 1.5; }
.footer-note span { color: #db6f9c; font-size: 19px; }
.footer-note p { margin: 0; }
[hidden] { display: none !important; }
.settings-dialog { width: min(100% - 20px, 540px); max-height: min(88vh, 900px); padding: 0; border: 0; border-radius: 24px; background: #fffdfd; color: var(--ink); box-shadow: 0 24px 80px #26123e40; }
.settings-dialog::backdrop { background: #24152e88; backdrop-filter: blur(4px); }
.dialog-header { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 20px 20px 16px; background: #fffdfd; border-bottom: 1px solid var(--line); z-index: 1; }
.dialog-header h2 { font-size: 25px; }
.settings-content { padding: 18px 20px 24px; overflow-y: auto; }
.field-label { display: block; font-size: 12px; font-weight: 800; margin: 0 0 7px; }
.field-label + input { margin-bottom: 15px; }
.list-editor { padding: 17px 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; flex-direction: column; gap: 3px; }
.section-heading h3 { margin: 0; font-size: 16px; }
.section-heading span, .small { color: var(--muted); font-size: 11px; }
.small { margin: 5px 0 9px; }
textarea { resize: vertical; line-height: 1.5; min-height: 110px; }
.error-message { color: #b4234d; background: #fff0f3; padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.settings-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.privacy-note { color: #8c8395; font-size: 11px; line-height: 1.55; margin: 17px 0 0; }
.toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 11px 16px; border-radius: 999px; background: #30233d; color: white; font-size: 13px; box-shadow: var(--shadow); transition: .2s ease; width: max-content; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 600px) { .app-shell { padding-top: 30px; } .intro { padding: 30px; } .game-panel { padding: 28px; } }
