/* ===== 红中麻将 · 全局样式 =====
   手机竖屏优先；牌面 272x360 (3:4)。 */

:root {
    --felt: #1c3a2a;          /* 桌面绿 */
    --felt-dark: #12271b;
    --panel: #ffffff0f;       /* 半透明面板 */
    --panel-solid: #24422f;
    --line: #ffffff22;
    --text: #f0ead6;          /* 暖白 */
    --text-dim: #c9c2a8;
    --gold: #e8c265;          /* 金 */
    --red: #e5484d;           /* 红中红 */
    --green-ok: #46a758;
    --orange: #f08c2e;
    --radius: 14px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overscroll-behavior: none;
}

body {
    background: radial-gradient(120% 90% at 50% 0%, #26503a 0%, var(--felt) 45%, var(--felt-dark) 100%);
    color: var(--text);
    font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    user-select: none;
}

#app { height: 100dvh; }

/* ---- 应用壳：手机宽度居中 ---- */
.app-shell {
    max-width: 480px;
    height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: var(--safe-t) 0 var(--safe-b);
    overflow: hidden;
}

.page {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 14px 24px;
}

/* ---- 页头 ---- */
.page-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 6px;
    flex: none;
}

.page-header h1 {
    font-size: 19px;
    margin: 0;
    letter-spacing: 1px;
}

.page-header .spacer { flex: 1; }

.back-btn {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: 10px;
    padding: 7px 14px;
    font-size: 15px;
    cursor: pointer;
}

/* ---- 按钮 ---- */
button { font-family: inherit; }

.btn {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 15px;
    cursor: pointer;
    transition: transform .06s ease, filter .12s ease;
}

.btn:active { transform: scale(.97); filter: brightness(1.15); }

.btn:disabled { opacity: .45; pointer-events: none; }

.btn-primary {
    background: linear-gradient(180deg, #e8c265, #c99a3a);
    border-color: #e8c26588;
    color: #35270c;
    font-weight: 600;
}

.btn-danger {
    background: linear-gradient(180deg, #e5484d, #b8323a);
    border-color: #e5484d88;
    color: #fff;
}

.btn-big {
    font-size: 17px;
    padding: 14px 18px;
    min-height: 52px;
}

.btn-huge {
    /* 碰/杠/抢杠胡：加大红字 */
    font-size: 17px;
    font-weight: 700;
    color: #ff6b6e;
    background: linear-gradient(180deg, #3a1c1e, #2c1416);
    border: 1.5px solid #e5484d99;
    border-radius: 14px;
    padding: 14px 10px;
    min-height: 56px;
    flex: 1;
}

/* ---- 面板 / 卡片 ---- */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 12px;
}

.panel h2 {
    font-size: 16px;
    margin: 0 0 10px;
    color: var(--gold);
    font-weight: 600;
}

.panel h3 {
    font-size: 14.5px;
    margin: 10px 0 6px;
    color: var(--text);
    font-weight: 600;
}

.hint { color: var(--text-dim); font-size: 13px; }

/* ---- 牌面 ---- */
.tile {
    display: inline-block;
    vertical-align: bottom;
    aspect-ratio: 272 / 360;
    height: auto;
    image-rendering: auto;
    border-radius: 3px;
    box-shadow: 0 1px 3px #0006;
    background: #fff;
}

.tile-xs { width: 20px; }
.tile-sm { width: 27px; }
.tile-md { width: 34px; }
.tile-lg { width: 42px; }

.tile-pick { cursor: pointer; }

.tile-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: flex-end;
}

/* ---- 主菜单 ---- */
.menu-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 26px;
    gap: 14px;
}

.menu-title {
    text-align: center;
    margin-bottom: 18px;
}

.menu-title img {
    width: 74px;
    box-shadow: 0 4px 18px #0008;
    border-radius: 8px;
}

.menu-title .t {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 6px;
    margin-top: 14px;
    text-shadow: 0 2px 8px #0008;
}

.menu-title .s {
    color: var(--text-dim);
    letter-spacing: 3px;
    font-size: 13px;
    margin-top: 4px;
}

.menu-entry {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff14, #ffffff08);
    color: var(--text);
    border-radius: 18px;
    padding: 20px 20px;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    text-align: left;
    transition: transform .06s ease, filter .12s ease;
}

.menu-entry:active { transform: scale(.98); filter: brightness(1.2); }

.menu-entry .arrow {
    margin-left: auto;
    color: var(--gold);
    font-size: 22px;
}

.menu-entry .sub {
    display: block;
    font-size: 12.5px;
    font-weight: 400;
    color: var(--text-dim);
    letter-spacing: 0;
    margin-top: 3px;
}

