:root {
  color-scheme: dark;
  --ink: #f7f3e9;
  --muted: #b9c6bf;
  --deep: #08110e;
  --panel: #101b17;
  --panel-2: #17251f;
  --felt: #0d6543;
  --felt-dark: #073e2a;
  --wood: #5b321d;
  --gold: #d5b46a;
  --red: #bc3f42;
  --blue: #376b8d;
  --line: rgba(239, 229, 201, .16);
  --shadow: 0 18px 44px rgba(0, 0, 0, .34);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 50% -20%, #263a31 0, var(--deep) 52%); }
body.table-active { overflow: hidden; }
button, input, select { font: inherit; }
button, a, input, select { min-height: 44px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
:focus-visible { outline: 3px solid #f6d47f; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0, 0, 0, 0); overflow: hidden; white-space: nowrap; border: 0; }
.app-shell { min-height: 100dvh; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: calc(10px + env(safe-area-inset-top)) 20px 10px; border-bottom: 1px solid var(--line); background: rgba(8, 17, 14, .88); backdrop-filter: blur(18px); position: relative; z-index: 30; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(145deg, #f3e4bd, #b79045); color: #192018; font-size: 28px; box-shadow: inset 0 1px rgba(255,255,255,.45); }
h1, h2, h3, p { margin-top: 0; }
.brand-lockup h1 { margin: 0; font: 700 clamp(18px, 2.4vw, 25px)/1.1 Georgia, "Songti SC", serif; white-space: nowrap; }
.brand-lockup p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.button { border: 1px solid transparent; border-radius: 12px; padding: 10px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--ink); text-decoration: none; font-weight: 700; }
.button-primary { background: linear-gradient(145deg, #d8ba72, #ad8437); color: #172018; }
.button-secondary { background: #275b46; border-color: #4a8169; }
.button-ghost { background: rgba(255,255,255,.06); border-color: var(--line); }
.button-danger { background: #87363a; border-color: #bb5a5e; }
.button-small { min-height: 44px; padding: 7px 11px; font-size: 13px; }
.badge { padding: 7px 10px; border: 1px solid #876e38; border-radius: 999px; background: rgba(213,180,106,.1); color: #f0d58e; font-size: 13px; }
.eyebrow { margin: 0 0 5px; color: var(--gold); text-transform: uppercase; letter-spacing: .13em; font-weight: 800; font-size: 11px; }
.muted { color: var(--muted); }
.error-text { min-height: 24px; color: #ff9da0; }
.entry-wrap { min-height: calc(100dvh - 72px); padding: clamp(24px, 7vw, 84px) 18px; display: grid; place-items: start center; }
.entry-card { width: min(720px, 100%); padding: clamp(24px, 5vw, 48px); border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(155deg, rgba(25,43,35,.96), rgba(10,22,17,.96)); box-shadow: var(--shadow); }
.entry-card h2 { font: 700 clamp(30px, 6vw, 54px)/1.05 Georgia, "Songti SC", serif; max-width: 12em; margin-bottom: 18px; }
.entry-lead { color: var(--muted); font-size: 16px; line-height: 1.7; }
.entry-form { margin-top: 30px; padding-top: 25px; border-top: 1px solid var(--line); display: grid; gap: 16px; }
.entry-form h3 { margin-bottom: 0; }
label { display: grid; gap: 7px; color: #d9e1dc; font-weight: 650; font-size: 14px; }
input, select { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px; background: #0a1511; color: var(--ink); }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.entry-empty { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 24px; }

.table-layout { height: calc(100dvh - 72px); min-height: 620px; padding: 14px; display: grid; grid-template-columns: minmax(230px, 280px) minmax(560px, 1fr) minmax(245px, 300px); grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "events felt host" "events hand host"; gap: 12px; overflow: hidden; }
.side-panel { min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; background: rgba(14,25,20,.94); box-shadow: var(--shadow); overflow: hidden; }
.event-panel { grid-area: events; }
.host-panel { grid-area: host; }
body:not(.is-host) .table-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "felt" "hand"; }
body:not(.is-host) .event-panel, body:not(.is-host) .host-panel { display: none; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font: 700 19px/1.1 Georgia, "Songti SC", serif; }
.icon-button { display: grid; place-items: center; min-width: 44px; width: 44px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.05); color: var(--ink); font-size: 22px; }
.drawer-close { display: none; }
.event-list { list-style: none; margin: 0; padding: 10px 14px 20px; overflow: auto; }
.event-list li { padding: 10px 2px; border-bottom: 1px solid rgba(255,255,255,.08); color: #d5ddd8; font-size: 13px; line-height: 1.45; }
.event-list time { display: block; color: #80958b; font-size: 11px; margin-top: 3px; }
.host-controls { padding: 12px; overflow: auto; display: grid; gap: 10px; }
.control-card { margin: 12px 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.035); display: grid; gap: 10px; }
.control-card h3 { margin: 0; font-size: 14px; }
.control-row { display: flex; flex-wrap: wrap; gap: 8px; }
.control-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.settle-pot { padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.winner-checks { display: grid; gap: 4px; margin-top: 8px; }
.winner-checks label { grid-template-columns: 24px 1fr; align-items: center; min-height: 44px; }
.winner-checks input { width: 20px; min-height: 20px; }

.felt-stage { grid-area: felt; min-width: 0; position: relative; display: grid; place-items: center; }
.felt-table { position: relative; width: min(100%, 960px); height: min(100%, 580px); min-height: 390px; border: clamp(10px, 1.5vw, 18px) solid var(--wood); border-radius: 48% / 50%; background: radial-gradient(ellipse, rgba(31,139,91,.35), transparent 55%), repeating-radial-gradient(circle at 20% 30%, rgba(255,255,255,.025) 0 1px, transparent 1px 4px), var(--felt-dark); box-shadow: inset 0 0 0 4px #8a5833, inset 0 0 70px rgba(0,0,0,.35), 0 24px 50px rgba(0,0,0,.35); }
.table-center { position: absolute; inset: 25% 22%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 10px; }
.phase-label { color: #f6dda1; font-size: 14px; font-weight: 800; letter-spacing: .04em; }
.board-cards { display: flex; justify-content: center; gap: 6px; min-height: 92px; }
.table-summary { padding: 9px 15px; border: 1px solid rgba(245,214,139,.35); border-radius: 999px; background: rgba(0,0,0,.46); color: #fff0c4; font-size: clamp(15px, 1.25vw, 18px); font-weight: 850; letter-spacing: .01em; box-shadow: 0 5px 18px rgba(0,0,0,.18); }
.last-play { font-size: 12px; color: #c7d5ce; }
.seat-layer { position: absolute; inset: 0; }
.seat { position: absolute; z-index: 2; width: clamp(126px, 15vw, 164px); min-height: 76px; transform: translate(-50%, -50%); padding: 10px 11px; border: 2px solid rgba(239,220,172,.34); border-radius: 15px; background: rgba(7,18,14,.97); text-align: center; box-shadow: 0 12px 28px rgba(0,0,0,.48); }
.seat[data-position="0"] { left: 50%; top: 97%; }
.seat[data-position="1"] { left: 93%; top: 50%; }
.seat[data-position="2"] { left: 50%; top: 3%; }
.seat[data-position="3"] { left: 7%; top: 50%; }
body.is-host .seat[data-position="1"] { left: 85%; }
body.is-host .seat[data-position="3"] { left: 15%; }
.seat.active { box-shadow: 0 0 0 3px #f4d276, 0 0 28px rgba(244,210,118,.75); }
.seat.active::after { content: "当前行动"; display: block; color: #ffe3a0; font-size: 11px; margin-top: 3px; }
.seat.self { border-color: #75bd9c; }
.seat.offline { border-color: #c25b5f; }
.seat-name { color: #fff9e9; font-size: 15px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.seat-meta { color: #b9cbc1; font-size: 11px; margin-top: 4px; }
.seat-chips, .seat-metric { min-height: 29px; margin-top: 7px; padding: 4px 8px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(213,180,106,.44); border-radius: 9px; background: rgba(213,180,106,.12); color: #f6dda0; }
.seat-chips span { font-size: 10px; white-space: nowrap; }
.seat-chips strong { color: #fff5d5; font-size: 17px; line-height: 1; }
.seat-metric { color: #e8f0eb; font-size: 12px; font-weight: 800; }
.seat-hand { position: absolute; left: 50%; top: calc(100% + 7px); transform: translateX(-50%); display: flex; gap: 3px; padding: 4px; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; background: rgba(4,12,9,.9); box-shadow: 0 8px 18px rgba(0,0,0,.32); }
.seat-hand .playing-card { width: 34px; height: 49px; min-height: 49px; flex-basis: 34px; padding: 3px; border-width: 1px; border-radius: 5px; font-size: 10px; }
.seat-hand .card-suit { font-size: 14px; }
.host-tag, .landlord-tag, .dealer-tag { display: inline-block; margin-left: 4px; color: #f0ce7f; font-size: 10px; }
.pause-banner { position: absolute; inset: auto 16px 16px; padding: 11px 16px; border: 1px solid #d97778; border-radius: 12px; background: rgba(104,29,33,.96); text-align: center; z-index: 8; }

.hand-dock { grid-area: hand; min-width: 0; border: 1px solid var(--line); border-radius: 18px; background: rgba(12,22,18,.96); padding: 12px; box-shadow: var(--shadow); }
.hand-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 7px; }
.hand-header strong { margin-left: 7px; }
.turn-text { color: var(--muted); font-size: 13px; text-align: right; }
.hand-cards { min-height: 112px; display: flex; align-items: end; gap: 4px; overflow-x: auto; overflow-y: hidden; padding: 14px 4px 8px; scroll-padding: 20px; scrollbar-color: #6a806f transparent; }
.playing-card { flex: 0 0 64px; width: 64px; height: 92px; border: 2px solid #e6e3dc; border-radius: 8px; background: #fcfbf6; color: #151b18; box-shadow: 0 5px 9px rgba(0,0,0,.25); padding: 5px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; user-select: none; transition: transform .14s ease, outline-color .14s ease; }
.playing-card.red { color: #b2252d; }
.playing-card .card-suit { align-self: center; font-size: 24px; }
.playing-card.selected { transform: translateY(-12px); outline: 4px solid #f4cf68; outline-offset: -1px; }
.playing-card[aria-disabled="true"] { opacity: .78; }
.card-back { background: repeating-linear-gradient(45deg, #173e59 0 5px, #255f81 5px 10px); border: 3px solid #e9e0c8; }
.board-slot { flex: 0 0 64px; width: 64px; height: 92px; perspective: 650px; }
.board-slot-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.board-slot.revealed .board-slot-inner { transform: rotateY(180deg); }
.board-slot.revealing .board-slot-inner { animation: board-slot-flip .52s cubic-bezier(.2,.75,.25,1) both; animation-delay: var(--motion-delay, 0ms); }
.board-slot .board-face { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.board-slot .board-front { transform: rotateY(180deg); }
.board-reveal { animation: board-flip .46s cubic-bezier(.2,.75,.25,1) both; animation-delay: var(--motion-delay, 0ms); }
.card-play-in { animation: card-play-in .28s cubic-bezier(.2,.8,.3,1) both; animation-delay: var(--motion-delay, 0ms); }
.card-exit { animation: card-exit .18s ease-in both; animation-delay: var(--motion-delay, 0ms); pointer-events: none; }
.last-play.play-pulse { animation: play-pulse .42s ease-out; }
@keyframes board-flip { 0% { transform: perspective(500px) rotateY(90deg) scale(.82); filter: brightness(.65); } 55% { transform: perspective(500px) rotateY(-7deg) scale(1.04); } 100% { transform: perspective(500px) rotateY(0) scale(1); filter: none; } }
@keyframes board-slot-flip { 0% { transform: rotateY(0) scale(.96); filter: brightness(.78); } 55% { transform: rotateY(100deg) scale(1.04); } 100% { transform: rotateY(180deg) scale(1); filter: none; } }
@keyframes card-play-in { from { opacity: 0; transform: translateY(22px) scale(.86); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes card-exit { to { opacity: 0; transform: translateY(-42px) scale(.82); } }
@keyframes play-pulse { 0% { opacity: .25; transform: translateY(5px); } 100% { opacity: 1; transform: none; } }
.action-bar { min-height: 54px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); padding-top: 9px; }
.bet-control { flex: 0 0 auto; display: flex; align-items: end; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,.18); }
.amount-field { width: 92px; display: grid; gap: 2px; color: var(--muted); font-size: 10px; }
.amount-field input { min-width: 0; height: 44px; text-align: center; font-weight: 800; }
.bet-adjust, .bet-quick { min-width: 44px; height: 44px; padding: 0 10px; border: 1px solid #587c6c; border-radius: 10px; background: #1c4938; color: var(--ink); font-weight: 900; font-size: 20px; }
.bet-quick { font-size: 12px; }
.action-pending { cursor: progress; }
.claim-field { width: 120px; }

.orientation-prompt { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(5,11,9,.95); }
.orientation-card { width: min(360px, 100%); text-align: center; }
.rotate-icon { display: block; font-size: 64px; color: var(--gold); margin-bottom: 15px; }
.confirm-dialog { width: min(480px, calc(100% - 28px)); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; background: #12221b; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.confirm-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.confirm-dialog form { padding: 8px; }
.confirm-preview { color: #d2ded7; line-height: 1.55; white-space: pre-line; }
.dialog-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
.mobile-drawer { display: none; }
.mobile-drawer:not([hidden]) { display: grid; justify-items: end; position: fixed; inset: 72px 0 0; z-index: 60; padding: 12px; background: rgba(4,10,8,.72); backdrop-filter: blur(8px); }
.mobile-drawer:not([hidden]) .side-panel { display: flex !important; width: min(390px, 100%); height: 100%; border-radius: 18px; }
.mobile-drawer:not([hidden]) .drawer-close { display: grid; }
.toast { position: fixed; left: 50%; bottom: calc(20px + var(--safe-bottom)); transform: translateX(-50%); z-index: 120; max-width: min(520px, calc(100% - 28px)); padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #1a2c24; box-shadow: var(--shadow); }
.toast.ante-toast { top: calc(92px + env(safe-area-inset-top)); bottom: auto; padding: 14px 22px; border-color: rgba(255,255,255,.2); background: rgba(0,0,0,.72); color: #fff5d5; font-size: 16px; font-weight: 850; text-align: center; backdrop-filter: blur(5px); animation: ante-toast-in .2s ease-out both; }
@keyframes ante-toast-in { from { opacity: 0; transform: translate(-50%, -8px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

@media (max-width: 1279px) {
  .table-layout { grid-template-columns: minmax(0, 1fr) 270px; grid-template-areas: "felt events" "hand events"; }
  body:not(.is-host) .table-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "felt" "hand"; }
  body:not(.is-host) .event-panel { display: none; }
  .host-panel { display: none; }
  body.is-host .table-layout { grid-template-columns: minmax(0, 1fr) 290px; grid-template-areas: "felt host" "hand host"; }
  body.is-host .event-panel { display: none; }
  .felt-table { height: min(100%, 520px); }
}

@media (min-width: 700px) and (max-width: 1100px) {
  .table-layout { padding: 10px; grid-template-columns: minmax(0, 1fr) 260px; min-height: 600px; }
  body:not(.is-host) .event-panel { display: none; }
  .felt-table { min-height: 360px; }
  .playing-card { flex-basis: 60px; width: 60px; height: 88px; }
}

@media (max-width: 699px) {
  .topbar { min-height: 60px; padding-inline: 10px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-lockup h1 { font-size: 16px; }
  .brand-lockup p, .badge { display: none; }
  .top-actions .button { padding-inline: 10px; font-size: 12px; }
  .entry-wrap { min-height: calc(100dvh - 60px); padding: 20px 12px; }
  .entry-card { padding: 24px 18px; border-radius: 20px; }
  .settings-grid { grid-template-columns: 1fr; }
  .table-layout, body.is-host .table-layout { height: calc(100dvh - 60px); min-height: 520px; padding: 6px; display: grid; grid-template: minmax(250px, 1fr) auto / minmax(0, 1fr); grid-template-areas: "felt" "hand"; gap: 6px; overflow: hidden; }
  .event-panel, .host-panel, body.is-host .event-panel, body.is-host .host-panel { display: none; }
  .felt-table { width: 96%; height: 94%; min-height: 240px; border-width: 8px; }
  .table-center { inset: 24% 19%; gap: 4px; }
  .board-cards { min-height: 54px; }
  .board-cards .board-slot { width: 38px; height: 54px; flex-basis: 38px; }
  .board-cards .playing-card { width: 100%; height: 100%; min-height: 0; flex-basis: 38px; font-size: 11px; padding: 3px; }
  .board-cards .card-suit { font-size: 15px; }
  .seat { width: 112px; min-height: 58px; padding: 6px 8px; font-size: 12px; }
  body.is-host .seat[data-position="1"] { left: 90%; }
  body.is-host .seat[data-position="3"] { left: 10%; }
  .seat-meta { font-size: 10px; }
  .seat-chips, .seat-metric { min-height: 24px; margin-top: 4px; padding: 2px 5px; }
  .seat-chips strong { font-size: 14px; }
  .hand-dock { border-radius: 14px; padding: 7px; padding-bottom: calc(7px + var(--safe-bottom)); }
  .hand-cards { min-height: 88px; padding-top: 12px; }
  .playing-card { flex-basis: 52px; width: 52px; height: 76px; min-height: 76px; padding: 4px; }
  .playing-card .card-suit { font-size: 20px; }
  .action-bar { flex-wrap: wrap; overflow-x: auto; }
  .action-bar .button { flex: 0 0 auto; }
  .hand-header .eyebrow { display: none; }
  .mobile-drawer:not([hidden]) { display: block; position: fixed; inset: 60px 0 0; z-index: 60; padding: 0; background: rgba(7,15,12,.94); }
  .mobile-drawer .side-panel { display: flex !important; height: 100%; border-radius: 0; }
  .mobile-drawer .drawer-close { display: grid; }
}

@media (max-width: 699px) and (orientation: landscape) {
  .topbar { min-height: 52px; padding-block: calc(4px + env(safe-area-inset-top)) 4px; }
  .brand-mark { width: 36px; height: 36px; }
  .table-layout, body.is-host .table-layout { height: calc(100dvh - 52px); grid-template: minmax(180px, 1fr) auto / 1fr; }
  .hand-cards { min-height: 78px; }
  .playing-card { height: 70px; min-height: 70px; }
  .mobile-drawer { inset: 52px 0 0; }
}

/* Modern phones report 780–930 CSS px in landscape; height distinguishes them from tablets. */
@media (max-width: 900px) and (max-height: 500px) {
  .topbar { min-height: 52px; padding: calc(4px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) 4px calc(8px + env(safe-area-inset-left)); }
  .brand-mark { width: 36px; height: 36px; }
  .brand-lockup h1 { font-size: 16px; }
  .brand-lockup p, .badge { display: none; }
  .top-actions .button { padding-inline: 10px; font-size: 12px; }
  .table-layout, body.is-host .table-layout { height: calc(100dvh - 52px); min-height: 0; padding: 5px; display: grid; grid-template: minmax(170px, 1fr) auto / minmax(0, 1fr); grid-template-areas: "felt" "hand"; gap: 5px; overflow: hidden; }
  .event-panel, .host-panel, body.is-host .event-panel, body.is-host .host-panel { display: none; }
  .felt-table { width: 94%; height: 96%; min-height: 160px; border-width: 7px; }
  .table-center { inset: 35% 20% 3%; gap: 3px; }
  .board-cards { min-height: 48px; }
  .board-cards .board-slot { width: 34px; height: 48px; flex-basis: 34px; }
  .board-cards .playing-card { width: 100%; height: 100%; min-height: 0; flex-basis: 34px; padding: 2px; font-size: 10px; }
  .board-cards .card-suit { font-size: 13px; }
  .seat { width: 104px; min-height: 54px; padding: 5px 7px; font-size: 12px; }
  .seat[data-position="2"] { left: 26%; top: 22%; }
  .seat.self { display: none; }
  .seat-chips span { display: none; }
  .hand-dock { border-radius: 13px; padding: 6px calc(6px + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) calc(6px + env(safe-area-inset-left)); }
  .hand-header { min-height: 20px; margin-bottom: 0; }
  .hand-cards { min-height: 64px; padding: 7px 4px 3px; }
  .playing-card { flex-basis: 48px; width: 48px; height: 60px; min-height: 60px; }
  .playing-card .card-suit { font-size: 18px; }
  .action-bar { flex-wrap: nowrap; overflow-x: auto; min-height: 48px; padding-top: 5px; }
  .action-bar .button { flex: 0 0 auto; }
  .hand-header .eyebrow { display: none; }
  .mobile-drawer { display: block; inset: 52px 0 0; }
  .mobile-drawer .side-panel { display: flex !important; height: 100%; border-radius: 0; }
  .mobile-drawer .drawer-close { display: grid; }
}

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

.rules-body { background: #0a1511; }
.rules-header { max-width: 1100px; margin: 0 auto; padding: calc(26px + env(safe-area-inset-top)) 22px 20px; display: flex; gap: 20px; align-items: center; }
.rules-header h1 { margin: 0; font: 700 clamp(28px, 5vw, 48px)/1 Georgia, "Songti SC", serif; }
.rules-main { max-width: 1100px; margin: 0 auto; padding: 0 22px calc(60px + env(safe-area-inset-bottom)); }
.rules-nav { position: sticky; top: 8px; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 10px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(13,27,21,.95); backdrop-filter: blur(14px); }
.rules-nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 10px; color: #f4dfaa; text-decoration: none; white-space: nowrap; }
.rules-section, .rules-sources { scroll-margin-top: 85px; padding: clamp(22px, 5vw, 44px); margin-bottom: 16px; border: 1px solid var(--line); border-radius: 20px; background: #112019; box-shadow: 0 14px 30px rgba(0,0,0,.18); }
.rules-section h2 { font: 700 clamp(26px, 4vw, 38px)/1.1 Georgia, "Songti SC", serif; }
.rules-section h3 { margin-top: 30px; color: #efd38c; }
.rules-section p, .rules-section li, .rules-sources p { color: #d0dbd5; line-height: 1.75; }
.rules-section li + li { margin-top: 7px; }
.rules-section code { padding: 3px 7px; border-radius: 6px; background: #09130f; color: #f4d88d; }
.rules-sources a { color: #f3d581; }
@media (max-width: 600px) { .rules-header { align-items: flex-start; flex-direction: column; } .rules-main { padding-inline: 12px; } .rules-section { padding: 22px 18px; } }
