/* Compact mobile game dialogs and named settings categories. */
.settings-tabs{display:flex;gap:5px;margin:8px 0 10px}
.settings-tabs button{flex:1;min-width:0;padding:8px 6px;min-height:36px;font-size:13px;border-radius:8px}
.settings-tabs [aria-selected=true]{background:#c8b07b;color:#14291f;border-color:#e6cd96}
.settings-panel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.settings-panel.settings-inactive{display:none!important}
.settings-panel>button,.settings-panel>.menu-row{width:100%;margin:0!important;min-height:38px;padding:8px 10px;font-size:13px}
.settings-panel .menu-row b{font-size:13px!important}.settings-panel .menu-row small{display:none}
.settings-panel>label{display:flex;align-items:center;justify-content:space-between;gap:7px;margin:0!important;padding:7px 9px;border:1px solid #c8b17b26;border-radius:9px;font-size:12px;min-width:0;background:#ffffff04}
.settings-panel select{min-width:0;max-width:65%;font-size:12px;padding:6px 22px 6px 7px;background-position:right 6px center}
.settings-panel input[type=range]{width:65%;min-width:0}.settings-panel input[type=file]{width:65%;min-width:0;font-size:10px}
.settings-panel .room-members{grid-column:1/-1;margin:0}.settings-panel .room-members summary{padding:8px}
.settings-close{width:100%;margin-top:12px!important;min-height:38px}
.settings-dialog>h2{font-size:22px!important;letter-spacing:1px;margin:0!important}
.settings-dialog .settings-note{font-size:11px;line-height:1.4;margin:6px 0}
.categorized-rules>.settings-panel{display:block}.categorized-rules .rules-card{margin:0!important}
.tools{top:calc(12px + env(safe-area-inset-top))!important;right:calc(12px + env(safe-area-inset-right))!important;bottom:auto!important;left:auto!important}
.tools .icon{width:40px!important;height:40px!important;min-height:40px!important}
.lan-header{right:65px!important}
#enable-entrance-music{position:static!important;inset:auto!important;transform:none!important;grid-column:1/-1;z-index:auto}
body>dialog.compact-dialog[open]{position:fixed!important;inset:0!important;margin:auto!important;width:calc(100vw - 40px)!important;max-width:420px!important;height:auto!important;max-height:calc(min(100dvh,var(--ui-height,100dvh)) - 32px)!important;padding:14px!important;overflow:hidden!important;box-sizing:border-box;background:#142d23!important;border-radius:16px;backdrop-filter:none!important}
.compact-dialog .eyebrow{display:none}
.compact-dialog h2,.compact-dialog .rules-heading h2{font-size:18px!important;letter-spacing:1px!important;line-height:1.25;margin:0 0 8px!important}
.compact-dialog p{font-size:12px!important;line-height:1.45;margin:5px 0!important}
.compact-dialog button:not(.icon){min-height:36px!important;padding:7px 10px!important;font-size:12px!important;letter-spacing:0!important;line-height:1.25;white-space:normal;backdrop-filter:none}
.compact-dialog input,.compact-dialog select{font-size:13px!important;min-height:32px}
.compact-dialog label{font-size:12px!important;gap:8px}
.compact-dialog .settings-tabs{margin:6px 0 8px}
.compact-dialog .settings-close{margin-top:10px!important}
.compact-dialog .rules-heading{padding:0!important;margin:0!important}
.compact-dialog #coin-rules-form .rules-card{padding:8px!important}
.compact-dialog #coin-rules-form .rules-card>header{display:none}
.compact-dialog #coin-rules-form label{min-height:34px!important;margin:4px 0!important;font-size:12px!important}
.compact-dialog #coin-rules-form input[type=number]{height:32px;width:56px;padding:4px;font-size:14px!important}
.compact-dialog input[type=checkbox]{width:18px!important;height:18px!important;min-height:18px}
.compact-dialog .rules-footer{position:static;display:flex;gap:7px;padding:8px 0 0!important;margin:0!important;background:transparent}
.compact-dialog .rules-footer button{width:auto!important;flex:1;font-size:12px!important}
.compact-dialog .rules-extra-grid{grid-template-columns:1fr;gap:0}
.compact-dialog .rule-mode{font-size:12px;margin:0 0 6px!important;gap:6px}
.compact-dialog .rule-mode-options{display:flex;flex:1;min-width:0;padding:3px}
.compact-dialog .rule-mode-options button{flex:1;padding:6px!important;min-width:0;font-size:11px!important}
.compact-dialog #animal-list{grid-template-columns:repeat(3,minmax(0,1fr));margin:10px 0;gap:6px}
.compact-dialog .animal-choice{padding:8px 4px!important;gap:5px}.compact-dialog .animal-choice img{width:36px;height:36px}.compact-dialog .animal-choice b{font-size:12px}
.compact-dialog #character-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.compact-dialog .character-card{min-width:0;min-height:62px;padding:7px;gap:5px}.compact-dialog .character-card img{width:28px;height:28px}.compact-dialog .character-card>div{min-width:0}
.compact-dialog .character-card b{font-size:12px}.compact-dialog .character-card p,.compact-dialog .character-card small{display:none}.compact-dialog .character-card input{width:16px!important;flex-shrink:0}
.compact-dialog #confirm-animal,.compact-dialog #apply-players{margin-top:8px}
.compact-dialog .chat-header{padding:0 0 7px!important}.compact-dialog #chat-log{max-height:180px;overflow:hidden}
.compact-dialog #qr{width:100px!important;height:100px!important;margin:8px auto!important}
.compact-dialog .roster-seat{padding:7px;border-radius:10px}.compact-dialog #roster{gap:6px;margin:8px 0}.compact-dialog .roster-seat img{width:26px;height:26px}.compact-dialog .roster-seat b{font-size:12px}.compact-dialog .roster-seat span{font-size:10px}
.compact-dialog #winner-hand-tiles img{max-height:36px;width:auto}.compact-dialog #winner-hand-panel{padding:8px}
.compact-dialog #coin-ledger{display:grid;grid-template-columns:1fr 1fr;gap:5px}.compact-dialog .coin-row{margin:4px 0;gap:5px}
.compact-dialog .entry-tabs{display:flex;margin:8px 0;gap:6px}.compact-dialog .entry-tabs button{flex:1}
.compact-dialog .lan-profile,.compact-dialog .lan-entry-card{padding:8px}.compact-dialog #entry-title{margin-bottom:6px}
.compact-dialog .lan-avatar-choice{gap:8px;margin-top:5px}.compact-dialog #avatar-preview{width:32px;height:32px}
.compact-dialog .lan-avatar-choice small,.compact-dialog .lan-entry-card>b,.compact-dialog .lan-entry-card>p{display:none}
.compact-dialog .lan-avatar-choice>div{display:flex;flex-direction:row;gap:5px;flex:1;min-width:0}
.compact-dialog .lan-avatar-choice button{font-size:10px!important}.compact-dialog #entry .lan-field{margin:5px 0!important}
.compact-dialog .entry-actions{display:block;margin:0}.compact-dialog #entry[data-entry-mode=create] .lan-entry-card:has(#join),.compact-dialog #entry[data-entry-mode=join] .lan-entry-card:has(#create){display:none}
.compact-dialog .lan-return{font-size:11px;margin-top:8px}
.compact-dialog .settings-panel:has(#entry-menu)>#entry-menu{display:block}
@media(max-height:500px){body>dialog.compact-dialog[open]{max-width:560px!important;padding:12px 16px!important;max-height:calc(min(100dvh,var(--ui-height,100dvh)) - 24px)!important}.compact-dialog .settings-panel{grid-template-columns:repeat(2,minmax(0,1fr))}.compact-dialog #character-list,.compact-dialog #animal-list{grid-template-columns:repeat(3,minmax(0,1fr))}.compact-dialog .rules-extra-grid{grid-template-columns:1fr 1fr;gap:0 10px}.compact-dialog .rules-toggles{grid-template-columns:1fr 1fr}.compact-dialog .categorized-rules>.settings-panel{display:block}.compact-dialog #entry{max-width:480px}.compact-dialog .lan-avatar-choice{display:none}.compact-dialog #qr{width:88px!important;height:88px!important}.compact-dialog .entry-actions .lan-field{display:inline-flex!important;width:49%;box-sizing:border-box}.compact-dialog #chat-log{max-height:120px}.compact-dialog .settings-note{display:none}}
body>dialog.compact-dialog[open]{inset:auto!important;top:calc(min(100dvh,var(--ui-height,100dvh))/2)!important;left:50%!important;transform:translate(-50%,-50%)!important;display:block!important;margin:0!important;height:fit-content!important;min-height:0!important}
#entry.compact-dialog .lan-field{margin:3px 0!important;min-height:32px;padding:0;font-size:12px}
#entry.compact-dialog>p{font-size:11px!important;margin:3px 0!important}
#entry.compact-dialog .lan-entry-card .primary{margin-top:6px!important}
#entry.compact-dialog .avatar-upload{margin:0!important;font-size:11px!important;padding:6px!important}
#entry.compact-dialog[data-entry-mode=create] .lan-entry-card:has(#join),#entry.compact-dialog[data-entry-mode=join] .lan-entry-card:has(#create){display:none}
#entry.compact-dialog .lan-field{flex-direction:row!important;align-items:center!important;justify-content:space-between!important}
#entry.compact-dialog .lan-field input,#entry.compact-dialog .lan-field select{height:32px!important;min-height:32px!important;padding:5px 8px!important;width:65%;min-width:0}
@media(max-height:500px){#entry.compact-dialog[data-entry-mode=join] .lan-entry-card:has(#join){display:grid;grid-template-columns:1fr 1fr;gap:6px}#entry.compact-dialog[data-entry-mode=join] .lan-entry-card .lan-field{width:100%!important}#entry.compact-dialog #join{grid-column:1/-1}.compact-dialog .lan-profile{padding:5px!important}.compact-dialog .lan-return{padding:4px;margin-top:4px}}
@media(max-height:500px){#invite-dialog.compact-dialog[open]{display:grid!important;grid-template-columns:minmax(0,1fr) 110px;gap:6px 14px}#invite-dialog.compact-dialog>h2,#invite-dialog.compact-dialog>p,#invite-dialog.compact-dialog>#invite-close{grid-column:1/-1}#invite-dialog.compact-dialog>#qr{grid-column:2;grid-row:3/span 3;margin:auto!important}#invite-dialog.compact-dialog>label,#invite-dialog.compact-dialog>#invite-link,#invite-dialog.compact-dialog>#copy-link{grid-column:1;margin:0!important}#invite-dialog.compact-dialog>label{display:flex;align-items:center;font-size:11px!important;gap:6px}#invite-dialog.compact-dialog select{min-width:0;width:70%;padding:6px;font-size:11px!important}#invite-dialog.compact-dialog>#invite-close{margin:0!important}}
@media(max-height:500px){.settings-dialog.compact-dialog .settings-panel{grid-template-columns:repeat(3,minmax(0,1fr))}.compact-dialog .rules-card:has(.rule-mode){display:grid;grid-template-columns:1fr 1fr;gap:0 12px}.compact-dialog .rules-card>.rule-mode{grid-column:1/-1}}
[hidden]{display:none!important}
.table-speech .operation-label,.table-speech .operation-label-chat{font-size:10px!important;line-height:1.4}
.opponent .speech .operation-label,.opponent .speech .operation-label-chat{font-size:6px!important}
#announcement{font-size:6px!important}
#coin-rules-dialog .rules-card{border:0!important;background:transparent!important;box-shadow:none!important;border-radius:0!important;padding:0!important}
#coin-rules-dialog label{border:0!important;background:transparent!important;box-shadow:none!important;border-radius:0!important;padding:0!important}
body>dialog#coin-rules-dialog.compact-dialog[open]{height:min(360px,calc(min(100dvh,var(--ui-height,100dvh)) - 32px))!important;display:flex!important;flex-direction:column;gap:10px;padding:14px!important}
#coin-rules-dialog .rules-heading{display:none!important}
#coin-rules-dialog .categorized-rules{display:contents}
#coin-rules-dialog .settings-tabs{margin:0 0 6px;border-bottom:1px solid #c8b17b26;gap:16px}
#coin-rules-dialog .settings-tabs button{background:transparent;border:0;border-bottom:2px solid transparent;border-radius:0;color:#a9bdb0;box-shadow:none}
#coin-rules-dialog .settings-tabs [aria-selected=true]{color:#f2d492;border-bottom-color:#d8b974}
#coin-rules-dialog .settings-panel{flex:1;min-height:0;display:block}
#coin-rules-dialog .settings-panel.settings-inactive{display:none!important}
#coin-rules-dialog .rules-footer{margin-top:auto!important;flex-shrink:0}
#coin-rules-dialog .basic-rules .rules-toggles{display:grid;grid-template-columns:1fr 1fr;gap:4px 8px}
#coin-rules-dialog .basic-rules .rule-mode{grid-column:1/-1;display:flex;align-items:center;margin:4px 0!important}
#coin-rules-dialog .basic-rules #flip-rules-card{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:6px!important}
#coin-rules-dialog .basic-rules #flip-rules-card[hidden]{display:none!important}
#animal-dialog.compact-dialog #animal-list{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:4px 0 12px}
#animal-dialog.compact-dialog .animal-choice{padding:9px 3px!important;min-height:76px;gap:6px}
#animal-dialog.compact-dialog .animal-choice img{width:36px;height:36px}
#animal-dialog.compact-dialog .animal-choice b{font-size:11px}
@media(max-height:500px){body>dialog#coin-rules-dialog.compact-dialog[open]{height:min(300px,calc(min(100dvh,var(--ui-height,100dvh)) - 24px))!important}#animal-dialog.compact-dialog #animal-list{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:500px) and (min-height:501px){#coin-rules-dialog .basic-rules #flip-rules-card{grid-template-columns:1fr;gap:0}#coin-rules-dialog .basic-rules .rules-toggles>label{gap:5px!important;font-size:11px!important}}
#mode-overlay{position:fixed;inset:0;width:100%;height:100%;border:0;background:#142d23;z-index:100}
.opponent [id^=seat]{display:none}
.opponent .speech{font-size:11px!important;line-height:1.4;max-width:170px;min-width:0;padding:6px 8px!important;border-radius:10px}
.opponent .speech .operation-label,.opponent .speech .operation-label-chat{font-size:11px!important;max-width:150px;line-height:1.4}
.opponent .speech .discard-label,.opponent .speech .last-discard-label{font-size:9px!important}
.opponent .speech .discard-card{width:24px;height:34px}.opponent .speech .discard-card img{width:18px;height:26px}
#announcement{font-size:11px!important;padding:6px 8px!important;border-radius:10px}
#result[open]{display:flex!important;flex-direction:column;gap:7px;height:min(380px,calc(min(100dvh,var(--ui-height,100dvh)) - 24px))!important;padding:12px!important;overflow:hidden!important;animation:none!important}
#result>.settings-tabs{margin:0;gap:7px;flex-shrink:0}
#result>.settings-panel{display:block;flex:1;min-height:0;overflow:hidden}
#result>.settings-panel.settings-inactive{display:none!important}
#result #result-title{margin:0!important;font-size:15px!important;flex-shrink:0}
#result #winner-income{font-size:28px!important}.compact-dialog .winner-inline-avatar{width:28px;height:28px}
#result #settlement-detail{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
#result .payer-card{padding:7px 5px;border-radius:9px;min-width:0}
#result .payer-card header{display:flex;flex-direction:column;gap:4px;margin:0 0 4px;padding:0 0 5px}
#result .payer-card header>b{font-size:11px}#result .payer-card header>span{font-size:10px}#result .payer-card header strong{font-size:18px}
#result .payment-component{display:flex;font-size:10px;line-height:1.2;margin:0;padding:3px 0;gap:3px}
#result #payment-wallet{padding:6px;font-size:11px;gap:6px}#result #payment-wallet-number{font-size:19px}
#result .result-actions{display:flex;gap:7px;flex-shrink:0;margin-top:auto;padding-top:6px;border-top:1px solid #c8b17b26}
#result .result-actions button{flex:1;width:auto!important;margin:0!important;min-height:40px!important;padding:7px!important;font-size:13px!important}
#result #winner-hand-panel{margin:0!important;padding:5px;border-radius:9px}#result #winner-hand-panel header{padding:4px;font-size:10px}#result #winner-hand-panel header span{display:none}
#result #winner-hand-tiles{padding:7px 4px;gap:8px}#result .result-tile{width:18px!important;height:27px!important;padding:1px}#result .result-tile-row{gap:2px}#result .result-tile-group>small{font-size:9px;margin:0 0 4px;letter-spacing:0}
#result .result-melds{padding-top:6px;gap:7px}#result #winner-hand-caption{font-size:10px;margin:3px 0;padding:0}
@media(max-height:500px){#result[open]{height:min(330px,calc(min(100dvh,var(--ui-height,100dvh)) - 24px))!important}.opponent .speech{max-width:150px}}
.tools{flex-direction:row!important;gap:7px!important}.tools .icon[aria-pressed=true]{color:#ffe0a2;background:#43513b;border-color:#d6b878}
.lan-header{right:155px!important}
/* Settings keep one size; navigation and content have distinct visual levels. */
body>dialog.settings-dialog[open]{width:calc(100vw - 40px)!important;max-width:520px!important;height:min(340px,calc(min(100dvh,var(--ui-height,100dvh)) - 32px))!important;max-height:none!important;padding:18px!important;overflow:hidden!important;text-align:left}
.settings-dialog .settings-tabs{padding-right:24px;margin:0 0 18px;gap:14px;border-bottom:1px solid #c8b17b25}
.settings-dialog .settings-tabs button{background:transparent;border:0;border-bottom:2px solid transparent;border-radius:0;box-shadow:none;color:#a9bdb0;min-height:38px!important;font-size:14px!important;padding:6px 2px!important}
.settings-dialog .settings-tabs [aria-selected=true]{color:#f2d492;border-bottom-color:#d8b974;background:transparent}
.settings-dialog .settings-dismiss{position:absolute;right:8px;top:7px;width:28px!important;height:28px;min-height:28px!important;padding:0!important;font-size:22px!important;line-height:1;border:0;background:transparent;box-shadow:none;color:#b8c7bd}
.settings-dialog .settings-panel{grid-template-columns:1fr 1fr!important;gap:9px}
.settings-dialog .game-modes,.settings-dialog .quality-options,.settings-dialog .mode-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;grid-column:1/-1}
.settings-dialog .settings-choice{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;height:68px;min-height:68px!important;width:100%;padding:6px!important;font-size:13px!important;line-height:1.3;background:#203e30;border:1px solid #8ca79040;border-radius:12px}
.settings-dialog .settings-choice small{display:block;font-size:9px;margin:0;color:#aebdaf}
.settings-dialog .settings-choice[aria-pressed=true]{border-color:#d6b878;background:#41533a;color:#ffe0a2}
.settings-dialog .game-secondary{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.settings-dialog .game-secondary button{width:100%;margin:0!important;font-size:12px!important;min-height:36px!important;padding:7px!important}
.settings-dialog .white-noise-row{grid-column:1/-1;min-height:44px;padding:8px 10px;font-size:13px}
.settings-dialog .white-noise-row select{flex:1;max-width:55%;min-width:0}
.settings-dialog .settings-panel>label{font-size:12px!important;min-height:38px}
.settings-dialog .settings-panel:has(#music-volume)>label:last-child{grid-column:1/-1}
.settings-dialog .settings-panel .room-members{grid-column:1/-1}
@media(max-height:500px){body>dialog.settings-dialog[open]{height:min(300px,calc(min(100dvh,var(--ui-height,100dvh)) - 24px))!important;max-width:520px!important;padding:14px 18px!important}.settings-dialog .settings-tabs{margin-bottom:12px}.settings-dialog .settings-choice{height:60px;min-height:60px!important}.settings-dialog .game-secondary{margin-top:8px}}
/* Keep table announcements at half their previous text size. */
.table-speech .operation-label,.table-speech .operation-label-chat{font-size:10px!important;line-height:1.4}
.opponent .speech .operation-label,.opponent .speech .operation-label-chat{font-size:5.5px!important}
#announcement{font-size:5.5px!important}
.table-speech .discard-label,.table-speech .last-discard-label{font-size:5.5px!important}

.settings-dialog #chat-unread{display:none!important}
.settings-dialog #seat-picker{position:static!important;transform:none!important;inset:auto!important;width:100%;grid-column:1/-1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;border:0;background:transparent;padding:0;box-shadow:none}
.settings-dialog #seat-picker>span{grid-column:1/-1;font-size:13px;margin-bottom:8px}
.settings-dialog #seat-picker button{position:static!important;transform:none!important;inset:auto!important;min-height:44px!important;font-size:13px!important;padding:8px!important}
.settings-dialog .settings-panel:has(#seat-picker:not([hidden]))>.game-modes,.settings-dialog .settings-panel:has(#seat-picker:not([hidden]))>.game-secondary{display:none!important}
/* Shared glass-inspired surfaces: blur only the dialog, not each control. */
:root{--ui-ink:#f2f5ed;--ui-muted:#bac8be;--ui-accent:#ead39a;--ui-line:#ffffff26;--ui-glass:linear-gradient(145deg,#426351e8,#132b23f2);--ui-control:linear-gradient(145deg,#ffffff13,#ffffff05)}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif}
body>dialog,body>dialog.compact-dialog[open],body>dialog.settings-dialog[open],body>dialog#result[open]{color:var(--ui-ink);background:var(--ui-glass)!important;border:1px solid var(--ui-line)!important;border-radius:24px!important;box-shadow:inset 0 1px 0 #ffffff28,0 20px 60px #0005!important;backdrop-filter:blur(10px) saturate(115%)!important;-webkit-backdrop-filter:blur(10px) saturate(115%)!important}
body>dialog::backdrop{background:#03100b60!important;backdrop-filter:none!important}
body>dialog button:not(.icon){border-radius:14px;border-color:var(--ui-line);background:var(--ui-control);color:var(--ui-ink);box-shadow:inset 0 1px 0 #ffffff10;transition:background .15s,border-color .15s,opacity .15s}
body>dialog button:not(.icon):active{background:#ffffff26}
body>dialog button:disabled{opacity:.42;box-shadow:none;cursor:default}
body>dialog button.primary{background:linear-gradient(145deg,#ecdba9,#cfb779)!important;color:#23372a!important;border-color:#fff0c066!important;font-weight:600}
body>dialog input:not([type=checkbox]):not([type=range]):not([type=hidden]):not([type=file]),body>dialog select{background-color:#06181065!important;color:var(--ui-ink)!important;border:1px solid #ffffff25!important;border-radius:10px;box-shadow:inset 0 1px 3px #0002}
body>dialog input::placeholder{color:#acbab0}body>dialog select option{background:#1c3528;color:var(--ui-ink)}
body>dialog input[type=checkbox],body>dialog input[type=range]{accent-color:var(--ui-accent)}
body>dialog :is(button,input,select):focus-visible{outline:2px solid var(--ui-accent);outline-offset:3px}
body>dialog .settings-tabs{background:#06181038;border:1px solid #ffffff16;border-radius:13px;padding:3px!important;gap:3px!important}
body>dialog .settings-tabs button{border:0!important;border-radius:10px!important;background:transparent!important;box-shadow:none!important;color:var(--ui-muted);font-weight:500}
body>dialog .settings-tabs button[aria-selected=true]{background:#ffffff1f!important;color:#fff1ce!important;box-shadow:inset 0 1px 0 #ffffff25!important}
.settings-dialog .settings-choice{background:var(--ui-control);border:1px solid var(--ui-line);border-radius:16px;box-shadow:inset 0 1px 0 #ffffff16}
.settings-dialog .settings-choice[aria-pressed=true]{background:#cfb77924;border-color:#ecdba978;color:#fff0c2}
.settings-dialog .settings-panel>label{background:transparent;border:0;border-bottom:1px solid #ffffff12;border-radius:0}
body>dialog :is(.animal-choice,.character-card,.payer-card,#winner-hand-panel,.roster-seat){background:#ffffff08;border-color:#ffffff20;box-shadow:none}
body>dialog :is(.animal-choice,.character-card)[aria-pressed=true],body>dialog .character-card.chosen{background:#cfb77924;border-color:#ead39a80}
.tools .icon{background:linear-gradient(145deg,#3a5149e0,#142a23ed)!important;border:1px solid #ffffff35!important;color:#f4f2df;box-shadow:inset 0 1px 0 #ffffff25,0 3px 12px #0002;backdrop-filter:none!important}
.opponent.floating{background:linear-gradient(145deg,#314b3de8,#172d24ed)!important;border-color:#ffffff25!important;box-shadow:inset 0 1px 0 #ffffff18,0 5px 15px #0002;backdrop-filter:none!important}
:is(.table-speech,#toast,#actions){border-radius:18px;background:#163126ef;border-color:#ffffff25;box-shadow:inset 0 1px 0 #ffffff18,0 5px 15px #0002;backdrop-filter:none!important}
#actions:empty{display:none}
#actions button{border-radius:12px;background:var(--ui-control);color:var(--ui-ink);border-color:var(--ui-line)}
@media(prefers-reduced-transparency:reduce){body>dialog,body>dialog.compact-dialog[open],body>dialog.settings-dialog[open],body>dialog#result[open]{background:#20392d!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}}
@media(prefers-reduced-motion:reduce){body>dialog button{transition:none!important}}
.settings-dialog #seat-picker>span{display:block}.settings-dialog #seat-picker button{background:var(--ui-control);border-color:var(--ui-line)}

.opponent.human,.lan-avatar.self{display:none!important}

#result .payment-note{display:block;margin-top:4px;font-size:9px;line-height:1.3;color:#ead39a}#result .payment-component>span::after{content:'（应付）';font-size:8px;color:#b8c7bc}
.award-3d-label{position:fixed;left:50%;top:69%;transform:translate(-50%,-50%);z-index:20;max-width:80vw;padding:8px 18px;border-radius:20px;background:#143026e8;border:1px solid #e8cc8755;color:#ffe3a2;font-size:16px;text-align:center;pointer-events:none;box-shadow:0 5px 25px #0004}
#win-signal{position:fixed!important;left:50%!important;top:50%!important;right:auto!important;bottom:auto!important;transform:translate(-50%,-50%)!important;max-width:calc(100vw - 32px);animation:none!important}
body>dialog#result[open],body>dialog#score-dialog[open]{left:50%!important;top:50%!important;inset:auto!important;left:50%!important;top:50%!important;margin:0!important;transform:translate(-50%,-50%)!important;animation:none!important}
#flip-award,#flip{display:none!important}
.award-playing .opponent,.award-playing .table-speech,.award-playing #win-signal,.award-playing #announcement{visibility:hidden!important}

.settings-dialog .settings-footer{display:flex;gap:8px;margin-top:12px;flex-shrink:0}
.settings-dialog .settings-footer>button{flex:1;min-width:0;min-height:40px;margin:0!important;padding:10px!important;text-align:center;font-size:13px}
.settings-dialog .settings-footer .menu-row b{font-size:13px}
.settings-dialog .settings-footer .menu-row small{display:none}

/* Global settings actions sit outside the category navigation and panels. */
body>dialog.settings-dialog[open]{display:flex!important;flex-direction:column;gap:0}
.settings-dialog>.settings-content{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding-bottom:10px}
.settings-dialog>.settings-footer{flex:0 0 auto;position:relative;margin-top:0;padding-top:12px;border-top:1px solid var(--ui-line,#c8b17b40);gap:10px}
.settings-dialog>.settings-footer>button{min-height:44px!important;font-size:14px!important;font-weight:600}
.settings-dialog>.settings-footer>#restart-game{background:#cfb77920;border-color:#ecdba960}
/* Three separate surfaces: settings above, two global action frames below. */
body>dialog.settings-dialog[open]{padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;overflow:visible!important;border-radius:0!important}
.settings-dialog>.settings-content{box-sizing:border-box;padding:16px 18px!important;border:1px solid var(--ui-line,#ffffff24);border-radius:24px;background:var(--ui-glass,#17382eed);box-shadow:inset 0 1px 0 #ffffff28,0 16px 40px #0004;backdrop-filter:blur(10px) saturate(115%);-webkit-backdrop-filter:blur(10px) saturate(115%)}
.settings-dialog>.settings-footer{padding:0!important;margin-top:10px!important;border:0!important;background:transparent;gap:12px}
.settings-dialog>.settings-footer>button{box-sizing:border-box;min-height:48px!important;border:1px solid var(--ui-line,#ffffff24)!important;border-radius:18px!important;box-shadow:inset 0 1px 0 #ffffff28,0 8px 24px #0003!important;backdrop-filter:blur(10px) saturate(115%);-webkit-backdrop-filter:blur(10px) saturate(115%)}
.settings-dialog>.settings-footer>#close-home,.settings-dialog>.settings-footer>#lobby-close{background:var(--ui-glass,#17382eed)!important;color:var(--ui-ink,#f0ecdd)!important}
.settings-dialog>.settings-footer>#restart-game{background:var(--ui-glass,#17382eed)!important;color:var(--ui-ink,#f0ecdd)!important}
@media(prefers-reduced-transparency:reduce){.settings-dialog>.settings-content,.settings-dialog>.settings-footer>button{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;background:#17382e!important}}
/* Fixed screens: content switches by categories/pages, never vertical scrolling. */
html,body{overflow:hidden!important;overscroll-behavior:none}
body>dialog,body>dialog[open],.settings-dialog>.settings-content,body>dialog .settings-panel,#chat-log,#settlement-detail,#coin-ledger,#winner-hand-panel,.room-members,#roster{overflow-y:hidden!important;overscroll-behavior:none;scrollbar-width:none}
body>dialog *::-webkit-scrollbar{display:none}
.page-hidden{display:none!important}
.page-controls{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0;margin-top:8px}
.page-controls button{min-height:36px;padding:7px 12px;font-size:12px}
.page-controls span{font-size:12px;white-space:nowrap}
#chat-log{flex:1;min-height:56px;max-height:140px!important;padding:8px!important}
#chat-log li{margin:0;padding:6px 0;font-size:12px;line-height:1.5}
#chat-dialog{height:auto!important;max-height:calc(min(100dvh,var(--ui-height,100dvh)) - 24px)!important}
#rules-dialog .settings-panel p{margin:6px 0!important;font-size:12px!important;line-height:1.6!important}
#rules-dialog .settings-tabs{gap:2px!important}
#rules-dialog .settings-tabs button{font-size:11px!important;padding:5px 2px!important}
@media(max-height:500px){
 .settings-dialog>.settings-content{padding:12px 16px!important}
 .settings-dialog .settings-tabs{margin-bottom:8px!important}
 .settings-dialog .settings-choice{height:48px!important;min-height:48px!important;gap:3px}
 .settings-dialog .game-secondary{margin-top:6px;gap:6px}
 .settings-dialog .game-secondary button{min-height:32px!important;padding:5px!important}
 .settings-dialog .settings-panel>label{min-height:32px!important;padding:5px 7px!important}
 #coin-dialog p{margin:4px 0!important;line-height:1.4!important}
 #coin-dialog .coin-row{margin:3px 0!important;font-size:11px!important}
}
/* Paifang: fixed character tabs and paged editable profiles. */
body>dialog#paifang-dialog[open]{box-sizing:border-box;width:min(620px,calc(100vw - 32px));max-width:620px!important;height:min(510px,calc(min(100dvh,var(--ui-height,100dvh)) - 24px));max-height:none!important;padding:16px!important;display:flex!important;flex-direction:column;gap:10px;overflow:hidden!important;text-align:left;position:fixed;top:50%;left:50%;inset:auto;margin:0;transform:translate(-50%,-50%);animation:none}
.paifang-heading{display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.paifang-heading h2{font-size:20px;margin:0!important}.paifang-heading span{font-size:11px;color:#c2cfc3}
.paifang-people{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px;flex-shrink:0}.paifang-people button{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:0;padding:5px 2px;font-size:11px;min-height:52px}.paifang-people img{width:28px;height:28px;border-radius:50%}
.paifang-tabs{display:flex;gap:6px;flex-shrink:0}.paifang-tabs button{flex:1;padding:6px;min-height:32px;font-size:12px}.paifang-tabs [aria-pressed=true]{background:#c3ad7e;color:#1c3026}
.paifang-body{flex:1;min-height:0;display:flex;gap:12px;overflow:hidden}.paifang-portrait{width:130px;flex-shrink:0;display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}.paifang-portrait img{width:68px;height:68px;border-radius:18px}.paifang-portrait b{font-size:16px}.paifang-portrait small{font-size:11px;line-height:1.5;margin:0}
.paifang-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px;flex:1;min-width:0}.paifang-field{min-width:0;padding:8px;border-radius:12px;background:#ffffff08;border:1px solid #ffffff12}.paifang-field small{display:block;margin:0 0 5px;font-size:10px;color:#b3c5b8}.paifang-field strong{font-size:12px;line-height:1.5;font-weight:500;overflow-wrap:anywhere}
.paifang-message{font-size:11px!important;min-height:16px;margin:0!important;line-height:1.4!important;flex-shrink:0;color:#f1d595!important}
.paifang-actions{display:flex;gap:8px;flex-shrink:0}.paifang-actions button{flex:1;min-width:0;margin:0!important;min-height:38px;padding:7px;font-size:12px}.paifang-actions button[hidden]{display:none!important}
.paifang-edit,.paifang-account{width:100%;display:grid;gap:8px;align-content:start}.paifang-edit label,.paifang-account label{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}.paifang-edit input,.paifang-edit select,.paifang-account input{width:70%;min-width:0;box-sizing:border-box;height:34px;min-height:34px;padding:5px 8px;font-size:12px;border:1px solid #ffffff25;border-radius:8px;background:#163329;color:#f3efde}.paifang-account p{font-size:11px!important;margin:0!important;line-height:1.4!important}.paifang-account .primary{margin:0!important;min-height:34px;font-size:12px}
@media(max-width:500px) and (min-height:501px){.paifang-people{grid-template-columns:repeat(4,minmax(0,1fr))}.paifang-body{flex-direction:column}.paifang-portrait{width:100%;flex-direction:row;text-align:left}.paifang-portrait img{width:46px;height:46px}.paifang-portrait small{flex:1;font-size:10px}.paifang-fields{gap:6px}}
@media(max-height:500px){body>dialog#paifang-dialog[open]{height:calc(min(100dvh,var(--ui-height,100dvh)) - 20px)!important;max-width:660px!important;padding:12px!important;gap:6px}.paifang-heading h2{font-size:17px}.paifang-people button{min-height:44px}.paifang-people img{width:24px;height:24px}.paifang-portrait img{width:50px;height:50px}.paifang-fields{gap:6px}.paifang-field{padding:6px}.paifang-field strong{font-size:11px}}
/* iOS 26 inspired, lightly translucent jade glass; no animated refraction. */
:root{--ui-ink:#f7f8f2;--ui-muted:#c5d2c9;--ui-line:#ffffff36;--ui-glass:linear-gradient(145deg,rgba(70,103,88,.79),rgba(19,43,35,.88));--ui-control:linear-gradient(150deg,#ffffff1d,#ffffff09)}
body>dialog,body>dialog.compact-dialog[open],body>dialog#result[open],.settings-dialog>.settings-content{box-shadow:inset 0 1px 0 #ffffff45,inset 0 -1px 0 #ffffff0a,0 18px 48px #0004!important;border-color:var(--ui-line)!important;backdrop-filter:blur(12px) saturate(120%)!important;-webkit-backdrop-filter:blur(12px) saturate(120%)!important}
body>dialog.settings-dialog[open]{background:transparent!important;box-shadow:none!important;border:0!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
body>dialog button:not(.icon),.page-controls button{border-radius:16px;box-shadow:inset 0 1px 0 #ffffff25,0 2px 5px #0001}
body>dialog button.primary{background:linear-gradient(145deg,#eedcaac9,#cfb779e6)!important;border-color:#fff3c479!important}
body>dialog input:not([type=checkbox]):not([type=range]):not([type=file]),body>dialog select{background-color:#081e1848!important;box-shadow:inset 0 1px 2px #0002,0 1px 0 #ffffff10}
.tools .icon{background:linear-gradient(145deg,#6688787a,#18382bc7)!important;border-color:#ffffff45!important;box-shadow:inset 0 1px 0 #ffffff55,0 4px 12px #0002!important}
.opponent.floating,.lan-avatar,.lan-header{background:linear-gradient(145deg,#527663b3,#173429d6)!important;border:1px solid #ffffff30;box-shadow:inset 0 1px 0 #ffffff35,0 5px 15px #0002}
:is(.table-speech,#toast,#actions,.award-3d-label){background:linear-gradient(145deg,#446853c9,#173429e0)!important;border:1px solid #ffffff35;box-shadow:inset 0 1px 0 #ffffff35,0 5px 16px #0002}
#actions button,.roll-button,#roll,#flip{background:var(--ui-control);border:1px solid #ffffff35;border-radius:20px;box-shadow:inset 0 1px 0 #ffffff28}
.paifang-people button,.paifang-tabs{background:var(--ui-control);border:1px solid #ffffff25;border-radius:14px}
.paifang-tabs{padding:3px}.paifang-tabs button{border:0;background:transparent}.paifang-tabs [aria-pressed=true]{background:#ffffff25!important;color:#fff1ce!important;box-shadow:inset 0 1px 0 #ffffff35}
@media(prefers-reduced-transparency:reduce){:root{--ui-glass:#20392d}body>dialog,body>dialog.compact-dialog[open],body>dialog#result[open],.settings-dialog>.settings-content,.settings-dialog>.settings-footer>button{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}body>dialog.settings-dialog[open]{background:transparent!important}}
/* Reserve space for Paifang in the fixed game category. */
body>dialog.settings-dialog[open]{height:min(360px,calc(min(100dvh,var(--ui-height,100dvh)) - 32px))!important}
@media(max-height:500px){body>dialog.settings-dialog[open]{height:min(320px,calc(min(100dvh,var(--ui-height,100dvh)) - 24px))!important}}

/* Action buttons stand alone without a second enclosing glass surface. */
#actions{background:transparent!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}

.settings-navigation{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:8px;flex-shrink:0;margin:0 0 10px;padding:0 0 8px;border-bottom:1px solid var(--ui-line);width:100%}
.settings-navigation button{width:40px!important;height:36px!important;min-height:36px!important;padding:0!important;margin:0!important;font-size:26px!important;border:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important}
.settings-navigation .navigation-title{text-align:center;font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.settings-dialog [hidden],body>dialog .rules-footer [hidden],body>dialog .paifang-actions [hidden],body>dialog .chat-header [hidden]{display:none!important}

.settings-dialog>.settings-content{display:flex;flex-direction:column}
.settings-dialog>.settings-content>.settings-panel{flex:1;min-height:0}
#settings-paifang{height:100%;min-height:0}
#paifang-dialog.embedded-paifang[open]{display:flex;flex-direction:column;gap:5px;position:static;inset:auto;transform:none;animation:none;width:100%;max-width:none;height:100%;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;backdrop-filter:none;overflow:hidden;text-align:left}
.embedded-paifang .paifang-heading,.embedded-paifang .settings-navigation,.embedded-paifang [data-action=back]{display:none!important}
.embedded-paifang .paifang-people{grid-template-columns:repeat(8,minmax(0,1fr));gap:3px}
.embedded-paifang .paifang-people button{min-height:34px;padding:2px;font-size:10px;gap:1px}
.embedded-paifang .paifang-people img{width:20px;height:20px}
.embedded-paifang .paifang-tabs button{min-height:26px;padding:3px}
.embedded-paifang .paifang-body{gap:6px}
.embedded-paifang .paifang-portrait{width:90px;gap:3px}
.embedded-paifang .paifang-portrait img{width:40px;height:40px}
.embedded-paifang .paifang-portrait b{font-size:12px}
.embedded-paifang .paifang-portrait small{font-size:9px}
.embedded-paifang .paifang-fields{gap:4px}
.embedded-paifang .paifang-field{padding:4px}
.embedded-paifang .paifang-field small{margin-bottom:2px}
.embedded-paifang .paifang-field strong{font-size:11px}
.embedded-paifang .paifang-message:empty{display:none}
.embedded-paifang .paifang-actions button{min-height:30px;padding:4px}
body>dialog.settings-dialog.paifang-selected[open]{height:min(510px,calc(min(100dvh,var(--ui-height,100dvh)) - 24px))!important}
@media(max-height:500px){body>dialog.settings-dialog.paifang-selected[open]{height:calc(min(100dvh,var(--ui-height,100dvh)) - 24px)!important}}

/* Compact horizontal profiles keep every field inside the fixed settings panel. */
@media(max-height:500px){.embedded-paifang .paifang-portrait small{display:none}.embedded-paifang .paifang-fields{grid-template-rows:1fr 1fr}.embedded-paifang .paifang-field{padding:2px 4px}.embedded-paifang .paifang-field small{font-size:9px;line-height:1}.embedded-paifang .paifang-field strong{font-size:10px;line-height:1.15}.embedded-paifang .paifang-portrait img{width:32px;height:32px}.embedded-paifang .paifang-portrait{width:72px;gap:1px}}
.embedded-paifang .paifang-people button{min-height:34px!important;padding:2px!important}.embedded-paifang .paifang-tabs button{min-height:26px!important;padding:3px!important}.embedded-paifang .paifang-actions button{min-height:30px!important;padding:4px!important}.embedded-paifang .paifang-actions[hidden]{display:none!important}
.embedded-paifang[data-screen=account] .paifang-people,.embedded-paifang[data-screen=edit] .paifang-people{display:none}.embedded-paifang .paifang-edit,.embedded-paifang .paifang-account{gap:4px}.embedded-paifang .paifang-edit input,.embedded-paifang .paifang-edit select,.embedded-paifang .paifang-account input{height:28px!important;min-height:28px!important}.embedded-paifang .paifang-account .primary{min-height:28px!important;margin:0!important}
#settings-paifang{grid-column:1/-1;width:100%}
/* Rule pages fit between navigation and save controls, including short phones. */
body>dialog#coin-rules-dialog[open]{height:min(420px,calc(min(100dvh,var(--ui-height,100dvh)) - 20px))!important;max-width:620px!important;padding:10px 12px!important;gap:4px!important;display:flex!important;flex-direction:column}
#coin-rules-dialog .settings-navigation{margin:0 0 3px;padding-bottom:3px;gap:4px}
#coin-rules-dialog .settings-navigation button{min-height:30px!important;height:30px!important}
#coin-rules-dialog .settings-tabs{margin:0 0 4px!important;gap:3px!important}
#coin-rules-dialog .settings-tabs button{min-height:30px!important;padding:4px 6px!important}
#coin-rules-dialog #coin-rules-form .rules-card{padding:2px!important;margin:0!important}
#coin-rules-dialog #coin-rules-form label{min-height:28px!important;margin:2px 0!important;gap:4px!important;font-size:11px!important;line-height:1.2}
#coin-rules-dialog #coin-rules-form input[type=number]{height:26px!important;min-height:26px!important;width:48px!important;padding:2px 4px!important;font-size:12px!important}
#coin-rules-dialog .rule-mode{gap:4px!important;margin:2px 0!important}
#coin-rules-dialog .rule-mode-options button{min-height:28px!important;padding:3px 6px!important}
#coin-rules-dialog .rules-extra-grid{display:grid;grid-template-columns:1fr 1fr;gap:3px 12px}
#coin-rules-dialog .rules-footer{padding:3px 0 0!important;margin:0!important}
#coin-rules-dialog .rules-footer button{min-height:30px!important;padding:4px 8px!important}
@media(max-width:420px) and (min-height:501px){#coin-rules-dialog .rules-extra-grid{grid-template-columns:1fr}}
.settings-navigation{border-bottom:0!important}

/* Paifang alone allows vertical browsing in a two-column layout. */
.paifang-layout{display:grid;grid-template-columns:110px minmax(0,1fr);gap:12px;flex:1;min-height:0;height:100%;overflow:hidden}
.embedded-paifang .paifang-layout>.paifang-people{display:flex;flex-direction:column;gap:6px;overflow-y:auto!important;overflow-x:hidden;min-height:0;touch-action:pan-y;overscroll-behavior:contain;padding-right:4px}
.embedded-paifang .paifang-layout>.paifang-people button{display:flex;flex-direction:row;justify-content:flex-start;gap:8px;min-height:48px!important;flex-shrink:0;padding:7px!important;font-size:12px}
.embedded-paifang .paifang-layout>.paifang-people img{width:30px;height:30px}
.embedded-paifang .paifang-details{min-width:0;min-height:0;overflow-y:auto!important;overflow-x:hidden;touch-action:pan-y;overscroll-behavior:contain;padding-right:3px;display:block}
.embedded-paifang .paifang-body{display:flex;flex-direction:column;overflow:visible!important;gap:12px;margin:12px 0}
.embedded-paifang .paifang-portrait{width:100%;flex-direction:row;align-items:center;gap:8px;text-align:left}
.embedded-paifang .paifang-portrait img{width:44px;height:44px}
.embedded-paifang .paifang-portrait small{display:block;font-size:10px;flex:1}
.embedded-paifang .paifang-fields{grid-template-columns:1fr 1fr;grid-template-rows:auto;gap:8px}
.embedded-paifang .paifang-field{padding:9px;min-height:60px}
.embedded-paifang .paifang-field small{font-size:10px;line-height:1.4;margin-bottom:5px}
.embedded-paifang .paifang-field strong{font-size:12px;line-height:1.6}
.embedded-paifang .paifang-actions{margin-top:12px}
.embedded-paifang .paifang-edit,.embedded-paifang .paifang-account{gap:12px}
.embedded-paifang .paifang-edit input,.embedded-paifang .paifang-edit select,.embedded-paifang .paifang-account input{min-height:36px!important;height:36px!important}
.embedded-paifang[data-screen=account] .paifang-layout,.embedded-paifang[data-screen=edit] .paifang-layout{grid-template-columns:minmax(0,1fr)}
.embedded-paifang[data-screen=account] .paifang-layout>.paifang-people,.embedded-paifang[data-screen=edit] .paifang-layout>.paifang-people{display:none!important}
@media(max-width:500px){.paifang-layout{grid-template-columns:80px minmax(0,1fr);gap:8px}.embedded-paifang .paifang-layout>.paifang-people button{gap:5px;padding:5px!important;font-size:11px}.embedded-paifang .paifang-layout>.paifang-people img{width:24px;height:24px}.embedded-paifang .paifang-fields{grid-template-columns:1fr}.embedded-paifang .paifang-portrait{flex-wrap:wrap}.embedded-paifang .paifang-portrait small{flex-basis:100%}}

body>dialog#mahjong-seat-dialog[open]{display:flex!important;flex-direction:column;gap:10px;width:min(500px,calc(100vw - 32px));padding:14px!important}
#mahjong-seat-dialog #seat-picker{position:static!important;inset:auto!important;transform:none!important;display:grid;grid-template-columns:1fr 1fr;gap:8px}
#mahjong-seat-dialog #seat-picker[hidden]{display:none!important}
#mahjong-seat-dialog #seat-picker>span{grid-column:1/-1;font-size:12px}
#mahjong-seat-dialog #seat-picker button{position:static!important;inset:auto!important;transform:none!important;min-height:44px!important}
#mahjong-seat-dialog>p{margin:0;font-size:12px}

/* One fixed settings shell for every category and subpage. */
body>dialog:is(#home-dialog,#lobby).settings-dialog[open],body>dialog:is(#home-dialog,#lobby).settings-dialog.paifang-selected[open]{width:min(620px,calc(100vw - 32px))!important;max-width:620px!important;height:min(510px,calc(min(100dvh,var(--ui-height,100dvh)) - 24px))!important}
.settings-page-host{display:none;flex:1;min-height:0;width:100%}
.show-settings-subpage>.settings-content>.settings-page-host{display:flex;flex-direction:column}
.show-settings-subpage>.settings-content>:not(.settings-page-host){display:none!important}
#home-dialog .settings-page-host>dialog.settings-subpage[open]{display:flex!important;flex-direction:column;position:static!important;inset:auto!important;transform:none!important;animation:none!important;margin:0!important;padding:0!important;width:100%!important;max-width:none!important;height:100%!important;max-height:none!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important;overflow:hidden!important;gap:4px!important}
#home-dialog .settings-page-host>dialog:not([open]){display:none!important}
#home-dialog .settings-subpage .settings-panel{flex:1;min-height:0;overflow:hidden}
#home-dialog .settings-subpage .navigation-title{font-size:15px}

/* A scrollable roster with a permanent, reachable continuation action. */
#home-dialog #players-dialog>.eyebrow,#home-dialog #players-dialog>h2{display:none!important}
#home-dialog #players-dialog>.settings-navigation,#home-dialog #players-dialog>p,#home-dialog #players-dialog>.players-footer{flex-shrink:0}
#home-dialog #players-dialog>p{font-size:12px;margin:0 0 4px}
#home-dialog #players-dialog #character-list{flex:1;min-height:0;overflow-y:auto!important;overflow-x:hidden;overscroll-behavior:contain;touch-action:pan-y;align-content:start;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:2px 3px 5px}
#home-dialog #players-dialog .character-card{min-height:68px;padding:8px;gap:8px;box-sizing:border-box}
#home-dialog #players-dialog .players-footer{display:flex;flex-direction:column;gap:5px;padding-top:7px;margin-top:0}
#home-dialog #players-dialog #players-note{font-size:12px;line-height:1.3;margin:0}
#home-dialog #players-dialog #apply-players{display:block;width:100%;min-height:42px!important;margin:0!important;flex-shrink:0}
#home-dialog #players-dialog #close-players{display:none!important}
#home-dialog .paifang-portrait{display:grid;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;gap:4px 8px}
#home-dialog .paifang-portrait>img{grid-column:1;grid-row:1/3}
#home-dialog .paifang-portrait>b{grid-column:2;grid-row:1;overflow-wrap:anywhere}
#home-dialog .paifang-portrait>small{grid-column:2;grid-row:2;display:block}
#home-dialog .paifang-portrait>[data-action=account]{grid-column:3;grid-row:1/3;min-height:34px!important;font-size:11px!important;white-space:nowrap;padding:5px 8px!important;margin:0!important}
@media(max-width:500px){#home-dialog #players-dialog #character-list{grid-template-columns:1fr}#home-dialog .paifang-portrait{grid-template-columns:32px minmax(0,1fr) auto;gap:3px 5px}#home-dialog .paifang-portrait>img{width:32px;height:32px}#home-dialog .paifang-portrait>[data-action=account]{font-size:10px!important;padding:4px!important}}

#lobby .settings-page-host>dialog.settings-subpage[open]{display:flex!important;flex-direction:column;position:static!important;inset:auto!important;transform:none!important;animation:none!important;margin:0!important;padding:0!important;width:100%!important;max-width:none!important;height:100%!important;max-height:none!important;border:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important;overflow:hidden!important;gap:4px!important}
#lobby .settings-page-host>dialog:not([open]){display:none!important}

/* Room members have their own page; the mode menu keeps all actions visible. */
#room-members-dialog #roster{flex:1;min-height:0;align-content:center;gap:8px;margin:8px 0;grid-template-columns:1fr 1fr}
#room-members-dialog .roster-seat{padding:10px;gap:8px}#room-members-dialog .roster-seat img{width:32px;height:32px}
#entry-solo{width:100%;min-height:40px;margin-top:8px}

.meld-preview{display:inline-flex;align-items:center;gap:4px}.selected-meld-card{outline:1px solid #dce8c588;border-radius:5px}
#actions>.meld-preview{order:-1;flex-basis:100%;justify-content:center}
@keyframes rejected-meld{0%,100%{transform:translateX(0)}20%,60%{transform:translateX(-5px)}40%,80%{transform:translateX(5px)}}
#actions button.invalid-meld,#tile-action button.invalid-meld{background:#a83437!important;color:#fff!important;border-color:#f78d8d!important;animation:rejected-meld .45s ease-in-out!important}
@media(prefers-reduced-motion:reduce){#actions button.invalid-meld,#tile-action button.invalid-meld{animation:none!important}}

.rule-mode-options{border-radius:14px!important;overflow:hidden;padding:3px!important;gap:3px!important}.rule-mode-options button{border-radius:11px!important}

/* Compact glass sheet, with readable grouped controls and keyboard scrolling. */
body>dialog:is(#home-dialog,#lobby).settings-dialog[open],body>dialog:is(#home-dialog,#lobby).settings-dialog.paifang-selected[open]{width:min(550px,calc(100vw - 28px))!important;max-width:550px!important;height:min(440px,calc(min(100dvh,var(--keyboard-height,100dvh)) - 28px))!important;top:calc(var(--keyboard-top,0px) + min(100dvh,var(--keyboard-height,100dvh))/2)!important;bottom:auto!important;left:50%!important;right:auto!important;margin:0!important;transform:translate(-50%,-50%)!important}
.settings-dialog>.settings-content{padding:16px!important;border-radius:28px!important;background:linear-gradient(145deg,#47675cbb,#18372dcc)!important;border:1px solid #ffffff38!important;box-shadow:inset 0 1px 0 #ffffff45,0 18px 50px #001b2340!important;backdrop-filter:blur(24px) saturate(135%)!important;-webkit-backdrop-filter:blur(24px) saturate(135%)!important;overflow:hidden!important}
.settings-navigation{border:0!important;margin:0 0 12px!important;padding:0!important;min-height:36px}.settings-navigation .navigation-title{font-size:17px!important;letter-spacing:-.3px}
.settings-tabs{background:#0b241a24!important;border:1px solid #ffffff15!important;border-radius:18px!important;padding:4px!important;gap:3px!important;flex-shrink:0;display:flex!important}
.settings-tabs button{flex:1;border:0!important;border-radius:14px!important;padding:7px 9px!important;min-height:36px!important;color:#dbe9e1!important;background:transparent!important;font-size:13px!important;box-shadow:none!important}
.settings-tabs button[aria-selected=true]{background:#ffffff29!important;color:#fff!important;box-shadow:inset 0 1px 0 #ffffff35,0 2px 8px #00170e18!important}
:is(#home-dialog,#lobby) .settings-panel{padding:8px 1px!important;line-height:1.5}
:is(#home-dialog,#lobby) .settings-subpage .settings-panel,#coin-rules-dialog .settings-panel{overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;touch-action:pan-y!important;scrollbar-width:thin!important}
#coin-rules-dialog #coin-rules-form{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden!important}
#coin-rules-dialog #coin-rules-form label{font-size:13px!important;min-height:40px!important;margin:0!important;padding:6px 8px!important;border-bottom:1px solid #ffffff10!important;box-sizing:border-box}
#coin-rules-dialog #coin-rules-form input[type=number]{font-size:16px!important;min-height:36px!important;height:36px!important;width:68px!important;border-radius:11px!important;text-align:center;background:#ffffff16!important;border:1px solid #ffffff22!important}
#coin-rules-dialog .rules-extra-grid{gap:0 14px!important}#coin-rules-dialog .rules-footer{flex-shrink:0;padding-top:10px!important}
.settings-dialog .settings-footer{gap:10px!important;padding-top:10px!important}.settings-dialog .settings-footer button{border-radius:20px!important;min-height:42px!important}
#result #payment-wallet{background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;justify-content:center!important}
#result #settlement-detail,#result .settlement-footer,#result .result-footer{border-bottom:0!important;border-top:0!important}
#result #winner-hand-panel,#result #winner-hand-panel header{border:0!important;text-align:center!important}
#result #winner-hand-tiles{display:flex!important;flex-wrap:wrap!important;align-items:flex-start!important;justify-content:center!important;gap:14px!important;text-align:center!important}
#result .result-tile-row{justify-content:center!important}#result .result-tile-group{display:flex;flex-direction:column;align-items:center}#result .result-melds{display:contents!important}#winner-hand-caption{display:none!important}
.animal-ledger{width:100%;box-sizing:border-box;border-radius:18px;background:#ffffff0b;border:1px solid #ffffff17;padding:12px;font-size:12px;line-height:1.6}.animal-ledger>small{color:#d4e6d9}.animal-ledger p{margin:7px 0}.animal-ledger input{width:80px!important;min-height:36px!important;font-size:16px!important;text-align:center}.animal-loan-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.animal-loan-actions button{flex:1;min-height:40px!important;border-radius:14px!important}
.embedded-paifang .paifang-body{flex-wrap:wrap!important}.embedded-paifang .paifang-fields{gap:8px!important}.embedded-paifang .paifang-field{padding:9px 10px!important;border-radius:14px!important}.embedded-paifang .paifang-portrait{margin-bottom:2px!important}
:is(#home-dialog,#lobby) .settings-content>.settings-panel{align-content:start!important;grid-auto-rows:min-content!important;gap:12px!important}
.settings-dialog .game-secondary{margin-top:2px!important;grid-auto-rows:44px!important;align-content:start!important}.settings-dialog .game-secondary button{height:44px!important}
.settings-dialog .settings-choice{height:76px!important;border-radius:18px!important}.settings-dialog .settings-navigation .navigation-close{border:0!important;background:#ffffff14!important;border-radius:50%!important;width:34px!important;height:34px!important;min-height:34px!important;font-size:21px!important}
#result .result-actions{border-top:0!important;border-bottom:0!important}
#result #winner-hand-panel header{justify-content:center!important}#result .result-tile{width:24px!important;height:34px!important}#result .result-tile-group>small{font-size:11px!important;color:#d9e6db!important}
@media(max-width:500px){#result .result-tile{width:18px!important;height:27px!important}#result #winner-hand-tiles{gap:12px!important}}
@media(max-width:500px){#coin-rules-dialog .rules-extra-grid{grid-template-columns:1fr!important}#coin-rules-dialog #coin-rules-form label{gap:12px!important;min-height:46px!important;white-space:normal;line-height:1.5!important}#coin-rules-dialog .rule-value{flex-shrink:0;width:116px;justify-content:flex-end}.settings-tabs button{padding-inline:5px!important;font-size:12px!important}}
@media(max-height:500px){.settings-dialog>.settings-content{padding:10px 12px!important;border-radius:22px!important}.settings-navigation{margin-bottom:5px!important}.settings-tabs button{min-height:32px!important;padding:4px 6px!important}#coin-rules-dialog #coin-rules-form label{min-height:36px!important}}
@media(prefers-reduced-transparency:reduce){.settings-dialog>.settings-content{background:#284739!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}}
.coin-cost-float{position:fixed;z-index:20;pointer-events:none;color:#ffbd99;font-size:28px;font-weight:700;text-shadow:0 2px 6px #0008;transform:translate(-50%,-100%);animation:coin-cost-rise 1.5s ease-out forwards}
@keyframes coin-cost-rise{0%{opacity:0;translate:0 8px}15%{opacity:1}75%{opacity:1}100%{opacity:0;translate:0 -32px}}
#round-notice{position:fixed;top:64px;left:50%;transform:translateX(-50%);z-index:12;pointer-events:none;text-align:center;padding:10px 16px;border-radius:18px;background:#183c2cd9;color:#fff1c9;max-width:calc(100vw - 40px);font-size:14px}
.room-summary{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:8px;font-size:12px}.room-summary #connection{font-size:11px}
#result.has-kong-bills #settlement-detail{grid-template-columns:repeat(4,minmax(0,1fr))!important}#result.has-kong-bills .payer-card{padding:6px;font-size:10px}#result.has-kong-bills .payment-component{font-size:10px;line-height:1.3;padding:2px 0}
@media(max-width:650px){#result.has-kong-bills #settlement-detail{grid-template-columns:repeat(2,minmax(0,1fr))!important}}

#result.has-kong-bills .payer-card header b small{display:block;font-size:9px;font-weight:400}#win-signal{font-size:24px!important;padding:12px 20px!important}#win-signal-avatar[hidden],#win-signal-detail[hidden]{display:none!important}

/* Payment is a cash transfer plus a single outstanding amount per player. */
#result #result-title{gap:4px 8px!important}#result .winner-earned{font-size:15px}.winner-received{flex-basis:100%;text-align:center;font-size:13px;color:#d5e4da}#result #winner-income{font-size:20px!important}#result .winner-award{font-size:23px}
#result .payer-card header{margin-bottom:6px!important;border:0!important}#result .payer-summary{display:flex;flex-direction:column;gap:5px;margin-bottom:8px}#result .payer-total{display:flex;align-items:center;gap:4px;font-size:11px}#result .payer-total>span{flex:1}#result .payer-total strong{font-size:15px;font-variant-numeric:tabular-nums}#result .payer-total small{margin:0;font-size:10px}#result .payer-breakdown{padding-top:6px;border-top:1px solid #ffffff18}#result .payment-component>span::after{content:none!important}
#result #payment-wallet{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px!important;grid-column:1/-1;text-align:center;align-items:center;padding:10px 0!important}#result .wallet-heading{grid-column:1/-1;font-size:12px}#result .wallet-metric{display:flex;flex-direction:column;gap:3px}#result .wallet-metric small{margin:0;font-size:10px}#result .wallet-metric strong,#result #payment-wallet-number{font-size:16px!important}
#result>.settings-panel{overflow-y:auto!important;overscroll-behavior:contain;touch-action:pan-y}#result #winner-hand-panel{display:flex;flex-direction:column;justify-content:center;min-height:100%;padding:12px 0 28px!important;background:transparent!important;box-shadow:none!important;border:0!important;overflow:visible!important}#result #winner-hand-panel[hidden]{display:none!important}#result #winner-hand-tiles{align-items:center!important;padding-bottom:26px!important}#result .result-tile.winning-tile>b{bottom:-20px;line-height:18px;font-size:11px!important}#result .result-tile-group:has(.winning-tile){padding-bottom:20px;margin-bottom:-20px}
:is(#home-dialog,#lobby) .settings-content>.settings-panel:has(#settings-paifang){display:block!important;min-height:0!important;height:100%;overflow:hidden!important}#settings-paifang{height:100%;min-height:0}#paifang-dialog.embedded-paifang[open]{height:100%!important;min-height:0!important}.embedded-paifang .paifang-layout{height:100%!important;min-height:0!important}.embedded-paifang .paifang-details,.embedded-paifang .paifang-people{height:100%;min-height:0;overflow-y:auto!important;overscroll-behavior:contain!important;touch-action:pan-y!important}
.rules-number-editing #coin-rules-dialog>.settings-navigation{display:grid!important}
.tools #chat-unread{display:none!important}
#result[open]{height:min(440px,calc(min(100dvh,var(--ui-height,100dvh)) - 24px))!important}#result>.settings-panel:not(.settings-inactive):has(#settlement-detail){display:flex!important;flex-direction:column;overflow:hidden!important}#result #settlement-detail{flex:1;min-height:0;overflow-y:auto!important;overscroll-behavior:contain;touch-action:pan-y;align-content:start}#result #payment-wallet{flex-shrink:0;padding:7px 0!important;gap:5px!important}#result .wallet-metric{display:grid;grid-template-columns:auto auto;justify-content:center;align-items:baseline;gap:2px 3px}#result .wallet-metric>small:first-child{grid-column:1/-1}#result>.settings-panel.settings-inactive{display:none!important}
@media(max-height:500px){#result[open]{height:min(360px,calc(min(100dvh,var(--ui-height,100dvh)) - 24px))!important}}
@media(max-width:500px){#result #settlement-detail,#result.has-kong-bills #settlement-detail{grid-template-columns:1fr!important}#result .payer-summary{flex-direction:row;gap:10px}#result .payer-total{flex:1;flex-wrap:wrap}#result .payer-total>span{flex-basis:100%}}
#invite-dialog.settings-subpage>h2,#invite-dialog.settings-subpage>.eyebrow{display:none}#invite-dialog.settings-subpage>p{font-size:12px;margin:4px 0}#invite-dialog.settings-subpage #qr{width:120px;height:120px;margin:6px auto}#invite-dialog.settings-subpage label{font-size:12px;margin:4px 0}

.paifang-tabs:empty{display:none!important}

/* Dice controls share the same anchor above the dice. */
#configure-round{bottom:auto;transform:translateX(-50%);letter-spacing:1px}
#configure-round,#roll,#continue-round,#table-room-return{background:linear-gradient(145deg,rgba(82,118,99,.72),rgba(23,52,41,.84));color:#fff8df;border:1px solid #ffffff45;border-radius:26px;min-width:112px;min-height:46px;padding:11px 22px;font-size:17px;font-weight:700;letter-spacing:1px;text-shadow:0 1px 3px #071e18cc;box-shadow:inset 0 1px 0 #ffffff55,inset 0 -1px 0 #ffffff0d,0 4px 12px #0002;backdrop-filter:blur(12px) saturate(120%);-webkit-backdrop-filter:blur(12px) saturate(120%)}
#configure-round:active,#roll:active,#continue-round:active,#table-room-return:active{background:linear-gradient(145deg,rgba(100,139,119,.8),rgba(30,66,51,.9));box-shadow:inset 0 1px 3px #0002,0 2px 6px #0002}
@media(prefers-reduced-transparency:reduce){#configure-round,#roll,#continue-round,#table-room-return{background:#294c3b;backdrop-filter:none;-webkit-backdrop-filter:none}}

/* Only the selected settings category may occupy the sheet. */
:is(#home-dialog,#lobby)>.settings-content>.settings-panel.settings-inactive,:is(#home-dialog,#lobby)>.settings-content>.settings-panel.settings-inactive:has(#settings-paifang){display:none!important}
:is(#home-dialog,#lobby)>.settings-content>.settings-panel:not(.settings-inactive):not(:has(#settings-paifang)){overflow-y:auto!important;overflow-x:hidden!important;touch-action:pan-y;overscroll-behavior:contain;grid-template-rows:none!important;align-content:start!important}
.settings-navigation>button{flex-shrink:0;min-width:34px;width:34px;height:34px;min-height:34px!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;border-radius:50%!important;font-size:22px!important}
body>dialog#chat-dialog[open]{display:flex!important;flex-direction:column;position:fixed!important;inset:auto!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;margin:0!important;animation:none!important;width:min(550px,calc(100vw - 28px))!important;max-width:550px!important;height:min(400px,calc(min(100dvh,var(--keyboard-height,100dvh)) - 28px))!important;max-height:none!important;box-sizing:border-box;padding:18px!important;text-align:left}
#chat-dialog .chat-header h2{display:none}#chat-dialog .chat-header{flex-shrink:0}#chat-dialog .settings-navigation{flex-shrink:0}#chat-dialog #chat-log{flex:1;min-height:0;max-height:none!important;overflow-y:auto!important;touch-action:pan-y;overscroll-behavior:contain}#chat-dialog .page-controls{flex-shrink:0}

/* Large transparent navigation controls, shared by every settings page. */
.settings-navigation{grid-template-columns:64px minmax(0,1fr) 64px;min-height:64px}
:is(#home-dialog,#lobby) .settings-navigation{grid-template-columns:64px minmax(0,1fr) 64px;min-height:64px}
.settings-navigation>button,.settings-dialog .settings-navigation .navigation-close{width:64px!important;height:64px!important;min-height:64px!important;min-width:64px!important;font-size:40px!important;background:transparent!important;border:0!important;box-shadow:none!important}
.settings-dialog .settings-navigation button,.settings-navigation button.navigation-back,.settings-navigation button.navigation-close{font-size:40px!important}
.settings-navigation>button:hover,.settings-navigation>button:active{background:transparent!important;box-shadow:none!important}
#coin-rules-dialog .settings-navigation{min-height:64px;grid-template-columns:64px minmax(0,1fr) 64px}
#coin-rules-dialog .settings-navigation>button{height:64px!important;min-height:64px!important}
.embedded-paifang .animal-ledger{background:transparent;border:0;padding:0 0 12px;border-bottom:1px solid #ffffff18;border-radius:0}
.animal-loan-note{display:block;margin:10px 0 6px;line-height:1.6;font-size:10px}
.animal-loan-actions button:disabled{opacity:.35;cursor:default}
#phone-hand{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;padding:0!important;pointer-events:none}
#lobby .room-summary{grid-column:1/-1;display:flex;justify-content:space-between;gap:12px;font-size:12px}
.embedded-paifang .paifang-portrait{display:grid!important;grid-template-columns:44px minmax(0,1fr) auto!important;min-height:48px;gap:4px 10px!important}
.paifang-avatar{width:44px;height:44px;grid-column:1;grid-row:1/3;display:grid;place-items:center;border-radius:50%;background:#ffffff0c}
.embedded-paifang .paifang-avatar>img{width:34px!important;height:34px!important;object-fit:contain;border-radius:50%;margin:0;padding:0}
.paifang-portrait>b{grid-column:2;grid-row:1;align-self:center;font-size:15px!important}
.paifang-portrait:has(.paifang-avatar):not(:has(small))>b{grid-row:1/3}
.paifang-portrait>small{grid-column:2;grid-row:2}
.paifang-money{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.paifang-money .paifang-field{min-height:0!important;padding:10px!important}
.embedded-paifang .paifang-fields{display:flex!important;flex-direction:column;gap:0!important}
.embedded-paifang .paifang-fields .paifang-field{display:grid;grid-template-columns:76px minmax(0,1fr);align-items:center;gap:12px;min-height:0!important;padding:12px 4px!important;border:0;border-bottom:1px solid #ffffff10;border-radius:0!important;background:transparent}
.embedded-paifang .paifang-fields .paifang-field small{margin:0;font-size:12px}
.embedded-paifang .paifang-fields .paifang-field strong{font-size:13px;font-weight:400}
.animal-loan-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.animal-loan-actions button{padding:8px 5px!important;line-height:1.5!important;font-size:12px!important}
.friendship-note{display:block;margin:8px 0;font-size:11px;line-height:1.6;color:#b9cdbf}
@media(max-width:500px){.animal-loan-actions{grid-template-columns:1fr 1fr}.animal-loan-actions button:last-child{grid-column:1/-1}.embedded-paifang .paifang-fields .paifang-field{grid-template-columns:64px minmax(0,1fr);gap:8px}}
.embedded-paifang .paifang-body{gap:8px!important;margin:6px 0!important}
.paifang-money .paifang-field{padding:7px 9px!important}.paifang-money .paifang-field small{margin:0 0 2px!important;line-height:1.3}.paifang-money .paifang-field strong{line-height:1.3}
.animal-ledger input{min-height:32px!important;height:32px!important}.animal-loan-actions{grid-template-columns:repeat(3,minmax(0,1fr))!important;margin-top:6px!important}.animal-loan-actions button:last-child{grid-column:auto!important}
.animal-debt{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.animal-debt>button{min-height:30px!important;padding:4px 10px!important;font-size:11px!important;flex-shrink:0}

/* Shared mode navigation and continuous history. */
#result #result-title{display:flex!important;flex-wrap:nowrap!important;justify-content:center;align-items:center;gap:12px!important;white-space:nowrap;font-size:clamp(11px,3vw,15px)!important}
#result .winner-inline-avatar{display:none!important}#result .winner-earned,#result .winner-received{flex:0 1 auto;flex-basis:auto;font-size:inherit!important}#result .winner-award,#result #winner-income{font-size:inherit!important}
#entry .settings-navigation{grid-template-columns:64px minmax(0,1fr) 64px}#entry .navigation-title{font-size:13px;white-space:normal;line-height:1.5;text-align:center}#entry .entry-tabs{display:flex!important}#entry[data-entry-mode=create] .lan-entry-card:has(#join){display:none!important}
#players-dialog #players-invite{margin:8px 0;min-height:44px}#players-dialog #character-list{overflow-y:auto!important;touch-action:pan-y}#mahjong-seat-dialog #seat-picker{position:static;transform:none;display:grid;grid-template-columns:1fr 1fr;gap:12px}
#chat-dialog #chat-log li{display:block!important}#chat-dialog #chat-log{overflow-y:auto!important;touch-action:pan-y}

/* The same avatar and action styling in both modes. */
.lan-avatar{padding:5px 10px 5px 5px!important;border-radius:28px!important;background:#17262bb5!important;border-color:#f7e9c51c!important;gap:8px!important;transform:translate(-50%,-50%);font-size:11px!important}.lan-avatar img{width:38px!important;height:38px!important}.lan-avatar b{font-size:11px!important;letter-spacing:1px;font-weight:400!important}.lan-avatar.self{bottom:calc(85px + env(safe-area-inset-bottom))!important;left:18px!important;transform:none}.lan-avatar.active{animation:none;border-color:#ffe3a0!important}
#tile-action:has(#actions){background:transparent!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important;padding:0!important}#tile-action:has(#actions)::after{display:none!important}#tile-action #actions{padding:0!important;border:0!important;gap:7px}#tile-action #actions button{flex:0 1 auto}

#entry .navigation-title{font-size:13px!important;letter-spacing:0!important;font-weight:500!important}

/* Animal profiles center their portrait, name and role text. */
:is(#home-dialog,#lobby) .embedded-paifang .paifang-portrait{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;width:100%!important;gap:5px!important;text-align:center!important;padding:8px 0!important}
.paifang-portrait>b,.paifang-portrait>small{align-self:center!important;text-align:center!important;flex:none!important}.paifang-portrait .paifang-avatar{flex:none;place-items:center}.paifang-people button{align-items:center!important;justify-content:center!important;text-align:center!important}.paifang-money .paifang-field,.paifang-fields .paifang-field{text-align:center!important}.animal-loan-note,.friendship-note{text-align:center}
body>dialog.animal-money-dialog[open]{display:flex!important;flex-direction:column!important;gap:8px!important;width:min(360px,calc(100vw - 24px))!important;height:auto!important;max-height:calc(100dvh - 24px)!important;overflow-y:auto!important;margin:auto!important;padding:20px!important;border-radius:24px!important;background:#20332ff5!important;text-align:center!important}
.animal-money-dialog h2{font-size:18px!important;letter-spacing:0!important;margin:0!important}.animal-money-amount{display:block;font-size:34px;font-variant-numeric:tabular-nums;line-height:1.3}.animal-money-dialog small{margin:0!important}.animal-money-dialog p{margin:0!important}.animal-money-hint{color:#ffb5a9!important;font-size:12px!important;min-height:18px}.animal-money-keypad{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.animal-money-keypad button{min-height:46px!important;font-size:22px!important;padding:6px!important}.animal-money-dialog>.primary{margin:0!important}.animal-money-review{padding:12px 0;font-size:16px!important}.animal-money-dialog::backdrop{background:#06130ec0;backdrop-filter:blur(6px)}
@media(max-height:500px){body>dialog.animal-money-dialog[open]{padding:12px!important;gap:4px!important}.animal-money-keypad button{min-height:36px!important;font-size:19px!important}.animal-money-dialog>button{min-height:36px!important;padding:6px!important}.animal-money-amount{font-size:26px}}
.embedded-paifang .paifang-layout>.paifang-people button{flex-direction:column!important;gap:4px!important;min-height:62px!important;line-height:1.4!important}.embedded-paifang .paifang-layout>.paifang-people img{flex:none;align-self:center}.animal-money-dialog[open]{animation:none!important}
.embedded-paifang .paifang-fields .paifang-field{text-align:left!important}.friendship-note{text-align:left!important}
.animal-money-footer{display:grid;grid-template-columns:1fr 1fr;gap:8px;flex:none}.animal-money-footer button{min-height:40px!important;padding:6px!important;margin:0!important}
body>dialog.animal-money-dialog[open]{gap:6px!important;max-height:calc(min(100dvh,var(--ui-height,100dvh)) - 16px)!important;overflow:hidden!important}.animal-money-dialog .animal-money-keypad button{font-size:22px!important}.animal-money-hint{line-height:1.3!important}
@media(max-height:500px){body>dialog.animal-money-dialog[open]{padding:10px 12px!important;gap:3px!important}.animal-money-dialog .animal-money-keypad{gap:4px}.animal-money-dialog .animal-money-keypad button{height:34px!important;min-height:34px!important;font-size:19px!important}.animal-money-footer button{height:36px!important;min-height:36px!important}.animal-money-dialog .animal-money-amount{font-size:25px;line-height:1.2}.animal-money-dialog .animal-money-hint{min-height:14px!important;font-size:11px!important}}
#invite-dialog #lan-address{display:none!important}#invite-dialog #qr{width:min(210px,42vw)!important;height:auto!important;margin:12px auto!important}#invite-dialog #invite-link{font-size:12px;text-align:center;margin:0!important}.invite-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.invite-actions button{min-height:44px;padding:8px;font-size:13px}

/* Keep the number display distinct and leave breathing room before actions. */
.animal-money-dialog h2{font-size:14px!important;color:#b9cabc!important;font-weight:500;margin-bottom:3px!important}
.animal-money-dialog .animal-money-amount{background:#ffffff0b;border:1px solid #ffffff18;border-radius:10px;padding:5px 12px;font-size:30px;font-weight:600;color:#fff5d9}
.animal-money-footer{margin-top:12px;padding-top:10px;border-top:1px solid #ffffff18}
@media(max-height:500px){.animal-money-dialog .animal-money-amount{font-size:24px;padding:3px 10px}.animal-money-dialog .animal-money-keypad button{height:31px!important;min-height:31px!important}.animal-money-dialog .animal-money-hint:empty{display:none}.animal-money-footer{margin-top:9px;padding-top:8px}}
#home-dialog #players-dialog #players-invite{grid-column:1/-1;min-height:58px;margin:0;font-size:15px;background:#ffffff0d;flex:none}
#home-dialog .settings-page-host>#invite-dialog.settings-subpage[open]{display:grid!important;grid-template-columns:minmax(110px,160px) minmax(0,1fr);grid-template-rows:auto 1fr auto;gap:12px 18px!important;align-items:center;align-content:start}
#invite-dialog>.settings-navigation{grid-column:1/-1}
#invite-dialog.settings-subpage #qr{grid-column:1;grid-row:2/4;width:min(160px,100%)!important;height:auto!important;margin:0!important;justify-self:center;border-radius:12px}
#invite-dialog #invite-link{grid-column:2;grid-row:2;align-self:end;width:100%;min-width:0;height:auto;white-space:normal}
#invite-dialog .invite-actions{grid-column:2;grid-row:3;align-self:start;margin:0;grid-template-columns:1fr;gap:8px}
@media(max-width:420px){#home-dialog .settings-page-host>#invite-dialog.settings-subpage[open]{grid-template-columns:110px minmax(0,1fr);gap:10px!important}#invite-dialog .invite-actions button{font-size:12px;padding:6px}}
#result #payment-wallet{display:none!important}
#result .result-actions #inspect-result:disabled{opacity:.35;pointer-events:none}

.animal-money-dialog .animal-money-amount{background:transparent!important;border:0!important;box-shadow:none!important}
.opponent.floating{display:flex!important;align-items:center!important;justify-content:center;gap:8px}.opponent.human{display:none!important}.opponent.floating>div{display:flex;flex-direction:column;justify-content:center;align-items:center}.opponent.floating b,.opponent.floating span{margin:0!important}
.opponent.floating[hidden]{display:none!important}
#chat-log li{display:flex!important;align-items:center!important;gap:8px}#chat-log li>img{flex:none;align-self:center!important}#chat-log li>span{min-width:0;line-height:1.5}
#home-dialog .settings-page-host>#invite-dialog.settings-subpage[open]{display:flex!important;flex-direction:column;gap:12px!important}
#invite-dialog .invite-layout{display:grid;grid-template-columns:160px minmax(0,1fr);gap:18px;align-items:center;align-content:center;flex:1;min-height:0;width:100%}
#invite-dialog .invite-info{display:flex;flex-direction:column;justify-content:center;gap:12px;min-width:0}
#invite-dialog .invite-layout #qr{grid-column:auto;grid-row:auto;justify-self:center;margin:0!important}
#invite-dialog .invite-info #invite-link,#invite-dialog .invite-info .invite-actions{grid-column:auto;grid-row:auto;align-self:stretch;margin:0!important}
#join-room-dialog .join-content{display:flex;flex-direction:column;justify-content:center;align-items:stretch;flex:1;width:min(340px,100%);margin:auto;gap:16px;min-height:0}
#join-room-dialog .join-content label{display:grid;grid-template-columns:80px minmax(0,1fr);align-items:center;gap:12px;margin:0;text-align:right;font-size:13px}
#join-room-dialog .join-content input{width:100%;min-width:0;min-height:40px;padding:8px 12px;text-align:center;border:1px solid #ffffff25;border-radius:12px;font:inherit}
#join-room-dialog .join-content #join-room{margin:0!important;width:100%;min-height:44px}
#home-dialog.room-guest .game-modes,#home-dialog.room-guest #settings-restart{display:none!important}
#home-dialog #players-dialog .players-footer{display:grid!important;grid-template-columns:1fr 2fr;gap:8px}
#players-dialog .players-footer #players-note{grid-column:1/-1;margin:0!important;text-align:center}#players-dialog .players-footer #apply-players{margin:0!important;grid-column:1/-1}#players-dialog .players-footer:has(#room-change-seat:not([hidden])) #apply-players{grid-column:2}#players-dialog .players-footer #room-change-seat{min-height:40px;margin:0!important}
body>dialog#result[open],body>dialog#score-dialog[open]{inset:auto!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;margin:0!important;width:min(650px,calc(100vw - 24px))!important;max-width:650px!important;text-align:center!important}
#result #settlement-detail,#score-detail{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px;align-content:center;justify-content:center}
:is(#result,#score-dialog) .payer-card{text-align:center;padding:9px 6px;border:1px solid #ffffff20;border-radius:12px;background:#ffffff08;min-width:0}
:is(#result,#score-dialog) .payer-card header{display:flex;align-items:center;justify-content:center;text-align:center;min-height:36px;margin:0 0 8px!important}
:is(#result,#score-dialog) .payer-card header b{font-size:11px;line-height:1.5;overflow-wrap:anywhere;color:#e4eedd}
:is(#result,#score-dialog) .payer-self{border-color:#dec88e80;background:#dec88e10}:is(#result,#score-dialog) .payer-self header b{color:#ffe4a5}
:is(#result,#score-dialog) .payer-summary{display:grid!important;grid-template-columns:1fr;gap:5px;margin-bottom:8px}:is(#result,#score-dialog) .payer-total{display:flex;justify-content:center;align-items:center;gap:5px;font-size:11px}:is(#result,#score-dialog) .payer-total>span{flex:none!important}:is(#result,#score-dialog) .payer-total strong{font-size:15px}:is(#result,#score-dialog) .payer-total small{margin:0;font-size:10px}
:is(#result,#score-dialog) .payer-breakdown{padding-top:6px;border-top:1px solid #ffffff18}:is(#result,#score-dialog) .payment-component{display:flex;justify-content:center;gap:10px;font-size:11px;line-height:1.6}:is(#result,#score-dialog) .payment-component>span{flex:none!important}:is(#result,#score-dialog) .payer-breakdown small{margin:4px 0;font-size:10px}
#score-dialog[open]{display:flex!important;flex-direction:column;max-height:calc(100dvh - 24px)!important;gap:12px;padding:16px!important}#score-title{font-size:16px!important;margin:0!important;letter-spacing:0!important;flex:none}#score-detail{min-height:0;overflow-y:auto}#confirm-score{margin:0!important;flex:none;font-size:13px!important}
#score-title{display:flex;align-items:center;justify-content:center;gap:6px 12px;flex-wrap:wrap}#score-title .winner-earned,#score-title .winner-received{font-size:14px;flex:0 1 auto;flex-basis:auto}#score-title strong{font-size:16px!important;line-height:1.4;margin:0}
@media(max-width:500px){#result #settlement-detail,#result.has-kong-bills #settlement-detail,#score-detail{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:420px){#invite-dialog .invite-layout{grid-template-columns:110px minmax(0,1fr);gap:12px}#join-room-dialog .join-content{gap:12px}#join-room-dialog .join-content label{grid-template-columns:65px minmax(0,1fr);gap:8px}}
#home-dialog #players-dialog .character-card:has(.room-kick){flex-wrap:wrap;justify-content:center}#home-dialog #players-dialog .character-card:has(.room-kick)>b{flex:1;min-width:65px;font-size:12px}
#home-dialog #players-dialog .room-kick{flex:none;min-height:32px!important;padding:5px 9px!important;font-size:11px!important;color:#ffcfb8;background:#ffffff08;border-color:#ffffff25}
.room-kick-confirm footer{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:20px}.room-kick-confirm footer button{margin:0!important;min-height:40px}

/* Compact joining form and full phone receipts. */
#home-dialog:has(#join-room-dialog[open]){width:min(510px,calc(100vw - 28px))!important;height:min(350px,calc(100dvh - 28px))!important}
#home-dialog #join-room-dialog .join-content{display:grid!important;grid-template-columns:1fr 1fr;align-content:center;align-items:start;gap:20px 16px;width:min(390px,100%)!important;margin:auto!important;flex:1}
#home-dialog #join-room-dialog .join-content label{display:flex!important;flex-direction:column;align-items:stretch;gap:9px;text-align:left;font-size:12px;color:#d4dfd6}
#home-dialog #join-room-dialog .join-content input{width:100%!important;min-height:48px!important;padding:10px 14px!important;font-size:17px!important;text-align:center;border-radius:14px!important;background:#122a2390!important;border:1px solid #ffffff20!important}
#home-dialog #join-room-dialog #join-room{grid-column:1/-1;margin:0!important;min-height:48px!important;border-radius:14px!important;font-size:16px!important}
.navigation-title:focus{outline:none}
/* Keep the player's account header in one compact horizontal row. */
:is(#home-dialog,#lobby) .embedded-paifang .paifang-portrait:has(>[data-action=account]){display:grid!important;grid-template-columns:40px minmax(0,1fr) auto!important;grid-template-rows:auto auto;align-content:center!important;gap:2px 10px!important;min-height:44px!important;padding:2px 0!important;text-align:left!important;flex-wrap:nowrap!important}
.embedded-paifang .paifang-portrait:has(>[data-action=account])>.paifang-avatar{grid-column:1;grid-row:1/3;width:40px;height:40px}
.embedded-paifang .paifang-portrait:has(>[data-action=account])>b{grid-column:2;grid-row:1;text-align:left!important;justify-self:start;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;font-size:14px!important}
.embedded-paifang .paifang-portrait:has(>[data-action=account])>small{grid-column:2;grid-row:2;text-align:left!important;justify-self:start;display:block!important;margin:0!important;font-size:10px!important;line-height:1.3!important}
.embedded-paifang .paifang-portrait:has(>[data-action=account])>[data-action=account]{grid-column:3;grid-row:1/3;align-self:center;min-height:34px!important;margin:0!important;padding:6px 10px!important;font-size:11px!important;white-space:nowrap}
@media(max-width:500px),(max-height:500px){
:is(#result,#score-dialog) .payer-card{padding:6px!important;gap:4px!important}
:is(#result,#score-dialog) .payer-card header{margin:0!important;min-height:28px;display:flex;align-items:center;justify-content:center}
:is(#result,#score-dialog) .payer-card header b{font-size:11px!important;line-height:1.35!important;letter-spacing:0!important}
:is(#result,#score-dialog) .payer-summary{gap:2px!important;padding:3px 0!important;margin:0!important}
:is(#result,#score-dialog) .payer-total{min-height:15px!important;line-height:15px!important;font-size:11px!important;gap:4px!important}
:is(#result,#score-dialog) .payer-total strong{font-size:12px!important}
:is(#result,#score-dialog) .payer-total small{margin:0!important;font-size:9px!important}
:is(#result,#score-dialog) .payer-breakdown{margin:0!important;padding:3px 0!important;gap:0!important}
:is(#result,#score-dialog) .payment-component{padding:2px 0!important;min-height:0!important;font-size:10px!important;line-height:14px!important}
:is(#result,#score-dialog) .payment-component strong{font-size:11px!important}
:is(#result,#score-dialog) .payer-breakdown small{margin:2px 0!important;line-height:14px!important}
#result #settlement-detail,#score-detail{gap:6px!important}
}
@media(max-width:500px) and (orientation:portrait){#result{height:min(590px,calc(100dvh - 24px))!important;max-height:calc(100dvh - 24px)!important}}

/* Fit the numeric panel with space above and below on every display. */
body>dialog.animal-money-dialog[open]{--number-panel-height:min(100dvh,var(--ui-height,100dvh));position:fixed!important;inset:0!important;transform:none!important;height:fit-content!important;max-height:calc(var(--number-panel-height) - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;margin:auto!important;padding:14px 18px!important;gap:5px!important;overflow-y:auto!important}
.animal-money-dialog .animal-money-keypad{gap:5px!important;flex:none}
.animal-money-dialog .animal-money-keypad button{height:clamp(26px,calc((var(--number-panel-height) - 260px)/4),44px)!important;min-height:0!important;padding:2px!important;font-size:20px!important}
.animal-money-dialog .animal-money-amount{font-size:26px!important;line-height:1.15!important;padding:2px 0!important}
.animal-money-dialog .animal-money-footer{margin-top:8px!important;padding-top:8px!important;gap:10px!important;flex:none}
.animal-money-dialog .animal-money-footer button{height:34px!important;min-height:34px!important;padding:4px!important}
.animal-money-dialog .animal-money-hint:empty{display:none!important}
#home-dialog:has(#join-room-dialog[open]){width:min(610px,calc(100vw - 28px))!important;height:min(520px,calc(min(100dvh,var(--ui-height,100dvh)) - 32px))!important}
#home-dialog #join-room-dialog.settings-subpage[open]{overflow:hidden!important;gap:10px!important}
#home-dialog #join-room-dialog .join-content{flex:none!important;margin:0 auto!important;width:100%!important;gap:10px 12px!important;align-content:start!important}
#home-dialog #join-room-dialog .join-content #join-password-field[hidden]{display:none!important}
#join-room-dialog #join-password-field{grid-column:1/-1}
#join-room-dialog .join-tools{display:flex;justify-content:center;gap:10px;flex:none}
#join-room-dialog .join-tools button{min-height:34px!important;padding:6px 16px!important;font-size:12px!important}
#join-room-dialog .room-discovery{flex:1;min-height:60px;overflow-y:auto;touch-action:pan-y;width:100%;text-align:left;padding:0 2px}
.room-discovery-heading{display:flex;justify-content:space-between;align-items:center;margin:2px 0 8px;font-size:12px;color:#bccdc3}
.room-discovery-heading button{min-height:28px!important;padding:4px 10px!important;font-size:11px!important}
.room-discovery-list{display:grid;gap:6px}.room-discovery-list>button{display:flex;justify-content:space-between;align-items:center;gap:10px;min-height:44px;padding:8px 12px;text-align:left;font-size:12px}
.room-discovery-list small{margin:0;font-size:10px;color:#c1cfc5}.room-discovery-list p{font-size:12px;text-align:center;margin:8px 0}
#invite-dialog .room-password-settings{grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:8px;width:100%;flex-wrap:wrap}
.room-password-settings input{width:160px!important;height:34px!important;min-height:34px!important;font-size:12px!important;padding:6px 10px!important}
.room-password-settings button{min-height:34px!important;padding:5px 10px!important;font-size:12px!important}
.room-password-settings small{flex-basis:100%;margin:0!important;font-size:10px!important}
body>dialog.room-scan-dialog[open]{width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 40px);padding:16px;overflow:auto}.room-scan-dialog h2{font-size:18px;margin:0 0 10px}.room-scan-dialog video{width:100%;max-height:50dvh;object-fit:cover;border-radius:14px;background:#10251e}.room-scan-dialog footer{display:flex;justify-content:center;gap:10px;margin-top:10px}.room-scan-dialog p{font-size:12px;margin:6px 0}
@media(max-height:420px){#home-dialog #join-room-dialog .join-content input{height:36px!important;min-height:36px!important;font-size:14px!important}#home-dialog #join-room-dialog #join-room{min-height:36px!important;height:36px!important}#home-dialog #join-room-dialog .join-content label{gap:4px!important}#home-dialog #join-room-dialog.settings-subpage[open]{gap:6px!important}#join-room-dialog .room-discovery{min-height:40px}}
@media(max-height:340px){body>dialog.animal-money-dialog[open]{padding:8px 12px!important;gap:3px!important}.animal-money-dialog .animal-money-footer{margin-top:6px!important;padding-top:6px!important}.animal-money-dialog .animal-money-keypad{gap:3px!important}}
@media(max-height:500px) and (min-width:600px){#home-dialog #join-room-dialog .join-content:has(#join-password-field:not([hidden])){grid-template-columns:1fr 1fr 1fr!important}#home-dialog #join-room-dialog .join-content:has(#join-password-field:not([hidden])) #join-password-field{grid-column:auto}}
@media(max-height:500px) and (max-width:599px){#home-dialog #join-room-dialog .join-content:has(#join-password-field:not([hidden])) #join-password-field{grid-column:1}#home-dialog #join-room-dialog .join-content:has(#join-password-field:not([hidden])) #join-room{grid-column:2;align-self:end}}
@media(max-height:340px){#home-dialog #join-room-dialog .settings-navigation{grid-template-columns:48px minmax(0,1fr) 48px!important;min-height:48px!important;height:48px!important}#join-room-dialog .settings-navigation button{width:48px!important;height:48px!important;min-height:48px!important}#home-dialog #join-room-dialog .join-content{gap:6px 10px!important}#home-dialog #join-room-dialog .join-content label{font-size:10px!important}#home-dialog #join-room-dialog.settings-subpage[open]{gap:4px!important}#join-room-dialog .join-tools button{min-height:30px!important;padding:4px 12px!important}}

/* Joining uses one form column beside its independently scrolling room list. */
#home-dialog:has(#join-room-dialog[open]){width:min(720px,calc(100vw - 28px))!important;max-width:720px!important;height:min(510px,calc(min(100dvh,var(--ui-height,100dvh)) - 32px))!important}
#home-dialog #join-room-dialog .join-layout{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:24px;flex:1;min-height:0;width:100%}
#join-room-dialog .join-left{display:flex;flex-direction:column;justify-content:center;min-height:0;gap:14px}
#home-dialog #join-room-dialog .join-left .join-content{display:flex!important;flex-direction:column;gap:10px!important;width:100%!important;margin:0!important;flex:none!important}
#home-dialog #join-room-dialog .join-left .join-content label{width:100%!important;max-width:none!important;margin:0!important;font-size:12px!important;gap:5px!important}
#home-dialog #join-room-dialog .join-left .join-content input{width:100%!important;max-width:none!important;flex:none!important;height:42px!important;min-height:42px!important;font-size:15px!important;line-height:1.3;padding:8px 12px!important}
#home-dialog #join-room-dialog .join-left #join-room{height:42px!important;min-height:42px!important;margin:0!important}
#join-room-dialog .join-left .join-tools{width:100%;flex:none}
#join-room-dialog #scan-room{width:100%;min-height:48px!important;border:1px solid #d8c28d88!important;background:#d1bc86!important;color:#20352b!important;font-size:16px!important;font-weight:600;box-shadow:0 3px 12px #0002}
#join-room-dialog #scan-room::before{content:'▣';font-size:21px;margin-right:9px;vertical-align:middle}
#join-room-dialog .join-layout .room-discovery{display:flex;flex-direction:column;overflow:hidden!important;min-height:0;margin:0;border-left:1px solid #ffffff18;padding:0 0 0 18px}
#join-room-dialog .room-discovery-heading{flex:none;margin:0 0 10px}
#join-room-dialog .room-discovery-list{display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto!important;overscroll-behavior:contain;touch-action:pan-y;gap:8px;scrollbar-width:thin;padding:1px 2px 6px}
#join-room-dialog .room-discovery-list>button{flex:none;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;width:100%;min-height:56px}
#join-room-dialog .room-discovery-list>p{margin:auto 0;font-size:12px}
#home-dialog #join-room-dialog .join-left #join-password-field[hidden]{display:flex!important}
#join-room-dialog #join-password:disabled{opacity:.6}
#players-dialog #room-edit-profile{min-height:34px!important;margin:0!important;font-size:12px!important;padding:6px 12px!important}
body>dialog.room-profile-dialog[open]{position:fixed!important;inset:0!important;transform:none!important;margin:auto!important;animation:none!important;width:min(380px,calc(100vw - 32px))!important;height:fit-content!important;max-height:calc(min(100dvh,var(--ui-height,100dvh)) - 40px)!important;overflow-y:auto!important;padding:18px!important;background:#203b30f5!important}
.room-profile-dialog h2{font-size:18px!important;letter-spacing:0!important;margin:0 0 12px!important}.room-profile-dialog form{display:flex;flex-direction:column;gap:10px;align-items:stretch}.room-profile-preview{width:48px;height:48px;border-radius:50%;object-fit:cover;align-self:center}.room-profile-dialog label{display:flex;align-items:center;gap:10px;font-size:12px;text-align:left}.room-profile-dialog input:not([type=file]){flex:1;min-width:0;height:38px;padding:8px 10px;border-radius:10px;border:1px solid #ffffff26;background:#122a23;color:inherit;text-align:center;font:inherit}.room-avatar-choices{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px}.room-avatar-choices button{padding:3px!important;min-height:34px!important;border-radius:50%;background:transparent}.room-avatar-choices img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:50%}.room-avatar-choices button[aria-pressed=true]{border-color:#e8cf91;background:#d7bc6930}.room-profile-dialog footer{display:grid;grid-template-columns:1fr 1fr;gap:10px}.room-profile-dialog footer button{margin:0!important;min-height:38px!important;padding:6px!important}.room-profile-hint{font-size:11px!important;margin:0!important;line-height:1.3!important;color:#ffd0b2!important}.room-profile-hint:empty{display:none}.room-profile-dialog #room-profile-upload{min-height:32px!important;padding:6px!important;font-size:12px!important}
@media(max-height:500px){#home-dialog #join-room-dialog .settings-navigation{grid-template-columns:48px minmax(0,1fr) 48px!important;height:48px!important;min-height:48px!important;margin-bottom:0!important}#join-room-dialog .settings-navigation button{width:48px!important;height:48px!important;min-height:48px!important}#home-dialog #join-room-dialog .join-left .join-content{gap:6px!important}#home-dialog #join-room-dialog .join-left .join-content label{font-size:11px!important;gap:3px!important}#home-dialog #join-room-dialog .join-left .join-content input{height:34px!important;min-height:34px!important;font-size:13px!important;padding:5px 8px!important}#home-dialog #join-room-dialog .join-left #join-room{height:34px!important;min-height:34px!important;font-size:13px!important}#join-room-dialog .join-left{gap:10px}#join-room-dialog #scan-room{min-height:38px!important;font-size:14px!important}}
@media(max-width:500px){#home-dialog #join-room-dialog .join-layout{grid-template-columns:minmax(0,1.18fr) minmax(0,1fr);gap:10px}#join-room-dialog .join-layout .room-discovery{padding-left:9px}#join-room-dialog .room-discovery-heading{flex-wrap:wrap;gap:6px;font-size:11px}#join-room-dialog .room-discovery-list>button{padding:8px!important;font-size:11px!important;min-height:60px}#join-room-dialog .room-discovery-list small{font-size:9px!important;line-height:1.5}#join-room-dialog #scan-room{font-size:13px!important;padding:6px!important}}
@media(max-height:340px){#home-dialog #join-room-dialog .join-left .join-content{gap:4px!important}#home-dialog #join-room-dialog .join-left .join-content label{font-size:10px!important;gap:1px!important}#home-dialog #join-room-dialog .join-left .join-content input{height:28px!important;min-height:28px!important}#home-dialog #join-room-dialog .join-left #join-room{height:30px!important;min-height:30px!important}#join-room-dialog .join-left{gap:6px}#join-room-dialog #scan-room{min-height:32px!important}body>dialog.room-profile-dialog[open]{padding:10px!important}.room-profile-dialog form{gap:6px}.room-profile-preview{width:36px;height:36px}.room-profile-dialog h2{margin-bottom:6px!important}}
@media(min-height:341px) and (max-height:380px){#home-dialog #join-room-dialog .join-left .join-content{gap:5px!important}#home-dialog #join-room-dialog .join-left .join-content input{height:32px!important;min-height:32px!important}#join-room-dialog .join-left{gap:8px}#join-room-dialog #scan-room{min-height:36px!important}}
@media(max-height:340px){#home-dialog #join-room-dialog .settings-navigation{grid-template-columns:40px minmax(0,1fr) 40px!important;height:40px!important;min-height:40px!important}#join-room-dialog .settings-navigation button{width:40px!important;height:40px!important;min-height:40px!important}#home-dialog #join-room-dialog .join-left .join-content input{height:26px!important;min-height:26px!important}}
@media(max-height:340px){#home-dialog #join-room-dialog .join-left .join-content{gap:2px!important}#join-room-dialog .join-left{gap:4px}#join-room-dialog #scan-room{height:30px!important;min-height:30px!important;padding:2px 8px!important;line-height:1!important}}

/* Room creation selects a game before the existing setup flow. */
#home-dialog #settings-create-room{grid-column:1/-1;width:100%;min-height:54px!important;font-size:16px!important;background:#cbb47ae0;color:#1d291b;border-color:#ead6a388}
#home-dialog .settings-page-host>#create-room-dialog[open]{justify-content:flex-start}
#create-room-dialog .game-modes{flex:1;min-height:0;align-content:center;gap:12px;padding:8px 0}
#create-room-dialog .settings-choice{height:110px!important;min-height:72px!important;font-size:16px!important;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}
#create-room-dialog .settings-choice small{margin:0;font-size:11px}
#home-dialog #join-room-dialog .join-actions-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;width:100%;flex:none}
#home-dialog #join-room-dialog .join-actions-row #join-room,#home-dialog #join-room-dialog .join-actions-row #scan-room{grid-column:auto!important;height:42px!important;min-height:42px!important;margin:0!important;padding:8px!important;font-size:14px!important;line-height:1.2!important}
#join-room-dialog #scan-room::before{content:none!important;display:none!important}
#join-room-dialog .join-actions-row .join-tools{display:block!important;width:100%;margin:0}
body>dialog#home-dialog.settings-dialog[open]:has(#join-room-dialog[open]){width:min(550px,calc(100vw - 28px))!important;max-width:550px!important;height:min(440px,calc(min(100dvh,var(--keyboard-height,100dvh)) - 28px))!important}
@media(max-height:500px){#create-room-dialog .settings-choice{height:80px!important;min-height:64px!important;font-size:14px!important}#home-dialog #join-room-dialog .join-actions-row #join-room,#home-dialog #join-room-dialog .join-actions-row #scan-room{height:36px!important;min-height:36px!important;font-size:12px!important;padding:5px!important}}
@media(max-width:500px){#home-dialog #join-room-dialog .join-actions-row{gap:6px}#home-dialog #join-room-dialog .join-actions-row #join-room,#home-dialog #join-room-dialog .join-actions-row #scan-room{font-size:11px!important;padding:5px 2px!important}}
@media(max-height:340px){#home-dialog #join-room-dialog .join-actions-row #join-room,#home-dialog #join-room-dialog .join-actions-row #scan-room{height:30px!important;min-height:30px!important}}

#create-room-dialog .game-modes{flex:none;width:min(420px,85%);margin:auto;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:repeat(2,52px);align-content:center;gap:12px;padding:10px 0}
#create-room-dialog .settings-choice{height:52px!important;min-height:44px!important;padding:8px 14px!important}
@media(max-height:500px){#create-room-dialog .game-modes{width:min(380px,85%);grid-template-rows:repeat(2,44px);gap:10px}#create-room-dialog .settings-choice{height:44px!important;min-height:44px!important}}
#invite-code{display:block;text-align:center;font-size:13px;font-weight:500;letter-spacing:1px;margin:0 0 8px}
body>dialog.room-password-dialog[open]{position:fixed!important;inset:0!important;transform:none!important;animation:none!important;margin:auto!important;width:min(360px,calc(100vw - 32px))!important;height:fit-content!important;max-height:calc(min(100dvh,var(--ui-height,100dvh)) - 40px)!important;overflow-y:auto!important;padding:20px!important;background:#213c32f5!important}
.room-password-dialog h2{font-size:17px!important;letter-spacing:0!important;margin:0 0 14px!important}.room-password-dialog form{display:flex;flex-direction:column;gap:12px}.room-password-dialog label{display:flex;flex-direction:column;gap:8px;text-align:left;font-size:12px}.room-password-dialog input{width:100%;height:42px;min-height:42px;border:1px solid #ffffff26;border-radius:12px;background:#122a23;color:inherit;padding:8px 12px;font:inherit}.room-password-dialog footer{display:grid;grid-template-columns:1fr 1fr;gap:10px}.room-password-dialog footer button{margin:0!important;min-height:38px!important}.room-password-hint{font-size:12px!important;color:#ffd1bb!important;margin:0!important;line-height:1.4!important}.room-password-hint:empty{display:none}

#character-list.room-seat-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-content:start;padding:8px;overflow:auto}.room-seat-card{display:flex;position:relative;align-items:center;justify-content:center;flex-direction:column;gap:4px;min-height:130px;padding:10px;border:1px solid #dfd7ac30;border-radius:20px;background:#ffffff06}.room-seat-card img{width:48px;height:48px;object-fit:contain}.room-seat-card small{position:absolute;left:12px;top:10px;color:#d9cc9b}.room-seat-card span{font-size:12px;opacity:.7}.room-seat-card button{min-height:28px;padding:4px 16px;font-size:13px}.room-seat-card .add-seat{font-size:34px;width:56px;height:56px;padding:0;background:transparent}.seat-occupant-dialog{position:fixed;inset:0;margin:auto;transform:none;width:min(450px,calc(100vw - 40px));max-height:calc(100dvh - 40px);overflow:auto;padding:20px;border-radius:24px;background:#244238;color:#f1eddf;border:1px solid #dfd7ac50}.seat-occupant-dialog h2{text-align:center}.seat-animal-list{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0}.seat-animal-list button{display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px}.seat-animal-list img{width:42px;height:42px;object-fit:contain}.room-options input{height:36px;width:160px;text-align:center}
@media(max-height:440px){.room-seat-card{min-height:100px;padding:6px}.room-seat-card img{width:36px;height:36px}}

#home-dialog #players-dialog:has(.room-seat-grid)>#players-invite,#home-dialog #players-dialog:has(.room-seat-grid) #room-change-seat{display:none!important}#home-dialog #players-dialog #character-list.room-seat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(88px,1fr));gap:8px;padding:2px 3px 5px;align-content:stretch}#home-dialog .room-seat-card{min-height:0;box-sizing:border-box}.room-seat-card .seat-move{position:absolute;right:8px;bottom:8px;padding:2px 7px;font-size:11px;min-height:24px}#home-dialog #players-dialog:has(.room-seat-grid) .players-footer{grid-template-columns:1fr 1fr!important}#home-dialog #players-dialog:has(.room-seat-grid) #apply-players{grid-column:2!important}#home-dialog #players-dialog:has(.room-seat-grid) #room-edit-profile{grid-column:1!important;grid-row:2!important;min-height:36px!important}

.room-seat-card .room-kick{position:absolute;right:8px;top:8px;font-size:11px;min-height:24px;padding:2px 7px}

.room-seat-card .remind-ready{position:absolute;right:8px;bottom:8px;font-size:11px;min-height:24px;padding:2px 7px}.ready-reminded{animation:ready-reminder-glow .65s ease-in-out 3}@keyframes ready-reminder-glow{50%{box-shadow:0 0 0 3px #e4d29a88}}@media(prefers-reduced-motion:reduce){.ready-reminded{animation:none;outline:2px solid #e4d29a}}

#home-dialog #players-dialog:has(.room-seat-grid) .players-footer{grid-template-columns:repeat(3,minmax(0,1fr))!important}#home-dialog #players-dialog:has(.room-seat-grid) #room-edit-profile{grid-column:1!important;grid-row:2!important}#home-dialog #players-dialog:has(.room-seat-grid) #players-exit-room{grid-column:2!important;grid-row:2!important;margin:0;min-height:36px}#home-dialog #players-dialog:has(.room-seat-grid) #apply-players{grid-column:3!important;grid-row:2!important;font-size:13px}#confirm-room-exit p{text-align:center;font-size:14px;line-height:1.6;margin:12px 0 20px}#confirm-room-exit footer{display:grid;grid-template-columns:1fr 1fr;gap:12px}#confirm-room-exit footer button{min-height:42px}

#ready-reminder-notice{position:fixed;z-index:3000;top:max(16px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);display:grid;grid-template-columns:40px 1fr auto;align-items:center;gap:12px;box-sizing:border-box;width:min(460px,calc(100vw - 32px));padding:18px 24px 18px 16px;border:1px solid #f5d080;background:linear-gradient(120deg,#fff3cd,#e9ca7e);color:#273e32;border-radius:22px;box-shadow:0 14px 45px #0006,0 0 0 5px #f5d08025;animation:ready-notice-enter .4s cubic-bezier(.2,.8,.3,1)}#ready-reminder-notice strong{display:block;font-size:19px;line-height:1.4}#ready-reminder-notice div>span{display:block;font-size:12px;margin-top:4px;color:#526047}.reminder-bell{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:#294535;color:#ffe8a2;animation:reminder-bell-ring .9s ease-in-out 4}.reminder-bell svg{width:26px;height:26px}#ready-reminder-notice>button{font-size:13px;min-height:38px;padding:6px 12px;background:#294535;color:#fff0c5;border:0;border-radius:12px}#ready-reminder-notice .reminder-dismiss{position:absolute;right:4px;top:2px;background:transparent;color:#53604b;padding:0;min-height:24px;width:24px;font-size:20px}.ready-reminded{animation:ready-reminder-pulse .8s ease-in-out 6!important}@keyframes ready-notice-enter{from{opacity:0;transform:translate(-50%,-26px) scale(.96)}to{opacity:1;transform:translate(-50%,0) scale(1)}}@keyframes reminder-bell-ring{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-18deg)}40%,80%{transform:rotate(18deg)}}@keyframes ready-reminder-pulse{50%{transform:scale(1.045);box-shadow:0 0 0 5px #f4d07b77,0 0 24px #f4d07b66;filter:brightness(1.15)}}@media(max-width:420px){#ready-reminder-notice{gap:8px;padding:16px 22px 16px 12px;grid-template-columns:34px 1fr auto}#ready-reminder-notice strong{font-size:16px}#ready-reminder-notice div>span{font-size:11px}.reminder-bell{width:34px;height:34px}#ready-reminder-notice>button{padding:6px 8px;font-size:12px}}@media(prefers-reduced-motion:reduce){#ready-reminder-notice,.reminder-bell,.ready-reminded{animation:none!important}.ready-reminded{outline:3px solid #f4d07b}}

#home-dialog>#ready-reminder-notice{width:min(460px,calc(100% - 24px));top:12px}

.opponent .autopilot-badge{position:absolute;left:6px;top:-8px;display:block;padding:2px 7px;border-radius:8px;background:#e9ca7e;color:#273e32;border:1px solid #ffe8a2;font-size:10px;font-style:normal;line-height:1.3;box-shadow:0 2px 8px #0004}.opponent.autopilot img{border:1px solid #e9ca7e}

#confirm-reset-round footer,#confirm-exit-round footer{display:grid;grid-template-columns:1fr 1fr;gap:12px}#confirm-reset-round p,#confirm-exit-round p{text-align:center;line-height:1.6}

#settlement-detail:has(>.payer-card:nth-child(3):last-child){grid-template-columns:repeat(3,minmax(0,1fr))}

#result #settlement-detail:has(>.payer-card:nth-child(3):last-child){grid-template-columns:repeat(3,minmax(0,1fr))!important}

.paifang-avatar[role="button"]{cursor:pointer}.paifang-avatar[role="button"]:focus-visible{outline:2px solid #c9e3cd;outline-offset:3px}

/* Room occupants use one compact row per seat on desktop and mobile. */
#players-dialog #character-list.room-seat-grid,#home-dialog #players-dialog #character-list.room-seat-grid{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:none!important;align-content:start;gap:8px}
#players-dialog .room-seat-card,#home-dialog .room-seat-card{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;gap:12px;min-height:76px;padding:10px 12px;box-sizing:border-box}
#players-dialog .room-seat-card>img{width:44px;height:44px;flex:0 0 44px;object-fit:contain;border-radius:50%;background:#ffffff0b}
#players-dialog .room-seat-info{display:flex;flex:1;min-width:0;flex-direction:column;align-items:flex-start;gap:3px;text-align:left}
#players-dialog .room-seat-info>b{font-size:14px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#players-dialog .room-seat-info>span{font-size:12px;opacity:.7}
#players-dialog .room-seat-info>small{position:static;font-size:10px;opacity:.7;color:inherit}
#players-dialog .room-seat-actions{display:flex;flex:none;gap:6px;align-items:center}
#players-dialog .room-seat-actions>button{position:static!important;margin:0!important;width:auto;height:auto;min-height:32px!important;padding:5px 9px!important;font-size:12px!important;white-space:nowrap}
@media(max-width:420px){#players-dialog .room-seat-card{gap:8px;padding:9px 8px}#players-dialog .room-seat-actions{gap:4px}#players-dialog .room-seat-actions>button{padding:5px 7px!important;font-size:11px!important}}

#players-dialog #character-list.room-seat-grid,#home-dialog #players-dialog #character-list.room-seat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(96px,auto))!important;align-content:start}
#players-dialog .room-seat-card,#home-dialog .room-seat-card{display:grid;grid-template-columns:34px minmax(0,1fr);gap:7px;min-height:96px;padding:8px}
#players-dialog .room-seat-card>img{width:34px;height:34px;grid-column:1;grid-row:1}
#players-dialog .room-seat-info{grid-column:2;grid-row:1;gap:2px}
#players-dialog .room-seat-actions{grid-column:1/-1;justify-content:flex-end;gap:4px;min-height:30px}
#players-dialog .room-seat-actions>button{padding:5px 6px!important;font-size:10px!important}
#home-dialog #players-dialog:has(.room-seat-grid) .players-footer{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px}
#home-dialog #players-dialog:has(.room-seat-grid) .players-footer>#room-edit-profile,#home-dialog #players-dialog:has(.room-seat-grid) .players-footer>#room-change-rules,#home-dialog #players-dialog:has(.room-seat-grid) .players-footer>#apply-players,#home-dialog #players-dialog:has(.room-seat-grid) .players-footer>#players-exit-room,#home-dialog #players-dialog:has(.room-seat-grid) .players-footer>#room-delete{grid-row:auto!important;grid-column:auto!important;min-height:36px!important;padding:6px 4px!important;margin:0!important;font-size:12px!important}
#home-dialog #players-dialog:has(.room-seat-grid) .players-footer>#room-edit-profile{order:1}#room-change-rules{order:2}#home-dialog #players-dialog:has(.room-seat-grid) .players-footer>#apply-players{order:3}#home-dialog #players-dialog:has(.room-seat-grid) .players-footer>#players-exit-room{order:4}#room-delete{order:5}#players-note{order:0}
body>dialog.room-profile-dialog[open]{inset:auto!important;top:calc(var(--keyboard-top,0px) + min(100dvh,var(--keyboard-height,100dvh))/2)!important;left:50%!important;margin:0!important;transform:translate(-50%,-50%)!important;max-height:calc(min(100dvh,var(--keyboard-height,100dvh)) - 24px)!important;box-sizing:border-box;overscroll-behavior:contain}
.room-profile-dialog input:not([type=file]){font-size:16px!important;scroll-margin-block:12px}.room-profile-dialog label{flex-shrink:0}

/* Half-height navigation: all three elements share a vertically centered 32 px row. */
.settings-navigation,:is(#home-dialog,#lobby,#entry,#coin-rules-dialog,#join-room-dialog) .settings-navigation,#home-dialog #join-room-dialog .settings-navigation{height:32px!important;min-height:32px!important;grid-template-columns:32px minmax(0,1fr) 32px!important;align-items:center!important;margin-bottom:6px!important;padding:0!important}
.settings-navigation>button,.settings-dialog .settings-navigation .navigation-close,.settings-dialog .settings-navigation button,.settings-navigation button.navigation-back,.settings-navigation button.navigation-close,#coin-rules-dialog .settings-navigation>button,#home-dialog #join-room-dialog .settings-navigation button{width:32px!important;height:32px!important;min-height:32px!important;min-width:32px!important;display:flex!important;align-items:center;justify-content:center;line-height:1!important;font-size:26px!important;padding:0!important}
.settings-navigation>.navigation-title{align-self:center;line-height:1.2}
#home-dialog #players-dialog:has(.room-seat-grid) .players-footer{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px}
#home-dialog #players-dialog:has(.room-seat-grid) .players-footer>button:is(#room-edit-profile,#room-change-rules,#apply-players,#players-exit-room,#room-delete){min-height:38px!important;font-size:11px!important;padding:5px 2px!important;line-height:1.25;white-space:normal;word-break:keep-all}
.settings-dialog .white-noise-row #noise-scene-choice{flex:1;min-width:0;max-width:55%;margin:0!important;min-height:36px!important;padding:6px 10px!important;background:linear-gradient(145deg,#47675cbb,#18372dcc)!important}
.settings-dialog .white-noise-row #scene-choice[hidden]{display:none!important}
body>dialog.noise-scene-dialog[open]{position:fixed!important;inset:auto!important;left:50%!important;top:calc(var(--keyboard-top,0px) + min(100dvh,var(--keyboard-height,100dvh))/2)!important;transform:translate(-50%,-50%)!important;margin:0!important;width:min(320px,calc(100vw - 32px))!important;max-height:calc(min(100dvh,var(--keyboard-height,100dvh)) - 32px)!important;overflow:auto;padding:18px!important;border-radius:24px!important;background:linear-gradient(145deg,#47675cbb,#18372dcc)!important;backdrop-filter:blur(24px) saturate(135%)!important;-webkit-backdrop-filter:blur(24px) saturate(135%)!important;border:1px solid #ffffff38!important;color:var(--ui-ink)}
.noise-scene-dialog h2{font-size:17px!important;margin:0 0 12px!important}.noise-scene-dialog>button{display:block;width:100%;min-height:36px!important;margin:4px 0!important;background:transparent!important;border-color:#ffffff20!important;font-size:13px!important}.noise-scene-dialog>button[aria-pressed=true]{background:#ffffff16!important;border-color:#ffffff40!important}
body>dialog.noise-scene-dialog[open]{background-color:#203b30!important;animation:none!important}
.noise-scene-dialog::backdrop{background:#06160e80;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}

#home-dialog #players-dialog .players-footer>#room-delete:not(:disabled),#confirm-room-delete #confirm-delete-room{background:transparent!important;border:1px solid #ffffff26!important;color:#ff3b30!important;box-shadow:none!important}#home-dialog #players-dialog .players-footer>#room-delete:not(:disabled):active,#confirm-room-delete #confirm-delete-room:active{background:transparent!important;color:#ff3b30!important}#confirm-room-delete h2{color:#ff3b30}
#chat-dialog #chat-log li{display:flex!important;align-items:center!important;gap:14px!important}
#chat-dialog #chat-log li>img{width:28px;height:28px;flex:0 0 28px;align-self:center!important;margin:0!important;object-fit:cover;border-radius:50%}
#chat-dialog #chat-log li>span{display:block;flex:1;min-width:0;align-self:center!important;line-height:1.5;margin:0!important;text-align:left}


/* Animal directory, personal profile and consistent segmented controls. */
:is(#home-dialog,#lobby) .settings-content>.settings-tabs{border-radius:16px!important;padding:4px!important;overflow:hidden;gap:4px!important;align-items:stretch}
:is(#home-dialog,#lobby) .settings-content>.settings-tabs>button{border-radius:11px!important;margin:0!important;min-width:0;flex:1;font-size:13px!important}
.seat-animal-list{grid-template-columns:repeat(2,minmax(0,1fr))}
.seat-animal-list button{flex-direction:row!important;align-items:center;justify-content:center;gap:10px;min-height:70px}
.seat-animal-list img{width:44px;height:44px;object-fit:cover;border-radius:50%;flex:0 0 44px}
.seat-animal-info{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;text-align:center}
.seat-animal-info small{display:block;color:var(--ui-muted);font-size:11px;margin:0}
#character-list .character-card{justify-content:center;align-items:center;text-align:center}
#character-list .character-card>div{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}
#character-list .character-card img{border-radius:50%;width:40px;height:40px;object-fit:cover}
#character-list .character-card small{display:block!important;margin:0!important;font-size:11px;color:var(--ui-muted)}
#character-list .character-card p{display:none}
#settings-personal{grid-column:1/-1;width:100%;height:100%;min-height:0}
:is(#home-dialog,#lobby) .settings-content>.settings-panel:has(#settings-personal){display:block!important;min-height:0!important;height:100%;overflow:hidden!important}
#paifang-dialog .paifang-layout{grid-template-columns:minmax(0,1fr)!important}
#paifang-dialog:not([data-screen=gallery]) .paifang-layout>.paifang-people{display:none!important}
#paifang-dialog[data-screen=gallery] .paifang-details{display:none!important}
#paifang-dialog[data-screen=gallery] .paifang-layout>.paifang-people{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-auto-rows:minmax(100px,auto);align-content:start;gap:10px!important;padding:4px!important;overflow-y:auto!important}
#paifang-dialog[data-screen=gallery] .paifang-people>button{flex-direction:column!important;align-items:center!important;justify-content:center!important;min-height:100px!important;padding:10px!important;gap:5px!important;text-align:center;font-size:13px!important}
#paifang-dialog[data-screen=gallery] .paifang-people img{width:48px!important;height:48px!important;border-radius:50%;object-fit:cover}
#paifang-dialog[data-screen=gallery] .paifang-people small{font-size:11px;color:var(--ui-muted);margin:0}
#paifang-dialog[data-screen=detail] .paifang-actions{display:flex!important;justify-content:center}
#paifang-dialog[data-screen=detail] .paifang-actions>[data-action=account],#paifang-dialog[data-screen=detail] .paifang-actions>[data-action=edit]{display:none!important}
@media(max-height:500px){#paifang-dialog[data-screen=gallery] .paifang-layout>.paifang-people{grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-auto-rows:minmax(86px,auto)}#paifang-dialog[data-screen=gallery] .paifang-people>button{min-height:86px!important}#paifang-dialog[data-screen=gallery] .paifang-people img{width:38px!important;height:38px!important}}

:is(#home-dialog,#lobby)>.settings-content>.settings-panel.settings-inactive:has(#settings-personal){display:none!important}
#paifang-dialog[data-screen=detail] [data-action=back]{display:block!important}

body>dialog.seat-occupant-dialog[open]{position:fixed!important;inset:auto!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;margin:0!important;width:min(420px,calc(100vw - 32px))!important;max-height:calc(100dvh - 28px)!important;height:auto!important;overflow-y:auto!important;padding:18px!important;border-radius:24px!important;background:linear-gradient(145deg,#35564cef,#17372df5)!important;backdrop-filter:blur(24px);border:1px solid #ffffff38!important;box-sizing:border-box}
.seat-occupant-dialog::backdrop{background:#06160e80;backdrop-filter:blur(6px)}
.seat-occupant-dialog h2{margin:0 0 10px!important;font-size:17px!important}
.seat-occupant-dialog>.primary,.seat-occupant-dialog>button:last-child{display:block;width:100%;margin:0!important;min-height:34px!important}
.seat-occupant-dialog .seat-animal-list{margin:10px 0;gap:6px}
.seat-occupant-dialog .seat-animal-list button{min-height:62px!important;padding:6px!important}
@media(max-height:500px){.seat-occupant-dialog .seat-animal-list button{min-height:54px!important}.seat-occupant-dialog .seat-animal-list img{width:36px;height:36px;flex-basis:36px}.seat-occupant-dialog .seat-animal-list{margin:8px 0}}

:is(#home-dialog,#lobby).show-settings-subpage>.settings-content>.settings-panel:has(:is(#settings-paifang,#settings-personal)){display:none!important}

body>dialog.seat-occupant-dialog[open]{animation:none!important}

/* Local player progress and the shop. */
#paifang-dialog[data-screen=profile] .paifang-body{display:flex!important;flex-direction:column!important;gap:14px!important}
#paifang-dialog[data-screen=profile] .paifang-portrait{width:100%!important;justify-content:center!important;flex-direction:column!important;text-align:center!important}
#paifang-dialog[data-screen=profile] .paifang-money{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important;gap:10px!important;flex:none!important}
#paifang-dialog[data-screen=profile] .paifang-money .paifang-field{padding:12px!important;border:1px solid #ffffff30;border-radius:16px;background:#ffffff0c;text-align:center}
#paifang-dialog[data-screen=profile] .paifang-money strong{font-size:24px!important;color:#ffe4a6!important;line-height:1.3}
#paifang-dialog[data-screen=profile] .paifang-money small{font-size:12px!important}
#paifang-dialog[data-screen=profile] .paifang-money .paifang-field:nth-child(3) strong{color:#ffb9ad!important}
#paifang-dialog[data-screen=profile] .paifang-money .paifang-field:nth-child(4) strong{color:#b6edce!important}
#paifang-dialog[data-screen=profile] .animal-ledger{width:100%!important;background:#061c1238;border:1px solid #ffffff25;padding:12px;border-radius:16px}
#paifang-dialog .animal-ledger h3{font-size:14px!important;color:#fff1cf;margin:0 0 8px!important}
#paifang-dialog[data-screen=profile] .animal-debt{font-size:15px!important;line-height:1.5;color:#ffe4ad;padding:8px 0!important}
#paifang-dialog .local-save-note{font-size:11px;line-height:1.6;color:var(--ui-muted)}
#paifang-dialog[data-screen=edit] .paifang-actions{display:flex!important}
#paifang-dialog[data-screen=edit] .paifang-edit{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
#paifang-dialog .personal-room-wallet{display:flex;flex-direction:column;gap:6px;padding:10px;border:1px solid #ffffff20;border-radius:12px;font-size:12px}
#paifang-dialog[data-screen=profile] .paifang-actions{display:flex!important;position:sticky;bottom:0;padding:8px 0;background:#203b30}
#paifang-dialog[data-screen=profile] .paifang-actions>button{font-size:12px!important;min-height:36px!important}
.shop-panel{width:100%;display:flex;flex-direction:column;gap:8px;padding:4px;box-sizing:border-box}
.shop-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.shop-heading strong{font-size:20px;color:#ffe4a6}.shop-note,.shop-panel>small{color:var(--ui-muted);font-size:11px}.shop-panel h3{font-size:15px;margin:10px 0 0}
.shop-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.shop-item{display:grid;grid-template-columns:40px minmax(0,1fr);align-items:center;gap:8px;padding:10px;border:1px solid #ffffff25;border-radius:16px;background:#ffffff0a}.shop-item img{width:40px;height:40px;object-fit:cover;border-radius:50%}.shop-noise-icon{display:flex;width:40px;height:40px;align-items:center;justify-content:center;background:#bbd6bc22;border-radius:50%;font-size:22px;color:#f1ddb3}.shop-item-info{display:flex;flex-direction:column;gap:4px;text-align:center}.shop-item-info small{font-size:11px;color:var(--ui-muted)}.shop-item button{grid-column:1/-1;width:100%;margin:0!important;min-height:32px!important;padding:6px!important;font-size:12px!important}.shop-message{margin:0!important;font-size:12px;color:#ffe4a6;line-height:1.5}
body>dialog.save-import-dialog[open]{width:min(340px,calc(100vw - 32px))!important;height:auto!important;padding:20px!important;background:#203b30!important;animation:none!important;border-radius:24px!important} .save-import-dialog p{font-size:13px;line-height:1.6}.save-import-dialog button{display:block;width:100%;margin:8px 0 0!important}
@media(max-width:500px){#paifang-dialog[data-screen=edit] .paifang-edit{grid-template-columns:1fr!important}}

#settings-shop{grid-column:1/-1;width:100%;min-width:0}
:is(#home-dialog,#lobby)>.settings-content>.settings-panel:not(.settings-inactive):has(#settings-shop){display:block!important;overflow-y:auto!important}
#paifang-dialog[data-screen=profile] .paifang-portrait{flex-direction:row!important;gap:10px!important;min-height:48px!important;margin:0!important}
#paifang-dialog[data-screen=profile] .paifang-portrait .paifang-avatar{flex:none;width:48px!important;height:48px!important}
#paifang-dialog[data-screen=profile] .paifang-portrait .paifang-avatar img{width:48px!important;height:48px!important}
#paifang-dialog[data-screen=profile] .paifang-money .paifang-field{padding:9px!important}
@media(min-width:501px){#paifang-dialog[data-screen=profile] .paifang-money{grid-template-columns:repeat(4,minmax(0,1fr))!important}}

#paifang-dialog[data-screen=profile] .paifang-body{flex-wrap:nowrap!important}
#paifang-dialog[data-screen=profile] .paifang-portrait{display:flex!important;flex-wrap:nowrap!important}
@media(min-width:501px) and (max-height:500px){#paifang-dialog[data-screen=profile] .paifang-money{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important}#paifang-dialog[data-screen=profile] .paifang-money .paifang-field{padding:8px 4px!important}#paifang-dialog[data-screen=profile] .paifang-money strong{font-size:22px!important}#paifang-dialog[data-screen=profile] .paifang-money small{font-size:11px!important}}
.shop-panel>small{display:block;margin:0!important;padding:0!important;min-height:0!important;line-height:1.5!important}
.shop-panel>h3{margin:8px 0 0!important;padding:0!important;min-height:0!important;line-height:1.4!important}
.shop-heading{min-height:28px!important}.shop-heading>b,.shop-heading>strong{margin:0!important;line-height:1.4!important}
.shop-item-info>b{font-size:14px!important;line-height:1.4;margin:0!important}.shop-item-info>small{margin:0!important;line-height:1.3!important}

.paifang-edit label,.paifang-edit input,.paifang-edit select,.paifang-edit textarea {text-align:left!important;}
.shop-item{display:flex!important;flex-direction:column;gap:8px;padding:12px!important;align-items:stretch!important}.shop-open-detail{display:flex!important;gap:12px;align-items:center;text-align:left;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;color:inherit;flex:1;min-width:0}.shop-open-detail .shop-item-info{min-width:0;flex:1}.shop-open-detail .shop-item-info b{white-space:normal}.shop-heading{flex-wrap:wrap}.shop-heading button{font-size:12px;padding:6px 12px}.shop-detail-dialog{width:min(660px,calc(100vw - 24px))!important;max-height:calc(100dvh - 24px)!important;padding:18px!important;overflow:auto!important;color:#eef2e8!important;background:#243a32!important;border-radius:24px!important}.shop-detail-dialog header{display:flex;justify-content:space-between;align-items:center;gap:16px}.shop-detail-dialog h2{margin:0;font-size:21px}.shop-detail-dialog header button{width:34px;height:34px;padding:0;font-size:24px}.shop-detail-preview{height:260px;border-radius:16px;background:#dce0d4;overflow:hidden;display:flex;align-items:center;justify-content:center;margin:14px 0}.shop-detail-preview canvas{display:block;width:100%;height:100%;touch-action:none}.shop-detail-preview img{width:150px;height:150px;border-radius:50%;object-fit:cover}.shop-detail-note{font-size:100px;color:#648570}.shop-detail-dialog p{font-size:14px;line-height:1.6;margin:12px 0}.shop-detail-dialog small{display:block;line-height:1.6;color:#bccbbe}.shop-detail-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}.shop-detail-message{color:#e4c890}.decor-toolbar{position:fixed;z-index:150;left:50%;bottom:12px;transform:translateX(-50%);width:min(760px,calc(100vw - 24px));background:#213d33ed;border:1px solid #a6bd9680;padding:12px;border-radius:18px;color:#f3f4e7;display:flex;gap:8px;align-items:center;flex-wrap:wrap;box-shadow:0 8px 32px #0005}.decor-toolbar[hidden]{display:none!important}.decor-toolbar strong{font-size:16px}.decor-toolbar small{width:100%;color:#becabb}.decor-toolbar button{font-size:12px;padding:8px 12px}.decor-selected{font-size:13px;flex:1;min-width:140px}.room-decorating>.floating,.room-decorating>.tools,.room-decorating>#avatars,.room-decorating>.opponent,.room-decorating>.lan-header{display:none!important}.paifang-edit label{align-items:flex-start!important}.paifang-edit input,.paifang-edit select{padding-left:12px!important;width:100%}.shop-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}@media(max-width:600px){.shop-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.shop-open-detail{flex-direction:column;align-items:flex-start!important}.shop-detail-preview{height:240px}.decor-toolbar{gap:6px}.decor-toolbar button{padding:8px;font-size:11px}}@media(orientation:landscape) and (max-height:500px){.shop-detail-preview{height:170px;float:left;width:48%;margin:12px 16px 12px 0}.shop-detail-actions{clear:both}.shop-detail-dialog p{font-size:12px}.shop-detail-dialog{padding:14px!important}}
/* Floating product preview and a compact right-side room toolbar. */
.shop-detail-dialog{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(130px,.55fr)!important;gap:22px!important;align-items:center!important;width:min(920px,calc(100vw - 36px))!important;height:min(590px,calc(100dvh - 36px))!important;padding:24px!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;overflow:hidden!important;text-align:left!important}.shop-detail-dialog:not([open]){display:none!important}.shop-detail-dialog::backdrop{background:transparent!important;backdrop-filter:none!important}.shop-details-open #home-dialog{visibility:hidden!important}.shop-detail-preview{float:none!important;width:100%!important;height:100%!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;overflow:hidden!important}.shop-detail-preview canvas{width:100%!important;height:100%!important}.shop-detail-info{min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:20px;color:#fff5df;text-shadow:0 2px 7px #000b}.shop-detail-info h2{font-size:25px!important;line-height:1.4;margin:0!important}.shop-detail-info strong{font-size:20px}.shop-detail-actions{margin:0!important;clear:none!important;display:flex!important;flex-direction:column;align-items:stretch;gap:12px;min-width:125px;max-width:100%}.shop-detail-actions button{margin:0!important;min-height:42px!important;padding:10px 18px!important}.shop-detail-message:empty{display:none}.shop-detail-close{position:absolute;top:0;right:0;width:38px;height:38px;padding:0!important;font-size:24px;z-index:1}.shop-media-preview{display:flex!important;position:relative;align-items:center;justify-content:center;background:transparent!important;border:0!important;padding:0!important;width:100%;height:100%;box-shadow:none!important}.shop-preview-play{position:absolute;bottom:20%;font-size:30px;color:#f6e7c6;text-shadow:0 2px 5px #000a}.shop-media-preview img{width:min(220px,80%)!important;height:auto!important;aspect-ratio:1;border-radius:50%}.shop-detail-note{font-size:120px}.decor-toolbar{left:auto!important;right:max(16px,env(safe-area-inset-right))!important;top:50%!important;bottom:auto!important;transform:translateY(-50%)!important;width:auto!important;display:flex!important;flex-direction:column!important;gap:12px!important;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;border-radius:0!important}.decor-toolbar[hidden]{display:none!important}.decor-toolbar button{min-width:98px;min-height:44px;font-size:14px!important;border-radius:14px!important;background:#264339c9!important;box-shadow:0 2px 8px #0002}.decor-toolbar button:disabled{opacity:.4}@media(max-width:600px){.shop-detail-dialog{gap:12px!important;padding:12px!important;grid-template-columns:minmax(0,1fr) 125px!important;width:calc(100vw - 20px)!important;height:min(460px,calc(100dvh - 36px))!important}.shop-detail-info{gap:16px}.shop-detail-info h2{font-size:19px!important}.shop-detail-info strong{font-size:17px}.shop-detail-actions{min-width:112px}.shop-detail-actions button{font-size:12px!important;padding:8px 12px!important}.decor-toolbar{right:12px!important;gap:9px!important}.decor-toolbar button{min-width:78px;font-size:12px!important;padding:9px 10px!important}.shop-preview-play{bottom:28%;font-size:24px}}@media(orientation:landscape) and (max-height:500px){.shop-detail-dialog{height:calc(100dvh - 24px)!important;max-height:calc(100dvh - 24px)!important;grid-template-columns:minmax(0,1fr) minmax(170px,.55fr)!important;padding:18px!important}.shop-detail-info h2{font-size:22px!important}.shop-detail-info{gap:14px}.shop-detail-preview{height:100%!important}.decor-toolbar{gap:8px!important}.decor-toolbar button{min-height:40px!important}}
body>dialog.shop-detail-dialog[open]{max-width:calc(100vw - 36px)!important;background:transparent!important;background-image:none!important;border:0!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;filter:none!important}body>dialog.shop-detail-dialog[open]::backdrop{background:transparent!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}.shop-media-preview{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}.shop-detail-info h2{letter-spacing:0!important}.shop-details-open>.tools,.shop-details-open>.lan-header{visibility:hidden!important}
body>dialog.shop-detail-dialog[open]{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(180px,.55fr)!important;grid-template-rows:minmax(0,1fr)!important;width:min(920px,calc(100vw - 36px))!important;height:min(590px,calc(100dvh - 36px))!important;padding:24px!important;align-items:center!important;gap:22px!important;inset:0!important;margin:auto!important}.shop-detail-preview{grid-column:1!important;grid-row:1!important}.shop-detail-info{grid-column:2!important;grid-row:1!important}@media(max-width:600px){body>dialog.shop-detail-dialog[open]{grid-template-columns:minmax(0,1fr) 125px!important;width:calc(100vw - 20px)!important;height:min(460px,calc(100dvh - 36px))!important;padding:12px!important;gap:12px!important}}@media(orientation:landscape) and (max-height:500px){body>dialog.shop-detail-dialog[open]{height:calc(100dvh - 24px)!important;padding:18px!important}}
body>dialog.shop-detail-dialog[open]{transform:none!important;translate:none!important;animation:none!important;position:fixed!important;min-width:0!important;min-height:0!important;flex-direction:initial!important}.shop-details-open>.floating{visibility:hidden!important}@media(max-width:600px){body>dialog.shop-detail-dialog[open]{width:calc(100vw - 20px)!important;max-width:calc(100vw - 20px)!important}}
body>dialog.shop-detail-dialog[open]{width:var(--shop-modal-width,min(550px,calc(100vw - 28px)))!important;max-width:calc(100vw - 28px)!important;height:var(--shop-modal-height,min(440px,calc(100dvh - 28px)))!important;max-height:calc(100dvh - 28px)!important;background:var(--ui-glass,#243f34)!important;border:1px solid var(--ui-line,#ffffff26)!important;border-radius:24px!important;box-shadow:inset 0 1px 0 #ffffff28,0 18px 48px #0004!important;padding:24px!important;grid-template-columns:minmax(0,1fr) minmax(160px,.72fr)!important;gap:16px!important}.shop-detail-info{height:100%;justify-content:center;align-items:center;gap:18px;text-align:center;text-shadow:none}.shop-detail-info h2{text-align:center!important;font-size:22px!important}.shop-detail-info strong{text-align:center;font-size:20px}.shop-detail-actions{align-items:stretch;width:min(160px,100%);min-width:0!important}.shop-detail-actions button{text-align:center}.shop-detail-close{top:8px;right:8px}.shop-detail-message{margin:0!important;text-align:center;line-height:1.3!important;font-size:13px!important}body>dialog.shop-detail-dialog[open]::backdrop{background:#03100b60!important}.decor-left{position:fixed;z-index:150;left:max(14px,env(safe-area-inset-left));top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:9px;width:126px;background:transparent}.decor-left[hidden]{display:none!important}.decor-left button{min-height:40px;padding:8px;font-size:13px;border-radius:12px;background:#264339c9;box-shadow:0 2px 8px #0002}.decor-left button[aria-pressed=true]{border-color:#dfc583;background:#5a6146dd;color:#fff0c6}.decor-left button:disabled{opacity:.4}.decor-left button[hidden]{display:none!important}.decor-arrows{display:grid;grid-template-columns:repeat(3,1fr);gap:5px}.decor-arrows button:nth-child(1){grid-column:2;grid-row:1}.decor-arrows button:nth-child(2){grid-column:1;grid-row:2}.decor-arrows button:nth-child(3){grid-column:3;grid-row:2}.decor-arrows button:nth-child(4){grid-column:2;grid-row:3}.decor-arrows button{font-size:20px;min-width:0;padding:3px}.shop-purchase-confirm footer{display:flex;gap:12px;margin-top:20px}.shop-purchase-confirm footer button{flex:1;margin:0!important}.shop-purchase-confirm h2{margin:0 0 14px!important}.shop-purchase-confirm p{font-size:15px!important;margin:0!important}body>dialog.shop-purchase-confirm[open]{inset:0!important;transform:none!important;position:fixed!important;margin:auto!important;width:min(340px,calc(100vw - 28px))!important;max-width:340px!important;height:fit-content!important;padding:24px!important;background:#243f34f9!important;border-radius:24px!important;text-align:center!important;display:block!important;animation:none!important}@media(max-width:600px){body>dialog.shop-detail-dialog[open]{padding:16px!important;grid-template-columns:minmax(0,1fr) 125px!important;gap:10px!important}.shop-detail-info h2{font-size:19px!important}.shop-detail-info strong{font-size:17px}.shop-detail-info{gap:16px}.decor-left{left:10px;width:104px;gap:7px}.decor-left button{font-size:12px;padding:6px}.decor-arrows button{font-size:18px;min-height:36px}.decor-toolbar{right:10px!important}}@media(orientation:landscape) and (max-height:500px){body>dialog.shop-detail-dialog[open]{padding:20px!important}.decor-left{gap:6px}.decor-left button{min-height:35px}.decor-arrows button{min-height:32px}.shop-detail-info h2{font-size:20px!important}.shop-detail-info{gap:12px}.shop-detail-actions{gap:8px!important}}
.shop-message{position:sticky;top:0;z-index:2;padding:8px 10px!important;background:#213d33f5;border-radius:10px}.shop-message:empty{display:none}

/* Solid panels keep game scenery from showing through product details. */
body>dialog.shop-detail-dialog[open]{background:#243f34!important;background-image:linear-gradient(145deg,#304d40,#20382e)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}.shop-design-image{width:58px;height:58px;object-fit:cover;border-radius:9px}.decor-inventory{background:#243f34!important;color:#f2efdf;width:min(440px,calc(100vw - 28px))!important;max-height:calc(100dvh - 28px)!important;height:auto!important;inset:0!important;transform:none!important;padding:20px!important;overflow:auto!important;border-radius:24px!important}.decor-inventory h2{margin:0 0 16px}.decor-inventory-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:16px}.decor-inventory-list button{display:flex;align-items:center;gap:8px;padding:10px;font-size:13px}.decor-inventory-list img{width:40px;height:40px;object-fit:cover;border-radius:6px}.decor-inventory-list p{grid-column:1/-1}.decor-toolbar button{min-height:40px!important}.decor-toolbar{gap:8px!important}

/* Stable personal controls and room tools. */
#paifang-dialog[data-screen=profile] .paifang-actions{background:transparent!important;box-shadow:none!important;border:0!important}
#paifang-dialog[data-screen=edit] .paifang-edit label{flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;gap:5px!important;width:100%;min-width:0}
#paifang-dialog[data-screen=edit] .paifang-edit input,#paifang-dialog[data-screen=edit] .paifang-edit select{display:block!important;box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;height:36px!important;min-height:36px!important;margin:0!important}

#paifang-dialog[data-screen=edit] .paifang-actions>[data-action=back]{display:block!important}

/* Fixed modal placement must not inherit the transform animation from game.css. */
body>dialog.settings-dialog[open],body>dialog.decor-inventory[open]{animation:none!important;inset:0!important;margin:auto!important;transform:none!important;translate:none!important}
button:focus,button:focus-visible,body>dialog button:focus-visible{outline:none!important}
.decor-left,.decor-toolbar{width:112px!important;gap:8px!important}
.decor-left button,.decor-toolbar button{box-sizing:border-box!important;width:112px!important;min-width:112px!important;height:42px!important;min-height:42px!important;padding:8px!important;margin:0!important;font-size:13px!important;line-height:1.2!important;border:1px solid #ffffff26!important;border-radius:12px!important;background:#264339e8!important;color:#f3f4e7!important;box-shadow:0 2px 8px #0002!important}
.decor-inventory-list button{flex-direction:column;justify-content:center;text-align:center;min-height:100px;gap:8px}.decor-inventory-list img{width:52px;height:52px;object-fit:cover}
.shop-message:empty{display:none}.shop-heading{justify-content:space-between}

#settings-shop .shop-open-detail{justify-content:center!important;align-items:center!important;text-align:center!important;min-height:64px;flex-direction:column!important}
#settings-shop .shop-item-info{width:100%;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}
#settings-shop .shop-item-info b{white-space:nowrap!important;font-size:clamp(11px,1.35vw,15px)!important;line-height:1.4}#settings-shop .shop-item-info small{margin:0!important}#settings-shop .shop-item>button{text-align:center!important}
.shop-preview-play{display:grid!important;place-items:center!important;width:52px;height:52px;border-radius:50%;bottom:16%!important;left:50%;transform:translateX(-50%);background:#294c3bb8;color:#e9e8d7;border:0;box-shadow:0 4px 14px #0003;text-shadow:none!important;transition:background .15s,transform .15s}.shop-preview-play svg{width:24px;height:24px}.shop-media-preview:hover .shop-preview-play{background:#416650cf}.shop-media-preview:active .shop-preview-play{transform:translateX(-50%) scale(.95)}
#paifang-dialog[data-screen=profile] .paifang-actions>button{background:#345746!important;backdrop-filter:none!important}
#actions button,#tile-action button,.response-panel button{border:0!important;box-shadow:none!important;outline:none!important}

#stage canvas{touch-action:none!important}

.shop-animal-detail .shop-detail-info{gap:9px!important;min-height:0;padding:8px 0;box-sizing:border-box}.shop-animal-about{width:100%;min-height:0;flex:1;overflow-y:auto;text-align:left;padding:0 4px;box-sizing:border-box}.shop-animal-about dl{display:grid;grid-template-columns:65px minmax(0,1fr);column-gap:8px;row-gap:9px;margin:0;font-size:12px;line-height:1.5}.shop-animal-about dt{color:#aebfb2}.shop-animal-about dd{margin:0;color:#edf0df;overflow-wrap:anywhere}.shop-animal-detail .shop-detail-info h2{font-size:21px!important}.shop-animal-detail .shop-detail-info strong{font-size:17px}.shop-animal-detail .shop-detail-actions{flex-shrink:0}
.shop-feedback{position:fixed;z-index:4000;left:50%;bottom:20px;transform:translateX(-50%);width:max-content;max-width:calc(100% - 40px);padding:11px 20px;border-radius:14px;color:#f0ead8;background:#233e32;box-shadow:0 5px 20px #0003;border:0;font-size:14px;line-height:1.45;text-align:center;pointer-events:none}dialog>.shop-feedback{bottom:12px}

#paifang-dialog[data-screen=profile] .paifang-actions{display:flex!important;flex-wrap:nowrap!important;gap:6px!important}#paifang-dialog[data-screen=profile] .paifang-actions>button{flex:1 1 0!important;min-width:0!important;padding:7px 3px!important;white-space:nowrap;font-size:11px!important}#paifang-dialog .paifang-actions>[data-action=delete],.profile-delete-action{color:#ff6767!important}.profile-avatar-editor{width:100%;display:flex;align-items:center;gap:12px;margin-top:8px}.profile-avatar-editor img{width:54px;height:54px;border-radius:50%;object-fit:cover}.profile-avatar-editor button{flex:1;min-height:36px;margin:0!important}.profile-delete-confirm p{line-height:1.7!important}

.room-seat-role{display:flex!important;align-items:center;gap:7px;flex-wrap:wrap}.room-seat-role .room-seat-ready{position:static!important;display:inline!important;margin:0!important;font-size:inherit!important;line-height:inherit}.room-seat-ready[data-ready=false]{color:#ff6767!important}.room-seat-ready[data-ready=true]{color:#e8cf84!important}
#home-dialog #players-dialog:has(.room-seat-grid) #character-list{flex:0 1 auto!important;max-height:calc(100% - 92px);overflow-y:auto!important}#home-dialog #players-dialog:has(.room-seat-grid)>#players-note{flex:1 0 32px!important;min-height:32px!important;display:flex!important;align-items:center;justify-content:center;margin:0!important;padding:0!important;text-align:center}#home-dialog #players-dialog:has(.room-seat-grid) .players-footer{padding-top:0!important}
#ready-reminder-notice{top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;animation:none!important;margin:0!important}

/* Show the local player's avatar above their hand, like the other seats. */
.opponent.human.floating:not([hidden]){display:flex!important}



#continue-round{bottom:auto;transform:translateX(-50%)}


.shop-detail-actions .shop-sell[hidden]{display:none!important}
.shop-detail-actions .shop-sell{color:#ead49b}
.blood-preparation[open]{position:fixed!important;inset:0!important;margin:auto!important;width:min(620px,calc(100vw - 28px))!important;max-height:calc(100dvh - 28px)!important;height:fit-content!important;display:block!important;background:#243f34!important;padding:22px!important;border-radius:24px!important;text-align:center!important;overflow:auto}.blood-preparation h2{font-size:22px;margin:0 0 10px}.blood-preparation p{margin:8px 0 18px;color:#e1dbc8}.blood-exchange-tiles{display:flex;flex-wrap:wrap;justify-content:center;gap:5px;margin:14px 0}.blood-exchange-tiles button{padding:2px;min-height:0;min-width:0;background:#ede5d2;border:0;border-radius:5px}.blood-exchange-tiles img{display:block;width:32px;height:46px}.blood-exchange-tiles button[aria-pressed=true]{transform:translateY(-8px);box-shadow:0 0 0 2px #e8c775}.blood-missing-buttons{display:flex;justify-content:center;gap:16px;margin:24px 0}.blood-missing-buttons button{min-width:90px;background:#345447;padding:12px;border:0}.blood-preparation footer{margin-top:18px}.blood-preparation [hidden]{display:none!important}.blood-won{opacity:.86}.blood-won small{color:#f0d08b}.blood-rule-info{font-size:12px;line-height:1.8;color:#e4e0cf}.blood-meld{display:inline-flex;margin-left:10px;gap:2px}.blood-winning-hand{margin-bottom:16px}.blood-winning-hand .result-tile-row{flex-wrap:wrap}.blood-winning-hand img{width:25px;height:36px}.blood-rules-extra[hidden]{display:none!important}

.opponent.floating span.blood-seat-status{display:block!important;font-size:11px!important;line-height:1.4!important;color:#efcf8b!important;opacity:1!important;margin-top:3px!important}
#result[data-variant=blood] #settlement-detail{grid-template-columns:repeat(2,minmax(0,1fr))!important;align-content:start!important}#result[data-variant=blood] .payer-summary{flex-direction:row!important;gap:8px!important}#result[data-variant=blood] .payer-total{flex:1;flex-wrap:wrap;justify-content:center}#result[data-variant=blood] .payer-total>span{flex-basis:100%}#result[data-variant=blood] .payment-component{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;text-align:left;gap:6px!important;align-items:center;line-height:1.5!important}#result[data-variant=blood] .payment-component>span{min-width:0;overflow-wrap:anywhere;white-space:normal!important}#result[data-variant=blood] .payment-component strong{white-space:nowrap}#result[data-variant=blood]>.settings-panel{overflow-y:auto!important}#result .blood-winning-hand .result-tile{width:25px!important;height:36px!important}#result .blood-winning-hand .result-tile img{width:19px!important;height:29px!important}#coin-rules-form .rule-mode[hidden]{display:none!important}
body>dialog#blood-preparation[open]{width:min(620px,calc(100vw - 28px))!important;max-width:620px!important}#blood-preparation .blood-exchange-tiles button{background:#eee6d5!important;width:34px!important;min-width:34px!important;min-height:48px!important;border:0!important;border-radius:5px!important;margin:0!important;padding:2px!important;box-shadow:inset 0 -2px 0 #c2b69f!important}#blood-preparation .blood-exchange-tiles button[aria-pressed=true]{box-shadow:0 0 0 2px #e8c775,inset 0 -2px 0 #c2b69f!important}#blood-preparation .blood-exchange-tiles img{width:30px!important;height:44px!important}
#blood-preparation .blood-exchange-tiles button{position:relative!important;display:flex!important;align-items:center!important;justify-content:center!important;flex:0 0 34px!important;overflow:visible!important}#blood-preparation .blood-tile-label{font-size:16px!important;line-height:20px!important;writing-mode:vertical-rl;color:#17613d;text-shadow:none}#blood-preparation [data-suit="0"] .blood-tile-label{color:#b12e28}#blood-preparation .blood-exchange-tiles img{flex:none!important;object-fit:contain!important}

#coin-rules-dialog[data-variant=blood] .blood-option-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 18px;width:100%}#coin-rules-dialog[data-variant=blood] .blood-option-grid[hidden]{display:none!important}#coin-rules-dialog[data-variant=blood] .blood-option-grid label{display:flex!important;align-items:center;justify-content:space-between;gap:12px;margin:0!important;padding:9px 12px!important;border-radius:12px;background:#ffffff08;min-height:40px}#coin-rules-dialog[data-variant=blood] .rules-card{width:100%}#coin-rules-dialog[data-variant=blood] .rules-card:has(>.rules-extra-grid)>header{display:none}#coin-rules-dialog[data-variant=blood] .blood-option-grid input[type=checkbox]{flex-shrink:0}@media(max-width:520px){#coin-rules-dialog[data-variant=blood] .blood-option-grid{grid-template-columns:1fr}}
#coin-rules-dialog[data-variant=blood] .rules-card:has([name=bloodMaxFan]) .blood-option-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px 10px}#coin-rules-dialog[data-variant=blood] .rules-card:has([name=bloodMaxFan]) .blood-option-grid label{min-height:32px!important;padding:5px 7px!important;font-size:11px!important;line-height:1.4}#coin-rules-dialog[data-variant=blood] label:has([name=base]){margin:0 0 6px!important;padding:5px 8px!important;min-height:32px!important}@media(max-width:650px){#coin-rules-dialog[data-variant=blood] .rules-card:has([name=bloodMaxFan]) .blood-option-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}#missing-suit-notice[open]{position:fixed!important;inset:0!important;margin:auto!important;display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:16px;width:280px!important;height:150px!important;padding:22px!important}#missing-suit-notice p{font-size:18px!important;margin:0!important}#missing-suit-notice button{width:100%}
#coin-rules-dialog[data-variant=blood] .rules-card:has([name=bloodMaxFan]) .blood-option-grid label{height:30px!important;min-height:30px!important;box-sizing:border-box!important}#coin-rules-dialog[data-variant=blood] .rules-card:has([name=bloodMaxFan]) .blood-option-grid{gap:4px 10px!important}#coin-rules-dialog[data-variant=blood] label:has([name=base]){height:34px!important;min-height:34px!important;box-sizing:border-box!important}#coin-rules-dialog[data-variant=blood] .blood-option-grid .rule-value input{width:48px!important;height:28px!important;min-height:28px!important}#coin-rules-dialog[data-variant=blood] .blood-option-grid input[type=checkbox]{width:18px!important;height:18px!important;min-height:18px!important}
/* Blood rules: center the basic choices and keep each label with its switch. */
#coin-rules-dialog[data-variant=blood] #coin-rules-form>.basic-rules:not(.settings-inactive):not([hidden]){display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;padding:14px 8px!important;box-sizing:border-box}
#coin-rules-dialog[data-variant=blood] .basic-rules>.rules-toggles{width:100%!important;max-width:480px!important;margin:auto!important;padding:0!important}
#coin-rules-dialog[data-variant=blood] .basic-rules .blood-option-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important}
#coin-rules-dialog[data-variant=blood] #coin-rules-form .blood-option-grid label{border:1px solid #b8cfba38!important;background:#11291f66!important;border-radius:10px!important;box-shadow:inset 0 1px 0 #ffffff08!important}
#coin-rules-dialog[data-variant=blood] .basic-rules .blood-option-grid label{height:64px!important;min-height:64px!important;padding:14px 16px!important;box-sizing:border-box!important;font-size:14px!important;gap:14px!important}
#coin-rules-dialog[data-variant=blood] .basic-rules .blood-option-grid label:has(input:disabled){background:#26392d66!important;border-style:dashed!important}
/* Blood results: one reading order, with separate round totals and transfers. */
#result[data-variant=blood] #settlement-detail.blood-settlement{display:flex!important;flex-direction:column!important;gap:18px!important;width:100%;padding:0!important}
#result[data-variant=blood] #result-title{display:flex!important;flex-direction:column!important;gap:5px!important;align-items:center!important;font-size:19px!important}
.blood-result-heading{font-weight:700}.blood-result-reason{font-size:12px;color:#bdccbc;font-weight:400}
#result[data-variant=blood] .blood-result-section{display:flex;flex-direction:column;gap:8px;width:100%;box-sizing:border-box;padding:12px;border:1px solid #bfceb82d;border-radius:14px;background:#132c2366}
#result[data-variant=blood] .blood-result-section h3{font-size:14px!important;margin:0 0 3px!important;color:#e7d3a2;text-align:left}
#result[data-variant=blood] .blood-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#result[data-variant=blood] .blood-player-summary{margin:0!important;padding:11px!important;border:1px solid #c6d0bb26!important;border-radius:10px!important;background:#ffffff05!important;display:flex!important;flex-direction:column!important;gap:8px!important}
#result[data-variant=blood] .blood-player-summary header{margin:0!important;line-height:1.5!important;text-align:left!important}
#result[data-variant=blood] .blood-player-summary header b{font-size:12px!important;white-space:normal!important}
#result[data-variant=blood] .blood-player-summary.payer-self{border-color:#d6bd7470!important;background:#dec3840c!important}
#result[data-variant=blood] .blood-net{font-size:23px;line-height:1.2;text-align:left}.blood-net[data-sign=win]{color:#e4c77c}.blood-net[data-sign=loss]{color:#f2a29a}
.blood-summary-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;font-size:11px;color:#d8e0d2;text-align:left}.blood-current-due{color:#ddc78e;font-size:11px;text-align:left}
#result[data-variant=blood] .blood-result-note{font-size:11px!important;line-height:1.6!important;margin:2px 0 0!important;color:#b4c8b8!important;text-align:left!important}
.blood-win-record,.blood-ledger-entry{display:flex;flex-direction:column;gap:5px;padding:10px 12px;border:1px solid #c6d0bb26;border-radius:10px;background:#ffffff05;text-align:left;font-size:12px;line-height:1.5;box-sizing:border-box}
.blood-win-record b{color:#ead69f}.blood-win-record small,.blood-ledger-status{color:#b7cabc;font-size:11px}.blood-ledger-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.blood-ledger-heading b{font-weight:600;min-width:0;overflow-wrap:anywhere}.blood-ledger-heading strong{flex-shrink:0;color:#e7ce8f;font-size:14px}.blood-ledger-label{color:#dde5d8}.blood-ledger-entry[data-current=true]:not(.payment-already-settled){border-color:#dac38166;background:#dec3840a}
@media(max-width:500px){#result[data-variant=blood] .blood-summary-grid{grid-template-columns:1fr}#coin-rules-dialog[data-variant=blood] .basic-rules .blood-option-grid label{font-size:12px!important;padding:12px!important}}
#coin-rules-dialog[data-variant=blood] .basic-rules>.rules-toggles{display:block!important;grid-template-columns:none!important}#coin-rules-dialog[data-variant=blood] .basic-rules .blood-option-grid{width:100%!important}#result[data-variant=blood] .blood-result-section{flex-shrink:0}
#result[data-variant=blood] #settlement-detail.blood-settlement{justify-content:flex-start!important;align-items:stretch!important;overflow-y:auto!important}#result[data-variant=blood]>.settings-panel:not(.settings-inactive):has(#settlement-detail){overflow:hidden!important}
@media(min-width:800px){#result[data-variant=blood] .blood-summary-grid{grid-template-columns:repeat(4,minmax(0,1fr))}#result[data-variant=blood] .blood-player-summary{padding:7px!important;gap:4px!important}#result[data-variant=blood] .blood-player-summary header{min-height:0!important;gap:2px!important;padding:0!important}#result[data-variant=blood] .blood-player-summary header b{font-size:10px!important;line-height:1.4!important}#result[data-variant=blood] .blood-player-balance{font-size:10px!important;color:#b7cabc;line-height:1.3}#result[data-variant=blood] .blood-net{font-size:21px}#result[data-variant=blood] .blood-summary-metrics{font-size:9px;gap:3px;line-height:1.4}#result[data-variant=blood] .blood-current-due{font-size:9px;line-height:1.4}}

#join-room-dialog .room-discovery-list .room-mode{font-size:11px;color:#f3d48d;border:1px solid #f3d48d55;border-radius:5px;padding:2px 7px;line-height:1.4}

/* Keep checked switches clean; each scoring control has its own row. */
#coin-rules-dialog :is(input,select):focus,#coin-rules-dialog :is(input,select):focus-visible{outline:none!important}
#coin-rules-dialog[data-variant=blood] label:has([name=base]),#coin-rules-dialog[data-variant=blood] .blood-option-grid label:has([name=bloodMaxFan]),#coin-rules-dialog[data-variant=blood] .blood-option-grid label:has([name=bloodSelfDrawFan]){grid-column:1/-1!important;display:flex!important;align-items:center!important;justify-content:space-between!important;width:100%!important;box-sizing:border-box!important;border:1px solid #b8cfba38!important;background:#11291f66!important;border-radius:10px!important;padding:8px 12px!important;height:38px!important;min-height:38px!important;box-shadow:inset 0 1px 0 #ffffff08!important}
#missing-suit-notice button{touch-action:manipulation}

#coin-rules-dialog[data-variant=blood] #coin-rules-form label:has([name=base]){margin:0 0 4px!important}
body>#coin-rules-dialog[data-room-modal=true][open]{transform:none!important;animation:none!important;position:fixed!important;inset:0!important;margin:auto!important;width:min(620px,calc(100vw - 32px))!important;height:min(480px,calc(min(100dvh,var(--ui-height,100dvh)) - 32px))!important;max-height:calc(100dvh - 32px)!important;display:flex!important;flex-direction:column!important;padding:18px!important;border-radius:20px!important;background:var(--ui-glass)!important;overflow:hidden!important;box-sizing:border-box!important}
#coin-rules-dialog[data-room-modal=true] .settings-navigation{grid-template-columns:1fr!important}
#coin-rules-dialog[data-room-modal=true] .settings-navigation :is(.navigation-back,.navigation-close){display:none!important}
#coin-rules-dialog[data-room-modal=true] #coin-rules-form{flex:1;min-height:0;display:flex!important;flex-direction:column!important;overflow:hidden!important}
#coin-rules-dialog[data-room-modal=true] #coin-rules-form>.settings-panel{flex:1;min-height:0;overflow-y:auto!important;overscroll-behavior:contain;touch-action:pan-y}
#coin-rules-dialog[data-room-modal=true] .rules-footer{flex-shrink:0}

/* Numeric score fields need space inside the surrounding option card. */
#coin-rules-dialog[data-variant=blood] #coin-rules-form label:has([name=base]),#coin-rules-dialog[data-variant=blood] #coin-rules-form label:has([name=bloodMaxFan]){height:46px!important;min-height:46px!important;padding:8px 12px!important}
#coin-rules-dialog[data-variant=blood] #coin-rules-form :is([name=base],[name=bloodMaxFan]){height:28px!important;min-height:28px!important;margin:0!important}
#coin-rules-dialog #coin-rules-form .rules-footer{background:transparent!important;border:0!important;box-shadow:none!important}

#coin-rules-dialog[data-variant=blood] .rules-card:has([name=base])>header{display:none!important}
#result #confirm-payment{display:none!important}
#result .result-actions{display:flex!important;gap:10px!important}#result .result-actions :is(#again,#inspect-result){flex:1!important}
.blood-call-hand>small{display:block;line-height:1.6!important;white-space:normal!important}

#paifang-dialog[data-screen=profile] .paifang-actions{position:static!important;bottom:auto!important;margin-top:16px!important;margin-bottom:8px!important}
.personal-stat{min-width:0!important;display:flex!important;flex-direction:column;gap:5px;text-align:left;margin:0!important;padding:12px!important;border-radius:14px!important;background:rgba(12,34,26,.55)!important;border:1px solid #ffffff20!important;color:#eee!important}
.personal-stat small{font-size:12px!important;color:#d6d5bb}.personal-stat strong{font-size:20px}.personal-stat>span{font-size:11px;color:#c6bb8c}
.personal-detail-dialog{width:min(760px,94vw)!important;max-width:94vw!important;max-height:88dvh!important;padding:16px!important;box-sizing:border-box;background:#203b30!important;color:#eee!important;border:1px solid #b8ac75!important;border-radius:18px!important;overflow:hidden!important}
.personal-detail-dialog[open]{display:flex!important;flex-direction:column;gap:12px}.personal-detail-dialog>header{display:flex;justify-content:space-between;align-items:center;flex-shrink:0}.personal-detail-dialog h2{margin:0;font-size:21px}.personal-detail-dialog button{min-height:36px;padding:7px 14px;margin:0!important}.personal-detail-body{overflow-y:auto;min-height:0;touch-action:pan-y;overscroll-behavior:contain}.personal-detail-status{margin:0;min-height:1em;font-size:12px}.personal-total{padding:12px;background:#c2b48020;border-radius:10px;font-weight:bold}.personal-help{font-size:12px;color:#ccc;line-height:1.7}.personal-ledger{list-style:none;padding:0;margin:0;display:grid;gap:8px}.personal-ledger li{display:grid;grid-template-columns:1fr auto;gap:7px;padding:12px;background:#142d23;border:1px solid #ffffff15;border-radius:12px}.personal-ledger small{grid-column:1;grid-row:2;font-size:11px;color:#c0c6be}.personal-ledger li>span:last-child{font-size:12px;text-align:right}.personal-ledger .income{color:#a8dba4}.personal-ledger .expense{color:#ffc0ac}.personal-record{padding:12px;margin-bottom:10px;background:#142d23;border:1px solid #ffffff20;border-radius:12px;overflow-wrap:anywhere}.personal-record h3,.personal-record h4{font-size:15px;margin:8px 0}.personal-record p{font-size:13px;line-height:1.7;margin:8px 0}.personal-record small{display:block;color:#c0c6be;font-size:11px;margin:6px 0}.personal-record summary{cursor:pointer}.personal-record summary>strong,.personal-record summary>span{display:block}.personal-record summary>span{font-size:12px;color:#dad3af}.personal-hand{display:flex;flex-wrap:wrap;gap:2px;align-items:center}.personal-hand img{width:25px;height:35px;object-fit:contain}.personal-meld{display:inline-flex;margin-left:7px;gap:2px}

.personal-ledger .personal-payment-note{grid-column:1/-1;grid-row:auto;text-align:left;line-height:1.5}

.personal-detail-body{text-align:left!important}.personal-hand img{background:#eee9d8;border-radius:3px;padding:2px;box-sizing:border-box}.personal-record summary{list-style:disclosure-closed;line-height:1.7}.personal-record[open] summary{list-style:disclosure-open}

/* Settlement and hands share one reading order and one scroll surface. */
#result>.result-scroll{display:block!important;flex:1 1 auto;min-height:0;overflow-y:auto!important;overflow-x:hidden!important;touch-action:pan-y;overscroll-behavior:contain;scrollbar-width:thin}
#result .result-scroll>#result-title{display:flex!important;align-items:center!important;justify-content:center!important;min-height:36px!important;padding:4px 0!important;margin:0 0 8px!important;box-sizing:border-box;line-height:1.25!important;gap:4px 8px!important;white-space:normal!important}
#result[data-variant=blood] .result-scroll>#result-title{font-size:16px!important;gap:2px!important}
#result .result-scroll .winner-award{font-size:20px!important}#result .result-scroll #winner-income{font-size:18px!important}
#result .result-scroll>#winner-hand-panel{min-height:0!important;height:auto!important;justify-content:flex-start!important;padding:12px 0 4px!important;margin-top:12px!important;overflow:visible!important}
#result .result-scroll>#winner-hand-panel>header{display:none!important}
#result .result-scroll #winner-hand-tiles{padding-bottom:12px!important}
#result .result-scroll>#settlement-detail{overflow:visible!important}

.personal-detail-dialog>.personal-detail-body{flex:1 1 auto;min-height:0;overflow-y:auto!important;scrollbar-width:thin;overscroll-behavior:contain}

/* Personal details use the settings frame with a bounded native touch scroller. */
body>dialog.personal-detail-dialog[open]{position:fixed!important;inset:auto!important;margin:0!important;transform:none!important;translate:none!important;width:calc(100vw - 40px)!important;max-width:none!important;height:min(340px,calc(min(100dvh,var(--ui-height,100dvh)) - 32px))!important;max-height:none!important;box-sizing:border-box!important;display:grid!important;grid-template-rows:32px minmax(0,1fr) auto!important;gap:12px!important;padding:18px!important;overflow:hidden!important;touch-action:pan-y!important;animation:none!important}
.personal-detail-dialog>header{height:32px!important;min-height:32px;align-items:center!important}.personal-detail-dialog>header h2{font-size:17px!important;line-height:1.2!important}.personal-detail-dialog>.personal-detail-body{height:100%!important;max-height:100%!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;touch-action:pan-y!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin;box-sizing:border-box}.personal-detail-status:empty{display:none!important}.personal-detail-status{flex:none;max-height:40px;overflow:auto}
.personal-record summary{position:relative;padding-right:28px!important;list-style:none!important;text-align:left!important}.personal-record summary::-webkit-details-marker{display:none}.personal-record summary::marker{content:''}.personal-record summary::after{content:'⌄';position:absolute;right:0;top:50%;transform:translateY(-50%);font-size:24px;color:#dbcf9c}.personal-record[open] summary::after{content:'⌃'}
@media(max-height:500px){body>dialog.personal-detail-dialog[open]{height:min(300px,calc(min(100dvh,var(--ui-height,100dvh)) - 24px))!important;padding:14px 18px!important}}

.personal-record summary::after{display:none!important}.personal-round-heading{display:flex!important;align-items:center;gap:8px}.personal-round-heading::after{content:'';display:inline-block;width:7px;height:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);margin-left:4px;margin-top:-3px}.personal-record[open] .personal-round-heading::after{transform:rotate(225deg);margin-top:4px}
.room-seat-direction{display:inline-flex!important;align-items:center;justify-content:center;min-width:22px;height:22px;border-radius:6px;background:#ceb77b22;color:#e7d3a2;margin-right:6px;font-size:13px}
#players-dialog .room-page-tabs{flex:none!important;margin:0 0 8px!important;display:flex!important;gap:8px!important}#players-dialog .room-page-tabs button{flex:1;min-height:32px!important;padding:5px!important}
#players-dialog .room-roster-panel,#players-dialog .room-chat-panel{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;overflow:hidden;gap:8px}#players-dialog .room-roster-panel[hidden],#players-dialog .room-chat-panel[hidden]{display:none!important}
#players-dialog .room-roster-panel>#character-list{flex:1;min-height:0;overflow-y:auto!important;touch-action:pan-y}#players-dialog .room-roster-panel>.players-footer{flex-shrink:0}
#players-dialog .room-chat-panel>#chat-log{flex:1;min-height:0;overflow-y:auto!important;touch-action:pan-y;overscroll-behavior:contain;margin:0;padding:4px;list-style:none}
.room-chat-form{display:flex;flex-shrink:0;gap:8px;margin:0;padding-top:6px}.room-chat-form input{flex:1;min-width:0;height:36px;box-sizing:border-box;padding:6px 10px}.room-chat-form button{flex:0 0 auto;min-height:36px!important;padding:6px 16px!important;margin:0!important}.room-chat-panel #chat-log li{display:flex;align-items:center;gap:10px;font-size:12px;line-height:1.5;padding:8px}.room-chat-panel #chat-log li>img{width:28px;height:28px;border-radius:50%;object-fit:cover;flex:none}#chat-dialog #room-chat-form{flex-shrink:0}

#players-dialog .room-roster-panel>.eyebrow,#players-dialog .room-roster-panel>h2{display:none!important}#players-dialog .room-chat-panel>#chat-log{height:auto!important;max-height:none!important}#players-dialog .room-page-tabs button[aria-selected=true]{background:#ffffff1f!important;color:#fff1ce!important}#players-dialog .room-page-tabs button[aria-selected=false]{background:transparent!important;box-shadow:none!important}

#home-dialog #players-dialog .room-roster-panel>#character-list.room-seat-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-template-rows:auto!important;gap:8px!important;max-height:none!important;align-content:start;flex:1 1 auto!important}
#home-dialog #players-dialog .room-seat-card{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-start!important;text-align:center!important;padding:10px 6px!important;gap:7px!important;min-height:0!important;min-width:0!important}
#players-dialog .room-seat-card>img{width:40px!important;height:40px!important;flex:none;border-radius:50%}#players-dialog .room-seat-info{display:flex!important;flex-direction:column!important;align-items:center;gap:5px!important;width:100%;min-width:0}#players-dialog .room-seat-info>b{font-size:12px!important;line-height:1.4;overflow-wrap:anywhere;width:100%}#players-dialog .room-seat-direction{margin:0!important;min-width:24px;height:24px;flex:none}#players-dialog .room-seat-role{display:flex;flex-direction:column;align-items:center;gap:3px;font-size:11px!important}#players-dialog .room-seat-role small{margin:0!important;font-size:10px!important}#players-dialog .room-seat-actions{display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-end!important;gap:5px!important;margin-top:auto;width:100%;min-height:0!important}#players-dialog .room-seat-actions>button{width:100%!important;min-height:28px!important;font-size:10px!important;padding:4px 2px!important}
#players-dialog .room-page-tabs{border-radius:13px!important;padding:3px!important;gap:3px!important}#players-dialog .room-page-tabs button{border-radius:10px!important}
@media(max-width:500px){#home-dialog #players-dialog .room-roster-panel>#character-list.room-seat-grid{gap:5px!important}#home-dialog #players-dialog .room-seat-card{padding:8px 4px!important}#players-dialog .room-seat-card>img{width:32px!important;height:32px!important}}
#table-room-return{bottom:auto!important;transform:translate(-50%,-50%);min-height:40px;padding:8px 18px;font-size:14px;white-space:nowrap}

#home-dialog #players-dialog .room-roster-panel>#character-list.room-seat-grid{width:100%!important;box-sizing:border-box!important;grid-auto-rows:max-content!important;overflow-x:hidden!important;align-items:stretch!important;padding:2px 0 5px!important}
#home-dialog #players-dialog .room-seat-card{width:100%!important;max-width:100%!important;box-sizing:border-box!important;overflow:hidden!important;padding:8px 5px!important;gap:8px!important;min-height:110px!important}
#players-dialog .room-seat-info,#players-dialog .room-seat-actions{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}#players-dialog .room-seat-info>.room-seat-ready{font-size:10px!important;line-height:1.3;margin:0!important}#players-dialog .room-seat-actions>button{box-sizing:border-box!important;max-width:100%!important;min-width:0!important;white-space:normal!important;overflow-wrap:anywhere;line-height:1.25!important}

#players-dialog .room-seat-person{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:6px;width:100%;min-width:0;box-sizing:border-box;text-align:left}
#players-dialog .room-seat-person>img{width:28px!important;height:28px!important;min-width:0;object-fit:cover;border-radius:50%;flex:none}#players-dialog .room-seat-person-text{display:flex;flex-direction:column;gap:3px;min-width:0;width:100%}#players-dialog .room-seat-person-text>b{display:block;font-size:12px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}#players-dialog .room-seat-person-text>.room-seat-role{display:block;text-align:left;font-size:10px!important;line-height:1.3;white-space:nowrap;color:#c6ccb9}
#players-dialog #players-note{display:none!important}
@media(max-width:500px){#players-dialog .room-seat-person{grid-template-columns:22px minmax(0,1fr);gap:4px}#players-dialog .room-seat-person>img{width:22px!important;height:22px!important}#players-dialog .room-seat-person-text>b{font-size:11px}}

/* Keep every seat the same size, including empty and animal seats. */
#home-dialog #players-dialog .room-seat-card{height:176px!important;min-height:176px!important;max-height:176px!important;align-self:stretch!important}
#home-dialog #players-dialog .room-roster-panel>#character-list.room-seat-grid{grid-template-rows:176px!important;grid-auto-rows:176px!important}
#players-dialog .room-seat-person{width:fit-content!important;max-width:100%!important;grid-template-columns:28px minmax(0,auto)!important;justify-content:center!important;margin-inline:auto!important;align-items:center!important}
#players-dialog .room-seat-person-text{width:auto!important;max-width:100%!important;text-align:left!important}#players-dialog .room-seat-person-text>.room-seat-role{align-self:flex-start!important;text-align:left!important}
@media(max-width:500px){#players-dialog .room-seat-person{grid-template-columns:22px minmax(0,auto)!important}}

#home-dialog #players-dialog .room-roster-panel>#character-list.room-seat-grid{align-content:safe center!important}
.player-display-name{display:inline-block!important;max-width:min(100%,8em);min-width:0;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;vertical-align:bottom;line-height:inherit}
#players-dialog .room-seat-person-text>b,.paifang-portrait>b,.paifang-people button>span,.room-discovery-list>button>span:first-child,#result .payer-card header>b,#win-signal-name,.opponent>b{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;min-width:0;max-width:100%;box-sizing:border-box}
.paifang-portrait>b{max-width:min(160px,45%)!important}.opponent>b{max-width:160px!important}

/* Compact phone seats while keeping all four cards equal in height. */
@media(pointer:coarse),(max-width:700px){
 #home-dialog #players-dialog .room-seat-card{height:160px!important;min-height:160px!important;max-height:160px!important;padding:6px 5px!important;gap:4px!important}
 #home-dialog #players-dialog .room-roster-panel>#character-list.room-seat-grid{grid-template-rows:160px!important;grid-auto-rows:160px!important}
 #players-dialog .room-seat-info{gap:3px!important}
 #players-dialog .room-seat-actions{gap:4px!important}
}

#table-room-return{min-width:112px;min-height:46px;padding:11px 22px;font-size:17px;font-weight:700}

.password-control{position:relative;display:block;min-width:0;width:100%}.password-control input{width:100%;box-sizing:border-box;padding-right:3rem!important}.password-control .room-password-toggle{position:absolute;right:.3rem;top:50%;transform:translateY(-50%);width:2rem;height:2rem;min-width:0;min-height:0;padding:.3rem;border:0;background:transparent;color:inherit;display:grid;place-items:center}.room-password-toggle svg{width:1.4rem;height:1.4rem;fill:none;stroke:currentColor;stroke-width:1.7}.room-password-toggle[hidden]{display:none}
.room-options .password-control{width:160px;flex:0 1 160px;max-width:calc(100% - 5rem);margin-left:auto}

#creation-room-password,#lan-room-password{direction:ltr!important;unicode-bidi:normal!important;text-align:left!important}
#creation-room-password-eye,#creation-room-password-eye:hover,#creation-room-password-eye:active,#creation-room-password-eye:focus{background:transparent!important;background-image:none!important;border:0!important;box-shadow:none!important;outline:0!important;border-radius:0!important}
#creation-room-password-eye svg{stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
#creation-room-password-eye[aria-pressed=false] .eye-open,#creation-room-password-eye[aria-pressed=true] .eye-closed{display:none}
#creation-room-password-eye[aria-pressed=false] .eye-closed,#creation-room-password-eye[aria-pressed=true] .eye-open{display:block}

.settings-dialog .game-secondary #pause-game[data-return-game=true]{grid-column:1/-1}

/* The two join columns share a heading row and start their controls together. */
#join-room-dialog .join-layout .join-left{justify-content:flex-start!important;gap:10px!important}
#home-dialog #join-room-dialog .join-layout .join-left .join-content label{gap:10px!important;text-align:left!important;align-items:stretch!important}
#join-room-dialog .join-code-caption,#join-room-dialog .room-discovery-heading{height:28px;min-height:28px;box-sizing:border-box;font-size:12px!important;line-height:20px;color:#bccdc3}
#join-room-dialog .room-discovery-heading{align-items:flex-start!important;flex-wrap:nowrap!important;gap:4px!important;margin:0 0 10px!important}
#join-room-dialog .room-discovery-list{padding-top:0!important}
#home-dialog #join-room-dialog .join-actions-row{grid-template-columns:minmax(0,1fr)!important;gap:8px!important}
#home-dialog #join-room-dialog .join-actions-row button{width:100%!important;box-sizing:border-box}

/* Game actions use one full-width button per row. */
#home-dialog>.settings-content>.settings-panel:has(>#settings-create-room){grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
#home-dialog .game-secondary{grid-template-columns:minmax(0,1fr)!important;grid-auto-rows:minmax(48px,auto)!important;gap:10px!important;margin-top:0!important;width:100%}
#home-dialog .game-secondary>button{grid-column:1!important;width:100%!important;height:auto!important;min-height:48px!important;padding:10px 14px!important;font-size:14px!important}
#home-dialog #settings-create-room{height:64px!important;min-height:64px!important;font-size:18px!important;font-weight:700;background:#cbb47a!important;color:#20352b!important;border:1px solid #ead6a3!important}

#win-signal{margin:0!important;inset:auto!important;left:50%!important;top:50%!important;z-index:9999!important;width:min(430px,calc(100vw - 40px));box-sizing:border-box;gap:14px!important;visibility:visible!important}
#win-signal[popover]:not(:popover-open){display:none!important}
#win-signal>div{min-width:0;flex:1}
#win-signal-name{font-size:22px!important;letter-spacing:0!important}
#win-signal-detail{font-size:15px!important;line-height:1.6;margin-top:8px}
#win-signal-avatar{width:52px!important;height:52px!important;flex:none}
#win-signal-tile{width:40px;height:56px;object-fit:contain;flex:none;background:#fff5db;border:1px solid #e7d09e;border-radius:5px;padding:3px;box-sizing:border-box}
#win-signal-tile[hidden]{display:none!important}

.award-playing #win-signal{visibility:visible!important}

/* Bound the feedback itself, including tile previews and response controls. */
.table-speech { box-sizing:border-box; max-width:calc(100vw - 16px)!important; max-height:calc(100dvh - 16px)!important; overflow:auto; overflow-wrap:anywhere; }

/* Keep animal names fully visible and the About action below profile controls. */
#paifang-dialog[data-screen=gallery] .paifang-people>button{height:auto!important;min-height:104px!important;flex-shrink:0!important}
#paifang-dialog[data-screen=gallery] .paifang-people>button>span{display:block!important;flex:0 0 auto!important;height:auto!important;min-height:1.5em!important;line-height:1.5!important;overflow:visible!important;padding:2px 0!important;white-space:normal!important;overflow-wrap:anywhere}
#paifang-dialog[data-screen=gallery] .paifang-people>button>small{flex:0 0 auto!important;line-height:1.5!important}
#paifang-dialog .paifang-actions>[data-action=about]{display:none!important}
#paifang-dialog[data-screen=profile] .paifang-actions{flex-wrap:wrap!important}
#paifang-dialog[data-screen=profile] .paifang-actions>[data-action=about]{display:block!important;flex:0 0 100%!important;width:100%!important;min-height:32px!important;margin-top:6px!important;background:transparent!important;color:var(--ui-muted,#c4ccc6)!important;font-size:12px!important;font-weight:400!important;border:0!important}
.about-body{user-select:text;line-height:1.7}.about-section{padding:4px 0 12px;border-bottom:1px solid #ffffff20}.about-section h3{font-size:16px;margin:12px 0 8px}.about-section p{font-size:13px;margin:6px 0;overflow-wrap:anywhere}.about-license{padding:12px 0;border-bottom:1px solid #ffffff20}.about-license summary{cursor:pointer;font-size:13px}.about-license pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;line-height:1.6}

#paifang-dialog[data-screen=gallery] .paifang-layout>.paifang-people{grid-template-rows:none!important;grid-auto-rows:max-content!important;row-gap:16px!important;column-gap:10px!important;align-items:start!important}
#paifang-dialog[data-screen=gallery] .paifang-people>button{box-sizing:border-box!important;margin:0!important;align-self:start!important}

#blood-preparation .blood-exchange-tiles button.blood-hand-preview:disabled{opacity:1!important;filter:none!important;cursor:default!important;pointer-events:none}
/* Infinite mode reuses the existing green panels and ordinary game controls. */
.infinite-hud{position:fixed;top:max(12px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));z-index:12;display:flex;flex-direction:column;align-items:flex-start;gap:5px;max-width:42vw;pointer-events:none}.infinite-hud[hidden]{display:none!important}.infinite-hud button{pointer-events:auto;background:rgba(36,63,52,.9);color:#e9e1cf;border:1px solid rgba(225,219,200,.25);border-radius:9px;padding:5px 10px;font:inherit;font-size:12px;min-height:28px;line-height:1.35}.infinite-hud small{background:rgba(36,63,52,.8);color:#e9e1cf;padding:3px 8px;border-radius:6px;font-size:11px}.infinite-dialog footer{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}.infinite-dialog footer button{min-height:36px;padding:8px 14px}.infinite-dialog footer .primary{width:100%}#coin-rules-dialog[data-variant=infinite] .rule-mode,#coin-rules-dialog[data-variant=infinite] .blood-rules-extra{display:none!important}#infinite-mode-note{line-height:1.8;margin:20px 0}

body>dialog#infinite-opening[open]{background:#243f34!important;opacity:1!important;width:min(900px,calc(100vw - 28px))!important;color:#f3ecd9!important;animation:none!important;transform:none!important}#infinite-opening .infinite-opening-cards section{background:#345447!important}#infinite-opening .infinite-opening-cards p{font-size:14px;color:#eee8d7!important;margin-bottom:8px}#infinite-opening::backdrop{background:#0008}

#coin-rules-dialog[data-variant=infinite] .room-options>small{display:none}#coin-rules-dialog[data-variant=infinite] .room-options input[type=number]{width:68px}

body>dialog#infinite-opening[open]{position:fixed!important;inset:0!important;left:0!important;top:0!important;right:0!important;bottom:0!important;margin:auto!important;height:fit-content!important;max-height:calc(100dvh - 28px)!important;max-width:calc(100vw - 28px)!important;overflow:auto!important;box-sizing:border-box!important}

#result #settlement-detail.infinite-settlement{display:block!important;text-align:left!important}#result #settlement-detail.infinite-settlement .blood-summary-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important}#result #settlement-detail.infinite-settlement .blood-player-summary{width:auto!important;min-width:0!important;display:block!important;padding:10px!important}#result #settlement-detail.infinite-settlement .blood-result-section{display:block!important;width:100%!important;box-sizing:border-box!important;margin-top:16px!important}#result #settlement-detail.infinite-settlement .blood-win-record{display:block!important;width:100%!important;box-sizing:border-box!important;padding:12px!important;margin-bottom:10px!important}#result #settlement-detail.infinite-settlement .blood-player-summary small{display:block!important;font-size:11px!important}
/* Receipts include payer, recipient and tile names; keep them inside each card. */
#result .payment-component{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:6px!important;align-items:start!important}
#result .payment-component>span{min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important;line-height:1.5!important;text-align:left!important}
#result .winner-hand-description{display:block!important;flex-basis:100%;white-space:normal!important;line-height:1.5!important;margin-top:6px}
.infinite-hud{max-width:min(52vw,560px);gap:7px}.infinite-rule-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;width:100%;pointer-events:auto}.infinite-rule-row button{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;padding:6px 9px;min-width:0}.infinite-rule-row button.rule-ready{background:#635737;color:#fff1bd;border-color:#cfb968}.infinite-rule-row button.rule-hit{background:#315c46;color:#f7e8ae;border-color:#d2c17c}.infinite-rule-row button.rule-pulse{animation:infinite-soft-pulse .9s ease 2}.infinite-rule-row button.rule-success{animation:infinite-rule-success .65s ease 2}.infinite-net{font-size:13px!important;font-weight:700;align-self:flex-start}.infinite-feedback{display:flex;flex-direction:column;align-items:flex-start;gap:4px;pointer-events:none}.infinite-feedback-item{border-radius:9px;background:#294c3eee;color:#f6e6b6;padding:6px 10px;font-size:12px;max-width:100%;line-height:1.5;animation:infinite-feedback-rise 1.8s ease forwards}.infinite-feedback-item.loss{color:#ffb8a5}.infinite-feedback-item.gain{color:#ffe493}.money-gain{animation:infinite-money-gain .6s ease}.money-loss{animation:infinite-money-loss .6s ease}
@keyframes infinite-soft-pulse{50%{filter:brightness(1.35)}}@keyframes infinite-rule-success{35%{transform:translateY(-3px) scale(1.035);filter:brightness(1.5)}100%{transform:none}}@keyframes infinite-feedback-rise{0%{opacity:0;transform:translateY(8px)}15%,75%{opacity:1;transform:none}100%{opacity:0;transform:translateY(-10px)}}@keyframes infinite-money-gain{40%{color:#ffe18b;transform:scale(1.1)}}@keyframes infinite-money-loss{40%{color:#ffb1a1;transform:scale(1.1)}}
body>dialog#infinite-opening[open]{width:min(640px,calc(100vw - 48px))!important;padding:18px!important}#infinite-opening .infinite-opening-cards{gap:10px}#infinite-opening .infinite-opening-cards section{padding:12px}#infinite-opening .infinite-opening-cards b{font-size:16px}@media(max-width:700px){.infinite-hud{max-width:56vw}.infinite-rule-row button{font-size:11px;padding:5px 6px}#infinite-opening .infinite-opening-cards b{font-size:14px}}
@media(prefers-reduced-motion:reduce){.infinite-rule-row button,.infinite-net,.infinite-feedback-item{animation:none!important}.infinite-feedback-item{opacity:1}}

.infinite-hud{width:min(52vw,560px)}@media(max-width:700px){.infinite-hud{width:56vw}}
/* Rule inspection stays fixed while a shared game keeps progressing behind it. */
body>dialog.infinite-rule-detail[open]{position:fixed!important;inset:0!important;left:0!important;right:0!important;top:0!important;bottom:0!important;margin:auto!important;transform:none!important;translate:none!important;animation:none!important;transition:none!important;width:min(520px,calc(100vw - 40px))!important;max-width:calc(100vw - 40px)!important;height:min(360px,calc(100dvh - 32px))!important;min-height:0!important;max-height:calc(100dvh - 32px)!important;box-sizing:border-box!important;display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important;gap:12px!important;padding:18px!important;overflow:hidden!important;background:#243f34!important;backdrop-filter:none!important}
body>dialog.infinite-rule-detail h2{display:flex!important;align-items:center;justify-content:center;gap:12px;font-size:20px!important;line-height:1.3!important;letter-spacing:0!important;margin:0!important}.infinite-rule-body{overflow-y:auto;min-height:0;overscroll-behavior:contain;padding:0 4px;text-align:left;scrollbar-width:none}.infinite-rule-body p{line-height:1.7!important;font-size:13px!important;margin:8px 0!important}.infinite-rule-body small{font-size:11px!important;line-height:1.6!important}.infinite-listening-status{color:#efda9d!important;font-weight:700}.infinite-listening-reason{color:#d4e2cc!important}body>dialog.infinite-rule-detail footer{margin:0!important;flex-wrap:wrap;gap:8px}body>dialog.infinite-rule-detail footer .primary{margin:0!important;min-height:38px!important}.infinite-detail-icon{width:40px;height:48px;flex:none;object-fit:contain}
.infinite-rule-row button{display:flex;align-items:center;justify-content:center;gap:6px;padding:5px 8px}.infinite-rule-icon{width:22px;height:27px;object-fit:contain;flex:none}.infinite-rule-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.infinite-rule-count{font-size:11px;flex:none}.infinite-opening-icon{width:42px;height:50px;object-fit:contain;display:block;margin:0 auto 8px}.infinite-net{background:none!important;border:0!important;border-radius:0!important;padding:0!important;box-shadow:none!important;text-shadow:0 1px 3px #102b20;line-height:1.5;color:#f5eacd!important}.infinite-feedback-item.gain,.infinite-feedback-item.loss{background:none;padding:0;text-shadow:0 1px 3px #102b20;font-weight:700}

/* Transparent rule controls, matching the table toolbar. */
.infinite-rule-row button,.infinite-rule-row button.rule-ready,.infinite-rule-row button.rule-hit{background:transparent!important;box-shadow:none!important;backdrop-filter:none!important;border:1px solid color-mix(in srgb,var(--rule-color) 45%,transparent);color:var(--rule-color);border-radius:24px;min-height:34px;text-shadow:0 1px 3px #102b20}
.infinite-rule-color{display:inline-block!important;width:7px!important;height:7px!important;border-radius:50%;background:var(--rule-color);flex:none;object-fit:unset}.infinite-opening-icon.infinite-rule-color{width:28px!important;height:4px!important;border-radius:2px}.infinite-detail-icon.infinite-rule-color{margin-right:10px}
.infinite-avatar-counts{display:flex;justify-content:center;gap:7px;font-size:11px;font-weight:800;text-shadow:0 1px 3px #102b20;pointer-events:none;white-space:nowrap}.infinite-avatar-counts.rule-success,.infinite-rule-row button.rule-success{animation:infinite-chain-pop .55s ease}
@keyframes infinite-chain-pop{0%{transform:scale(1)}35%{transform:scale(calc(1.05 + var(--chain-level,1)*.025));filter:brightness(calc(1.1 + var(--chain-level,1)*.12))}100%{transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.infinite-avatar-counts.rule-success{animation:none}}

.opponent.floating .infinite-avatar-counts{display:flex!important;flex-direction:row!important;gap:7px;line-height:1.25}.opponent.floating .infinite-avatar-counts span{font-size:10px!important}

.audio-group-settings{grid-column:1/-1;display:grid;gap:10px;width:100%}.settings-dialog .audio-group-settings>label{display:grid!important;grid-template-columns:minmax(130px,1fr) minmax(90px,1fr) 40px;gap:12px;align-items:center;padding:8px 0;margin:0!important;min-height:48px!important}.audio-group-settings label>span{display:flex;flex-direction:column;text-align:left;gap:4px}.audio-group-settings b{font-size:14px}.audio-group-settings small{font-size:10px;line-height:1.5;opacity:.7}.audio-group-settings input[type=range]{width:100%;min-width:0;accent-color:#d2bd89}.audio-group-settings output{font-size:11px;text-align:right}

/* Compact, sequential win announcements for every seat. */
#win-signal{width:min(286.67px,calc((100vw - 40px)*.666667))!important;gap:9px!important;padding:10px 13px!important}
#win-signal-avatar{width:40px!important;height:40px!important}
#win-signal-name{font-size:18px!important;white-space:normal!important;overflow-wrap:anywhere}
#win-signal-detail{font-size:12px!important;line-height:1.5;margin-top:5px}
#win-signal-tile{width:30px;height:43px;padding:2px}
body:has(#win-signal:not([hidden])) #actions,body:has(#win-signal:not([hidden])) .table-speech{visibility:hidden!important;pointer-events:none!important}
/* Seat cards keep actions in their contextual menu. */
#players-dialog .room-seat-card,#home-dialog .room-seat-card{justify-content:center!important;align-items:center!important;cursor:pointer}
#players-dialog .room-seat-info{align-items:center!important;justify-content:center!important;text-align:center!important;width:100%}
#players-dialog .room-seat-person{flex-direction:column!important;justify-content:center!important;align-items:center!important;text-align:center!important;gap:5px!important}
#players-dialog .room-seat-person-text{align-items:center!important;text-align:center!important}
#players-dialog .room-seat-card small{position:static!important;text-align:center!important;font-size:10px!important}
#players-dialog .room-seat-info .room-seat-stats{opacity:.65;line-height:1.5}
.room-seat-card:focus-visible{outline:2px solid #e9d59d;outline-offset:2px}
.room-seat-menu>button{display:block;width:100%;margin:8px 0;min-height:38px}
.room-seat-menu>button.danger{color:#ff665c!important;background:transparent!important}
@media(max-height:500px){#players-dialog .room-seat-person img{width:36px!important;height:36px!important}#players-dialog .room-seat-info{gap:3px!important}}
#players-dialog .room-seat-person{display:flex!important;width:100%!important;grid-template-columns:none!important;gap:6px!important}
#players-dialog .room-seat-person-text{display:flex!important;flex-direction:column!important;width:100%!important;min-width:0!important}
#players-dialog .room-seat-person-text b{max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere;font-size:13px!important;line-height:1.35!important;text-align:center!important}
#players-dialog .room-seat-person img{width:42px!important;height:42px!important;flex:0 0 42px!important}
#players-dialog .room-seat-person-text .room-seat-role{align-self:center!important;justify-self:center!important;text-align:center!important;width:auto!important}
#players-dialog .room-seat-person-text b{width:100%!important;max-width:none!important;text-overflow:clip!important;overflow:visible!important;white-space:normal!important}
#players-dialog .room-seat-card .room-seat-stats{margin-top:-4px!important;transform:translateY(-3px)}
#paifang-dialog[data-screen=gallery] .paifang-group-heading,#paifang-dialog[data-screen=gallery] .paifang-friend-empty{grid-column:1/-1!important;width:100%;margin:0;text-align:left;box-sizing:border-box}
#paifang-dialog[data-screen=gallery] .paifang-group-heading{font-size:14px;color:var(--ui-ink);padding:4px 2px;border-bottom:1px solid #ffffff1c}
#paifang-dialog[data-screen=gallery] .paifang-friend-empty{font-size:12px;line-height:1.6;color:var(--ui-muted);padding:3px 2px 8px}
/* Consistent pill curvature for settings tabs and room actions. */
#players-dialog #room-edit-profile{display:none!important}
#home-dialog #players-dialog:has(.room-seat-grid) .players-footer{grid-template-columns:repeat(4,minmax(0,1fr))!important}
.settings-dialog .settings-tabs,.settings-dialog .settings-tabs>button,.settings-dialog .room-page-tabs,.settings-dialog .room-page-tabs>button{border-radius:999px!important}
#coin-rules-dialog .room-mode-choices{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;width:100%;margin:14px 0}
#coin-rules-dialog .room-mode-choices>button{min-width:0;min-height:44px;padding:8px 2px!important;white-space:nowrap;font-size:12px!important;border-radius:999px!important;border:1px solid #e6d7ab65!important;background:transparent!important;color:#e9e4d5!important;box-shadow:none!important}
#coin-rules-dialog .room-mode-choices>button[aria-pressed=true]{background:#e7cd8d!important;border-color:#f0dca8!important;color:#243c31!important;font-weight:700}
#coin-rules-dialog .room-mode-choices>button:disabled{opacity:.45}
#coin-rules-dialog #room-mode-switch[hidden]{display:none!important}
#coin-rules-dialog .room-mode-choices>button{transition:none!important}
/* Every occupied seat has the same rows, independent of ready state. */
#players-dialog .room-seat-person-text .room-seat-role{display:flex!important;flex-direction:row!important;align-items:center!important;gap:0!important;white-space:nowrap!important;min-height:16px;line-height:16px!important}
#players-dialog .room-seat-role .room-seat-ready{display:inline!important;position:static!important;margin:0!important;font-size:inherit!important;line-height:inherit!important;transform:none!important}
#players-dialog .room-seat-person-text>b{height:36px!important;min-height:36px!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important}
#players-dialog .room-seat-card .room-seat-stats{margin-top:0!important;transform:none!important;min-height:15px;white-space:nowrap!important}

/* Native tap feedback must not flash blue on room seats. */
.room-seat-card,.room-seat-card *, .seat-occupant-dialog button{-webkit-tap-highlight-color:transparent!important}
#players-dialog .room-seat-card:not(:has(.room-seat-person)) .room-seat-direction{margin-bottom:6px!important}
#coin-rules-dialog .mode-choice-card>label{display:none!important}

.infinite-finale-row{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:12px 0}.infinite-finale-row>div{display:flex;gap:8px}.infinite-finale-row button{min-width:72px;border:1px solid #b9c9bc66;background:transparent;color:inherit}.infinite-finale-row button[aria-pressed="true"]{background:#e6cc85;color:#183527;border-color:#e6cc85}.infinite-finale{width:min(620px,86vw)}

/* Final guesses compare concealed tiles; exposed melds stay visible for reference. */
dialog.infinite-finale{width:min(920px,94vw);max-height:calc(100dvh - 24px);box-sizing:border-box;overflow-y:auto}.infinite-finale h2{font-size:20px!important;margin:0 0 8px}.infinite-finale .finale-intro{font-size:12px;line-height:1.5;margin:0 0 12px}.infinite-finale-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.infinite-finale .infinite-finale-player{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:10px;min-width:0;margin:0;padding:12px;border:1px solid #b6c8b533;border-radius:16px;background:#10291e55}.infinite-finale-player header{display:flex;align-items:center;gap:8px}.infinite-finale-player header img{width:28px;height:28px;border-radius:50%}.infinite-finale-player header b{font-size:14px}.infinite-finale .finale-melds{display:flex;flex-wrap:wrap;align-content:flex-start;gap:5px;min-height:59px}.finale-melds>small{flex-basis:100%}.finale-meld{display:flex;flex-direction:column;gap:2px}.finale-meld small,.finale-melds>small,.finale-concealed-hand>small,.finale-empty{font-size:10px;opacity:.8}.infinite-finale .finale-tiles{display:flex;gap:1px;flex-wrap:wrap}.finale-tiles img,.finale-tile-back{width:19px;height:27px;object-fit:contain;display:block}.finale-tile-back{box-sizing:border-box;border:2px solid #e1e4ce;border-radius:3px;background:#30715e}.infinite-finale .finale-concealed-hand{display:flex;flex-direction:column;gap:5px}.finale-hidden-hand{font-size:12px;text-align:center;border:1px dashed #b6c8b54d;border-radius:7px;padding:7px;opacity:.7}.infinite-finale .finale-suit-options{display:flex;gap:6px;margin-top:auto}.infinite-finale .finale-suit-options button{min-width:0;min-height:34px;flex:1;padding:5px}.finale-verdict{font-size:12px}.finale-verdict[data-correct=true]{color:#e9ce88}.finale-verdict[data-correct=false]{color:#f3a091}.finale-suit-counts{font-size:11px}.finale-public-results{font-size:12px;margin-top:12px}.finale-public-results p{font-size:11px!important;margin:5px 0}.infinite-finale footer{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:12px}.infinite-finale footer small{font-size:11px;line-height:1.5}.infinite-finale footer button{flex:none;min-height:36px;padding:7px 20px}

.reference-fan-settings{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px;margin:10px 0}.reference-fan-settings dt{font-size:11px;opacity:.75}.reference-fan-settings dd{margin:0;font-size:12px;color:#ead395}


