:root{color-scheme:dark;--bg:#071e20;--panel:#0d2b2d;--felt:#12574c;--text:#eff4ec;--muted:#9fb9b0;--gold:#e3bb6a;--red:#c9504b;--line:#ffffff18;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;font-size:16px}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 50% 0,#173d39,transparent 65%),var(--bg);color:var(--text)}button{font:inherit;cursor:pointer;transition:background .16s,transform .16s;border:0}button:focus-visible,summary:focus-visible{outline:3px solid var(--gold);outline-offset:4px}button:disabled{cursor:default;opacity:.4}button:not(:disabled):active{transform:translateY(1px)}.topbar{max-width:1540px;margin:auto;padding:18px 30px;display:flex;align-items:center;justify-content:space-between;gap:16px}.brand{display:flex;align-items:center;gap:13px}.brand-seal{width:44px;height:44px;background:#b84038;border-radius:8px;display:grid;place-items:center;font:30px "Songti SC",serif;box-shadow:inset 0 0 0 4px #ffffff13}.brand h1{font:600 26px "Songti SC",serif;letter-spacing:4px;margin:0}.brand h1 span{font:14px -apple-system,sans-serif;letter-spacing:1px;margin-left:15px;color:var(--gold)}.brand p{font-size:12px;letter-spacing:2px;color:var(--muted);margin:5px 0 0}nav{display:flex;gap:8px}.quiet{padding:10px 16px;color:var(--text);border:1px solid #ffffff24;border-radius:7px;background:#ffffff06}.quiet:hover{background:#ffffff12}.primary{background:var(--gold);color:#1d3029;padding:11px 22px;border-radius:7px;font-weight:700}.primary:hover{background:#f4cc7a}main{max-width:1540px;display:grid;grid-template-columns:minmax(0,1fr) 272px;gap:20px;padding:0 30px;margin:auto}.game{border:1px solid #d4b77d40;border-radius:20px;overflow:hidden;background:#0d342f;box-shadow:0 25px 80px #0004}.table-top{display:flex;justify-content:space-between;gap:10px;padding:12px 24px;color:#d7e7dd;font-size:14px;border-bottom:1px solid #ffffff15}.table-top span:nth-child(2){color:var(--muted)}.felt{height:clamp(350px,calc(100dvh - 380px),490px);position:relative;z-index:1;background:radial-gradient(ellipse at 50% 40%,#1b6b57,var(--felt) 55%,#10463f);box-shadow:inset 0 0 60px #071e2070}.felt:after{content:"";position:absolute;inset:14px;border:1px solid #ffffff10;border-radius:10px;pointer-events:none}.seat{position:absolute;text-align:center;z-index:2;max-width:32%}.seat.north{top:18px;left:50%;transform:translateX(-50%);width:370px}.seat.west{top:130px;left:20px;width:142px}.seat.east{top:130px;right:20px;width:142px}.player-head{display:flex;align-items:center;justify-content:center;gap:9px;flex-wrap:wrap;font-size:14px}.avatar{width:35px;height:35px;border-radius:50%;display:grid;place-items:center;background:#204b44;border:1px solid #ffffff30;font-family:"Songti SC",serif;color:#f6d497;font-size:18px}.turn .avatar{border-color:var(--gold);box-shadow:0 0 0 3px #e3bb6a30}.player-name{font-weight:600}.player-meta{color:#b6cdc1;font-size:12px;margin:5px 0 9px}.badge{padding:2px 6px;border-radius:4px;font-size:12px;background:#0003;color:#e3bb6a}.badge.missing{color:#f2a9a2}.won .avatar{background:#75603a}.backs{display:flex;justify-content:center;margin:10px 0;gap:2px}.back{width:13px;height:28px;background:linear-gradient(135deg,#2e7b67,#205d50);border:1px solid #a8c0a16b;border-bottom:3px solid #0a362c;border-radius:3px}.west .backs,.east .backs{flex-wrap:wrap;padding:0 15px}.table-center{position:absolute;top:clamp(92px,calc(100dvh - 628px),145px);left:50%;transform:translateX(-50%);width:220px;text-align:center;z-index:1}.center-kicker{font-size:12px;letter-spacing:3px;color:#c4d5b8}.center-mark{font:32px "Songti SC",serif;letter-spacing:12px;padding:3px 0 3px 12px;color:#e7d9a5}.table-center p{margin:5px 0;color:#dce6d5;font-size:14px}.table-center #last-caption{color:#b6cdc1;font-size:12px;min-height:18px}.table-center #last-play{height:55px;display:flex;align-items:center;justify-content:center}.discard-area{position:absolute;bottom:18px;left:170px;right:170px;display:grid;grid-template-columns:1fr 1fr;gap:12px;max-height:clamp(80px,calc(100dvh - 640px),144px);overflow-y:auto;scrollbar-width:thin}.river{background:#062a2645;padding:6px;border-radius:6px;min-width:0}.river-title{font-size:12px;color:#aac4b6;margin-bottom:4px}.river-tiles{display:flex;flex-wrap:wrap;gap:2px}.tile{--tile-w:49px;--tile-h:70px;flex-shrink:0;width:var(--tile-w);height:var(--tile-h);background:linear-gradient(135deg,#fffef3,#ecebd8);border-radius:5px;border:1px solid #dedeca;box-shadow:0 4px 0 #abbba6,0 5px 0 #376659,0 7px 7px #0003;display:inline-flex;align-items:center;justify-content:center;flex-direction:column;position:relative;color:#1e3838;user-select:none;font-family:"Songti SC","STSong",serif;line-height:1.1}.tile .number{font-size:25px;font-weight:700}.tile .suit{font-size:21px;font-weight:700}.tile.s0{color:#af342c}.tile.s1{color:#17735b}.tile.s2{color:#215b9c}.tile.mini{--tile-w:24px;--tile-h:33px;border-radius:3px;box-shadow:0 2px 0 #abbba6;font-family:inherit}.tile.mini .number{font-size:14px}.tile.mini .suit{font-size:12px}.tile.small{--tile-w:29px;--tile-h:40px}.tile.small .number{font-size:17px}.tile.small .suit{font-size:14px}.tile.selected{transform:translateY(-12px);border-color:var(--gold);box-shadow:0 4px 0 #9d8b55,0 0 0 3px var(--gold)}.tile.missing-tile:after{content:"缺";position:absolute;top:-7px;right:-4px;background:#b84038;color:white;font:10px sans-serif;padding:2px 3px;border-radius:3px}.tile.drawn{margin-left:12px}.tile.unavailable{opacity:.5;cursor:not-allowed}.tile:hover:not(:disabled){filter:brightness(1.06)}.human-zone{padding:15px 20px 19px;background:linear-gradient(#0b312d,#0a2a29);min-height:240px;position:relative;z-index:3}
/* 碰牌标签绝对定位在 meld-group 下方，会盖住手牌首行：标签不吃点击 + 下方留白，两端都防 */
.human-melds{padding-bottom:11px}.human-info{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:8px}.human-info .player-head{justify-content:flex-start}.human-info .player-meta{margin:0}.melds{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;min-height:4px;margin:7px 0}.meld-group{display:flex;gap:2px;position:relative;padding-bottom:6px}.meld-label{font-size:10px;color:#b7cfc3;position:absolute;bottom:-8px;width:100%;text-align:center;pointer-events:none}.hand-scroll{overflow-x:auto;padding:20px 3px 12px;scrollbar-width:thin}.hand{display:flex;align-items:center;gap:5px;justify-content:center;min-width:max-content}.action-panel{display:flex;justify-content:space-between;align-items:center;gap:16px;padding-top:13px}.action-panel h2{font-size:16px;margin:0 0 5px;font-weight:600}.action-panel p{font-size:13px;margin:0;color:var(--muted);max-width:480px}.actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.actions button{font-size:14px}.actions .win-button{background:#c24b42;color:white}.sidebar section{background:#ffffff03;border:1px solid var(--line);border-radius:12px;padding:18px}.sidebar h2{font-size:16px;font-weight:600;margin:0 0 17px}.sidebar h2 span{display:block;color:var(--muted);font-size:12px;font-weight:400;margin-top:5px}.score-row{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid var(--line);font-size:14px}.score-row:last-child{border-bottom:0}.score-row b{font-variant-numeric:tabular-nums;color:var(--gold);font-size:19px}.score-row b.negative{color:#ecaaa3}.log-panel{margin-top:16px}.log-panel ol{padding:0;margin:0;list-style:none;height:260px;overflow-y:auto;scrollbar-width:thin}.log-panel li{font-size:13px;color:#b9cdc3;line-height:1.6;padding:7px 0;border-bottom:1px solid var(--line)}.log-panel li:first-child{color:#eee8d6}.quick-rule{margin-top:16px}.quick-rule p{font-size:13px;line-height:1.7;color:#aac2b5;margin:8px 0}.quick-rule b{color:#d6e1d1;font-weight:500}footer{max-width:1540px;padding:18px 30px 24px;margin:auto;font-size:12px;color:#809e94;display:flex;justify-content:space-between;gap:15px}footer span{letter-spacing:2px}dialog{border:1px solid #c6ad7050;border-radius:17px;padding:28px;background:#102e2b;color:var(--text);max-width:min(720px,calc(100vw - 28px));max-height:86vh;width:720px;box-shadow:0 30px 120px #0008}dialog::backdrop{background:#031512bb;backdrop-filter:blur(4px)}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:20px}.dialog-heading h2{margin:8px 0 0;font:26px "Songti SC",serif}.eyebrow{font-size:12px;color:var(--gold);letter-spacing:2px}.rules-content{line-height:1.85;color:#c7d8ce}.rules-content h3{font-size:17px;color:#f1ebd8;margin:25px 0 8px}.rules-content p{margin:8px 0;font-size:15px}.rules-note{border-top:1px solid var(--line);padding-top:15px;color:var(--muted)}.result-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:24px}#result-summary{line-height:1.7;color:#c6d6c9}details{margin-top:22px;font-size:14px}summary{cursor:pointer;color:var(--gold);padding:10px 0}.detail-line{font-size:13px;padding:7px 0;color:#bad0c5;border-bottom:1px solid var(--line)}.revealed-hand{display:flex;gap:3px;flex-wrap:wrap;margin:10px 0 18px}.claimed{opacity:.28} .toast{color:#efcf82!important} /* ===== AI8899 增强 2026-10-26：摸牌 / 出牌 / 胡牌 反馈 ===== */
.tile.drawn{margin-left:12px;box-shadow:0 4px 0 #abbba6,0 5px 0 #c9962f,0 0 14px #e3bb6a80,0 7px 7px #0003}
.tile.just-played{animation:tile-drop .34s ease-out}
@keyframes tile-drop{0%{transform:translateY(-16px) scale(1.14);opacity:.2}100%{transform:none;opacity:1}}
.tile.hu-glow{animation:hu-glow 1.2s ease-in-out infinite alternate}
@keyframes hu-glow{from{box-shadow:0 4px 0 #abbba6,0 5px 0 #376659,0 0 0 0 #e3bb6a00}to{box-shadow:0 4px 0 #abbba6,0 5px 0 #376659,0 0 16px 5px #e3bb6a99}}
#win-flash{position:fixed;inset:0;z-index:60;pointer-events:none;opacity:0;background:radial-gradient(circle at 50% 42%,#e3bb6a66,#c9504b2e 46%,transparent 72%)}
#win-flash.on{animation:win-flash 1.3s ease-out}
@keyframes win-flash{0%{opacity:0}16%{opacity:1}100%{opacity:0}}
body.hu-active .felt{box-shadow:inset 0 0 60px #071e2070,#e3bb6a44}
/* 顶栏按钮双标签：桌面显全称，手机显短名，避免顶栏内容把视口撑破 */
.lbl-mini{display:none}

@media(min-width:1450px){.felt{height:510px}.tile{--tile-w:53px;--tile-h:76px}}@media(max-width:1120px){main{grid-template-columns:minmax(0,1fr);padding:0 20px}.sidebar{display:grid;grid-template-columns:1fr 1fr;gap:16px}.sidebar section{margin-top:0}.quick-rule{display:none}.log-panel ol{height:180px}.topbar{padding:20px}.felt{height:450px}.discard-area{left:160px;right:160px}.table-center{top:120px}.action-panel{align-items:flex-start}footer{padding:18px 20px}}@media(max-width:720px){
  body{height:100dvh;display:flex;flex-direction:column;overflow:hidden;padding-bottom:0}
  body .topbar{flex:0 0 auto;height:48px;padding:0 10px;flex-wrap:nowrap;gap:8px;position:static;min-width:0}
  .brand{gap:8px;min-width:0}
  .brand h1{font-size:15px;letter-spacing:1px;white-space:nowrap}
  .brand h1 span{display:none}
  .brand-seal{width:30px;height:30px;font-size:19px}
  .brand p{display:none}
  body .topbar nav{width:auto;flex-wrap:nowrap;gap:4px;margin-left:auto;min-width:0}
  body .topbar .quiet{font-size:10px;padding:5px 6px;min-height:30px;white-space:nowrap}
  .lbl-full{display:none}
  .lbl-mini{display:inline}
  main{display:block;flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 6px 10px}
  .game{position:sticky;top:0;z-index:2;border-radius:12px;display:flex;flex-direction:column;height:calc(100dvh - 58px)}
  .table-top{flex:0 0 auto;padding:7px 10px;font-size:11px}
  .table-top span:nth-child(2){display:none}
  .felt{flex:1 1 auto;height:auto;min-height:198px;display:flex;flex-direction:column;justify-content:flex-end}
  .seat.north{top:4px;max-width:74%}
  .seat.west,.seat.east{top:52px;width:74px;max-width:25%}
  .seat.west{left:8px}
  .seat.east{right:8px}
  .player-head{gap:4px;font-size:12px}
  .player-meta{font-size:10px;margin:3px 0 6px}
  .player-name{font-size:12px}
  .avatar{width:26px;height:26px;font-size:14px}
  .badge{font-size:10px;padding:1px 4px}
  .backs{margin:6px 0}
  .west .backs,.east .backs{padding:0;gap:1px}
  .back{width:8px;height:22px}
  .table-center{top:48px;width:150px}
  .center-mark{font-size:22px;letter-spacing:6px;padding:2px 0 2px 7px}
  .center-kicker{font-size:9px;letter-spacing:2px}
  .table-center p{font-size:11px;margin:2px 0}
  .table-center #last-play{height:38px}
  .table-center #last-play .tile{--tile-w:30px;--tile-h:38px}
  .table-center #last-play .number{font-size:17px}
  .table-center #last-play .suit{font-size:13px}
  .discard-area{position:static;max-height:38%;min-height:96px;overflow-y:auto;padding:0 8px 8px;grid-template-columns:1fr 1fr;gap:4px}
  .river{padding:3px}
  .river-title{font-size:10px;margin-bottom:2px}
  .river-tiles{gap:1px}
  .river .tile.mini{--tile-w:18px;--tile-h:24px}
  .river .tile.mini .number{font-size:10px}
  .river .tile.mini .suit{font-size:8px}
  .human-zone{flex:0 0 auto;padding:6px 8px calc(8px + env(safe-area-inset-bottom));min-height:0}
  .human-info{align-items:flex-start;margin-bottom:4px;gap:8px}
  .human-info .player-meta{font-size:11px}
  .melds{gap:6px;margin:3px 0;justify-content:flex-start}
  .melds .tile.small{--tile-w:22px;--tile-h:30px}
  .meld-label{font-size:9px}
  .hand-scroll{overflow:visible;padding:9px 0 2px}
  .hand{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px 3px;align-items:end;justify-content:stretch;min-width:0;width:100%}
  .tile{--tile-w:auto;--tile-h:50px;width:100%;max-width:46px;justify-self:center}
  .tile .number{font-size:18px}
  .tile .suit{font-size:13px}
  .tile.selected{transform:translateY(-5px)}
  .tile.drawn{margin-left:0}
  .tile.missing-tile:after{top:-4px;right:-2px;font-size:9px;padding:1px 2px}
  .action-panel{flex-direction:column;align-items:stretch;gap:6px;padding:9px 0 0}
  .action-panel h2{font-size:13px;margin:0 0 2px}
  .action-panel p{font-size:11px;max-width:none;line-height:1.5}
  .actions{width:100%;justify-content:flex-end;gap:6px}
  .actions button{font-size:13px;padding:8px 13px;min-height:36px}
  .actions .primary{min-width:76px}
  .sidebar{gap:8px;grid-template-columns:1fr 1fr;margin-top:8px}
  .sidebar section{padding:11px}
  .sidebar h2{font-size:13px;margin:0 0 12px}
  .log-panel ol{height:150px}
  .log-panel li{font-size:11px}
  .score-row{font-size:12px;padding:8px 0}
  .score-row b{font-size:16px}
  body footer{display:none}
  dialog{padding:18px;max-height:88dvh}
  .rules-content p{font-size:13px;line-height:1.75}
  .rules-content h3{font-size:15px;margin:18px 0 6px}
  .start-dialog h2{font-size:26px;letter-spacing:5px}
  html.games-fs body{display:block!important;height:100dvh!important;overflow:hidden!important}
  html.games-fs main{height:100dvh!important;overflow-y:auto;padding:0 6px 10px}
  html.games-fs .game{height:100%!important}
}
@media(max-width:720px) and (orientation:landscape){
  .topbar{height:42px}
  .game{height:calc(100dvh - 52px)}
  .felt{min-height:120px;height:clamp(140px,38dvh,240px)}
  .discard-area{max-height:44%;min-height:70px}
  .seat.west,.seat.east{top:46px}
  .table-center{top:42px}
  .hand{grid-template-columns:repeat(14,minmax(0,1fr));gap:4px 2px}
  .tile{--tile-h:40px;max-width:40px}
  .tile .number{font-size:15px}
  .tile .suit{font-size:11px}
  .action-panel{flex-direction:row;align-items:center;gap:10px}
  .action-panel>div:first-child{flex:1;min-width:0}
  .actions{width:auto}
}
@media(max-width:360px){
  .tile{--tile-h:46px;max-width:42px}
  .tile .number{font-size:16px}
  .tile .suit{font-size:12px}
  .felt{min-height:180px}
  body .topbar{padding:0 6px;gap:6px}
  body .brand h1{display:none}
  .brand-seal{width:26px;height:26px;font-size:17px}
  body .topbar nav{gap:2px}
  body .topbar .quiet{font-size:9px;padding:4px 4px;min-height:28px}
  .tool-chip{padding:2px 6px;font-size:9px}
}
@media(max-width:720px) and (max-height:700px){
  .felt{height:clamp(250px,42dvh,320px)}
  .tile{--tile-h:46px}
}
@media(max-width:720px) and (orientation:landscape){
  .felt{height:clamp(170px,46dvh,300px)}
  .table-center{top:64px}
  .seat.west,.seat.east{top:66px}
  .hand{grid-template-columns:repeat(14,minmax(0,1fr));gap:4px 2px}
  .tile{--tile-h:42px;max-width:40px}
  .tile .number{font-size:15px}
  .tile .suit{font-size:11px}
  .action-panel{flex-direction:row;align-items:center;gap:10px;padding:8px 12px calc(8px + env(safe-area-inset-bottom))}
  .action-panel>div:first-child{flex:1;min-width:0}
  .actions{width:auto}
}
@media(max-width:360px){
  .tile{--tile-h:46px;max-width:42px}
  .tile .number{font-size:16px}
  .tile .suit{font-size:12px}
  .topbar .quiet{font-size:10px;padding:5px 5px}
}

.table-center #last-play .tile{--tile-w:39px;--tile-h:55px}.table-center #last-play .number{font-size:22px}.table-center #last-play .suit{font-size:18px}
@media(max-height:800px) and (min-width:1121px){.table-center{top:112px}.center-kicker{display:none}.center-mark{font-size:26px;padding:0 0 0 12px}.table-center p{margin:3px 0}.table-center #last-caption{font-size:11px}.human-zone{min-height:220px}.human-zone .hand-scroll{padding-top:16px;padding-bottom:9px}.human-zone .action-panel{padding-top:8px}}

/* ===== AI8899 增强 2026-10-26（二次）：主操作重设计 + 完整功能工具 ===== */
/* 牌桌顶栏工具条：排序 / 记牌 / 战报 */
.table-tools{display:flex;gap:6px;align-items:center;flex-shrink:0}
.tool-chip{padding:4px 10px;font-size:12px;color:#d9e6dc;background:#ffffff10;border:1px solid #ffffff26;border-radius:999px;white-space:nowrap}
.tool-chip:hover{background:#ffffff1e}
.tool-chip.on{background:var(--gold);color:#1d3029;border-color:var(--gold);font-weight:600}
/* 操作说明行：选中牌 / 听牌提示（单行，可换行） */
.info-line{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-top:6px;font-size:12px;line-height:1.5}
.info-line:empty{display:none}
.sel-chip{padding:2px 9px;border-radius:999px;background:#e3bb6a2e;border:1px solid #e3bb6a70;color:#f2e2b6;font-weight:600}
.sel-chip.dim{background:#ffffff10;border-color:#ffffff22;color:var(--muted);font-weight:400}
.wait-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:6px;background:#0a2a29;border:1px solid #ffffff26;font-size:12px;color:#e8efe4}
.wait-chip i{font-style:normal;font-size:10px;color:var(--gold)}
/* 主操作：打出（实心大按钮 + 选中牌预览 + 未选牌禁用态） */
.actions .discard-btn{min-width:132px;min-height:46px;font-size:17px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:5px;letter-spacing:1px}
.actions .discard-btn:disabled{background:#ffffff10;color:#9fb9b0;opacity:1;border:1px dashed #ffffff33;box-shadow:none}
/* AI 回合：不再留白，显示思考状态 */
.actions .wait-inline{display:inline-flex;align-items:center;gap:7px;padding:9px 14px;font-size:13px;color:#cfe0d6;background:#ffffff0c;border:1px solid #ffffff1c;border-radius:8px}
.actions .wait-inline i{font-style:normal;color:var(--gold);letter-spacing:2px;animation:dot-blink 1.1s infinite}
@keyframes dot-blink{0%,100%{opacity:.3}50%{opacity:1}}
/* 响应阶段（碰/杠/胡/过）按钮 */
.actions .respond-btn{min-height:44px;padding:9px 16px;font-size:15px;font-weight:600}
.actions .respond-btn.gang{background:#2f7d6b;color:#fff}
.actions .respond-btn.pass{background:#ffffff0f;color:#cddcd3}
/* 记牌器浮层 */
.counter-panel{position:fixed;z-index:45;right:16px;bottom:16px;width:min(340px,calc(100vw - 32px));background:#0d2b2df2;border:1px solid #d4b77d55;border-radius:12px;padding:12px 13px 10px;box-shadow:0 18px 50px #000a}
.counter-panel[hidden]{display:none}
.counter-head{display:flex;align-items:center;gap:8px;margin-bottom:9px}
.counter-head b{color:var(--gold);font-size:14px}
.counter-head span{color:var(--muted);font-size:11px;margin-left:auto}
.counter-close{width:22px;height:22px;border-radius:50%;background:#ffffff16;color:#fff;font-size:15px;line-height:1;display:grid;place-items:center;padding:0}
.counter-close:hover{background:#ffffff2a}
.counter-body{display:flex;flex-direction:column;gap:5px}
.counter-row{display:flex;align-items:center;gap:3px}
.counter-suit{width:18px;font-size:12px;font-weight:700;flex-shrink:0}
.counter-suit.s0{color:#e08b84}.counter-suit.s1{color:#7fd0b2}.counter-suit.s2{color:#8fb6ef}
.counter-tile{position:relative;width:23px;height:27px;border-radius:3px;background:#fffdf2;border:1px solid #dedeca;display:grid;place-items:center;font:12px "Songti SC",serif;color:#1e3838;flex-shrink:0}
.counter-tile.s0{color:#af342c}.counter-tile.s1{color:#17735b}.counter-tile.s2{color:#215b9c}
.counter-tile.out{opacity:.3}
.counter-tile i{position:absolute;right:-3px;bottom:-4px;font:9px sans-serif;font-style:normal;background:#0f5a4c;color:#d6ece2;border-radius:3px;padding:0 2px;line-height:1.3}
.counter-note{font-size:10px;color:var(--muted);margin:9px 0 0;line-height:1.5}
/* 战报回放 */
.replay-detail-box{background:#ffffff08;border:1px solid var(--line);border-radius:9px;padding:11px 13px;margin-bottom:12px;min-height:44px}
.replay-detail{margin:0;display:flex;justify-content:space-between;gap:12px;font-size:13px;flex-wrap:wrap}
.replay-detail span{color:var(--muted)}
.replay-detail-empty{margin:0;font-size:13px;color:var(--muted)}
.replay-controls{display:flex;gap:8px;margin-bottom:12px;flex-wrap:wrap}
.replay-list{list-style:none;margin:0;padding:0;max-height:min(46vh,340px);overflow-y:auto;scrollbar-width:thin}
.replay-list li{display:flex;align-items:center;gap:9px;padding:8px 9px;border-bottom:1px solid var(--line);font-size:13px;color:#c2d5c9;cursor:pointer}
.replay-list li:hover{background:#ffffff0d}
.replay-list li.cur{background:#e3bb6a22;color:#f4e9cc}
.replay-no{min-width:22px;color:var(--gold);font-variant-numeric:tabular-nums;font-size:11px}
.replay-text{flex:1;min-width:0}
.replay-wall{color:var(--muted);font-size:11px}
.replay-empty{color:var(--muted)}
/* 分享战报 */
.share-text{width:100%;background:#08211f;color:#d9e6dc;border:1px solid #ffffff2a;border-radius:8px;padding:11px;font:13px/1.6 ui-monospace,Menlo,monospace;resize:vertical}

@media(max-width:720px){
  .table-tools{gap:4px}
  .tool-chip{padding:3px 8px;font-size:10px}
  .info-line{margin-top:4px;font-size:11px;gap:4px}
  .sel-chip{padding:1px 7px;font-size:11px}
  .wait-chip{font-size:11px;padding:1px 6px}
  .actions{justify-content:space-between;gap:6px}
  .actions button{font-size:13px;padding:8px 12px;min-height:38px}
  .actions .discard-btn{min-width:116px;min-height:46px;font-size:15px;flex:1 1 auto;max-width:62%}
  .actions .respond-btn{min-height:44px;font-size:14px;padding:9px 14px}
  .counter-panel{left:8px;right:8px;top:54px;bottom:auto;width:auto}
  .counter-tile{width:calc((100% - 60px)/9);height:26px}
  .replay-list{max-height:40vh}
}


/* ===== AI8899 增强 2026-10-26（三次）：dialog 降级 / 错误可见化 / 阶段指示 / 触摸适配 ===== */
/* 老浏览器无 <dialog> 支持时的自绘模态遮罩 */
.dlg-backdrop{position:fixed;inset:0;background:rgba(3,21,18,.72);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);z-index:110;display:none}
.dlg-backdrop:not([hidden]){display:block}
html.no-dialog dialog.dlg-fallback{position:fixed;inset:0;margin:auto;z-index:120;display:block;max-height:86vh;overflow:auto;-webkit-overflow-scrolling:touch}
html.no-dialog dialog.dlg-fallback::backdrop{background:transparent}
/* 全局错误条：脚本异常时显示，不再静默失败 */
.fatal-bar{position:fixed;left:0;right:0;top:0;z-index:999;background:#7a1f1a;color:#ffe9e4;padding:10px 14px;font-size:13px;line-height:1.5;box-shadow:0 4px 16px #0006}
.fatal-bar[hidden]{display:none}
/* 阶段指示：换三张 → 定缺 → 打牌，让人知道还差几步能出牌 */
.phase-steps{display:flex;gap:6px;align-items:center;margin-top:7px;flex-wrap:wrap}
.phase-steps .step{display:inline-flex;align-items:center;gap:4px;font-size:11px;line-height:1;padding:4px 8px;border-radius:20px;border:1px solid #ffffff1f;color:#9fb9b0;background:#ffffff08}
.phase-steps .step .dot{width:6px;height:6px;border-radius:50%;background:#ffffff33}
.phase-steps .step.done{color:#9fd6bd;border-color:#7fd0a63d;background:#7fd0a61a}
.phase-steps .step.done .dot{background:#7fd0a6}
.phase-steps .step.cur{color:#1d3029;border-color:#e3bb6a;background:#e3bb6a;font-weight:700}
.phase-steps .step.cur .dot{background:#1d3029}
.phase-steps .step .no{font-size:10px;opacity:.75}
/* 移动端触摸：消除 300ms 双击延迟与点击高亮块 */
button,.tile,.tool-chip{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
@media(max-width:720px){
  .phase-steps .step{padding:3px 7px;font-size:10px}
  .fatal-bar{font-size:12px;padding:9px 12px}
}
/* 横屏（375 高）空间寸土寸金：隐藏阶段指示 + 压缩牌桌，保证出牌主按钮不被挤出视口 */
@media(max-width:720px) and (orientation:landscape){
  .phase-steps{display:none}
  .felt{height:clamp(150px,40dvh,300px)}
}
