/* Layout: setup = title band + two panels + character gallery; game = snake board (fluid) beside a 360px sidebar, stacked under 980px */
:root {
  --ground: #EDF5FD;
  --ground-top: #D6EBFF;
  --surface: #FFFFFF;
  --surface-2: #F1F6FC;
  --ink: #1E2638;
  --muted: #586377;
  --line: #D5E0EC;
  --line-strong: #B3C4D6;
  --lapis: #2B66DF;
  --saffron: #B97600;
  --pome: #D23F4A;
  --olive: #3D8B32;
  --glow: #FFC53D;
  --p1: #12909C;
  --p2: #8447C2;
  --p3: #D4642A;
  --p4: #CF4778;
  --p5: #3672D9;
  --p6: #A87C00;
  --p7: #646D82;
  --p8: #389A43;
  --on-accent: #FFFFFF;
  --pawn-ink: #FFFFFF;
  --shade: rgba(43, 102, 223, .12);
  --scrim: rgba(20, 32, 60, .45);
  /* 배민 주아체 for titles and big numbers, 본고딕 for text: familiar to children */
  --font-display: "Jua", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ground: #0E1420; --surface: #172030; --surface-2: #1E293A; --ink: #E6E9EF; --muted: #9AA3B5;
  --line: #2C374A; --line-strong: #405069; --lapis: #8DABEF; --saffron: #E8B04A; --pome: #E7787D;
  --olive: #A1C273; --glow: #F5C85C; --p1: #45B8BF; --p2: #B583CF; --p3: #E58F5F; --p4: #E57AA5; --p5: #7FA2EC; --p6: #D6AE4A; --p7: #A3AAB8; --p8: #74C477;
  --on-accent: #0E1420; --pawn-ink: #0E1420; --shade: rgba(0, 0, 0, .45); --scrim: rgba(3, 6, 12, .7); --ground-top: #0E1420;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
html { font-synthesis: none; }
body { background: linear-gradient(180deg, var(--ground-top) 0, var(--ground) 360px) no-repeat, var(--ground); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.25; text-wrap: balance; font-weight: 700; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 24px 48px; }
.small { font-size: 13px; color: var(--muted); }
.k-f { color: var(--saffron); } .k-l { color: var(--pome); } .k-p { color: var(--olive); } .k-lamp { color: var(--saffron); } .k-shield { color: var(--lapis); }
.ic { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; vertical-align: -0.18em; }
.ic.inl { width: 1em; height: 1em; margin-right: 1px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; line-height: 1.3; }
.btn:hover:not(:disabled) { border-color: var(--ink); }
.btn.primary { background: var(--lapis); border-color: var(--lapis); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); border-color: var(--lapis); }
.btn.big { padding: 14px 22px; font-size: 17px; border-radius: 12px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--glow); outline-offset: 2px; }

