:root {
  --ink: #173d44; --teal: #126556; --paper: #123c43; --panel: #fffbee;
  --muted: #526a68; --line: #d6dfd0; --soft: #e9f1df; --orange: #b53732;
  --gold: #ffdb68; --gold-edge: #c79428; --mint: #b5efd5; --felt: #236b64;
  --game-font: "Avenir Next Rounded Pro", "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  --motion-fast: 140ms; --motion-normal: 280ms; --motion-slow: 420ms;
  --motion-ease: cubic-bezier(.22,1,.36,1);
}
[hidden] { display: none !important; }
* { -webkit-tap-highlight-color: transparent; }
body {
  min-height: 100svh; color: var(--ink); font-family: var(--game-font);
  background: radial-gradient(ellipse at 50% -15%, #337b70 0, transparent 60%),
    radial-gradient(circle at 5% 70%, #215761 0, transparent 44%), #123c43;
  background-attachment: fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .22;
  background-image: radial-gradient(#b4e3cc 1px, transparent 1px); background-size: 24px 24px;
  mask-image: linear-gradient(transparent, #000 70%);
}
button, input, a { touch-action: manipulation; }
button { transition: color var(--motion-fast), background var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast) var(--motion-ease); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
button:disabled { opacity: .5; }
.duel-shell { width: 100%; max-width: 700px; margin: auto; padding: 0 max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.duel-header { height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.duel-brand { display: flex; align-items: center; gap: 12px; color: #f8f5dd; text-decoration: none; min-height: 44px; }
.duel-brand b { display: grid; place-items: center; width: 46px; height: 43px; border-radius: 13px; font: 900 30px/1 var(--game-font); font-style: italic; letter-spacing: -2px; color: #234e42; background: var(--gold); border: 2px solid #ffe9a1; box-shadow: 0 4px 0 #987a32, 0 6px 10px #062a3933; transform: rotate(-7deg); }
.duel-brand > span { font-size: 16px; font-weight: 750; letter-spacing: 1px; }
.solo-link { color: #d8ebe0; text-decoration: none; font-size: 12px; min-height: 44px; padding: 0 13px; border: 1px solid #a5cfc64d; border-radius: 24px; display: flex; align-items: center; gap: 9px; background: #123c4333; }
.solo-link span { font-size: 18px; }
.connection-panel { position: relative; max-width: 410px; margin: 30px auto 20px; background: linear-gradient(140deg, #fffcf0, #eef2db); border: 3px solid #f4eccf; border-radius: 30px; padding: 22px 28px 16px; box-shadow: 0 9px 0 #0b3036, 0 16px 30px #062b3544; animation: lobby-enter var(--motion-slow) var(--motion-ease) both; }
.lobby-art { height: 176px; position: relative; width: 254px; margin: 0 auto; }
.fan-card { position: absolute; width: 78px; height: 108px; top: 22px; left: 42px; border-radius: 12px; background: #fffef7; border: 2px solid #cdd7c0; box-shadow: 0 4px 0 #c2cab8; font: 850 40px/1 var(--game-font); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transform: rotate(-23deg); }
.fan-card small { font-size: 20px; }
.fan-card:nth-child(4) { left: 78px; top: 12px; transform: rotate(-8deg); color: #bf463e; }
.fan-card:nth-child(5) { left: 113px; top: 12px; transform: rotate(8deg); }
.fan-card:nth-child(6) { left: 148px; top: 22px; transform: rotate(23deg); color: #bf463e; }
.lobby-badge { position: absolute; z-index: 1; bottom: 0; left: 93px; width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); border: 4px solid #fff1b2; box-shadow: 0 5px 0 var(--gold-edge), 0 8px 12px #284b3433; font: 900 38px/1 var(--game-font); font-style: italic; letter-spacing: -3px; transform: rotate(-9deg); }
.lobby-spark { position: absolute; color: #2a8874; font-size: 29px; font-weight: 700; }
.spark-one { left: 10px; top: 20px; transform: rotate(-10deg); }
.spark-two { right: 2px; top: 94px; font-size: 22px; color: #c67536; }
.lobby-title { text-align: center; margin: 21px 0 20px; font: 850 26px/1.3 var(--game-font); letter-spacing: 2px; }
.connect-form { display: flex; flex-direction: column; gap: 10px; }
.connect-form label { font-size: 12px; color: var(--muted); font-weight: 650; }
input { font: 700 16px var(--game-font); color: var(--ink); border: 2px solid #c5d3bb; background: #fffef7; box-shadow: inset 0 3px 0 #e5eadb; padding: 12px; border-radius: 12px; min-width: 0; min-height: 50px; width: 100%; }
#room-input { text-transform: uppercase; letter-spacing: 2px; }
.join-row { display: flex; gap: 10px; }
.join-row button { min-width: 76px; }
.next-button { border: 2px solid #e1b645; border-radius: 13px; color: #354629; background: linear-gradient(#ffe792, #ffcf50); box-shadow: 0 5px 0 var(--gold-edge); padding: 11px 18px; min-height: 48px; font-weight: 800; }
.next-button:hover { background: #ffe689; }
.next-button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--gold-edge); }
.connect-form > .next-button { min-height: 54px; font-size: 16px; }
.or-line { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 11px; margin: 10px 0 0; }
.or-line::before, .or-line::after { content: ""; height: 1px; background: #ced8bf; flex: 1; }
#connection-feedback { height: 38px; color: #9f352d; font-size: 12px; line-height: 17px; margin: 0; overflow: auto; }
.small-button { background: #1c4f51; color: #eff5e6; border: 1px solid #75a59a66; border-radius: 10px; min-height: 44px; min-width: 44px; padding: 8px 12px; font-size: 12px; font-weight: 650; }
.small-button:hover { background: #2a6a63; }
.room-bar { display: flex; align-items: center; gap: 8px; padding: 2px 0 16px; }
#room-code { color: #e6f4e5; font: 800 18px var(--game-font); letter-spacing: 2px; }
#copy-invite { width: 60px; flex-shrink: 0; }
#connection-status { font-size: 10px; color: #c6e3d2; margin-left: auto; display: flex; align-items: center; gap: 5px; }
#connection-status::before { content: ""; width: 5px; height: 5px; background: #b9eeb0; border-radius: 50%; }
#leave-room { background: transparent; border-color: transparent; padding: 8px; color: #c6ded2; }
.versus-row { position: relative; margin-bottom: 18px; }
.duel-players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.versus-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg); color: #ffe18a; font: 950 italic 21px/1 var(--game-font); text-shadow: 0 3px 0 #0e3339; pointer-events: none; }
.player-panel { min-width: 0; border: 2px solid #7ca6a2; background: linear-gradient(135deg, #e5f5e8, #c4e6db); border-radius: 18px; padding: 13px 14px; display: flex; align-items: center; gap: 10px; box-shadow: 0 4px 0 #0a343d; position: relative; }
.player-panel:nth-child(2) { background: linear-gradient(135deg, #ffe3ce, #edc0a6); border-color: #d2a28b; }
.player-panel.me { border-color: #e7f6a8; }
.player-panel.is-answering { box-shadow: 0 0 0 3px #ffdb6877, 0 4px 0 #0a343d; }
.player-avatar { flex-shrink: 0; width: 44px; height: 44px; border-radius: 15px; background: #268d85; border: 2px solid #fff7; box-shadow: 0 3px 0 #13756c; position: relative; display: grid; place-items: center; }
.player-avatar::before { content: ""; width: 26px; height: 21px; background: #d4fff0; border-radius: 8px; box-shadow: inset 0 -3px 0 #9be2cd; }
.player-avatar::after { content: ""; position: absolute; width: 4px; height: 5px; border-radius: 2px; background: #155456; left: 14px; top: 18px; box-shadow: 10px 0 0 #155456; }
.player-avatar .antenna { position: absolute; width: 3px; height: 7px; left: 50%; top: -7px; background: #a8e5cd; border-radius: 2px; }
.player-avatar .antenna::before { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; top: -3px; left: -1px; background: #ffe598; }
.player-panel:nth-child(2) .player-avatar { background: #cf704e; box-shadow: 0 3px 0 #a75238; }
.player-panel:nth-child(2) .player-avatar::before { background: #fff0d1; box-shadow: inset 0 -3px 0 #efccaa; }
.player-info { min-width: 0; flex: 1; }
.player-name { font-size: 14px; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.player-state { font-size: 10px; color: #3b605d; height: 16px; line-height: 16px; margin-top: 3px; }
.hand-count { display: flex; align-items: baseline; gap: 3px; white-space: nowrap; font-size: 10px; color: #47635a; }
.hand-count strong { font: 850 34px/1 var(--game-font); letter-spacing: -1px; color: #1a5b54; font-variant-numeric: tabular-nums; }
.player-panel:nth-child(2) .hand-count strong { color: #913f2c; }
.duel-panel { position: relative; overflow: hidden; border: 3px solid #669b87; border-radius: 26px; background: linear-gradient(150deg, #2b7970, #1d5d58); color: #f5f6dc; box-shadow: 0 7px 0 #0b3037, inset 0 0 0 3px #8abda021, 0 15px 35px #062e3b44; }
.duel-panel::before { content: ""; position: absolute; inset: 10px; border: 1px dashed #acdcc32b; border-radius: 19px; pointer-events: none; }
.duel-panel .panel-top { position: relative; padding: 16px 20px 13px; min-height: 79px; border-bottom: 0; align-items: center; }
.phase-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.round-label { color: #c0dfcc; font-size: 10px; font-weight: 650; letter-spacing: 1px; }
.phase-pill { color: #fff6c9; font-size: 15px; font-weight: 800; line-height: 1.3; }
.countdown { display: flex; align-items: baseline; gap: 5px; flex-shrink: 0; min-width: 106px; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 10px; color: #c0e0cc; }
.countdown small { font-size: 10px; color: #e3efda; }
.countdown strong { font: 900 35px/1 var(--game-font); min-width: 44px; text-align: center; color: #ffe28b; letter-spacing: -1px; }
.countdown.urgent strong { color: #ffbd98; }
.time-track { position: relative; height: 5px; background: #123f4066; margin: 0 20px; border-radius: 10px; overflow: hidden; }
#time-fill { display: block; width: 100%; height: 100%; transform: scaleX(1); transform-origin: left; background: #d3e999; border-radius: inherit; transition: transform 200ms linear, background var(--motion-normal); }
.duel-panel[data-phase="answering"] #time-fill { background: var(--gold); }
.duel-panel.is-critical #time-fill { background: #ffad8f; }
.duel-board { position: relative; text-align: center; padding: 12px 20px 14px; }
.original-cards { display: flex; align-items: center; justify-content: center; gap: 7px; height: 28px; min-height: 28px; margin-bottom: 17px; overflow: hidden; flex-wrap: nowrap; }
.original-cards[hidden] { display: flex !important; visibility: hidden; }
.original-card { border-radius: 5px; padding: 3px 8px; background: #f0f2d9; color: #265b55; font: 750 13px/20px var(--game-font); box-shadow: 0 2px 0 #0d3c4133; white-space: nowrap; }
.original-card small { font-size: 8px; margin-left: 5px; opacity: .7; }
.red-suit { color: #bd4336; }
.duel-board .cards { position: relative; min-height: 146px; gap: 12px; align-items: center; z-index: 1; }
.duel-board .number-card { --card-edge: #d3cfba; background: linear-gradient(145deg, #fffff5, #f6f1dc); color: #204f4b; border: 2px solid #ffffec; border-radius: 13px; width: min(112px, calc((100% - 36px) / 4)); height: 140px; flex-shrink: 0; box-shadow: 0 6px 0 var(--card-edge), 0 9px 10px #0c3d3c55; position: relative; transform: none; animation: none; padding-bottom: 7px; }
.duel-board .number-card:disabled { opacity: 1; cursor: default; }
.duel-board .number-card:hover:not(:disabled) { background: #fffbea; transform: translateY(-3px); box-shadow: 0 9px 0 var(--card-edge), 0 12px 16px #0c3d3c44; }
.duel-board .number-card:active:not(:disabled) { transform: translateY(1px); }
.duel-board .number-card[aria-pressed="true"] { background: #fff3ba; color: #244e43; border-color: #ffe078; box-shadow: 0 6px 0 #c8a84a, 0 0 0 3px #ffe28b66, 0 10px 18px #093c3933; transform: translateY(-7px); }
.duel-board .number-card.red-suit { color: #b63c32; }
.duel-board .number-card .card-value { font: 850 55px/1 var(--game-font); letter-spacing: -2px; }
.duel-board .number-card .fraction-value { font-size: 31px; letter-spacing: -1px; }
.poker-card .card-corner { font: 17px var(--game-font); top: 8px; left: 10px; opacity: 1; }
.poker-card .card-corner ~ .card-corner { top: auto; left: auto; bottom: 7px; right: 9px; transform: rotate(180deg); }
.owner-tag { position: absolute; bottom: 10px; left: 0; right: 0; color: #6c7962; font: 9px var(--game-font); letter-spacing: .2px; }
.number-card .card-expression { color: #526548; font-size: 9px; }
.table-status { height: 42px; min-height: 42px; display: grid; align-items: center; margin: 10px 0 9px; overflow: auto; }
.table-status > * { grid-area: 1 / 1; max-height: 42px; overflow: auto; }
.table-status #duel-selection, .table-status #duel-feedback, .table-status .round-result { margin: 0; padding: 4px 8px; min-height: 0; font-size: 12px; line-height: 17px; border-radius: 8px; }
#duel-selection { color: #f6f3ce; font-weight: 750; }
#duel-feedback { color: #ffcfb8; background: #733b3333; }
#duel-feedback:empty { display: none; }
.round-result { color: #ffe799; font-weight: 750; background: #163f4666; }
.round-result.victory { background: var(--gold); color: #2e4a35; }
.table-status:has(#duel-feedback:not(:empty)) #duel-selection, .table-status:has(#round-result:not([hidden])) #duel-selection, .table-status:has(#duel-feedback:not(:empty)) #round-result { visibility: hidden; }
.duel-operators { gap: 12px; margin: 0; }
.duel-operators button { border: 1px solid #8bb9a47a; background: #154d4d; color: #f3f4d6; border-radius: 13px; width: 56px; height: 48px; font: 650 28px var(--game-font); box-shadow: 0 4px 0 #113e41; }
.duel-operators button:disabled { opacity: .42; }
.duel-operators button:hover:not(:disabled) { background: #2c8578; }
.duel-operators button[aria-pressed="true"] { background: var(--gold); color: #2c5144; border-color: #ffeaa4; box-shadow: 0 4px 0 #ae8b39; }
.duel-actions { position: relative; margin: 0 20px 17px; display: grid; grid-template-columns: 46px 46px minmax(76px, 1fr) minmax(110px, 1.6fr); align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid #8ebfa333; }
.duel-actions .utility { display: flex; flex-direction: column; gap: 2px; color: #e0ebcd; justify-content: center; padding: 0; font-size: 10px; min-height: 48px; }
.duel-actions .utility svg { width: 19px; height: 19px; }
.duel-actions .utility:disabled { opacity: .38; }
.duel-actions .small-button { white-space: nowrap; padding: 8px; height: 48px; background: #204e4f; border-color: #90b69b55; font-size: 12px; border-bottom-width: 3px; }
#vote-count { font-size: 10px; opacity: .8; }
.buzz-button { display: flex; align-items: center; justify-content: center; gap: 7px; height: 50px; min-height: 50px; padding: 8px; border-radius: 15px; font-size: 19px; font-weight: 900; letter-spacing: 2px; box-shadow: 0 6px 0 #b68c32, 0 9px 16px #103d4033; }
.buzz-button svg { width: 21px; height: 25px; fill: #526032; stroke-width: 1.6; }
.buzz-button:disabled { opacity: .52; background: #d0d1a1; border-color: #b4bb8e; box-shadow: 0 5px 0 #7c936a; }
#start-match { grid-column: 1 / -1; font-size: 16px; min-height: 50px; }
.duel-actions:has(#start-match:not([hidden])) { grid-template-columns: 1fr; }
.calculation { height: 99px; border-top: 1px solid #8ebfa333; margin: 0 20px; padding: 11px 0 12px; overflow: auto; }
.calculation[hidden] { display: block !important; visibility: hidden; }
.calculation .section-heading h2 { color: #c3dbc4; font-size: 10px; font-weight: 600; letter-spacing: 1px; }
.calculation .section-heading > span { color: #c3dbc4; font-size: 10px; }
.calculation .history { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 5px; margin: 7px 0 0; }
.calculation .history li { background: #124a4b77; color: #e7eed5; border-radius: 7px; padding: 5px 7px; min-height: 28px; font-size: 12px; justify-content: center; animation: none; }
.calculation .history strong { color: #ffe18a; }
.calculation .step-number { display: none; }
.table-idle { display: none; position: absolute; left: 50%; top: 42px; width: 150px; height: 146px; transform: translateX(-50%); pointer-events: none; }
.table-idle span { position: absolute; width: 70px; height: 100px; left: 28px; top: 10px; border: 3px solid #b0d8bc; border-radius: 10px; transform: rotate(-15deg); background: repeating-linear-gradient(45deg, #367d70, #367d70 4px, #438c7a 4px, #438c7a 6px); box-shadow: 0 5px 0 #164b4c; }
.table-idle span:nth-child(2) { left: 58px; transform: rotate(14deg); }
.table-idle b { position: absolute; top: 63px; left: 48px; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; background: #e3dfac; color: #2a6656; font: 900 30px var(--game-font); border: 3px solid #f5e7bd; box-shadow: 0 4px 0 #b0a36d; }
.duel-panel[data-phase="lobby"] .table-idle { display: block; }
.duel-panel[data-phase="lobby"] .duel-board { min-height: 226px; }
.duel-panel[data-phase="lobby"] .original-cards { visibility: hidden; }
.duel-panel[data-phase="lobby"] .table-status { margin-top: 148px; }
.duel-panel[data-phase="lobby"] .calculation { display: none !important; }
#game-effects { position: fixed; inset: 0; z-index: 50; overflow: hidden; pointer-events: none; }
.fx-particle { position: absolute; width: 8px; height: 12px; border-radius: 2px; background: var(--gold); }
.collect-card { position: absolute; width: 26px; height: 38px; border-radius: 5px; background: repeating-linear-gradient(45deg, #388f7e, #388f7e 3px, #6da88c 3px, #6da88c 5px); border: 2px solid #f8efcd; box-shadow: 0 3px 0 #122e3d55; }
.fx-callout { position: absolute; left: 50%; top: 37%; transform: translate(-50%, -50%); padding: 12px 23px; border-radius: 18px; background: var(--gold); border: 3px solid #fff4c0; color: #34532e; font: 900 23px var(--game-font); box-shadow: 0 5px 0 var(--gold-edge), 0 10px 20px #0c333c44; white-space: nowrap; }
@keyframes lobby-enter { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes critical-tick { 0%,100% { transform: scale(1); } 45% { transform: scale(1.12); } }
.countdown.critical strong { animation: critical-tick 1s ease-in-out 3; }
@media (max-width: 540px) {
  .duel-shell { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); max-width: 460px; }
  .duel-header { height: 66px; }
  .duel-brand { gap: 10px; }
  .duel-brand b { width: 39px; height: 37px; font-size: 26px; border-radius: 11px; }
  .duel-brand > span { font-size: 14px; }
  .solo-link { font-size: 11px; padding: 0 11px; }
  .room-bar { padding-bottom: 13px; gap: 6px; }
  #room-code { font-size: 16px; letter-spacing: 1px; }
  #connection-status { font-size: 9px; gap: 3px; }
  .room-bar .small-button { padding: 8px; }
  .versus-row { margin-bottom: 14px; }
  .duel-players { gap: 25px; }
  .versus-badge { font-size: 17px; }
  .player-panel { border-radius: 15px; padding: 10px 9px; gap: 7px; }
  .player-avatar { width: 32px; height: 34px; border-radius: 11px; }
  .player-avatar::before { width: 21px; height: 17px; border-radius: 6px; }
  .player-avatar::after { width: 3px; height: 4px; top: 14px; left: 10px; box-shadow: 8px 0 0 #155456; }
  .player-name { font-size: 11px; }
  .player-state { font-size: 9px; height: 13px; line-height: 13px; margin-top: 3px; }
  .hand-count { flex-direction: column; gap: 1px; align-items: center; font-size: 8px; }
  .hand-count strong { font-size: 25px; }
  .duel-panel { border-radius: 23px; }
  .duel-panel .panel-top { padding: 13px 14px 11px; min-height: 69px; }
  .phase-pill { font-size: 13px; }
  .round-label { font-size: 9px; }
  .countdown { min-width: 78px; }
  .countdown span { display: none; }
  .countdown strong { font-size: 34px; }
  .time-track { margin: 0 14px; height: 4px; }
  .duel-board { padding: 8px 12px 13px; }
  .original-cards { height: 25px; min-height: 25px; margin-bottom: 13px; gap: 5px; }
  .original-card { font-size: 12px; padding: 2px 6px; }
  .original-card small { font-size: 8px; margin-left: 3px; }
  .duel-board .cards { min-height: 115px; gap: 9px; }
  .duel-board .number-card { width: min(88px, calc((100% - 27px) / 4)); height: 111px; border-radius: 11px; }
  .duel-board .number-card .card-value { font-size: 45px; }
  .duel-board .number-card .fraction-value { font-size: 25px; }
  .poker-card .card-corner { font-size: 14px; left: 7px; top: 6px; }
  .poker-card .card-corner ~ .card-corner { right: 6px; bottom: 7px; }
  .owner-tag { font-size: 8px; bottom: 9px; }
  .duel-operators { gap: 11px; }
  .duel-operators button { width: 52px; height: 46px; border-radius: 12px; }
  .table-status { height: 40px; min-height: 40px; margin: 8px 0; }
  .table-status > * { max-height: 40px; }
  .table-status #duel-selection, .table-status #duel-feedback, .table-status .round-result { font-size: 11px; }
  .duel-actions { margin: 0 12px 14px; grid-template-columns: 39px 39px minmax(65px, 1fr) minmax(94px, 1.5fr); gap: 8px; padding-top: 11px; }
  .duel-actions .small-button { font-size: 11px; padding: 6px; }
  .buzz-button { font-size: 17px; height: 48px; min-height: 48px; }
  .calculation { margin: 0 12px; height: 94px; padding: 10px 0; }
  .calculation .history { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .calculation .history li { min-height: 25px; font-size: 11px; padding: 4px; }
  .table-idle { top: 32px; }
  .connection-panel { margin-top: 24px; padding: 18px 25px 12px; border-radius: 26px; }
}
@media (max-width: 360px) {
  .duel-shell { padding-left: 10px; padding-right: 10px; }
  .duel-players { gap: 22px; }
  .player-panel { padding: 9px 7px; gap: 5px; }
  .player-avatar { display: none; }
  .player-name { font-size: 12px; }
  .hand-count { flex-direction: row; font-size: 9px; }
  .duel-actions { gap: 7px; grid-template-columns: 35px 35px minmax(61px,1fr) minmax(83px,1.3fr); }
  .duel-board .number-card .card-value { font-size: 39px; }
  .connection-panel { padding: 16px 20px 10px; }
  .lobby-art { transform: scale(.9); transform-origin: center bottom; }
}
@media (max-height: 740px) and (max-width: 540px) {
  .duel-header { height: 58px; }
  .room-bar { padding-bottom: 8px; }
  .versus-row { margin-bottom: 12px; }
  .player-panel { padding-top: 8px; padding-bottom: 8px; }
  .duel-panel .panel-top { min-height: 60px; padding-top: 9px; padding-bottom: 9px; }
  .duel-board .number-card { height: 100px; }
  .duel-board .cards { min-height: 104px; }
  .original-cards { margin-bottom: 9px; }
  .table-status { margin: 6px 0; height: 36px; min-height: 36px; }
  .duel-operators button { height: 44px; }
  .duel-board { padding-bottom: 10px; }
  .duel-actions { margin-bottom: 13px; padding-top: 10px; }
  .connection-panel { margin-top: 16px; }
  .lobby-art { height: 154px; }
  .lobby-title { margin-top: 15px; margin-bottom: 16px; }
}
@media (orientation: landscape) and (max-height: 500px) and (min-width: 600px) {
  .duel-shell { max-width: 1000px; }
  .duel-header { height: 56px; }
  #match { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 8px 16px; align-items: start; }
  .room-bar { grid-column: 1; flex-wrap: wrap; padding: 0; }
  #connection-status { margin-left: 0; }
  .versus-row { grid-column: 1; grid-row: 2; margin-top: 12px; }
  .duel-players { grid-template-columns: 1fr; gap: 24px; }
  .versus-badge { top: 50%; font-size: 17px; }
  .player-panel { padding: 9px; gap: 7px; }
  .player-avatar { width: 32px; height: 34px; }
  .player-name { font-size: 12px; }
  .hand-count strong { font-size: 28px; }
  .duel-panel { grid-column: 2; grid-row: 1 / 3; }
  .duel-panel .panel-top { min-height: 50px; padding: 9px 14px; }
  .phase-info { flex-direction: row; align-items: center; gap: 12px; }
  .phase-pill { font-size: 12px; }
  .countdown strong { font-size: 28px; }
  .duel-board { padding: 5px 14px 8px; }
  .original-cards { height: 23px; min-height: 23px; margin-bottom: 6px; }
  .duel-board .cards { min-height: 85px; }
  .duel-board .number-card { height: 81px; width: 76px; }
  .duel-board .number-card .card-value { font-size: 36px; }
  .duel-board .number-card .fraction-value { font-size: 23px; }
  .poker-card .card-corner { font-size: 11px; }
  .owner-tag { bottom: 6px; font-size: 8px; }
  .table-status { height: 32px; min-height: 32px; margin: 4px 0; }
  .duel-operators button { height: 44px; }
  .duel-actions { margin: 0 14px 13px; padding-top: 8px; }
  .calculation { margin: 0 14px; }
  .connection-panel { margin-top: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .duel-board .number-card[aria-pressed="true"] { transform: none; }
}
.buzz-button > span { padding-left: 0; font-size: inherit; line-height: 1; }
.fan-card { --fan-angle: -23deg; animation: fan-in 500ms var(--motion-ease) both; animation-delay: 60ms; }
.fan-card:nth-child(4) { --fan-angle: -8deg; animation-delay: 110ms; }
.fan-card:nth-child(5) { --fan-angle: 8deg; animation-delay: 160ms; }
.fan-card:nth-child(6) { --fan-angle: 23deg; animation-delay: 210ms; }
@keyframes fan-in { from { opacity: 0; transform: translateY(20px) rotate(0deg) scale(.88); } to { opacity: 1; transform: translateY(0) rotate(var(--fan-angle)) scale(1); } }
@media (max-width: 360px) {
  .duel-actions { grid-template-columns: 44px 44px minmax(54px,1fr) minmax(75px,1.3fr); }
}
@media (orientation: landscape) and (max-height: 400px) and (min-width: 600px) {
  .duel-header { height: 46px; }
  .duel-panel .panel-top { min-height: 46px; padding-top: 7px; padding-bottom: 7px; }
  .table-status { height: 28px; min-height: 28px; }
}
.game-nav { display: flex; align-items: center; gap: 12px; }
.home-back { color: #d8ebe0; text-decoration: none; font-size: 12px; min-height: 44px; min-width: 40px; display: grid; place-items: center; }
.home-back:hover { color: #ffe18a; }
@media (max-width: 540px) {
  .game-nav { gap: 6px; }
  .home-back { font-size: 11px; }
}
@media (max-width: 360px) {
  .game-nav { gap: 4px; }
  .game-nav .solo-link { padding: 0 8px; gap: 4px; font-size: 10px; }
}
