@font-face {
  font-family: HanamiText;
  src: url('assets/fonts/wenkai-regular.woff2') format('woff2');
  font-weight: 100 500;
  font-display: swap;
}
@font-face {
  font-family: HanamiText;
  src: url('assets/fonts/wenkai-medium.woff2') format('woff2');
  font-weight: 600 900;
  font-display: swap;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #090607; }
body { color: #f5e9d1; font-family: HanamiText, 'Kaiti SC', serif; font-weight: 400; }
h1, h2, h3, .result-yaku-row strong { font-family: HanamiText, 'Kaiti SC', serif; font-weight: 600; }
canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; }
body.settings-open::before { content: ''; position: fixed; inset: 0; z-index: 5; pointer-events: none; background: #08050678; backdrop-filter: blur(3px); }
#actions { position: fixed; z-index: 4; left: 50%; bottom: calc(clamp(178px, 28vh, 228px) + var(--action-clearance, 0px)); width: min(720px, calc(100vw - 420px)); transform: translateX(-50%); display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; pointer-events: none; }
#actions button { padding: 9px 7px; font-size: 20px; line-height: 1.25; white-space: nowrap; }
#actions button { height: 48px; border-width: 2px; animation: none; }
@media (min-width: 920px) {
  body:not(.ipad) { --action-clearance: 8px; --auto-clearance: 18px; }
  body:not(.ipad) #actions { width: min(720px, calc(100vw - 104px - 2 * clamp(210px, (100vw - 700px) / 2, 320px))); }
}
#actions button.current { transform: translateY(-3px) scale(1.04); }
#actions button.recommended { z-index: 1; }
#actions button.counter-action { z-index: 3; transform: translateY(-6px) scale(1.08); border: 2px solid #ffbd70; color: #fff3c5; background: linear-gradient(180deg, #ee3851, #a6122d 62%, #580716); box-shadow: inset 0 2px #fff6, inset 0 -5px #3d0610, 0 0 34px #ef344b99, 0 12px 34px #000c; font-size: 21px; letter-spacing: .04em; animation: counter-arrive .42s cubic-bezier(.12,.9,.18,1.25) both, counter-alert .72s ease-in-out .42s 2; }
#actions button.win-action { z-index: 3; transform: translateY(-7px) scale(1.15); border: 2px solid #ffe29a; color: #fff4ca; background: linear-gradient(180deg, #ff3d55, #b01130 62%, #630819); box-shadow: inset 0 2px #fff6, inset 0 -5px #4b0512, 0 0 32px #f649617a, 0 12px 34px #000c; font-size: 25px; letter-spacing: .02em; text-align: center; display: grid; place-items: center; padding: 0; animation: win-arrive .42s cubic-bezier(.12,.9,.18,1.25) both, win-beat 1.2s ease-in-out .42s infinite; }
@keyframes win-beat { 0%, 100% { transform: translateY(-7px) scale(1.15); } 50% { transform: translateY(-10px) scale(1.19); filter: brightness(1.12); } }
#actions button.win-action { height: 54px; font-size: clamp(19px, 2vw, 25px); }
#actions:has(.win-action), #actions:has(.counter-action) { bottom: calc(clamp(178px, 28vh, 228px) - 12px + var(--action-clearance, 0px)); }
@keyframes win-arrive { from { opacity: 0; transform: translateY(12px) scale(.75); } to { opacity: 1; transform: translateY(-7px) scale(1.15); } }
#actions button.win-action:not(:disabled):hover { transform: translateY(-7px) scale(1.15); }
#actions button.handoff-action:not(:disabled) { z-index: 2; border-color: #f1ce78; color: #fff0bd; background: linear-gradient(180deg, #9d7040, #714324 62%, #3d2518); box-shadow: inset 0 2px #fff4, inset 0 -4px #2a160d, 0 0 25px #e0b65c66, 0 10px 28px #000b; animation: handoff-focus 1.35s ease-in-out infinite; }
@keyframes handoff-focus { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.13); } }
@keyframes counter-arrive { from { opacity: 0; transform: translateY(12px) scale(.75); } to { opacity: 1; transform: translateY(-6px) scale(1.08); } }
@keyframes counter-alert { 0%, 100% { filter: brightness(1); box-shadow: inset 0 2px #fff6, inset 0 -5px #3d0610, 0 0 25px #ef344b70, 0 12px 34px #000c; } 50% { filter: brightness(1.18); box-shadow: inset 0 2px #fff8, inset 0 -5px #3d0610, 0 0 46px #ff405cbd, 0 12px 34px #000c; } }
@keyframes action-settle { from { transform: translateY(5px) scale(.97); } to { transform: none; } }
@keyframes action-arrive { from { transform: translateY(10px) scale(.9); } to { transform: translateY(-3px) scale(1.05); } }
button { position: relative; min-width: 0; overflow: hidden; pointer-events: auto; border: 1px solid #d0ae6866; border-radius: 6px; padding: 12px 9px; color: #f8e7bd; background: linear-gradient(180deg, #8f3546, #5b202d 58%, #34151b); font: 600 18px HanamiText, 'Yu Mincho', serif; letter-spacing: .11em; box-shadow: inset 0 2px #fff2, inset 0 -3px #210d12aa, 0 8px 24px #0009; cursor: pointer; transition: transform .09s ease, filter .12s ease, box-shadow .09s ease, opacity .12s ease; }
button::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 25%, #ffe8aa33 50%, transparent 72%); transform: translateX(-120%); transition: transform .32s ease; }
button:disabled { color: #8c8274; border-color: #786b5833; background: linear-gradient(145deg, #302b29, #1c1918); box-shadow: inset 0 1px #fff1; cursor: default; opacity: .58; }
button.current { color: #fff0bd; border-color: #e8c274; background: linear-gradient(145deg, #9b3448, #521c28); box-shadow: inset 0 1px #fff4, 0 0 20px #d6a95455, 0 8px 28px #0009; opacity: 1; }
button:not(:disabled):hover { filter: brightness(1.16); transform: translateY(-2px); }
button:not(:disabled):hover::after { transform: translateX(120%); }
button:not(:disabled):active { transform: translateY(2px) scale(.985); filter: brightness(.92); box-shadow: inset 0 4px 8px #1a080ca8, 0 2px 7px #0008; }
#actions button:not(:disabled):hover { transform: none; }
#actions button.current:not(:disabled):hover { transform: translateY(-3px) scale(1.04); }
#actions button.counter-action:not(:disabled):hover { transform: translateY(-6px) scale(1.08); }
#actions button.win-action:not(:disabled):hover { transform: translateY(-7px) scale(1.15); }
#actions button.handoff-action:not(:disabled):hover { transform: translateY(-3px) scale(1.04); }
#actions button:disabled { animation: none; transform: none; color: #958a7e; border-color: #786b5833; background: linear-gradient(145deg, #302b29, #1c1918); box-shadow: inset 0 1px #fff1; opacity: .58; filter: none; }
button.secondary { background: linear-gradient(145deg, #36544c, #172b28); }
button:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid #efd18d; outline-offset: 3px; }
#status { position: fixed; left: 50%; top: 17px; transform: translateX(-50%); margin: 0; padding: 6px 16px; border: 1px solid #c4a25d35; border-radius: 999px; color: #c9b792; background: #0d090ab8; font-size: 12px; letter-spacing: .14em; white-space: nowrap; backdrop-filter: blur(8px); }
#table-picker { position: fixed; z-index: 4; left: 34px; bottom: 30px; display: grid; gap: 5px; color: #9f9079; font: 10px HanamiText, serif; letter-spacing: .18em; pointer-events: auto; }
#table-theme { width: 112px; appearance: none; border: 0; border-bottom: 1px solid #b89a5b66; border-radius: 0; padding: 5px 18px 5px 0; color: #dbc89e; background: linear-gradient(45deg, transparent 50%, #b89a5b 50%) right 4px center / 5px 5px no-repeat; font: 600 13px HanamiText, sans-serif; cursor: pointer; }
#table-theme:focus-visible { outline: 1px solid #d4b266; outline-offset: 4px; }
#settings { position: fixed; z-index: 6; right: 34px; top: 24px; color: #c6b38e; font-size: 14px; }
#settings.start-settings-open { z-index: 26; top: 50%; right: 50%; transform: translate(50%, -50%); }
#settings summary { cursor: pointer; list-style: none; font: 600 17px HanamiText, serif; letter-spacing: .16em; }
#settings[open] { width: 286px; padding: 18px 20px 20px; border: 1px solid #c5a45f66; border-radius: 11px; background: #100b0df4; box-shadow: 0 18px 50px #000c, inset 0 1px #fff1; backdrop-filter: blur(14px); }
#settings[open] summary { padding-bottom: 12px; border-bottom: 1px solid #aa8d523d; color: #eed9aa; font-size: 21px; }
.settings-content { max-height: calc(100dvh - 140px); overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
.voice-previews { display: flex; gap: 8px; margin-top: 10px; }
.voice-previews button { flex: 1; padding: 9px 5px; font-size: 15px; }
#settings-close { display: none; }
#settings[open] #settings-close { position: absolute; display: grid; place-items: center; right: 14px; top: 11px; width: 34px; height: 34px; padding: 0; border-radius: 50%; background: #28171a; box-shadow: inset 0 1px #fff1; font-family: HanamiText, sans-serif; font-size: 23px; line-height: 1; }
#settings label { display: flex; min-height: 31px; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; font-size: 15px; }
#settings select { min-width: 108px; border: 0; border-bottom: 1px solid #b99a5d66; padding: 4px 20px 4px 4px; color: #ead6ab; background: transparent; font: 600 14px HanamiText, serif; }
.settings-section { margin: 14px 0 2px; color: #8e7d63; font: 700 10px HanamiText, sans-serif; letter-spacing: .22em; }
#settings .range-setting { display: grid; grid-template-columns: 82px 1fr; }
#settings input[type="range"] { width: 100%; accent-color: #c54b59; }
#settings input[type="checkbox"], #auto-resolve-control input { width: 18px; height: 18px; accent-color: #b94755; }
#settings[open] ~ #record-toggle { visibility: hidden; }
body.settings-open #actions, body.settings-open #auto-resolve-control, body.settings-open #opponent-toggle, body.settings-open #flavor-toggle, body.settings-open #rules-toggle { visibility: hidden; }
body.inspector-open #actions, body.inspector-open #auto-resolve-control, body.inspector-open #record-toggle, body.inspector-open #settings, body.inspector-open #table-picker, body.inspector-open #flavor-toggle, body.inspector-open #rules-toggle { visibility: hidden; }
body.flavor-open #actions, body.flavor-open #auto-resolve-control, body.flavor-open #opponent-toggle { visibility: hidden; }
#opponent-toggle { position: fixed; z-index: 7; left: 34px; top: 132px; min-width: 0; padding: 7px 13px; border-radius: 5px; font-size: 16px; line-height: 1.2; letter-spacing: .06em; }
#opponent-toggle[aria-expanded="true"] { visibility: hidden; }
#flavor-toggle { position: fixed; z-index: 20; right: 30px; bottom: 155px; display: flex; align-items: center; gap: 9px; padding: 7px 13px 7px 7px; border-color: #cfad658c; border-radius: 28px 9px 9px 28px; background: linear-gradient(120deg, #63333b, #221417); font-size: 17px; }
#flavor-toggle .emote-art { width: 40px; height: 40px; }
#flavor-toggle small { display: block; margin-top: 2px; color: #beaa88; font: 10px HanamiText, sans-serif; }
#flavor-toggle[aria-expanded="true"] { border-color: #f3d28a; filter: brightness(1.15); }
#record-toggle { position: fixed; z-index: 6; top: 24px; }
.pre-game #actions, .pre-game #auto-resolve-control, .pre-game #status, .pre-game #record-toggle, .pre-game #opponent-toggle, .pre-game #flavor-toggle { visibility: hidden; }
#flavor-panel { position: fixed; z-index: 26; right: 30px; bottom: 222px; width: 420px; max-height: calc(100dvh - 245px); overflow-y: auto; border: 1px solid #c5a45f99; border-radius: 13px; padding: 17px; color: #dcca9f; background: #100b0df5; box-shadow: 0 18px 50px #000c, inset 0 1px #fff1; backdrop-filter: blur(14px); }
.pre-game #flavor-panel { top: 50%; bottom: auto; right: 50%; transform: translate(50%, -50%); max-height: calc(100dvh - 40px); }
#lobby-emotes { margin-top: 9px; width: 100%; }
.voice-credit { margin: 16px 0 0; color: #ad9a7c; font: 11px HanamiText, sans-serif; line-height: 1.7; }
.voice-credit a { color: #dfc78f; }
.start-card { max-height: calc(100dvh - 48px); overflow-y: auto; }
@media (max-height: 640px) { #flavor-panel { bottom: 80px; max-height: calc(100dvh - 110px); } #flavor-toggle { bottom: 90px; } }
@media (max-width: 700px) { #flavor-toggle { right: 18px; bottom: 78px; } #flavor-panel { bottom: 140px; max-height: calc(100dvh - 160px); } }
.flavor-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid #aa8d523d; }
.flavor-heading strong { font-size: 20px; letter-spacing: .12em; }
#flavor-close { width: 32px; height: 32px; padding: 0; border-radius: 50%; background: #28171a; box-shadow: none; font-family: HanamiText, sans-serif; font-size: 21px; }
#flavor-panel > p { margin: 10px 0 13px; color: #857762; font-size: 11px; }
.flavor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.flavor-grid button { display: grid; justify-items: center; gap: 2px; padding: 8px 5px 9px; overflow: visible; background: linear-gradient(145deg, #4b2a2d, #211617); letter-spacing: .03em; }
.flavor-grid button strong { color: #f1d8a2; font-size: 13px; }
.flavor-grid button small { color: #8f806a; font: 9px HanamiText, sans-serif; }
.emote-art { display: block; width: 88px; height: 88px; border: 1px solid #d2ae6266; border-radius: 50%; background-repeat: no-repeat; background-size: 300% 200%; box-shadow: inset 0 0 0 2px #fff1, 0 5px 16px #0008; }
[data-avatar="flower"] .emote-art { background-image: url('assets/emotes/flower-fox-sheet.png'); }
[data-avatar="moon"] .emote-art { background-image: url('assets/emotes/moon-rabbit-sheet.png'); }
.emote-art.nice { background-position: 0 0; } .emote-art.cheers { background-position: 50% 0; } .emote-art.bold { background-position: 100% 0; }
.emote-art.surprise { background-position: 0 100%; } .emote-art.thanks { background-position: 50% 100%; } .emote-art.focus { background-position: 100% 100%; }
[data-avatar] .emote-art.extra { background-image: url('assets/emotes/extra-reactions-sheet.png'); background-size: 400% 200%; background-position: var(--emote-column) var(--emote-row, 0%); }
[data-avatar="moon"] .emote-art.extra { --emote-row: 100%; }
.emote-art.laugh { --emote-column: 0%; } .emote-art.cry { --emote-column: 33.333333%; }
.emote-art.love { --emote-column: 66.666667%; } .emote-art.smug { --emote-column: 100%; }
.flavor-toast { position: fixed; z-index: 27; display: flex; align-items: center; gap: 14px; width: min(390px, calc(100vw - 36px)); min-height: 166px; padding: 10px 18px 10px 10px; border: 1px solid #d8b46588; border-radius: 38px 16px 16px 38px; color: #f2db9e; background: linear-gradient(110deg, #4c242aee, #170e10f5 48%, #0d090aed); box-shadow: 0 14px 42px #000c, 0 0 28px #c89d4340; pointer-events: none; animation: flavor-in 4.2s ease both; }
.flavor-toast[data-side="opponent"] { left: 36px; top: 82px; border-color: #b5c7a1aa; }
.flavor-toast[data-side="self"] { right: 36px; bottom: 118px; }
.flavor-toast .emote-art { flex: 0 0 144px; width: 144px; height: 144px; border-radius: 25%; animation: emote-pop .42s cubic-bezier(.16,.9,.25,1.35) both; }
.flavor-copy { flex: 1; min-width: 0; }
.flavor-sender { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #c8a96755; }
.flavor-sender b { color: #fff0c8; font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.flavor-sender span { flex: none; border: 1px solid #dba56866; border-radius: 4px; padding: 2px 5px; color: #e9c07f; font-size: 12px; }
.flavor-toast[data-side="opponent"] .flavor-sender span { border-color: #92b39388; color: #bed4b1; }
@keyframes emote-pop { from { transform: translateY(22px) rotate(-9deg) scale(.55); } 72% { transform: translateY(-6px) rotate(4deg) scale(1.09); } to { transform: none; } }
.flavor-toast strong { display: block; color: #f5dda4; font-size: 22px; letter-spacing: .08em; }
.flavor-toast small { display: block; margin-top: 5px; color: #c6b694; font: 14px HanamiText, sans-serif; }
@keyframes flavor-in { 0% { opacity: 0; scale: .86; } 10%, 82% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: .96; } }
#auto-resolve-control { position: fixed; z-index: 4; left: 50%; bottom: calc(clamp(132px, 21.5vh, 178px) + var(--auto-clearance, 0px)); display: flex; align-items: center; gap: 9px; transform: translateX(-50%); color: #dac79f; font-size: 13px; white-space: nowrap; cursor: pointer; }
#auto-resolve-control span { display: grid; gap: 1px; }
#auto-resolve-control small { color: #897b66; font: 9px HanamiText, sans-serif; letter-spacing: .04em; }
#auto-resolve-control label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.ceremony { position: fixed; inset: 0; z-index: 18; display: grid; place-items: center; padding: 24px; background: #0805069e; backdrop-filter: blur(8px) saturate(.8); }
.ceremony-card { position: relative; width: min(620px, 92vw); overflow: hidden; border: 1px solid #d2af6485; border-radius: 14px; padding: 28px 42px; color: #f1dfb9; background: radial-gradient(circle at 50% 0, #70313a55, transparent 48%), linear-gradient(145deg, #241316f8, #0d090afa); box-shadow: 0 30px 90px #000d, inset 0 1px #fff2; text-align: center; }
.ceremony-card::before, .ceremony-card::after { content: ''; position: absolute; width: 110px; height: 110px; border: 1px solid #c8a2582e; border-radius: 50%; }
.ceremony-card::before { left: -56px; top: -56px; } .ceremony-card::after { right: -56px; bottom: -56px; }
.ceremony-mon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 8px; border: 1px solid #d2b16a88; border-radius: 50%; color: #f0d89d; font: 600 25px HanamiText, serif; background: #6e2631; box-shadow: 0 0 0 5px #d6b66a16; }
.eyebrow { margin: 0 0 7px; color: #ad9873; font: 700 10px HanamiText, sans-serif; letter-spacing: .28em; }
.ceremony h1, .ceremony h2, #record-dialog h2 { margin: 0; color: #f5dfad; font-family: HanamiText, 'Yu Mincho', serif; font-weight: 600; letter-spacing: .12em; text-shadow: 0 2px 16px #d4aa5440; }
.ceremony h1 { font-size: 40px; } .ceremony h2 { font-size: 34px; }
.start-copy { margin: 8px 0 15px; color: #b8a487; font-size: 13px; letter-spacing: .08em; }
#lobby-audio { min-width: 0; margin: -5px auto 12px; padding: 6px 13px; border-color: #b89b5d45; border-radius: 999px; color: #d8c59e; background: #120d0ebd; box-shadow: none; font: 600 11px HanamiText, sans-serif; letter-spacing: .08em; }
#lobby-audio.playing { border-color: #d1ad626b; color: #f0d899; background: #4a2a214f; }
.versus { display: grid; grid-template-columns: 1fr 50px 1fr; align-items: center; border-block: 1px solid #b492563d; padding: 11px 0; font-size: 20px; }
.versus b { color: #9f895f; font: 600 12px HanamiText, serif; letter-spacing: .14em; }
.online-room { margin-top: 14px; border: 1px solid #ad8d5035; border-radius: 8px; padding: 12px; background: #09060772; }
.identity-row { display: grid; grid-template-columns: 1.2fr .8fr; gap: 10px; }
.online-room label { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 8px; color: #9f8e73; font-size: 12px; text-align: left; }
.online-room input { width: 100%; min-width: 0; border: 1px solid #aa8d554d; border-radius: 5px; padding: 9px 11px; color: #f0dbae; outline: none; background: #1a1012; font: 700 14px HanamiText, sans-serif; letter-spacing: .08em; }
.online-room input:focus { border-color: #d0ad64a8; box-shadow: 0 0 0 2px #cba75b1c; }
.avatar-choice { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 6px; }
.avatar-preview { width: 28px; height: 28px; border: 1px solid #c7a55d66; border-radius: 50%; background-repeat: no-repeat; background-size: 300% 200%; background-position: 0 0; box-shadow: inset 0 0 0 1px #fff1; }
.avatar-preview[data-avatar="flower"] { background-image: url('assets/emotes/flower-fox-sheet.png'); }
.avatar-preview[data-avatar="moon"] { background-image: url('assets/emotes/moon-rabbit-sheet.png'); }
.avatar-choice select { width: 100%; min-width: 0; border: 1px solid #aa8d554d; border-radius: 5px; padding: 7px 5px; color: #f0dbae; background: #1a1012; font: 600 13px HanamiText, serif; }
#settings select, .avatar-choice select { font-family: HanamiText, sans-serif; }
.room-actions, .join-room { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.room-actions:has(#copy-invite[hidden]) { grid-template-columns: 1fr; }
.online-room button { padding: 9px; font-size: 19px; line-height: 1.3; box-shadow: inset 0 1px #fff2, 0 5px 18px #0006; }
#room-status { min-height: 17px; margin: 9px 0 0; color: #b6a486; font-size: 11px; letter-spacing: .04em; }
.start-rules { display: flex; justify-content: center; gap: 20px; margin: 12px 0; color: #9d8d73; font-size: 11px; letter-spacing: .08em; }
.start-buttons { display: grid; grid-template-columns: .8fr .9fr 1.4fr; gap: 8px; }
.start-buttons button { padding: 11px 10px; font-size: 20px; line-height: 1.3; }
#start-match { border-radius: 7px; font-size: 22px; }
.result-card { display: flex; flex-direction: column; width: min(720px, 94vw); height: min(900px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; }
.result-card > :not(.result-yaku) { flex-shrink: 0; }
.result-reason { margin: 8px 0 20px; color: #a9977b; font-size: 13px; }
.result-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-score { border: 1px solid #b6975c35; border-radius: 7px; padding: 14px; background: #09060778; text-align: left; }
.result-score.winner { border-color: #d7b45e88; background: #61212b45; }
.result-score strong { display: block; margin-bottom: 6px; color: #e8d3a9; font-size: 16px; }
.result-score b { color: #f1ce77; font-size: 26px; } .result-score small { float: right; margin-top: 9px; color: #9c8d75; }
.result-yaku { flex: 1; min-height: 90px; overflow-y: auto; overscroll-behavior: contain; margin: 14px 0 10px; border-block: 1px solid #b6975c35; padding: 10px 4px; color: #c8b38e; font-size: 13px; }
.result-yaku-title { margin: 0 10px 3px; color: #8f8068; font: 700 10px HanamiText, sans-serif; letter-spacing: .24em; text-align: left; }
.result-yaku-row { display: grid; grid-template-columns: 1fr auto; align-items: center; margin: 4px 10px; padding: 9px 14px; border: 1px solid #d3ad6040; border-radius: 4px; background: linear-gradient(90deg, #701e2c66, #1a0d0f88); box-shadow: 0 5px 16px #0008; text-align: left; opacity: 0; transform: translateX(-80px) rotate(-1.8deg) scale(.9); animation: yaku-strike .42s cubic-bezier(.1,.9,.15,1.3) forwards; }
.result-yaku-row:nth-of-type(even) { transform: translateX(80px) rotate(1.8deg) scale(.9); }
.result-yaku-row strong { color: #f1d58b; font-size: 24px; letter-spacing: .06em; line-height: 1.4; }
.result-yaku-row b { color: #fff0ba; font-size: 19px; }
.result-subtotal { margin: 12px 10px; padding: 10px; border-block: 1px solid #b6975c40; color: #dec58d; font-size: 18px; letter-spacing: .08em; }
.result-multipliers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0 10px; }
.result-multiplier { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; padding: 14px 16px; border: 2px solid #bda461; background: #31463c66; border-radius: 3px; color: #e0cc99; animation: multiplier-stamp .34s cubic-bezier(.15,.8,.2,1.3) both; }
.result-multiplier span { font-size: 22px; font-weight: 600; line-height: 1.4; } .result-multiplier b { color: #fff0b8; font-size: 36px; line-height: 1; }
.result-multiplier small { grid-column: 1 / -1; color: #d0c6a7; font-size: 16px; line-height: 1.5; } .result-multiplier strong { grid-column: 1 / -1; justify-self: end; color: #f0d68d; font-size: 21px; line-height: 1.35; }
.result-total { position: relative; display: flex; align-items: baseline; justify-content: center; gap: 12px; margin: 8px 10px 16px; padding: 30px 12px 8px; border-block: 2px solid #d8b05d; background: radial-gradient(ellipse, #b788244d, #30151b00 75%); color: #ffe0a0; }
.result-total-label { position: absolute; top: 7px; color: #e6cc94; font-size: 17px; letter-spacing: .08em; }
.result-number-window { position: relative; overflow: hidden; min-width: 3ch; height: 1.25em; font-size: clamp(54px, 8vw, 76px); line-height: 1.25; font-variant-numeric: tabular-nums; }
.result-number-window b, .result-number-old { display: block; font-size: inherit; font-weight: 600; font-style: normal; line-height: inherit; text-shadow: 0 3px #5c2d16, 0 0 30px #dfa73c66; }
.result-number-old { position: absolute; inset: 0; }
.result-impact .result-total { animation: score-impact .7s cubic-bezier(.12,.8,.2,1.15) both; }
.result-total small { font-size: 24px; }
.result-impact .result-card { animation: score-shake .3s ease-out; }
.result-scores { margin-bottom: 16px; }
.result-multiplier { text-align: left; border-width: 1px; border-left: 4px solid #d9b967; border-radius: 8px; background: linear-gradient(135deg, #334b42bb, #1b2826bb); padding: 15px 18px; }
.result-multiplier strong { padding-top: 6px; border-top: 1px solid #d7b97944; width: 100%; text-align: right; }
.result-score { position: relative; }
.scores-arrive { animation: scores-arrive .45s ease-out both; }
@keyframes scores-arrive { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.streak-stamp { position: absolute; right: 16px; top: -10px; padding: 4px 9px; border: 3px double #e78271; border-radius: 5px; color: #ffb092; background: #70202ae8; font-size: 22px; font-style: normal; transform: rotate(-13deg); animation: streak-stamp .45s cubic-bezier(.1,.8,.2,1.25) both; }
.streak-stamp[data-level="hot"] { font-size: 26px; box-shadow: 0 0 18px #e54f4577; }
.streak-stamp[data-level="legend"] { color: #ffe697; border-color: #ffe697; font-size: 30px; box-shadow: 0 0 30px #f4b53599; }
@keyframes streak-stamp { from { opacity: 0; transform: rotate(-22deg) scale(2.4); } to { opacity: 1; transform: rotate(-13deg) scale(1); } }
.ceremony.leaving { pointer-events: none; animation: scene-leave .7s ease both; }
@keyframes scene-leave { to { opacity: 0; transform: scale(1.025); } }
.match-finale .result-total { display: none; }
.recap-cards { display: block !important; }
.recap-cards-title { margin: 12px 0 8px; font-size: 14px; color: #d2bc8b; }
.recap-card-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 9px; border-top: 1px solid #ba974327; padding: 8px 0; }
.recap-card-label { display: grid; gap: 4px; text-align: center; color: #dfbd72; }
.recap-card-label strong { font-size: 22px; }
.recap-card-label small { font-size: 12px; color: #bbaa8a; }
.recap-card-strip { display: flex; gap: 6px; overflow-x: auto; padding: 3px 0 7px; min-height: 72px; align-items: center; }
.recap-card-strip .guide-card { width: 44px; height: 63px; flex: 0 0 44px; object-fit: contain; }
.recap-card-empty { color: #8b7a62; font-size: 13px; }
.match-finale .result-card { border-color: #ecd183; background: radial-gradient(ellipse at top, #88612666, transparent 55%), #170e12f8; }
.recap-player { margin: 10px 6px 20px; padding: 18px; border: 1px solid #9a82564d; border-radius: 12px; text-align: left; background: #160e12; }
.recap-player.champion { border-color: #d8b564; background: linear-gradient(120deg, #5b382a66, #191012); }
.recap-player h3 { margin: 5px 0; font-size: 26px; color: #f3d590; }
.recap-player p { line-height: 1.7; font-size: 15px; }
.recap-facts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.recap-facts div { padding: 8px 4px; text-align: center; border-radius: 5px; background: #ffffff06; }
.recap-facts b { display: block; font-size: 26px; color: #ffe2a3; }
.recap-facts span { font-size: 12px; }
.recap-cards { display: flex; flex-wrap: wrap; gap: 5px; }
.recap-cards .guide-card { width: 42px; }
#rules-toggle { position: fixed; z-index: 6; top: 24px; }
#rules-dialog { width: min(760px, 94vw); max-height: 90dvh; padding: 0; border: 1px solid #c8a75b; border-radius: 13px; color: #dfcba6; background: #170f12; }
#rules-dialog::backdrop { background: #080509aa; backdrop-filter: blur(6px); }
#rules-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
#rules-dialog .record-heading { flex-shrink: 0; }
#rules-close { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: #392328; font-size: 28px; }
#rules-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 24px; }
.guide-note { font-size: 16px; line-height: 1.8; color: #e0cca5; }
.guide-rule { border-top: 1px solid #d0ab6044; padding: 16px 0; font-size: 16px; line-height: 1.8; }
.guide-rule h3 { margin: 0; color: #f5d895; font-size: 24px; }
.guide-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.guide-card { width: 58px; height: auto; aspect-ratio: 1 / 1.42; object-fit: contain; border: 1px solid #c59d64; border-radius: 5px; background: #2a171c; }
.guide-candidates { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.guide-candidate { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 14px; border: 1px solid #a68d534d; border-radius: 10px; background: #302021; }
.guide-candidate b { color: #efd384; font-size: 17px; }
.guide-candidate small { line-height: 1.6; }
.guide-candidate.unavailable { opacity: .6; }
.guide-candidate em { color: #e9a08b; font-size: 13px; font-style: normal; }
* { scrollbar-width: thin; scrollbar-color: #997849 #211619; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #211619; border-radius: 8px; }
::-webkit-scrollbar-thumb { background: linear-gradient(#d0ac68, #795834); border: 2px solid #211619; border-radius: 8px; }
::-webkit-scrollbar-corner { background: #211619; }
input[type="checkbox"], input[type="range"] { accent-color: #b94d59; }
@keyframes multiplier-stamp { from { opacity: 0; transform: scale(1.35) rotate(-8deg); } 70% { opacity: 1; transform: scale(.96) rotate(1deg); } to { transform: none; } }
@keyframes score-impact { from { opacity: 0; transform: scale(1.65); filter: blur(6px); } 45% { opacity: 1; transform: scale(.94); filter: none; } 72% { transform: scale(1.035); } to { opacity: 1; transform: none; } }
@keyframes score-shake { 0%, 100% { transform: none; } 25% { transform: translateY(5px); } 55% { transform: translateY(-3px); } 80% { transform: translateY(1px); } }
@media (prefers-reduced-motion: reduce) { .result-yaku-row, .result-multiplier, .result-total, .result-impact .result-total, .result-impact .result-card, .flavor-toast, .flavor-toast .emote-art, .streak-stamp, .scores-arrive { animation: none; opacity: 1; transform: none; } #result-screen.leaving { transition: none; } }
@keyframes yaku-strike { 55% { opacity: 1; transform: translateX(6px) rotate(.5deg) scale(1.045); filter: brightness(1.65); } 72% { transform: translateX(-2px) rotate(-.2deg) scale(.99); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes total-reveal { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.result-actions { display: flex; justify-content: center; gap: 10px; }
.result-actions button { min-width: 150px; }
.result-actions { visibility: hidden; }
.result-total-speaking .result-actions, .result-complete .result-actions { visibility: visible; }
#record-dialog { width: min(700px, 92vw); max-height: min(760px, 88vh); padding: 0; overflow: hidden; border: 1px solid #ceb06b85; border-radius: 12px; color: #e8d6b5; background: #100b0df5; box-shadow: 0 30px 90px #000d; }
#record-dialog::backdrop { background: #070405b5; backdrop-filter: blur(7px); }
.record-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px 17px; border-bottom: 1px solid #b89a5a38; background: linear-gradient(90deg, #5d252f44, transparent); }
#record-dialog h2 { font-size: 27px; }
#record-close { width: 38px; height: 38px; padding: 0; border-radius: 50%; background: #251719; box-shadow: none; font-size: 24px; }
#record-content { max-height: calc(88vh - 100px); overflow: auto; padding: 20px 26px 28px; }
.record-section { margin-bottom: 24px; }
.record-section h3 { margin: 0 0 10px; color: #dabe86; font-size: 14px; letter-spacing: .12em; }
.record-list { margin: 0; padding: 0; list-style: none; }
.record-list li { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; padding: 10px 6px; border-bottom: 1px solid #a4875030; color: #ad9c81; font-size: 13px; }
.record-list li span:first-child { color: #d2bb8d; } .record-list li b { color: #e7cb8e; }
.round-log li { grid-template-columns: 32px 1fr; }
.record-empty { color: #786e60; font-size: 13px; }
#pair-choice { width: min(430px, 90vw); padding: 0 22px 24px; overflow: hidden; border: 1px solid #d5b36b99; border-radius: 13px; color: #ead8b5; background: radial-gradient(circle at 50% 0, #7f34445c, transparent 52%), #110b0df5; box-shadow: 0 28px 90px #000e, inset 0 1px #fff2; }
#pair-choice::backdrop { background: #070405b8; backdrop-filter: blur(6px); }
.pair-choice-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 -22px; padding: 18px 20px 14px 24px; border-bottom: 1px solid #b89a5a38; background: linear-gradient(90deg, #6d293744, transparent); }
.pair-choice-heading h2 { margin: 0; color: #f3dca8; font: 600 25px HanamiText, serif; letter-spacing: .12em; }
#pair-choice-close { width: 36px; height: 36px; padding: 0; border-radius: 50%; background: #251719; box-shadow: none; font-size: 23px; }
#pair-choice-note { margin: 15px 0 13px; color: #aa987b; font-size: 12px; text-align: center; }
#pair-choice-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#pair-choice-options button { display: grid; justify-items: center; gap: 6px; padding: 13px 10px 11px; border-color: #cba75f66; background: linear-gradient(155deg, #51252c, #1b1113); }
#pair-choice-options img { width: 92px; height: 131px; border: 3px solid #713121; border-radius: 7px; object-fit: cover; box-shadow: 0 9px 24px #000b; }
#pair-choice-options strong { color: #f0d69a; font-size: 15px; }
#pair-choice-options small { color: #99886d; font: 10px HanamiText, sans-serif; letter-spacing: .05em; }
#pair-choice-options button.recommended::before { content: '推荐'; position: absolute; right: 8px; top: 8px; z-index: 1; border: 1px solid #efd48699; border-radius: 999px; padding: 3px 7px; color: #fff0bd; background: #9a3044; font: 700 9px HanamiText, sans-serif; letter-spacing: .08em; }
#orientation-tip { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; background: #0906079c; backdrop-filter: blur(8px); }
.orientation-card { width: min(360px, 88vw); padding: 28px 30px 24px; border: 1px solid #d6b56888; border-radius: 14px; color: #ead6aa; background: linear-gradient(145deg, #2d171bfa, #100b0dfa); box-shadow: 0 24px 70px #000c, inset 0 1px #fff2; text-align: center; }
.orientation-card .rotate-mark { display: block; margin-bottom: 8px; color: #d2ad60; font-size: 38px; line-height: 1; }
.orientation-card strong { display: block; font-size: 23px; letter-spacing: .12em; }
.orientation-card p { margin: 12px 0 20px; color: #ad9b7d; font-size: 14px; line-height: 1.7; }
.orientation-card button { min-width: 126px; padding-inline: 20px; }
@media (min-width: 701px) and (max-width: 919px) and (orientation: portrait) {
  #actions { bottom: 185px; width: min(430px, calc(100vw - 310px)); grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 700px) { #actions { bottom: 160px; width: calc(100vw - 36px); grid-template-columns: repeat(4, 1fr); } #auto-resolve-control { bottom: 118px; } button { padding: 10px 5px; font-size: 15px; } #opponent-toggle { left: 24px; top: 132px; min-width: 0; } #table-picker { left: 24px; bottom: 24px; } #settings { right: 24px; } #settings[open] { width: min(286px, calc(100vw - 48px)); } }
@media (min-width: 920px) and (orientation: landscape) {
  body.ipad { --action-clearance: 20px; --auto-clearance: 20px; }
  body.ipad #actions { --side-width: clamp(210px, calc(50vw - 350px), 320px); width: min(720px, calc(100vw - var(--side-width) - var(--side-width) - 96px)); gap: 5px; }
  body.ipad #actions button { padding-inline: 4px; font-size: 18px; letter-spacing: .04em; }
  body.ipad #actions button.counter-action, body.ipad #actions button.win-action { font-size: 24px; letter-spacing: 0; padding-inline: 0; }
  body.ipad #flavor-toggle { bottom: 114px; min-height: 40px; padding: 4px 10px 4px 5px; }
  body.ipad #flavor-toggle .emote-art { width: 30px; height: 30px; }
  body.ipad #flavor-toggle small { display: none; }
}
@media (max-width: 700px) { #record-toggle { right: 80px; top: 24px; } #flavor-panel { right: 18px; width: calc(100vw - 36px); } .flavor-grid { grid-template-columns: repeat(2, 1fr); } .flavor-toast[data-side] { left: 50%; right: auto; width: min(390px, calc(100vw - 30px)); transform: translateX(-50%); } .flavor-toast[data-side="opponent"] { top: 24px; bottom: auto; } .flavor-toast[data-side="self"] { top: auto; bottom: 118px; } .flavor-toast .emote-art { width: 120px; height: 120px; flex-basis: 120px; } .result-multipliers { grid-template-columns: 1fr; } .ceremony-card { padding: 28px 22px; } .ceremony h1 { font-size: 33px; } .ceremony h2 { font-size: 29px; } .start-rules { gap: 9px; } .result-actions button { min-width: 0; flex: 1; } }
@media (min-width: 920px) and (min-height: 700px) {
  #flavor-toggle { top: 620px; bottom: auto; }
  body.ipad #flavor-toggle { top: 613px; bottom: auto; }
}
@media (min-width: 920px) and (min-height: 700px) and (max-height: 899px) {
  body:not(.ipad) #flavor-toggle { top: 570px; min-height: 38px; padding: 3px 10px 3px 5px; }
  body:not(.ipad) #flavor-toggle .emote-art { width: 30px; height: 30px; }
  body:not(.ipad) #flavor-toggle small { display: none; }
}
@media (min-width: 920px) and (min-height: 700px) and (max-height: 799px) {
  body:not(.ipad) #flavor-toggle { top: 546px; }
}
@media (min-width: 920px) and (min-height: 700px) and (max-height: 819px) { body.ipad #flavor-toggle { top: 570px; } }
@media (pointer: fine) {
  body, canvas { cursor: url('assets/cursors/arrow.svg') 3 2, default; }
  button:not(:disabled), select, summary, canvas.card-pointer { cursor: url('assets/cursors/select.svg?v=polish-13') 6 3, pointer; }
  button:disabled { cursor: url('assets/cursors/arrow.svg') 3 2, default; }
}
@media (prefers-reduced-motion: reduce) { #actions button.win-action { animation: none; } }
#actions:has(.win-action), #actions:has(.counter-action) { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(126px, 1.8fr) repeat(2, minmax(0, 1fr)); align-items: center; }
#actions:has(.win-action) .action-gap, #actions:has(.counter-action) .action-gap { display: none; }
#actions button.win-action, #actions button.counter-action { height: 66px; font-size: 28px; line-height: 1; letter-spacing: 0; padding: 0 0 2px; display: grid; place-items: center; text-align: center; transform: translateY(-3px); animation: decisive-beat 1.1s ease-in-out infinite; }
#actions button.win-action:not(:disabled):hover, #actions button.counter-action:not(:disabled):hover { transform: translateY(-3px); }
#actions button.win-action:disabled, #actions button.counter-action:disabled { animation: none; transform: none; }
#actions button.turn-finish, body.ipad #actions button.turn-finish { font-size: clamp(13px, 1.1vw, 16px); letter-spacing: 0; padding-inline: 3px; }
@keyframes decisive-beat { 0%, 100% { scale: 1; filter: brightness(1); } 50% { scale: 1.035; filter: brightness(1.12); } }
#actions:has(.koi-action) { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(76px, 1.25fr) minmax(88px, 1.5fr) repeat(2, minmax(0, 1fr)); align-items: center; }
#actions:has(.koi-action) button.current { height: 56px; }
#actions button.koi-action:not(:disabled) { font-size: 25px; letter-spacing: .04em; animation: decisive-beat 1.25s ease-in-out infinite; box-shadow: inset 0 2px #fff3, inset 0 -4px #102c29, 0 0 22px #e0bd6266; }
body.ipad #actions button.koi-action { font-size: 23px; }
@media (prefers-reduced-motion: reduce) { #actions button.koi-action:not(:disabled) { animation: none; } }
.start-chatty { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 15px; font-size: 14px; color: #eed6a6; }
.start-chatty small { color: #b7a07c; font-size: 11px; }
.start-chatty input { accent-color: #b94755; width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { #actions button.win-action, #actions button.counter-action { animation: none; } }
body.light-table #table-picker, body.light-table #table-theme,
body.light-table #auto-resolve-control { color: #432d25; }
body.light-table #auto-resolve-control small { color: #5d493a; }

/* One compact toolbar treatment; the open settings panel keeps its own heading. */
body { --toolbar-edge: clamp(24px, 2.5vw, 34px); }
body #settings:not([open]) { right: var(--toolbar-edge); top: 24px; }
body #record-toggle { right: calc(var(--toolbar-edge) + 90px); }
body #rules-toggle { right: calc(var(--toolbar-edge) + 180px); }
#rules-toggle, #record-toggle, #settings:not([open]) > summary {
  display: grid; place-items: center; width: 80px; height: 44px; min-width: 0;
  padding: 0 12px; border: 1px solid #b9975b88; border-radius: 9px;
  color: #eed9aa; background: linear-gradient(180deg, #302226f2, #1b1316f2);
  box-shadow: inset 0 1px #fff2, inset 0 -2px #08050866, 0 3px 9px #0005;
  font: 600 16px/1 HanamiText, serif; letter-spacing: .08em; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
}
#rules-toggle { width: 120px; }
#rules-toggle::after, #record-toggle::after { display: none; }
#settings summary::-webkit-details-marker { display: none; }
:is(#rules-toggle, #record-toggle, #settings:not([open]) > summary):hover {
  transform: none; filter: none; border-color: #dfbc78; background: linear-gradient(180deg, #433035, #25191d);
}
:is(#rules-toggle, #record-toggle, #settings:not([open]) > summary):active {
  transform: none; box-shadow: inset 0 2px 5px #0009; background: #1b1215;
}
:is(#rules-toggle, #record-toggle, #settings:not([open]) > summary):focus-visible {
  outline: 2px solid #edcc82; outline-offset: 3px;
}
#dealer-intro { z-index: 24; display: flex; flex-direction: column; justify-content: center; gap: 24px; background: #0b080cf2; text-align: center; }
.dealer-banner { width: 100%; padding: 20px; border-block: 1px solid #c9a45f88; background: linear-gradient(90deg, transparent, #53242e88, transparent); animation: dealer-banner-in .5s ease-out both; }
.dealer-banner h2 { margin: 8px 0; font-size: clamp(26px, 4vw, 46px); color: #ffe4a5; }
.dealer-banner p { margin: 8px 0; color: #cdbb98; }
.dealer-cards { display: flex; justify-content: center; gap: clamp(50px, 10vw, 140px); }
.dealer-entry { opacity: 0; transform: translateY(45px); transition: opacity .45s, transform .55s; }
.draw-cards .dealer-entry { opacity: 1; transform: none; }
.dealer-entry:nth-child(2) { transition-delay: .12s; }
.dealer-entry h3 { margin: 0 0 12px; font-size: 23px; }
.dealer-flip { width: clamp(88px, 11vw, 138px); aspect-ratio: 1 / 1.42; position: relative; transform-style: preserve-3d; transition: transform .65s ease-in-out; }
.dealer-flip > * { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; border: 3px solid #d6b476; border-radius: 7px; }
.dealer-flip img { transform: rotateY(180deg); }
.show-faces .dealer-flip { transform: rotateY(180deg); }
.dealer-back { display: grid; place-items: center; background: repeating-radial-gradient(circle at 50% 100%, #f6edda 0 8px, #94b8ac 9px 10px, #f6edda 11px 17px); }
.dealer-back span { padding: 9px; border-radius: 50%; background: #fff4dc; color: #bc5361; font-size: 35px; }
.dealer-month { opacity: 0; color: #edc983; transition: opacity .25s .4s; }
.show-faces .dealer-month { opacity: 1; }
.dealer-winner .dealer-flip { box-shadow: 0 0 35px #edbc6266; }
.dealer-decided .dealer-banner { animation: dealer-win .5s ease-out both; }
@keyframes dealer-banner-in { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes dealer-win { from { filter: brightness(1.8); scale: 1.04; } to { filter: brightness(1); scale: 1; } }
#match-request { width: min(460px, 92vw); border: 1px solid #c8a75b; border-radius: 13px; padding: 20px; background: #211417; color: #efd9ad; }
#match-request::backdrop { background: #080509bb; backdrop-filter: blur(5px); }
#match-request .record-heading { padding: 0 0 12px; }
#match-request h2 { margin: 0; font-size: 25px; }
#match-request-close { width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 25px; }
#match-request-note { font-size: 17px; line-height: 1.7; }
#match-options { margin-top: 16px; border-top: 1px solid #b4965f55; }
body.dealing #auto-resolve-control, body.dealing #flavor-toggle { visibility: hidden; }

/* A single centered decisive action, not an enlarged cell in an uneven toolbar. */
body #actions.counter-stage { top: 50%; bottom: auto; left: 50%; width: min(760px, 86vw); transform: translate(-50%, -50%); display: block; }
body #actions.counter-stage button.counter-action { width: 100%; height: 128px; transform: none; font-size: clamp(36px, 5vw, 64px); letter-spacing: 0; padding: 0; border-radius: 2px; border-inline: 0; background: linear-gradient(90deg, #42101aeb, #a62a3af5 50%, #42101aeb); animation: none; box-shadow: 0 12px 40px #0008, inset 0 1px #ffe4a1; }
body #actions.counter-stage button.counter-action::after { content: '返り討ち · 点击收局'; position: static; inset: auto; background: none; transform: none; transition: none; font-size: 15px; letter-spacing: .12em; color: #ebce9e; }
body #actions.counter-stage button.counter-action:not(:disabled):hover { transform: none; filter: brightness(1.12); }
body #actions.counter-stage button.counter-action:not(:disabled):active { transform: scale(.985); }
body.action-presenting #actions.counter-stage { visibility: hidden; }
#result-screen[data-verdict="loss"] #result-title { color: #c7c7d4; }
#result-screen[data-verdict="loss"] .result-heading { border-color: #90899e; }
body #actions.last-strike-stage button.counter-action::after { content: '最後の一手 · 点击收局'; }
#actions button.stop-action.current:not(:disabled) { border: 2px solid #e8c782; background: linear-gradient(#963544, #541522); box-shadow: inset 0 2px #ffe8b166, inset 0 -5px #21080d, 0 8px 22px #0008; font-size: 26px; }
#actions button.stop-action:not(:disabled):active { transform: translateY(3px) scale(.96); box-shadow: inset 0 3px 9px #1c060d; }
#match-rules { margin: 12px 0; padding: 9px 12px; border: 1px solid #b9975355; border-radius: 7px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; text-align: left; }
#match-rules legend { font-size: 13px; color: #d5bc89; padding: 0 6px; }
#match-rules label { display: flex; gap: 4px; align-items: center; font-size: 14px; white-space: nowrap; }
#match-rules input { accent-color: #b74150; width: 17px; height: 17px; }
#match-rules input:disabled { opacity: .8; }
#match-rules small { display: block; width: 100%; font-size: 11px; color: #ad9a79; line-height: 1.6; }
.start-card { overflow-y: auto; }
.record-score-detail { grid-column: 1 / -1; border-left: 2px solid #b58b49; padding: 0 12px; line-height: 1.7; }
.record-score-detail p { margin: 5px 0; }
.record-formula { color: #f0d095; }
.record-score-detail .guide-card { width: 48px; }
#result-title.verdict-pending { visibility: hidden; }
.special-ceremony { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 35px; background: #10090be8; color: #f8dca1; pointer-events: auto; overflow: auto; }
.special-card-strip { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; max-width: 94vw; }
.special-card-strip .guide-card { width: clamp(65px, 12vw, 140px); height: auto; max-height: 32vh; object-fit: contain; filter: drop-shadow(0 10px 18px #000b); }
.special-ceremony h2 { width: 100%; padding: 24px 12px; text-align: center; border-block: 2px solid #d9ae61; background: linear-gradient(90deg, #49142588, #941e36, #49142588); font: 600 clamp(24px, 4vw, 52px) HanamiText, serif; margin: 0; }
.special-ceremony h2 small { display: block; font-size: 18px; margin-top: 10px; color: #dbc18a; }
@media (prefers-reduced-motion: reduce) { .dealer-entry, .dealer-flip, .dealer-month { transition: none; } .dealer-banner, .dealer-decided .dealer-banner { animation: none; } }