.menu-entry.hero {
    background: linear-gradient(180deg, #e8c26522, #c99a3a0d);
    border-color: #e8c26555;
}

/* ---- 页签 ---- */
.tabs {
    display: flex;
    gap: 6px;
    padding: 8px 12px 4px;
    flex: none;
}

.tab {
    flex: 1;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text-dim);
    border-radius: 10px;
    padding: 8px 4px;
    font-size: 14px;
    cursor: pointer;
}

.tab.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #35270c;
    font-weight: 600;
}

/* ---- chip（进章等小标签）---- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: 1px solid var(--line);
    background: #ffffff10;
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 13px;
}

.chip.gold { border-color: #e8c26566; color: var(--gold); }
.chip.red { border-color: #e5484d66; color: #ff8a8d; }

/* ---- 加载中 ---- */
.busy-tip {
    text-align: center;
    color: var(--gold);
    padding: 10px;
    font-size: 14px;
    letter-spacing: 2px;
}

.busy-tip::after {
    content: "…";
    animation: dots 1.2s steps(4) infinite;
}

@keyframes dots {
    0% { content: ""; }
    25% { content: "·"; }
    50% { content: "··"; }
    75% { content: "···"; }
}

/* ---- 加载进度（index.html 初始屏）---- */
.loading-progress { position: absolute; inset: 0; margin: auto; }

.loading-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    color: var(--gold);
    letter-spacing: 3px;
}

#blazor-error-ui {
    background: #3a1012;
    color: #ffd7d8;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 14px;
    position: absolute;
    display: none;
    z-index: 9999;
    font-size: 13px;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 12px; }

/* ---- 通用小工具 ---- */
.row { display: flex; gap: 8px; align-items: center; }
.row-wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.center { text-align: center; }
.dim { color: var(--text-dim); }
.ok { color: #7ed488; }
.bad { color: #ff8a8d; }

/* ---- 模式分段切换 ---- */
.mode-seg {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.mode-seg .seg {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-dim);
    padding: 10px 4px;
    font-size: 14px;
    cursor: pointer;
}

.mode-seg .seg.on {
    background: var(--gold);
    color: #35270c;
    font-weight: 600;
}

/* ---- 点选牌墙 ---- */
.tile-wall {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 8px;
}

.wall-row {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 6px;
}

.wall-row:last-child { margin-bottom: 0; }

.wall-label {
    width: 18px;
    color: var(--text-dim);
    font-size: 13px;
    flex: none;
    text-align: center;
}

.wall-cell {
    position: relative;
    border: 1.5px solid transparent;
    background: transparent;
    padding: 2px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 0;
    flex: none;
}

.wall-cell .tile { opacity: .5; }

.wall-cell.has .tile { opacity: 1; }

.wall-cell.has { border-color: #e8c26566; background: #e8c26514; }

.wall-cell.full { border-color: #e5484d66; background: #e5484d1a; }

.wall-cell.full .tile { filter: grayscale(.6); }

.wall-cell:active { transform: scale(.93); }

.wall-badge {
    position: absolute;
    top: -7px;
    right: -6px;
    background: var(--gold);
    color: #35270c;
    font-size: 11px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    line-height: 17px;
    border-radius: 9px;
    text-align: center;
    box-shadow: 0 1px 3px #0008;
}

.wall-cell.full .wall-badge { background: var(--red); color: #fff; }

.wall-cell.red .tile { opacity: 1; }

.wall-spacer { flex: 1; }

.wall-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dim);
    font-size: 13px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: 9px;
    cursor: pointer;
}

/* ---- 牌局分析结果 ---- */
.shanten-big {
    font-size: 26px;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 2px;
    white-space: nowrap;
    margin-right: 10px;
}

.shape-summary {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
    color: var(--text-dim);
    font-size: 13.5px;
}

.ukeire-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}

.ukeire-item {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #ffffff0a;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 7px 8px;
}

.ukeire-meta {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    line-height: 1.35;
    min-width: 0;
}

.uk-count { font-weight: 600; }

.uk-hint { color: var(--text-dim); font-size: 11.5px; }

.discard-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 9px;
    background: #ffffff08;
}

.discard-card.best {
    border-color: var(--gold);
    background: #e8c26514;
}

.discard-card.best .dc-name { color: var(--gold); }

.dc-name { font-weight: 600; }

.dc-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    font-size: 12.5px;
}

.chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

/* ---- 听牌专项 ---- */
.wait-banner {
    background: #e8c26518;
    border: 1px solid #e8c26566;
    color: var(--gold);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.red-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.chip-btn {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text-dim);
    border-radius: 9px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
}

