:root { --lime-hover: #e1ff9d; --error: #ffb8b8; --field: #16181f; --secret: #14171d; --subtle: #292c36; --accent-ink: #d4fa72; --callout: #bbb0f5; }
:root[data-theme="light"] { color-scheme: light; --bg: #f6f5ef; --panel: #fffefa; --line: #d4d5cb; --ink: #22291e; --muted: #60675c; --field: #f2f3eb; --secret: #eef2e4; --subtle: #e9ecdf; --accent-ink: #496018; --callout: #5f4b96; --lime: #d4fa72; --lime-hover: #e1ff9d; --purple: #bbb0f5; --orange: #ffc79c; --error: #a42c2c; }
:root[data-theme="mint"] { color-scheme: light; --bg: #eef7f2; --panel: #fbfffd; --line: #c6dcd1; --ink: #14302a; --muted: #4e665e; --field: #e5f1eb; --secret: #dcece4; --subtle: #d6e8de; --accent-ink: #0a6a4d; --callout: #5a4a9e; --lime: #7fe0b5; --lime-hover: #9aebc6; --purple: #c3b8f7; --orange: #ffcfa8; --error: #a42c2c; }
:root[data-theme="peach"] { color-scheme: light; --bg: #fbf3ee; --panel: #fffdfb; --line: #ecd6ca; --ink: #34201b; --muted: #7a615a; --field: #f7ebe4; --secret: #f6e4da; --subtle: #f1e0d6; --accent-ink: #b0361c; --callout: #6b4aa0; --lime: #ff9f80; --lime-hover: #ffb59c; --purple: #cdbcf5; --orange: #ffd39a; --error: #a42c2c; }
:root[data-theme="sky"] { color-scheme: light; --bg: #eef4fb; --panel: #fdfeff; --line: #cddbea; --ink: #16233a; --muted: #536480; --field: #e7eff8; --secret: #dce8f5; --subtle: #dce7f4; --accent-ink: #1b55b5; --callout: #6a4aa8; --lime: #8cc4ff; --lime-hover: #a8d2ff; --purple: #c9bff7; --orange: #ffd0a8; --error: #a42c2c; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.theme-toggle { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); flex: none; }
.brand-icon { color: #1c2312; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline-color: var(--callout); }
.lime, .eyebrow, h1 em { color: var(--accent-ink); }
.name-field, input[type="text"], select { background: var(--field); }
.name-field input { background: transparent; }
.secret { background: var(--secret); }
.player { background: var(--field); }
.player .number, .secondary { background: var(--subtle); }
.callout { color: var(--callout); }
.player.selected { border-color: var(--accent-ink); }
.error { color: var(--error); }
.primary:hover { background: var(--lime-hover); }
footer, .name-field span { color: var(--muted); }
#storage-notice:empty { display: none; }
.storage-warning { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.text-button { min-height: 44px; }
.counter button { min-width: 44px; min-height: 44px; }
#player-count { width: 44px; min-width: 44px; height: 44px; border: 0; border-radius: 0; padding: 0 2px; background: transparent; color: var(--ink); text-align: center; font-size: 16px; font-weight: 700; appearance: textfield; -moz-appearance: textfield; }
#player-count::-webkit-inner-spin-button, #player-count::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.names, .name-field { min-width: 0; }
input[type="text"], .name-field input, select { font-size: 16px; }
dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
footer { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
@media (max-width: 720px) {
  .topbar { padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
  .header-actions { gap: 8px; }
  .intro { grid-template-columns: 1fr auto; gap: 6px; margin-bottom: 22px; }
  .intro h1 { font-size: clamp(30px, 8.5vw, 44px); letter-spacing: -1.5px; margin: 12px 0; }
  .intro .lead { font-size: 13px; }
  .art { width: 74px; height: 140px; margin: 0; overflow: hidden; }
  .character { width: 64px; height: 90px; border-radius: 15px; gap: 16px; }
  .character.back, .character.third { display: none; }
  .character.front { transform: rotate(5deg); }
  .character small { font-size: 7px; letter-spacing: .5px; }
  .character.front:after { font-size: 28px; top: -24px; right: 8px; }
  .eyes { gap: 12px; }
  .eyes i { width: 7px; height: 12px; }
  .panel { padding: 18px 16px; border-radius: 16px; }
  h2 { font-size: 19px; }
  .names { gap: 8px; margin-top: 16px; }
  .name-field { padding: 0 8px; gap: 6px; }
  .game-top { margin-bottom: 14px; }
  .game-top .eyebrow { font-size: 10px; letter-spacing: 1px; }
  .game-top .text-button { flex: none; }
  .game-card { padding: 22px 16px; }
  .game-card h1 { font-size: 30px; overflow-wrap: anywhere; margin: 14px 0; }
  .avatar { width: 64px; height: 64px; border-radius: 20px; margin: 8px auto 16px; font-size: 28px; }
  .progress { margin: 10px 0 20px; }
  .secret { padding: 20px 12px; margin: 20px 0; }
  .secret .word { font-size: 28px; }
  .player { padding: 12px; gap: 10px; min-height: 48px; }
  .player small { max-width: 42%; }
  .dialog-content { padding: 20px; }
}
@media (max-width: 359px) {
  .art { display: none; }
  .intro { grid-template-columns: 1fr; }
  .names { grid-template-columns: 1fr; }
}
.theme-picker { position: relative; }
.theme-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 20; min-width: 190px; padding: 8px; display: grid; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px #0003; }
.theme-option { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 14px; font-weight: 650; }
.theme-option:hover { background: var(--subtle); }
.theme-option[aria-pressed="true"] { background: var(--subtle); }
.theme-option[aria-pressed="true"]::after { content: "✓"; margin-left: auto; color: var(--accent-ink); }
.swatch { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 1px solid var(--line); }
.swatch[data-swatch="dark"] { background: linear-gradient(135deg, #14151b 50%, #d4fa72 50%); }
.swatch[data-swatch="light"] { background: linear-gradient(135deg, #f6f5ef 50%, #d4fa72 50%); }
.swatch[data-swatch="mint"] { background: linear-gradient(135deg, #eef7f2 50%, #7fe0b5 50%); }
.swatch[data-swatch="peach"] { background: linear-gradient(135deg, #fbf3ee 50%, #ff9f80 50%); }
.swatch[data-swatch="sky"] { background: linear-gradient(135deg, #eef4fb 50%, #8cc4ff 50%); }
.theme-menu[hidden] { display: none; }
/* Simplified single-column layout */
.topbar { max-width: 720px; }
main { max-width: 680px; padding: 36px 20px 8px; }
footer { max-width: 640px; width: calc(100% - 40px); }
.eyebrow { text-transform: uppercase; }
@media (min-width: 721px) {
  .topbar { padding: 20px; }
  .intro { grid-template-columns: 1fr auto; gap: 24px; margin-bottom: 24px; }
  .intro h1 { font-size: clamp(32px, 6vw, 48px); letter-spacing: -1.5px; margin: 0 0 12px; }
  .intro .lead { max-width: 340px; margin: 0 0 4px; }
  .art { width: 220px; height: 170px; }
  .character { width: 96px; height: 124px; border-radius: 18px; gap: 18px; }
  .character.back { transform: translate(-66px, 4px) rotate(-15deg); }
  .character.third { transform: translate(66px, 14px) rotate(19deg); }
  .character small { font-size: 8px; letter-spacing: 1px; }
  .character.front:after { font-size: 38px; top: -26px; right: -10px; }
  .eyes { gap: 13px; }
  .eyes i { width: 8px; height: 13px; }
}
.notice-line { margin: 0 0 12px; }
.notice-line:empty { display: none; }
.setup-card { padding: 0; }
.setup-section { padding: 22px; }
.setup-section + .setup-section { border-top: 1px solid var(--line); }
.setup-section h2 { font-size: 17px; letter-spacing: -.2px; margin: 0 0 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.names { margin-top: 0; }
.name-field span { min-width: 16px; text-align: center; }
fieldset { margin: 0 0 16px; }
legend { color: var(--muted); font-weight: 600; margin-bottom: 8px; }
fieldset .muted { margin: 8px 0 0; }
.setup-section > .muted:last-child { margin: 0; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; }
.segmented label { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 6px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 650; text-align: center; cursor: pointer; transition: background .15s, color .15s; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:hover { color: var(--ink); }
.segmented label:has(:checked) { background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--accent-ink), 0 1px 3px #0000001f; }
.segmented label:has([type="checkbox"]:checked)::before { content: "✓"; margin-right: 6px; color: var(--accent-ink); }
.segmented label:has(:focus-visible) { outline: 3px solid var(--callout); outline-offset: 2px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0 14px; cursor: pointer; }
.toggle-row strong { display: block; font-size: 14px; }
.toggle-row small { color: var(--muted); font-size: 13px; }
.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 50px; height: 30px; margin: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: background .15s; }
.switch::before { content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0004; transition: transform .15s, background .15s; }
.switch:checked { background: var(--lime); }
.switch:checked::before { transform: translateX(20px); background: #1c2312; }
.role-summary { display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: var(--secret); border-radius: 14px; }
.big-count { min-width: 36px; color: var(--accent-ink); font-size: 36px; font-weight: 850; line-height: 1; text-align: center; }
.role-summary strong { font-size: 14px; }
.role-summary p { margin: 2px 0 0; }
.start-bar { position: sticky; bottom: 0; z-index: 5; margin: 0 -20px; padding: 14px 20px max(16px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 40%); }
.game-top { gap: 12px; margin-bottom: 16px; }
.pill { margin-left: auto; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.pill strong { color: var(--ink); }
@media (max-width: 720px) {
  main { padding: 22px 16px 8px; }
  footer { width: calc(100% - 32px); }
  .start-bar { margin: 0 -16px; padding-inline: 16px; }
  .setup-section { padding: 18px 16px; }
  .segmented label { min-height: 44px; font-size: 13px; }
}
footer { flex-wrap: wrap; gap: 6px 16px; }
.group-panel { padding: 16px 22px; margin-bottom: 14px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.group-head h2 { font-size: 15px; margin: 0; }
.group-head .muted { margin: 0; }
.group-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.group-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); font-size: 14px; font-weight: 650; }
.group-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-chip small { color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.group-chip:hover { border-color: var(--accent-ink); }
.group-chip[aria-pressed="true"] { background: var(--lime); border-color: transparent; color: #1c2312; }
.group-chip[aria-pressed="true"] small { color: #1c2312b3; }
.group-manage summary { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; color: var(--accent-ink); font-size: 14px; font-weight: 650; cursor: pointer; list-style: none; }
.group-manage summary::-webkit-details-marker { display: none; }
.group-save { display: flex; gap: 8px; margin-top: 4px; }
.group-save input { flex: 1; }
.group-save .secondary { min-height: 46px; padding: 0 18px; }
.group-manage .text-button { margin-top: 4px; }
@media (max-width: 720px) { .group-panel { padding: 14px 16px; } }