/* ---------- setup ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding-block: 12px 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.eyebrow { font-size: 13px; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.hero h1 { font-size: clamp(44px, 8vw, 84px); letter-spacing: -0.02em; line-height: 1.05; }
.hero h1 em { font-style: normal; color: var(--saffron); }
.lede { max-width: 62ch; margin-top: 16px; font-size: 16.5px; color: var(--ink); }
.hero-art { width: 230px; max-width: 100%; height: auto; }
.hero-art .road { fill: none; stroke: var(--line-strong); stroke-width: 10; stroke-linecap: round; }
.hero-art .dash { fill: none; stroke: var(--surface); stroke-width: 2; stroke-dasharray: 6 8; stroke-linecap: round; }
.setup-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; min-width: 0; box-shadow: 0 2px 10px var(--shade); }
.panel h2 { font-size: 22px; margin-bottom: 14px; }
.seg { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); width: 100%; max-width: 520px; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.seg button { border: 0; background: transparent; padding: 8px 0; cursor: pointer; font-weight: 600; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.prows { display: grid; gap: 10px; margin-bottom: 20px; }
.prow { display: grid; grid-template-columns: 30px minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1.2fr); gap: 8px; align-items: center; }
.pdot { width: 28px; height: 28px; border-radius: 50%; background: var(--pc); color: var(--pawn-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.pdot.two { font-size: 10.5px; letter-spacing: -0.04em; }
.prow input, .prow select { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--ground); }
.start-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.rules-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.rules-list li::marker { color: var(--muted); font-weight: 600; }
.legend { display: grid; gap: 8px; margin-top: 18px; }
.legend-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; }
.legend-item .sw { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); }
.legend-item .sw .ic { width: 20px; height: 20px; }
.t-d { color: var(--lapis); } .t-c { color: var(--olive); } .t-t { color: var(--pome); } .t-pr { color: var(--saffron); } .t-q { color: var(--muted); }
.scorebox { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.why { margin-top: 14px; font-size: 14px; color: var(--muted); }
.why b { color: var(--ink); }
.chars { margin-top: 34px; }
.chars > h2 { font-size: 26px; margin-bottom: 6px; }
.chars > p { color: var(--muted); margin-bottom: 16px; }
.char-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.char-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: grid; gap: 4px; min-width: 0; }
.char-card .cn { font-family: var(--font-display); font-size: 22px; font-weight: 700; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.char-card .ct { font-size: 13px; color: var(--muted); font-family: var(--font-body); font-weight: 500; }
.char-card .ca { font-size: 14px; }
.char-card .cr { font-size: 12px; color: var(--muted); }
.foot { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); max-width: 80ch; }

/* ---------- game ---------- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.brand { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.round { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lamp { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.lamp-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.lamp-label b { color: var(--ink); font-variant-numeric: tabular-nums; }
.lamp-bar { display: flex; gap: 3px; }
.lamp-bar i { width: 12px; height: 18px; border-radius: 6px 6px 3px 3px; background: var(--line); transition: background .3s; }
.lamp-bar i.on { background: var(--glow); }
.lamp.low .lamp-bar i.on { background: var(--pome); }
.top-actions { display: flex; gap: 8px; }
.top-actions .btn { padding: 7px 12px; font-size: 14px; }
.game-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.board-wrap { min-width: 0; }
#board { width: 100%; height: auto; display: block; max-width: 820px; margin: 0 auto; }
.conn { stroke: var(--line-strong); stroke-width: 14; stroke-linecap: round; }
.cell .bg { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.cell .num { fill: var(--muted); font: 600 12px var(--font-body); }
.cell .lbl { fill: var(--ink); font: 600 12.5px var(--font-body); text-anchor: middle; }
.cell .disc { fill-opacity: .14; }
.cell-d .disc, .cell-d .gl { fill: var(--lapis); }
.cell-c .disc, .cell-c .gl { fill: var(--olive); }
.cell-t .disc, .cell-t .gl { fill: var(--pome); }
.cell-pr .disc, .cell-pr .gl { fill: var(--saffron); }
.cell-q .disc, .cell-q .gl { fill: var(--muted); }
.cell-start .disc, .cell-start .gl { fill: var(--ink); }
.cell-end .bg { stroke: var(--saffron); stroke-width: 2.5; }
.cell-end .tint { fill: var(--glow); fill-opacity: .22; }
.cell-end .disc, .cell-end .gl { fill: var(--saffron); }
.cell-end .lbl { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; }
.pawn { transition: transform .2s ease; }
.pawn circle.body { stroke: var(--surface); stroke-width: 3; }
.pawn text { fill: var(--pawn-ink); font: 700 12px var(--font-body); text-anchor: middle; dominant-baseline: central; }
.pawn text.two { font-size: 9.5px; letter-spacing: -0.04em; }
.pawn .ring { fill: none; stroke: var(--glow); stroke-width: 3; opacity: 0; }
.pawn.cur .ring { opacity: 1; animation: pulse 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.18); opacity: .4; } }
.board-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-top: 12px; font-size: 13px; color: var(--muted); }
.board-legend span { display: inline-flex; align-items: center; gap: 5px; }

.side { display: grid; gap: 14px; min-width: 0; }
.turn-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 12px; box-shadow: 0 6px 20px var(--shade); }
.turn-who { display: flex; align-items: center; gap: 10px; }
.turn-who b { font-size: 17px; }
.turn-who small { display: block; color: var(--muted); font-size: 13px; }
.turn-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.turn-note { font-size: 14px; color: var(--muted); }
.toast { font-size: 14px; background: var(--surface-2); border-radius: 10px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.die { width: 52px; height: 52px; border-radius: 12px; background: var(--ground); border: 2px solid var(--line-strong); display: inline-grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 7px; gap: 2px; flex: none; }
.die i { border-radius: 50%; }
.die i.on { background: var(--ink); }
.die.sm { width: 34px; height: 34px; padding: 5px; border-radius: 8px; border-width: 1.5px; vertical-align: middle; }
.die.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.6) rotate(-20deg); } 70% { transform: scale(1.1) rotate(4deg); } 100% { transform: none; } }

.players { display: grid; gap: 8px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.pcard.is-cur { border-color: var(--ink); }
.pc-head { display: flex; align-items: center; gap: 10px; }
.pc-head > div { min-width: 0; flex: 1; }
.pc-head b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-head small { display: block; font-size: 12.5px; color: var(--muted); }
.pc-pos { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pc-pos strong { display: block; font-size: 18px; color: var(--ink); font-family: var(--font-display); }
.res-row { display: flex; flex-wrap: wrap; gap: 6px 14px; font-variant-numeric: tabular-nums; font-weight: 600; }
.res-row span { display: inline-flex; align-items: center; gap: 4px; }
.res-row .rn { font-size: 12px; font-weight: 500; color: var(--muted); }
.pc-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--muted); }
.pc-meta span { background: var(--surface-2); border-radius: 999px; padding: 2px 9px; }
.players.compact { gap: 6px; }
.players.compact .pcard { padding: 8px 12px; gap: 4px; }
.players.compact .pc-head small, .players.compact .res-row .rn:not(.pos-note) { display: none; }
.players.compact .pc-pos strong { font-size: 16px; }

.log-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.log-panel h3 { font-size: 16px; margin-bottom: 8px; }
#log { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13px; max-height: 230px; overflow: auto; }
#log li { color: var(--muted); }
#log li:first-child { color: var(--ink); }
#log li.round { font-weight: 600; color: var(--ink); padding-top: 4px; }

/* ---------- modal & cards ---------- */
.modal { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; z-index: 50; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.sheet { width: 100%; max-width: 620px; max-height: 100%; overflow: auto; background: var(--surface); border-radius: 20px; box-shadow: 0 20px 60px var(--shade); animation: rise .25s ease; }
.sheet.wide { max-width: 860px; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
#sheet-body { padding: 24px; display: grid; gap: 16px; }
.ch { display: grid; gap: 4px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ch-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.ch-d .ch-kind { color: var(--lapis); } .ch-c .ch-kind { color: var(--olive); } .ch-t .ch-kind { color: var(--pome); } .ch-pr .ch-kind { color: var(--saffron); } .ch-q .ch-kind { color: var(--muted); } .ch-end .ch-kind { color: var(--saffron); }
.ch-who { font-size: 14px; color: var(--muted); font-weight: 600; }
.ch-title { font-size: clamp(24px, 4.5vw, 30px); }
.ch-ref { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.for { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.for b { color: var(--ink); }
.for-res { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 4px 12px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.for-res > span { display: inline-flex; align-items: center; gap: 3px; }
.scene { font-size: 16.5px; line-height: 1.7; }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 14px; padding: 14px 16px; cursor: pointer; display: grid; gap: 8px; }
.opt:hover:not(:disabled) { border-color: var(--lapis); background: var(--surface-2); }
.opt:disabled { cursor: not-allowed; opacity: .5; }
.opt.chosen { border-color: var(--lapis); background: var(--surface-2); opacity: 1; }
.opt-t { font-weight: 600; font-size: 15.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-variant-numeric: tabular-nums; }
.chip .ic { width: 14px; height: 14px; }
.chip.k-f .ic { fill: var(--saffron); } .chip.k-l .ic { fill: var(--pome); } .chip.k-p .ic { fill: var(--olive); } .chip.k-lamp .ic { fill: var(--saffron); } .chip.k-shield .ic { fill: var(--lapis); }
.chip.neg { border-style: dashed; }
.chip .cn { font-weight: 500; color: var(--muted); }
.tag { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 6px; border: 1px solid currentColor; }
.tag-courage { color: var(--pome); } .tag-peace { color: var(--olive); }
.need { font-size: 12.5px; color: var(--pome); }
.hint { font-size: 13px; color: var(--muted); }
.reveal { display: grid; gap: 12px; }
.your { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; display: grid; gap: 8px; }
.your .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.your .choice { font-weight: 700; }
.badge { justify-self: start; font-size: 12.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.badge.ok { background: var(--olive); color: var(--on-accent); }
.badge.alt { border: 1px solid var(--line-strong); color: var(--muted); }
.story { border-left: 3px solid var(--saffron); padding: 2px 0 2px 14px; display: grid; gap: 6px; }
.story .lbl { font-size: 12.5px; font-weight: 700; color: var(--saffron); letter-spacing: .04em; }
.story p { font-size: 15px; line-height: 1.75; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.check-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; font-variant-numeric: tabular-nums; }
.result-word { font-weight: 700; }
.result-word.pass { color: var(--olive); } .result-word.fail { color: var(--pome); }
.give-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.give-btn { border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 14px; padding: 14px 6px; cursor: pointer; display: grid; justify-items: center; gap: 4px; }
.give-btn b { font-size: 26px; font-family: var(--font-display); line-height: 1; }
.give-btn:hover:not(:disabled) { border-color: var(--olive); background: var(--surface-2); }
.give-btn:disabled { opacity: .35; cursor: not-allowed; }
.tally { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-display); }
.tally .big { font-size: 46px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tally .of { font-size: 20px; color: var(--muted); }
.privacy { text-align: center; display: grid; gap: 12px; justify-items: center; padding-block: 16px; }
.privacy .pdot { width: 54px; height: 54px; font-size: 22px; }
.privacy h2 { font-size: 26px; }
.qopts { display: grid; gap: 8px; }
.qopt { text-align: left; border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 12px; padding: 12px 14px; cursor: pointer; font-weight: 600; }
.qopt:hover:not(:disabled) { border-color: var(--ink); }
.qopt.right { border-color: var(--olive); background: var(--surface-2); }
.qopt.wrong { border-color: var(--pome); border-style: dashed; }
.qopt:disabled { cursor: default; }
.pray-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pray-btn { border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 14px; padding: 14px; cursor: pointer; display: grid; gap: 2px; text-align: left; }
.pray-btn b { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.pray-btn span { font-size: 12.5px; color: var(--muted); }
.pray-btn:hover:not(:disabled) { border-color: var(--saffron); }
.pray-btn.chosen { border-color: var(--saffron); background: var(--surface-2); }
.thinking { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.thinking::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--glow); animation: pulse 1s infinite; }
.res-table-wrap { overflow-x: auto; }
.res-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.res-table th, .res-table td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.res-table th:first-child, .res-table td:first-child, .res-table th:nth-child(2), .res-table td:nth-child(2) { text-align: left; }
.res-table th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.res-table td.total { font-weight: 700; font-size: 16px; }
.res-table tr.top td { background: var(--surface-2); }
.hist { display: grid; gap: 8px; }
.hist details { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.hist summary { cursor: pointer; font-weight: 600; }
.hist ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.hist li .ok { color: var(--olive); font-weight: 700; }
.hist li .alt { color: var(--muted); }
.final-head { display: grid; gap: 6px; }
.final-head h2 { font-size: clamp(28px, 5vw, 38px); }

@media (max-width: 980px) {
  .game-grid { grid-template-columns: minmax(0, 1fr); }
  .setup-grid { grid-template-columns: minmax(0, 1fr); }
  .char-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-art { display: none; }
  .prow { grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr); }
  .prow input { grid-column: 2 / 4; }
  .prow select:first-of-type { grid-column: 2; }
  .char-grid { grid-template-columns: minmax(0, 1fr); }
  .cell .lbl { display: none; }
  .lamp { margin-left: 0; width: 100%; }
  .modal { place-items: end center; padding-bottom: 0; padding-left: 0; padding-right: 0; }
  .sheet { border-radius: 20px 20px 0 0; max-height: 92%; }
  #sheet-body { padding: 20px max(16px, env(safe-area-inset-left, 0px)) max(24px, env(safe-area-inset-bottom, 0px)); }
  .give-btn b { font-size: 22px; }
  .pray-grid { grid-template-columns: minmax(0, 1fr); }
  .res-table .c-lamp { display: none; }
  .res-table th, .res-table td { padding: 8px 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