.chip-btn.on {
    background: var(--gold);
    border-color: var(--gold);
    color: #35270c;
    font-weight: 600;
}

.gold-btn {
    border-color: #e8c26566;
    color: var(--gold);
}

/* ---- 牌型图鉴 ---- */
.family-group {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-top: 10px;
    background: #ffffff08;
}

.family-group summary {
    padding: 11px 13px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14.5px;
    list-style: none;
    display: flex;
    align-items: center;
}

.family-group summary::before {
    content: "▸";
    color: var(--gold);
    margin-right: 8px;
    transition: transform .15s;
    display: inline-block;
}

.family-group[open] summary::before { transform: rotate(90deg); }

.fg-count {
    margin-left: auto;
    color: var(--text-dim);
    font-size: 12.5px;
    font-weight: 400;
}

.family-card {
    border-top: 1px dashed var(--line);
    padding: 11px 13px;
}

.fc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.fc-name { font-weight: 600; font-size: 15px; }

.fc-wait {
    margin-top: 8px;
    color: var(--gold);
    font-size: 13px;
}

/* ---- 舍牌考核 ---- */
.quiz-q {
    font-size: 16.5px;
    font-weight: 700;
    margin-bottom: 4px;
}

.quiz-score {
    margin-top: 8px;
    color: var(--gold);
    font-size: 13.5px;
}

.quiz-hand { gap: 6px; }

.quiz-tile {
    border: 2.5px solid transparent;
    background: transparent;
    padding: 2px;
    border-radius: 8px;
    cursor: pointer;
    line-height: 0;
}

.quiz-tile:active { transform: scale(.94); }

.quiz-tile:disabled { opacity: .55; cursor: default; }

