:root {
  color-scheme: light;
  --paper: #f8f7ee;
  --card: #fffefa;
  --ink: #172a22;
  --muted: #626b61;
  --line: #e7e7dc;
  --green: #275c48;
  --deep: #194536;
  --gold: #f9d88b;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; font-size: 1rem; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .46; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #a16d23; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg { display: inline-block; width: 1.15rem; height: 1.15rem; flex: none; vertical-align: middle; }
[hidden] { display: none !important; }

.topbar { background: #fffefa; border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1264px; padding: 0 32px; margin: auto; min-height: 73px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 25px; }
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; white-space: nowrap; }
.brand-icon { width: 37px; height: 41px; display: grid; place-items: center; color: #ffedba; font: 700 1.5rem var(--serif); border: 1px solid #346c53; border-radius: 11px; background: var(--green); box-shadow: inset 0 -4px 0 #173e33; }
.brand-text { font-family: var(--serif); font-size: 1.46rem; font-weight: 800; letter-spacing: .08em; }
.brand-text small { margin-left: 7px; color: var(--muted); font: 500 .82rem system-ui, sans-serif; letter-spacing: .02em; }
.main-nav { align-self: stretch; display: flex; align-items: stretch; gap: 33px; white-space: nowrap; }
.main-nav a { display: grid; place-items: center; padding: 0 3px; position: relative; font-size: .93rem; color: var(--muted); }
.main-nav a.active { color: var(--green); font-weight: 700; }
.main-nav a.active::after { content: ""; position: absolute; inset: auto 5px 0; height: 3px; border-radius: 3px 3px 0 0; background: #41765b; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
#account { min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; border: 1px solid transparent; border-radius: 12px; padding: 0 16px; color: inherit; white-space: nowrap; font-weight: 650; font-size: .92rem; line-height: 1.1; transition: background .16s, border-color .16s, transform .16s; }
.btn-primary { color: white; background: var(--green); border-color: var(--green); }
.btn-primary:hover:not(:disabled) { background: var(--deep); }
.btn-outline { border-color: #cfdbcf; background: #f9fcf7; color: #245441; }
.btn-outline:hover:not(:disabled) { border-color: #7da289; background: #eef6ed; }
.btn-gold { color: #3b311b; background: var(--gold); border-color: #edc26f; box-shadow: inset 0 -3px 0 #edc26f; }
.btn-gold:hover:not(:disabled) { background: #ffe3a7; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-plain { background: transparent; color: var(--muted); padding-inline: 8px; }
.btn-plain:hover { color: var(--ink); background: #eceee5; }
.btn-small { min-height: 34px; padding-inline: 10px; font-size: .83rem; }
.icon-btn { background: transparent; border: 1px solid var(--line); color: var(--green); display: grid; place-items: center; padding: 0; width: 40px; height: 40px; border-radius: 8px; flex: none; }
.icon-btn:hover { background: #edf2e8; }
.btn-account { max-width: 180px; background: #f0f2e9; padding: 3px 10px 3px 4px; min-width: 0; }
.btn-account > span:last-child { overflow: hidden; text-overflow: ellipsis; }

.layout { max-width: 1264px; margin: auto; padding: 34px 32px 60px; }
.hero { min-height: 363px; position: relative; isolation: isolate; border-radius: 24px; overflow: hidden; background: #d7e6d6 url('/assets/hero-v2.jpg') center right / cover no-repeat; color: #193c2f; display: flex; align-items: center; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #e1eee160 0%, #dceddd2b 41%, transparent 62%); }
.hero-copy { padding: 34px 52px 40px; }
.hero-kicker { display: flex; align-items: center; gap: 9px; font-size: .88rem; font-weight: 800; letter-spacing: .13em; color: #355642; }
.hero-kicker span { width: 15px; height: 15px; background: #f8d481; border-radius: 5px; transform: rotate(-15deg); box-shadow: inset 0 -3px 0 #dfa853; }
.hero h1 { font-size: clamp(2.65rem, 5vw, 4.15rem); letter-spacing: .01em; line-height: 1.12; font-weight: 820; margin: 14px 0 16px; }
.hero-copy > p { color: #335244; line-height: 1.65; max-width: 405px; }
.hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 23px; }
.hero-actions .btn { min-height: 45px; padding-inline: 17px; }
.hero-secondary { color: #254b39; border-color: #b5ccba; background: #f2faf2ad; }
.hero-secondary:hover { background: #f6fff5; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) 298px; gap: 24px; margin-top: 33px; }
.section-heading { min-height: 71px; display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 4px; }
.section-heading h2 { font: 800 1.55rem var(--serif); letter-spacing: .045em; }
.section-heading p { margin-top: 7px; font-size: .875rem; color: var(--muted); }
.filter-group { display: flex; border: 1px solid #e8e9df; border-radius: 9px; gap: 3px; padding: 3px; background: #edeee6; }
.filter { border-radius: 6px; font-size: .85rem; white-space: nowrap; border: 1px solid transparent; background: transparent; color: #585e51; padding: 7px 10px; }
.filter.chosen { background: var(--card); border-color: #e1e6dc; font-weight: 700; color: #25513e; }
.filter:hover:not(.chosen) { background: #e1e8dd; }
.room-list { background: var(--card); border: 1px solid var(--line); border-radius: 17px; overflow: hidden; }
.list-header, .room-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(120px, 1.3fr) 79px 82px; gap: 10px; align-items: center; padding: 13px 18px; }
.list-header { border-bottom: 1px solid var(--line); color: #596659; font-size: .83rem; background: #f3f5ed; }
.room-row + .room-row { border-top: 1px solid var(--line); }
.room-name, .room-status { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.room-name strong { overflow-wrap: anywhere; font-size: .96rem; }
.room-lock { display: inline-flex; vertical-align: middle; margin-right: 4px; color: #775412; }
.room-lock svg { width: .9rem; height: .9rem; }
.room-name small, .room-status small { color: var(--muted); font-size: .77rem; }
.list-players { display: flex; align-items: center; gap: 5px 8px; min-width: 0; flex-wrap: wrap; }
.list-player { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; color: #425549; font-size: .83rem; }
.list-player span:last-child { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; max-width: 8.5rem; }
.status { display: inline-flex; gap: 5px; align-items: center; width: max-content; border-radius: 20px; padding: 3px 8px; color: #486751; background: #e5ecde; font-size: .77rem; font-weight: 650; white-space: nowrap; }
.status::before { content: ""; background: currentColor; width: 6px; height: 6px; border-radius: 50%; }
.status.playing, .status.between { color: #805615; background: #f7ecd0; }
.status.finished { color: #5e655d; background: #eeeeea; }
.empty { display: grid; justify-items: center; align-content: center; min-height: 247px; padding: 20px; text-align: center; }
.empty h3 { font-size: 1.08rem; }
.empty p { color: var(--muted); font-size: .9rem; margin: 7px 0 13px; line-height: 1.5; }
.empty .btn { min-height: 35px; padding-inline: 10px; font-size: .85rem; }
.empty-symbol { display: flex; margin: 0 0 10px; }
.empty-symbol span { display: grid; place-items: center; width: 34px; height: 43px; color: #41654f; background: #f8f3e4; border: 1px solid #c4d5c3; padding-bottom: 6px; border-radius: 8px; box-shadow: inset 0 -5px 0 #c5dcc1; font: 700 1.2rem var(--serif); transform: rotate(-12deg) translate(2px, 3px); }
.empty-symbol span:last-child { color: #aa5a48; transform: rotate(11deg) translate(-1px, 0px); }
.mode-card { display: flex; align-items: center; padding: 15px 13px; gap: 13px; background: #eef4e8; border: 1px solid #dce5d8; border-radius: 16px; margin-bottom: 11px; min-height: 87px; transition: border-color .15s; }
.mode-card.hangzhou { background: #f7f1e3; border-color: #ece1cb; }
.mode-card:hover, .mode-card.selected { border-color: #769480; }
.mode-card.hangzhou:hover, .mode-card.hangzhou.selected { border-color: #b6985f; }
.mode-tile { flex: none; border: 1px solid #b3c7b9; box-shadow: inset 0 -4px 0 #ceddce; background: #fbfcf3; color: #3d664d; border-radius: 7px; width: 42px; height: 50px; display: grid; place-items: center; padding-bottom: 4px; font: 800 1.48rem var(--serif); }
.hangzhou .mode-tile { border-color: #e0caa2; background: #fffbeb; color: #8e6639; box-shadow: inset 0 -4px 0 #eaddc6; }
.mode-card strong, .mode-card small { display: block; }
.mode-card strong { font-size: 1rem; }
.mode-card small { margin-top: 5px; font-size: .85rem; color: #5d6758; }
.mode-card > svg { margin-left: auto; color: #60765f; }
.hangzhou > svg { color: #96754a; }

.site-footer { max-width: 1200px; margin: 0 auto; padding: 17px 0 22px; border-top: 1px solid #e4e4d8; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: .82rem; }
.footer-divider { display: inline-block; vertical-align: middle; width: 10px; height: 1px; background: #9ca397; margin: 0 4px; }
.network { z-index: 3; position: fixed; right: max(17px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; min-width: 74px; justify-content: center; color: #6f7c79; font: 700 .8rem ui-monospace, monospace; border: 1px solid #394b41; background: #1a2e25f5; border-radius: 7px; padding: 7px 9px; box-shadow: 0 3px 10px #182e2120; }
.network[data-signal="4"] { color: #92ecac; }
.network[data-signal="3"] { color: #d9e69a; }
.network[data-signal="2"] { color: #ffd578; }
.network[data-signal="1"], .network[data-signal="0"] { color: #ff967f; }
.signal { display: flex; gap: 2px; align-items: flex-end; height: 13px; }
.signal i { width: 3px; background: #748378; border-radius: 1px; }
.signal i:nth-child(1) { height: 4px; }.signal i:nth-child(2) { height: 7px; }.signal i:nth-child(3) { height: 10px; }.signal i:nth-child(4) { height: 13px; }
[data-signal="4"] .signal i, [data-signal="3"] .signal i:nth-child(-n+3), [data-signal="2"] .signal i:nth-child(-n+2), [data-signal="1"] .signal i:first-child { background: currentColor; }

.page-intro { margin-bottom: 28px; background: #e7eee3; border: 1px solid #dce5d7; border-radius: 15px; padding: 28px 32px; }
.page-mark { color: #3d684e; }
.page-intro h1, .room-heading h1 { font: 800 clamp(2rem, 4.2vw, 3.1rem) var(--serif); margin: 5px 0 9px; overflow-wrap: anywhere; }
.page-intro p, .room-heading p { color: var(--muted); line-height: 1.5; }
.rules-layout { display: grid; grid-template-columns: 255px minmax(0, 1fr); gap: 23px; }
.rule-sheet { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: clamp(20px, 5vw, 41px); line-height: 1.8; }
.rule-sheet h2 { font: 800 2rem var(--serif); }
.rule-sheet h3 { font-size: 1.15rem; margin: 26px 0 6px; }
.rule-sheet p + p, .rule-sheet li + li { margin-top: 8px; }
.rule-lead { margin-top: 7px; color: var(--green); font-weight: 600; }
.rule-sheet ul { padding-left: 23px; margin: 6px 0 0; }
.rule-table { background: #f5f6ef; border: 1px solid var(--line); border-radius: 8px; margin: 11px 0; overflow: hidden; }
.rule-table > div { display: grid; grid-template-columns: 65px minmax(0, 1fr) 75px; gap: 7px; padding: 7px 12px; }
.rule-table > div + div { border-top: 1px solid var(--line); }
.rule-sources { margin-top: 25px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: .89rem; }
.rule-sources a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }

.avatar { flex: none; display: inline-grid; place-items: center; border-radius: 34%; width: 46px; height: 46px; vertical-align: middle; object-fit: cover; overflow: hidden; background-color: #e4ecdb; }
.avatar.portrait { background-image: url('/assets/avatars.jpg'); background-size: 500% 200%; background-position: var(--ax) var(--ay); }
.avatar.placeholder { background: #e7eee2; color: #687c67; border: 1px dashed #bdcbb9; }
.avatar.xs { width: 25px; height: 25px; }
.avatar.sm { width: 34px; height: 34px; }
.avatar.lg { width: 57px; height: 57px; }
.avatar.lg svg { width: 25px; height: 25px; }
.room-heading { display: flex; justify-content: space-between; align-items: end; gap: 17px; margin-bottom: 20px; }
.room-heading > div:first-child { min-width: 0; }
.room-heading p span { margin-inline: 2px; }
.back-link { color: var(--green); text-decoration: underline; text-underline-offset: 3px; font-size: .88rem; }
.room-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.waiting-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: clamp(21px, 6vw, 45px); text-align: center; }
.waiting-intro h2 { font: 800 2.15rem var(--serif); margin: 10px 0; }
.waiting-intro p { color: var(--muted); }
.waiting-seats { margin: 29px auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; max-width: 760px; }
.seat-card { border: 1px solid #dce6d9; background: #eef3ea; border-radius: 11px; min-height: 137px; display: grid; justify-items: center; align-content: center; gap: 7px; padding: 9px; }
.seat-card.vacant { border-style: dashed; background: #f5f5ee; }
.seat-text { min-width: 0; overflow-wrap: anywhere; }
.seat-text small { display: block; color: var(--muted); margin-top: 3px; }
.waiting-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }

.in-room { padding-top: 24px; }
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) 268px; align-items: stretch; gap: 16px; }
.table { min-width: 0; background: #184333; border: 1px solid #215140; padding: 8px; border-radius: 14px; color: #faf2d9; box-shadow: 0 6px 14px #19372823; }
.table-inner { display: grid; grid-template-columns: 145px minmax(0, 1fr) 145px; grid-template-rows: 48px minmax(46px, auto) minmax(112px, auto) minmax(46px, auto) 48px; padding: 13px; gap: 6px; min-height: 352px; background: radial-gradient(ellipse at 50% 50%, #316b50, #224e3d); border-radius: 10px; border: 1px solid #73937a6b; }
.table-seat { display: flex; gap: 6px; align-items: center; background: #18382fd1; border: 1px solid #416853; border-radius: 8px; padding: 4px 6px; min-width: 0; width: 100%; max-width: 195px; }
.table-seat > div { min-width: 0; flex: 1; }
.table-seat strong, .table-seat small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-seat strong { font-size: .83rem; }
.table-seat small { color: #c2d0bf; font-size: .72rem; margin-top: 2px; }
.table-seat .points { color: #ffdc8d; font-variant-numeric: tabular-nums; font-size: .92rem; }
.table-seat.turn { border-color: #e0b967; box-shadow: 0 0 0 1px #e0b96651; }
.pos-top { grid-area: 1 / 2; justify-self: center; }
.pos-bottom { grid-area: 5 / 2; justify-self: center; }
.pos-left { grid-area: 2 / 1; align-self: start; }
.pos-right { grid-area: 2 / 3; align-self: start; }
.river { display: flex; gap: 2px; justify-content: center; align-content: center; flex-wrap: wrap; min-width: 0; align-self: center; }
.river-top { grid-area: 2 / 2; }.river-bottom { grid-area: 4 / 2; }.river-left { grid-area: 3 / 1; }.river-right { grid-area: 3 / 3; }
.river .tile { --tw: 22px; }
.river .recent { outline: 2px solid #edca7f; }
.table-center { min-width: 0; grid-area: 3 / 2; display: grid; align-content: center; justify-items: center; gap: 5px; text-align: center; }
.table-center .remaining, .table-center small { color: #d8e5d8; font-size: .83rem; }
.turn-text { color: #ffde9e; font-size: .98rem; overflow-wrap: anywhere; }
.center-tile .tile { --tw: 32px; }
.center-brand { display: grid; place-items: center; color: #e8d3a2; background: #203f35; width: 32px; height: 42px; border: 1px solid #7b977a; border-radius: 5px; font: 700 1.2rem var(--serif); }
.open-melds { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; align-content: center; }
.open-melds .tile { --tw: 15px; }
.meld-top { grid-area: 1 / 3; }.meld-left { grid-area: 4 / 1; }.meld-right { grid-area: 4 / 3; }
.meld { display: inline-flex; gap: 1px; flex: none; }
.hand-area { padding: 8px 6px 11px; min-width: 0; }
.move-bar, .own-melds, .hand { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; }
.move-bar { min-height: 22px; padding-bottom: 4px; }
.move-bar .btn { min-height: 34px; padding-inline: 11px; font-size: .85rem; }
.move-btn { background: #e1ebd9; color: #183c2c; }
.move-btn:hover { background: #fbffe8; }
.own-melds:not(:empty) { margin: 3px 0 6px; }
.own-melds .tile { --tw: 24px; }
.hand { flex-wrap: nowrap; gap: clamp(1px, .35vw, 4px); }
.tile-holder, .tile-btn { display: grid; place-items: center; min-width: 0; flex: 0 1 46px; padding: 0; background: none; border: 0; }
.hand .tile { --tw: 100%; font-size: clamp(.52rem, 1.28vw, 1.06rem); }
.fresh { margin-left: clamp(3px, 1vw, 11px); }
.tile-btn { transition: transform .15s; }
.tile-btn:hover, .tile-btn:focus-visible { transform: translateY(-5px); }
.tile-btn:focus-visible { outline-color: #f5d28b; }
.tile { --tw: 34px; width: var(--tw); aspect-ratio: .74; border-radius: 14%; border: 1px solid #dcca9f; background: linear-gradient(#fffdf2, #f6edd7); color: #283b31; box-shadow: inset 0 -3px 0 #b2c29b; font: 700 .78rem / 1 var(--serif); display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 1px; padding: 1px 1px 3px; flex: none; vertical-align: middle; }
.tile.wan i { font: 700 .72em / 1 var(--serif); color: #9b302a; }
.tile.red-letter { color: #a92c2a; }.tile.green-letter { color: #166439; }
.tile-back { background: #70946a; border-color: #899f76; box-shadow: inset 0 -3px 0 #436f53; }
.white-frame { width: 53%; height: 53%; border: 1.5px solid #375582; border-radius: 12%; }
.pips { width: 72%; height: 73%; display: grid; place-content: center; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); align-items: center; justify-items: center; margin: 0 auto; gap: 1px; }
.pips i { width: 72%; aspect-ratio: 1; border-radius: 50%; background: #2b6950; }
.dots .pips i { box-shadow: inset 0 0 0 1px #284631; background: #5d926a; }
.pips i.red-pip { background: #b74839; }
.bamboo .pips i { border-radius: 30%; aspect-ratio: .5; }
.pip-1 { display: flex; align-items: center; justify-content: center; }.pip-1 i { width: 47%; }
.pip-2, .pip-4, .pip-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.river .tile, .open-melds .tile { font-size: .68rem; }
.chat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-width: 0; padding: 13px; }
.chat h2 { display: flex; align-items: center; gap: 7px; font-size: 1rem; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.chat h2 svg { color: var(--green); }
.chat-log { overflow-y: auto; height: 132px; padding: 9px 0; }
.chat-empty { color: var(--muted); font-size: .87rem; margin-top: 7px; }
.chat-line { display: flex; gap: 6px; margin-bottom: 9px; line-height: 1.3; overflow-wrap: anywhere; }
.chat-line strong { font-size: .77rem; color: var(--muted); }
.chat-line p { margin-top: 2px; font-size: .86rem; color: var(--ink); }
.quick-heading { border-top: 1px solid var(--line); padding: 9px 0 6px; font-weight: 700; font-size: .83rem; }
.quick-list { display: grid; grid-template-columns: 1fr; gap: 4px; }
.quick-list button { font-size: .8rem; text-align: left; padding: 5px 7px; min-height: 26px; border-radius: 5px; color: #315343; background: #edf2e8; border: 1px solid #e4ece0; }
.quick-list button:hover { border-color: #9eb399; background: #e2eddb; }

dialog { width: min(460px, calc(100% - 28px)); padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 12px 55px #17281fa1; max-height: calc(100dvh - 26px); }
dialog::backdrop { background: #192c21a3; }
dialog.profile-dialog, dialog.result-dialog { width: min(525px, calc(100% - 28px)); }
.dialog-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 15px; }
.dialog-head h2 { font: 800 1.6rem var(--serif); }
.dialog-head .icon-btn { width: 34px; height: 34px; }
dialog p { color: var(--muted); line-height: 1.6; margin: 0 0 12px; }
dialog label, fieldset { display: grid; gap: 6px; margin-bottom: 14px; font-size: .92rem; font-weight: 650; }
dialog fieldset { border: 0; padding: 0; min-width: 0; }
dialog legend { margin-bottom: 6px; padding: 0; }
dialog input:not([type="radio"]):not([type="file"]):not([type="checkbox"]) { width: 100%; height: 43px; border: 1px solid #d6ded0; padding: 8px 11px; border-radius: 9px; background: #fcfcf7; color: var(--ink); }
dialog label > small { color: var(--muted); font-size: .78rem; font-weight: 400; line-height: 1.45; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 16px; }
.auth-note { font-size: .8rem; }
.profile-account { font-size: .87rem; }
.round-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 13px; }
dialog .inline-check { display: flex; gap: 5px; align-items: center; font-weight: 550; }
.form-choices { display: flex; gap: 7px; }
.choice { position: relative; flex: 1; margin: 0; cursor: pointer; min-width: 0; }
.choice input { position: absolute; opacity: 0; }
.choice span { min-height: 52px; padding: 8px; display: grid; align-content: center; border: 1px solid var(--line); background: #f6f7f0; border-radius: 7px; }
.choice span small { color: var(--muted); margin-top: 3px; font-weight: 400; font-size: .78rem; }
.choice input:checked + span { border-color: #6f9b7d; background: #e8f1e6; color: #214c39; }
.choice input:focus-visible + span { outline: 2px solid #a16d23; outline-offset: 2px; }
.round-choices .choice span { text-align: center; min-height: 38px; }
.form-error { color: #aa3f2c; font-size: .87rem; margin: 5px 0 10px; }
.form-error:empty { display: none; }
.full { width: 100%; }
.profile-current { margin: -3px 0 12px; }
.avatar-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.portrait-option { border: 1px solid var(--line); background: #fcfcf7; border-radius: 8px; padding: 5px 2px; display: grid; justify-items: center; gap: 3px; min-width: 0; font-size: .72rem; color: var(--ink); }
.portrait-option .avatar { width: 100%; max-width: 44px; aspect-ratio: 1; height: auto; }
.portrait-option.chosen { border-color: #739980; background: #e7f1e5; }
dialog label.upload { display: flex; width: max-content; align-items: center; gap: 7px; padding: 8px 10px; background: #edf2e8; border: 1px solid #dce7d9; border-radius: 7px; cursor: pointer; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload:focus-within { outline: 2px solid #a16d23; }
.form-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.result-intro .status { margin-bottom: 8px; }
.result-intro p { color: var(--green); font-weight: 700; overflow-wrap: anywhere; }
.result-hand { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 12px; }
.result-hand .tile { --tw: 23px; }
.score-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.score-header, .score-row { display: grid; grid-template-columns: minmax(0, 1fr) 75px 65px; gap: 7px; padding: 7px 11px; align-items: center; }
.score-header { background: #edf1e7; font-size: .85rem; font-weight: 700; }
.score-row { border-top: 1px solid var(--line); font-size: .91rem; }
.score-row > span { display: flex; gap: 6px; align-items: center; overflow-wrap: anywhere; }
.score-row .positive { color: var(--green); }
#toast { position: fixed; z-index: 5; left: 50%; bottom: 55px; max-width: calc(100% - 25px); transform: translate(-50%, 10px); opacity: 0; pointer-events: none; background: #192f24; color: #fffdfa; padding: 9px 14px; border-radius: 8px; transition: opacity .16s, transform .16s; font-size: .92rem; }
#toast.shown { transform: translate(-50%, 0); opacity: 1; }

.admin-intro { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.admin-tabs a { border: 1px solid #dbe7d9; background: #f1f6ed; border-radius: 11px; color: var(--green); padding: 9px 12px; font-weight: 650; font-size: .9rem; }
.admin-tabs a.selected { border-color: var(--green); background: var(--green); color: white; }
.admin-pane { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.admin-pane-head { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 18px; }
.admin-pane h2 { font-size: 1.2rem; }
.admin-pane-head p, .admin-pagination, .admin-empty { font-size: .87rem; color: var(--muted); }
.admin-pane-head p { margin-top: 4px; line-height: 1.4; }
.admin-empty { padding: 21px; border-top: 1px solid var(--line); }
.audit-scroll { overflow-x: auto; }
.audit-table { border-collapse: collapse; width: 100%; text-align: left; font-size: .87rem; }
.audit-table th, .audit-table td { border-top: 1px solid var(--line); padding: 10px 12px; white-space: nowrap; }
.audit-table th { background: #f0f5eb; color: #3c5d4a; }
.audit-table td { min-width: 78px; max-width: 290px; white-space: normal; overflow-wrap: anywhere; }
.admin-actions { display: flex; align-items: center; gap: 4px; }
.admin-remove { color: #a14237; background: #fff6f0; border-color: #efe1d8; }
.admin-remove:hover, .btn-danger:hover { background: #fce7dc; color: #862e24; }
.btn-danger { background: #9b3930; color: white; }
.admin-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.admin-pagination span { margin-right: auto; }

@media (max-width: 1264px) { .site-footer { margin-inline: 32px; padding-right: 73px; } }
@media (max-width: 950px) {
  .lobby-grid { grid-template-columns: minmax(0, 1fr) 235px; gap: 14px; }
  .list-header, .room-row { padding-inline: 10px; grid-template-columns: minmax(78px, 1fr) minmax(75px, 1fr) 65px 70px; gap: 5px; }
  .list-player span:last-child { max-width: 6rem; }
  .play-layout { grid-template-columns: minmax(0, 1fr) 226px; gap: 10px; }
  .table-inner { grid-template-columns: minmax(99px, 1fr) minmax(83px, 1.4fr) minmax(99px, 1fr); padding: 8px; }
  .river .tile { --tw: 18px; }
}
@media (max-width: 740px) {
  .top-inner { padding: 0 12px; gap: 9px; min-height: 61px; }
  .brand-text small { display: none; }
  .brand { gap: 6px; }.brand-icon { width: 30px; height: 33px; font-size: 1.2rem; }.brand-text { font-size: 1.2rem; }
  .main-nav { gap: 12px; }.main-nav a { font-size: .83rem; padding: 0; }
  .top-actions { gap: 5px; }
  .top-actions .icon-btn { width: 33px; height: 34px; }.top-actions .icon-btn svg { width: 15px; }
  .top-actions .btn { min-height: 34px; font-size: .79rem; padding: 3px 7px; }.top-actions .btn-account .avatar { width: 25px; height: 25px; }
  .layout { padding: 19px 12px 44px; }
  .hero { min-height: 355px; background-size: auto 205px; background-position: right -1px bottom -3px; align-items: start; }
  .hero::before { background: linear-gradient(180deg, #d7e6d6 0%, #d7e6d6 45%, #d7e6d600 65%); }
  .hero-copy { padding: 24px 21px 166px; }.hero-copy > p { max-width: 312px; font-size: .9rem; }
  .hero h1 { font-size: 2.35rem; }.hero-actions { margin-top: 13px; }.hero-actions .btn { min-height: 39px; }
  .lobby-grid { display: block; margin-top: 19px; }
  .section-heading h2 { font-size: 1.36rem; }
  .variants { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
  .variants .section-heading { grid-column: span 2; }
  .mode-card { padding: 11px 8px; gap: 6px; min-height: 69px; }.mode-card small { font-size: .78rem; }.mode-card > svg { display: none; }
  .mode-tile { width: 34px; height: 42px; font-size: 1.2rem; }
  .site-footer { margin-inline: 12px; min-height: 76px; flex-wrap: wrap; gap: 5px; align-content: start; }
  .rules-layout { display: block; }.rules-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }.page-intro { margin-bottom: 13px; padding: 17px; }
  .room-heading { flex-direction: column; align-items: start; gap: 10px; }.room-tools .btn { min-height: 35px; padding-inline: 9px; }
  .waiting-seats { grid-template-columns: 1fr 1fr; }
  .play-layout { grid-template-columns: minmax(0, 1fr); }.chat-log { height: 115px; }.quick-list { grid-template-columns: 1fr 1fr; }
  .hand .tile { font-size: clamp(.65rem, 2.5vw, 1rem); }.table-inner { min-height: 328px; }
}
@media (max-width: 430px) {
  .top-inner { padding-inline: 8px; gap: 5px; }
  .top-actions .btn-account { padding: 3px; }.top-actions .btn-account > span:last-child { max-width: 44px; }
  .main-nav { gap: 9px; }
  .hero { min-height: 350px; }.hero-copy { padding: 20px 15px 160px; }
  .filter { padding-inline: 6px; font-size: .8rem; }
  .list-header, .room-row { grid-template-columns: minmax(60px, 1fr) minmax(55px, .9fr) 52px 66px; }
  .room-row .btn { padding-inline: 3px; font-size: .76rem; }
  .list-player span:last-child { max-width: 4.7rem; }.list-player .avatar { width: 20px; height: 20px; }
  .status { padding-inline: 5px; }
  .table { padding: 5px; }.table-inner { grid-template-columns: minmax(76px, 1fr) minmax(75px, 1.14fr) minmax(76px, 1fr); padding: 4px; }
  .table-seat { gap: 3px; padding-inline: 3px; }.table-seat .avatar { width: 24px; height: 24px; }.table-seat strong { font-size: .75rem; }.table-seat small { font-size: .66rem; }
  .hand-area { padding-inline: 1px; }.river .tile { --tw: 15px; }
}
@media (max-width: 359px) { .brand-text { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; } }