.quiz-tile.best { border-color: var(--green-ok); background: #46a75822; }

.quiz-tile.mine { border-color: var(--orange); background: #f08c2e22; }

.quiz-tile.best.mine { border-color: var(--green-ok); }

.quiz-legend {
    display: flex;
    gap: 14px;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--text-dim);
}

.quiz-legend .lg.best { color: #7ed488; }

.quiz-legend .lg.mine { color: var(--orange); }

.panel.quiz-ok { border-color: #46a75888; background: #46a75814; }

.panel.quiz-bad { border-color: #e5484d88; background: #e5484d14; }

.opt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 7px;
    font-size: 13.5px;
    background: #ffffff08;
}

.opt-row.best {
    border-color: var(--green-ok);
    background: #46a75814;
}

.opt-name { font-weight: 600; min-width: 34px; }

/* ---- 快速入门 ---- */
.guide-sub {
    text-align: center;
    color: var(--gold);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.guide-sec {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    background: #ffffff08;
    overflow: hidden;
}

.guide-sec summary {
    padding: 13px 15px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    list-style: none;
    display: flex;
    align-items: center;
    background: #ffffff0a;
}

.guide-sec summary::before {
    content: "▸";
    color: var(--gold);
    margin-right: 9px;
    transition: transform .15s;
    display: inline-block;
}

.guide-sec[open] summary::before { transform: rotate(90deg); }

.guide-sec > *:not(summary) { padding: 0 15px; }

.guide-sec p, .guide-sec .guide-block, .guide-sec .term, .guide-sec .settle-table, .guide-sec .guide-ex, .guide-sec .tile-row, .guide-sec .guide-cap, .guide-sec .guide-tiles-block { margin: 12px 15px; }

.guide-tiles-block .guide-suit {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    margin: 0 0 6px;
}

.gs-label {
    width: 20px;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 13px;
}

.gs-label.red { color: #ff8a8d; }

.gs-note { color: var(--text-dim); font-size: 12px; margin-left: 8px; }

.guide-tiles-block p { color: var(--text); font-size: 13.5px; line-height: 1.7; }

.guide-block { font-size: 13.5px; line-height: 1.7; color: var(--text); }

.guide-cap { color: var(--text-dim); font-size: 12px; line-height: 1.6; }

.guide-sec .tile-row { gap: 2px; }

.term { font-size: 13.5px; line-height: 1.75; color: var(--text); }

.term b { color: var(--gold); }

.guide-ex {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--text-dim);
}

.guide-ex .red-text { font-weight: 600; }

.guide-hr { border-top: 1px dashed var(--line); margin: 14px 15px; }

.red-text { color: #ff8a8d; }

.mono { font-family: Consolas, Menlo, monospace; color: var(--gold); }

.settle-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }

.st-row {
    display: flex;
    gap: 10px;
    padding: 9px 11px;
    font-size: 13px;
    line-height: 1.6;
    border-bottom: 1px solid #ffffff12;
}

.st-row:last-child { border-bottom: none; }

.st-row.head {
    background: #ffffff0d;
    color: var(--text-dim);
    font-weight: 700;
    font-size: 12.5px;
}

.st-row > b { min-width: 76px; color: var(--gold); flex: none; }

.st-row > span { flex: 1; }

/* ===== 人机实战 ===== */

.tile-hand { width: 30px; }

.battle-page { overflow: hidden; }

.battle-stats { font-size: 11.5px; color: var(--text-dim); text-align: right; line-height: 1.4; max-width: 46%; }

.battle-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 8px 20px;
}

/* ---- 座位面板 ---- */

.seat {
    background: var(--panel);
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: 5px 7px;
    min-width: 0;
}

.seat-turn { border-color: var(--gold); box-shadow: 0 0 8px #e8c26555; }

.seat-reactor {
    border-color: var(--orange);
    box-shadow: 0 0 10px #f08c2e77;
    background: #f08c2e14;
}

.seat-name {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
}

.seat-dir {
    background: var(--panel-solid);
    border-radius: 6px;
    padding: 0 5px;
    font-size: 11px;
    color: var(--gold);
}

.dealer-badge {
    background: linear-gradient(180deg, #e5484d, #b8323a);
    color: #fff;
    border-radius: 6px;
    padding: 0 5px;
    font-size: 10.5px;
}

.seat-chips { margin-left: auto; color: var(--gold); font-size: 11.5px; font-weight: 400; }

.seat-backs, .river-row, .seat-melds { display: flex; gap: 2px; flex-wrap: wrap; }

.seat-backs { margin-bottom: 3px; }

.seat-melds { gap: 8px; margin-bottom: 3px; }

.meld-group { display: flex; gap: 1px; background: #00000024; border-radius: 4px; padding: 1px 2px; }

.seat-river .river-row { margin-bottom: 2px; }

.river-last { outline: 2px solid var(--red); outline-offset: -1px; border-radius: 3px; }

/* 上家（左）/ 下家（右）窄栏：牌河 3 张一行竖向堆叠 */
.battle-mid { display: flex; gap: 6px; margin-top: 6px; align-items: stretch; }

.seat-left, .seat-right { flex: none; width: 104px; }

.battle-center { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; }

/* ---- 牌墙环 ---- */

.wall-ring {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 2px;
}

.wall-edge { display: flex; gap: 2px; justify-content: center; }

.wall-mid { display: flex; gap: 2px; align-items: stretch; flex: 1; padding: 2px 0; }

.wall-left, .wall-right { flex-direction: column; justify-content: center; }

.wall-core {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 6px;
    min-width: 0;
}

.wstack {
    width: 9px;
    height: 13px;
    border-radius: 2px;
    background: linear-gradient(180deg, #2e6a48, #1d4730);
    border: 1px solid #ffffff1a;
    flex: none;
}

.wstack.off { opacity: .16; border-color: transparent; }

.wall-count { font-size: 11.5px; color: var(--text-dim); text-align: center; }

.follow-text { font-size: 11.5px; color: var(--gold); text-align: center; }

/* ---- 反应横幅（闪烁红底） ---- */

.react-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, #e5484d, #b8323a);
    border: 2px solid #ffd9da;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 18px #00000066;
    max-width: 96%;
    animation: banner-flash .9s ease-in-out infinite alternate;
}

@keyframes banner-flash {
    from { box-shadow: 0 4px 18px #00000066; }
    to { box-shadow: 0 0 4px 2px #ff6b6ecc; }
}

.react-banner .banner-tile { flex: none; }

/* ---- 我的区域 ---- */

.my-area {
    margin-top: 8px;
    background: var(--panel);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 7px 9px;
}

.my-area.seat-turn { border-color: var(--gold); }

.my-seat-line {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
}

.my-turn-tag {
    background: #e8c265;
    color: #35270c;
    border-radius: 6px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
}

.my-river { margin-bottom: 4px; }

.my-river .river-row { margin-bottom: 2px; }

.my-melds { margin-bottom: 4px; }

.my-hand {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px 0;
    align-items: flex-end;
}

.tile-btn {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tile-btn:active { transform: translateY(3px); }

.tile-btn:disabled { opacity: .6; pointer-events: none; }

.tile-btn .tile { display: block; }

.tile-btn.last-drawn { margin-left: 12px; }

.tile-btn.last-drawn .tile {
    outline: 2px solid var(--gold);
    outline-offset: -1px;
    border-radius: 3px;
}

.hand-placeholder { display: flex; justify-content: center; padding: 18px 0; }

.btn-huge-start {
    font-size: 18px;
    font-weight: 700;
    padding: 16px 44px;
    border-radius: 16px;
}

.self-act-row, .react-row {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

.react-row { margin-top: 8px; }

.btn-pass { color: var(--text-dim); background: var(--panel); border-color: var(--line); }

.gang-strip { display: flex; align-items: center; gap: 4px; }

.gang-label { font-size: 12px; color: var(--text-dim); flex: none; }

.status-line {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.55;
}

.speed-row { display: flex; align-items: center; gap: 5px; margin-top: 8px; flex-wrap: wrap; }

.speed-label { font-size: 12px; color: var(--text-dim); flex: none; }

.assist-switch {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text-dim);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12.5px;
    flex: none;
}

.assist-switch.on { color: var(--gold); border-color: #e8c26577; }

/* ---- 辅助面板 ---- */

.assist { margin-top: 8px; }

.assist-toggle {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.assist-toggle.has-data .assist-badge {
    margin-left: auto;
    background: #e8c265;
    color: #35270c;
    font-size: 11px;
    font-weight: 700;
    border-radius: 6px;
    padding: 1px 7px;
}

.assist-body {
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.6;
}

.assist-empty { color: var(--text-dim); }

.assist-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 6px; }

.assist-label { font-size: 12px; color: var(--text-dim); flex: none; }

.assist-total { color: var(--gold); font-weight: 600; }

.assist-line.recommend { background: #e8c26512; border-radius: 8px; padding: 6px 8px; }

.recommend-text { min-width: 0; flex: 1; }

.recommend-text .reason { color: var(--text-dim); font-size: 12px; }

.ukeire-grid { display: flex; flex-wrap: wrap; gap: 6px; }

.ukeire-cell { display: flex; align-items: center; gap: 3px; }

.u-remain { font-size: 11.5px; color: var(--text-dim); }

.assist-options { display: flex; flex-direction: column; gap: 5px; }

.opt-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 7px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.opt-row.opt-best { background: #46a7581c; border-color: #46a75855; }

.opt-text { min-width: 0; flex: 1; line-height: 1.45; }

.opt-outcome { font-size: 12.5px; }

.opt-best .opt-outcome { color: #7ed491; font-weight: 600; }

.opt-reason { font-size: 11.5px; color: var(--text-dim); }

.mt8 { margin-top: 8px; }

/* ---- 对局日志 ---- */

.battle-logs { margin-top: 10px; font-size: 12.5px; }

.battle-logs summary { color: var(--text-dim); cursor: pointer; padding: 4px 0; }

.log-list {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 9px;
    margin-top: 5px;
}

.log-line { color: var(--text-dim); line-height: 1.65; font-size: 12px; }

/* ---- 局末结算层 ---- */

.overlay-mask {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #000000b3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.overlay-card {
    width: 100%;
    max-width: 400px;
    max-height: 88dvh;
    overflow-y: auto;
    background: linear-gradient(180deg, #2a4a37, #1a3325);
    border: 1.5px solid #e8c26566;
    border-radius: 18px;
    padding: 18px 16px;
    box-shadow: 0 10px 40px #000000aa;
}

.overlay-card h2 {
    margin: 0 0 6px;
    font-size: 19px;
    text-align: center;
    letter-spacing: 2px;
    color: var(--gold);
}

.round-summary { text-align: center; color: var(--text); font-size: 13.5px; margin: 0 0 12px; }

.codes-title { font-size: 12.5px; color: var(--text-dim); margin-bottom: 5px; text-align: center; }

.codes-row { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin-bottom: 5px; }

.code-tile { border-radius: 6px; padding: 1px; }

.code-hit { outline: 2.5px solid var(--red); outline-offset: 1px; }

.codes-summary { text-align: center; font-size: 12px; color: var(--text-dim); margin: 0 0 12px; }

.result-table { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }

.result-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 9px;
    background: #ffffff0a;
    font-size: 13.5px;
}

.result-row.row-winner { background: #e8c26526; }

.r-name { flex: 1; font-weight: 600; }

.r-me { color: var(--gold); }

.r-delta { min-width: 44px; text-align: right; font-weight: 700; font-size: 15px; }

.r-delta.pos { color: #7ed491; }

.r-delta.neg { color: #ff8a8d; }

.r-chips { color: var(--text-dim); font-size: 12px; }

.overlay-btns { display: flex; gap: 8px; }

.overlay-btns .btn { flex: 1; }

