/* ============================================
   德州扑克训练器 - 深色赌场主题
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #0a0e1a;
    color: #e0e0e0;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

/* 游戏画面锁定滚动 */
body.in-game {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

.hidden { display: none !important; }

/* ============================================
   主菜单
   ============================================ */

#menu-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px 16px;
    background: radial-gradient(ellipse at center, #1a1f3a 0%, #0a0e1a 70%);
    overflow-y: auto;
}

.menu-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f0c040;
    text-shadow: 0 0 20px rgba(240, 192, 64, 0.4);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.menu-subtitle {
    font-size: 1rem;
    color: #8892b0;
    margin-bottom: 3rem;
}

.menu-stage-card {
    background: linear-gradient(135deg, #1a2040 0%, #252d4a 100%);
    border: 1px solid #3a4570;
    border-radius: 12px;
    padding: 1.5rem 3rem;
    margin-bottom: 1rem;
    text-align: center;
    width: 400px;
    max-width: 90vw;
}

.menu-stage-card h3 {
    color: #f0c040;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.menu-stage-card p {
    color: #8892b0;
    font-size: 0.85rem;
}

.btn-primary {
    background: linear-gradient(135deg, #f0c040, #d4a020);
    color: #1a1a2e;
    border: none;
    border-radius: 8px;
    padding: 14px 48px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(240, 192, 64, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.locked-badge {
    display: inline-block;
    background: #555;
    color: #999;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

/* ============================================
   游戏界面
   ============================================ */

#game-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

/* 顶部信息栏 */
#top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: #111628;
    border-bottom: 1px solid #2a3050;
    height: 48px;
    flex-shrink: 0;
}

#stage-name {
    color: #f0c040;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-bar {
    width: 200px;
    height: 6px;
    background: #2a3050;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f0c040, #d4a020);
    border-radius: 3px;
    transition: width 0.3s;
}

#progress-text {
    color: #8892b0;
    font-size: 0.85rem;
    min-width: 50px;
    text-align: center;
}

#score-display {
    color: #2ecc71;
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 80px;
    text-align: right;
}

/* 牌桌区域 */
#table-area {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
}

.table-felt {
    position: relative;
    width: min(75vw, 700px);
    height: min(58vh, 480px);
    background: radial-gradient(ellipse at center, #1a6b3c 0%, #145a30 50%, #0d4020 100%);
    border-radius: 45%;
    border: 6px solid #5a3a1a;
    box-shadow:
        inset 0 0 40px rgba(0,0,0,0.4),
        0 0 30px rgba(0,0,0,0.6),
        0 4px 0 #3a2510;
}

/* 底池和盲注显示 */
.pot-area {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.blind-info {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.45);
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.pot-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}

#pot-display {
    font-size: 1.1rem;
    color: #f0c040;
    font-weight: 700;
}

/* ============================================
   座位系统
   ============================================ */

#seats-container {
    position: absolute;
    inset: 0;
}

.seat {
    position: absolute;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 76px;
    transition: opacity 0.3s;
    z-index: 10;
}

/* 位置标签 */
.seat-pos {
    font-size: 0.6rem;
    color: #f0c040;
    background: rgba(0,0,0,0.6);
    padding: 1px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 2px;
}

/* SVG 头像容器 */
.seat-avatar-wrap {
    width: 42px;
    height: 42px;
    margin: 0 auto 2px;
    position: relative;
}

.seat-avatar-wrap svg {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #444;
}

.hero-seat .seat-avatar-wrap svg {
    border: 2px solid #f0c040;
}

/* 盲注筹码标识 */
.blind-chip {
    position: absolute;
    bottom: -4px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.45rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #fff;
    z-index: 5;
}

.sb-chip {
    background: #3498db;
    color: #fff;
}

.bb-chip {
    background: #e67e22;
    color: #fff;
}

.seat-stack {
    font-size: 0.6rem;
    color: #ccc;
}

.seat-personality {
    font-size: 0.5rem;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    color: #fff;
    white-space: nowrap;
    line-height: 1.2;
    margin-top: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.seat.folded {
    opacity: 0.35;
}

.seat.hero-active .seat-avatar-wrap svg {
    box-shadow: 0 0 12px rgba(240, 192, 64, 0.8);
    animation: heroPulse 1.5s ease-in-out infinite;
}

@keyframes heroPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(240, 192, 64, 0.5); }
    50% { box-shadow: 0 0 20px rgba(240, 192, 64, 0.9); }
}

/* 动作气泡 */
.action-bubble {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    white-space: nowrap;
    animation: bubbleIn 0.3s ease-out;
    z-index: 20;
}

@keyframes bubbleIn {
    from { transform: translateX(-50%) scale(0.5); opacity: 0; }
    to { transform: translateX(-50%) scale(1); opacity: 1; }
}

.fold-action {
    background: #555;
    color: #999;
}

.raise-action {
    background: #e74c3c;
    color: #fff;
}

.call-action {
    background: #2ecc71;
    color: #fff;
}

/* ============================================
   下注日志面板
   ============================================ */

#action-log {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 180px;
    background: rgba(17, 22, 40, 0.92);
    border: 1px solid #2a3050;
    border-radius: 8px;
    z-index: 40;
    max-height: 55vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: max-height 0.3s;
}

#action-log.collapsed {
    max-height: 30px;
}

#action-log.collapsed #log-content {
    display: none;
}

.log-header {
    padding: 6px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #f0c040;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #2a3050;
    flex-shrink: 0;
}

.log-header:hover {
    background: rgba(240, 192, 64, 0.08);
}

#log-content {
    padding: 6px 8px;
    overflow-y: auto;
    flex: 1;
    max-height: 45vh;
}

.log-street-header {
    font-size: 0.6rem;
    color: #f0c040;
    font-weight: 600;
    padding: 2px 0 4px;
    border-bottom: 1px solid #2a3050;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.log-entry {
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 3px;
    margin-bottom: 2px;
    line-height: 1.4;
}

.log-fold {
    color: #777;
}

.log-raise {
    color: #e74c3c;
}

.log-call {
    color: #2ecc71;
}

.log-check {
    color: #95a5a6;
}

.log-empty {
    color: #555;
    font-size: 0.6rem;
    text-align: center;
    padding: 8px 0;
}

/* ============================================
   街道标签栏
   ============================================ */

#street-bar {
    display: flex;
    justify-content: center;
    gap: 2px;
    background: #111628;
    padding: 4px 20px;
    border-top: 1px solid #2a3050;
    flex-shrink: 0;
}

.street-tab {
    padding: 5px 16px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
    transition: all 0.2s;
    min-width: 90px;
}

.street-tab.active {
    background: linear-gradient(135deg, #f0c040, #d4a020);
    color: #1a1a2e;
}

.street-tab.locked {
    color: #444;
    cursor: not-allowed;
}

/* Hero 手牌区域 */
#hero-cards {
    position: absolute;
    bottom: 2%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 30;
}

.poker-card {
    width: 52px;
    height: 72px;
    background: #fff;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    border: 1px solid #ddd;
}

.card-rank {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
}

.card-suit {
    font-size: 1.1rem;
    line-height: 1;
}

/* 底部操作区域 */
#bottom-panel {
    flex-shrink: 0;
    background: #111628;
    border-top: 1px solid #2a3050;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#scenario-desc {
    color: #b0b8d0;
    font-size: 0.85rem;
    text-align: center;
    min-height: 20px;
}

#action-panel {
    display: flex;
    gap: 12px;
    justify-content: center;
}

#action-panel.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.action-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 100px;
    letter-spacing: 1px;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

.btn-fold {
    background: linear-gradient(135deg, #555, #444);
    color: #ccc;
}

.btn-fold:hover {
    box-shadow: 0 4px 12px rgba(100,100,100,0.3);
}

.btn-call {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    color: #fff;
}

.btn-call:hover {
    box-shadow: 0 4px 12px rgba(46,204,113,0.4);
}

.btn-raise {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.btn-raise:hover {
    box-shadow: 0 4px 12px rgba(231,76,60,0.4);
}

/* ============================================
   结果弹层
   ============================================ */

#result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.result-card {
    background: linear-gradient(135deg, #1a2040 0%, #252d4a 100%);
    border-radius: 16px;
    padding: 2rem;
    width: 480px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    text-align: center;
    border: 1px solid #3a4570;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.result-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.result-icon.correct { color: #2ecc71; }
.result-icon.acceptable { color: #f39c12; }
.result-icon.wrong { color: #e74c3c; }
.result-icon.mixed { color: #8892b0; }

.result-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.result-title.correct { color: #2ecc71; }
.result-title.acceptable { color: #f39c12; }
.result-title.wrong { color: #e74c3c; }
.result-title.mixed { color: #8892b0; }

#correct-action {
    font-size: 0.9rem;
    color: #f0c040;
    margin-bottom: 1rem;
    font-weight: 600;
}

#result-feedback {
    font-size: 0.85rem;
    color: #b0b8d0;
    line-height: 1.6;
    text-align: left;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.btn-next {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 36px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(52,152,219,0.4);
}

/* ============================================
   诊断报告
   ============================================ */

#report-screen {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-y: auto;
    padding: 2rem;
    background: radial-gradient(ellipse at top, #1a1f3a 0%, #0a0e1a 70%);
}

#report-content {
    max-width: 600px;
    margin: 0 auto;
}

.report-header {
    text-align: center;
    margin-bottom: 2rem;
}

.report-header h2 {
    color: #f0c040;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.report-grade {
    display: inline-block;
}

.grade-letter {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 0 20px currentColor;
}

.report-summary {
    text-align: center;
    background: linear-gradient(135deg, #1a2040 0%, #252d4a 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #3a4570;
}

.score-big {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.score-pct {
    font-size: 1.1rem;
    color: #b0b8d0;
    margin: 0.3rem 0;
}

.progress-bar-report {
    width: 100%;
    height: 10px;
    background: #2a3050;
    border-radius: 5px;
    overflow: hidden;
    margin: 0.8rem 0;
}

.progress-fill-report {
    height: 100%;
    border-radius: 5px;
    transition: width 1s ease;
}

.mixed-note {
    font-size: 0.75rem;
    color: #8892b0;
}

.grade-comment {
    color: #b0b8d0;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.report-section {
    background: linear-gradient(135deg, #1a2040 0%, #252d4a 100%);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    border: 1px solid #3a4570;
}

.report-section h3 {
    color: #f0c040;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #3a4570;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.85rem;
}

.stat-name {
    color: #b0b8d0;
}

.stat-value {
    color: #fff;
    font-weight: 600;
}

.weaknesses {
    border-color: #e74c3c;
}

.weakness-item {
    color: #e74c3c;
    font-size: 0.85rem;
    padding: 4px 0;
}

/* 题目详情 */
.detail-row {
    display: flex;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 4px;
    align-items: center;
}

.detail-correct { background: rgba(46, 204, 113, 0.1); }
.detail-acceptable { background: rgba(243, 156, 18, 0.1); }
.detail-wrong { background: rgba(231, 76, 60, 0.1); }
.detail-mixed { background: rgba(136, 146, 176, 0.1); }

.detail-num { color: #8892b0; width: 28px; }
.detail-hand { color: #fff; font-weight: 700; width: 40px; }
.detail-pos { color: #f0c040; width: 40px; }
.detail-scenario { color: #b0b8d0; flex: 1; }
.detail-action { color: #8892b0; width: 60px; }
.detail-answer { color: #3498db; width: 72px; }
.detail-score { color: #2ecc71; width: 30px; text-align: right; }

/* 报告底部按钮 */
.report-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 2rem;
    padding-bottom: 2rem;
}

.btn-secondary {
    background: linear-gradient(135deg, #3a4570, #2a3050);
    color: #b0b8d0;
    border: 1px solid #4a5580;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    border-color: #6a75a0;
    color: #fff;
}

/* ============================================
   响应式 — 手机竖屏 (宽度 < 480px)
   ============================================ */

@media (max-width: 480px) {
    /* --- 菜单页 --- */
    #menu-screen {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        justify-content: flex-start;
        padding: 16px 12px 24px;
        overflow-y: auto;
    }

    .menu-title {
        font-size: 1.5rem;
        margin-top: 8px;
        margin-bottom: 2px;
    }

    .menu-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .menu-stage-card {
        width: 100%;
        max-width: 100%;
        padding: 12px 16px;
        margin-bottom: 8px;
    }

    .menu-stage-card h3 {
        font-size: 1.05rem;
        margin-bottom: 3px;
    }

    .menu-stage-card p {
        font-size: 0.78rem;
        margin-bottom: 1px;
    }

    .menu-options {
        margin-top: 0.5rem;
        margin-bottom: 0.3rem;
    }

    .btn-primary {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
        margin-top: 0.5rem;
    }

    .btn-guide, .btn-history {
        font-size: 0.7rem;
        padding: 3px 10px;
        margin-top: 6px;
    }

    /* --- 游戏界面 --- */
    #top-bar {
        padding: 4px 10px;
        height: 40px;
        gap: 4px;
    }

    #stage-name { font-size: 0.75rem; }
    #progress-text { font-size: 0.75rem; min-width: 40px; }
    #score-display { font-size: 0.8rem; min-width: 60px; }
    .progress-bar { width: 80px; }

    .table-felt {
        width: min(92vw, 380px);
        height: min(52vh, 360px);
        border-width: 5px;
        border-radius: 42%;
    }

    #table-area { padding: 2px; }

    /* 座位 */
    .seat { width: 50px; }
    .seat-avatar-wrap { width: 28px; height: 28px; }
    .seat-avatar-wrap svg { width: 28px; height: 28px; }
    .seat-pos { font-size: 0.5rem; padding: 1px 4px; }
    .seat-stack { font-size: 0.5rem; }
    .seat-personality { font-size: 0.4rem; padding: 1px 3px; }
    .blind-chip { width: 14px; height: 14px; font-size: 0.38rem; }

    /* 公共牌 */
    .community-card { width: 36px; height: 50px; }
    .community-card .card-rank { font-size: 0.9rem; }
    .community-card .card-suit { font-size: 0.8rem; }
    #community-cards { gap: 4px; top: 16%; }

    /* Hero手牌 */
    .poker-card { width: 42px; height: 58px; }
    .card-rank { font-size: 1.1rem; }
    .card-suit { font-size: 0.9rem; }
    #hero-cards { gap: 6px; bottom: 2%; }

    /* 底池 */
    .blind-info { font-size: 0.55rem; }
    .pot-label { font-size: 0.6rem; }
    #pot-display { font-size: 0.9rem; }
    .board-texture-badge { font-size: 0.55rem; top: 6%; }
    .pot-odds-tip { font-size: 0.6rem; }

    /* 动作气泡 */
    .action-bubble { font-size: 0.5rem; padding: 1px 5px; }

    /* 下注日志 */
    #action-log {
        width: 120px;
        right: 4px;
        top: 4px;
        max-height: 40vh;
    }

    .log-header { font-size: 0.6rem; padding: 4px 8px; }
    .log-entry { font-size: 0.52rem; }
    #log-content { padding: 4px 6px; max-height: 35vh; }

    /* 街道标签 */
    #street-bar { padding: 3px 8px; gap: 1px; }
    .street-tab {
        padding: 4px 8px;
        font-size: 0.6rem;
        min-width: auto;
        flex: 1;
        text-align: center;
    }

    /* 底部操作面板 */
    #bottom-panel { padding: 8px 10px; gap: 6px; }
    #scenario-desc { font-size: 0.78rem; min-height: 16px; }

    #action-panel { gap: 8px; }
    .action-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        min-width: 80px;
        flex: 1;
    }

    #sizing-panel { gap: 6px; flex-wrap: wrap; }
    #sizing-panel .action-btn {
        padding: 9px 10px;
        font-size: 0.78rem;
        min-width: 70px;
        flex: 1 1 calc(50% - 6px);
    }

    /* 结果弹层 */
    .result-card {
        padding: 1rem;
        max-width: 95vw;
        max-height: 85vh;
    }

    .result-icon { font-size: 2.2rem; }
    .result-title { font-size: 1.1rem; }
    #correct-action { font-size: 0.8rem; }
    #result-feedback { font-size: 0.78rem; padding: 0.8rem; }
    .btn-next { padding: 10px 28px; font-size: 0.9rem; }

    /* 报告页 */
    #report-screen { padding: 1rem 0.8rem; }
    .report-header h2 { font-size: 1.2rem; }
    .grade-letter { font-size: 3rem; }
    .score-big { font-size: 1.6rem; }
    .report-section { padding: 0.8rem; }
    .stat-row { font-size: 0.78rem; }

    .detail-row { font-size: 0.65rem; gap: 4px; padding: 4px 6px; }
    .detail-scenario { display: none; }
    .detail-num { width: 22px; }
    .detail-hand { width: 36px; }
    .detail-pos { width: 34px; }
    .detail-action { width: 50px; }
    .detail-answer { width: 60px; }
    .detail-score { width: 24px; }

    .report-actions { gap: 8px; flex-direction: column; align-items: center; }
    .report-actions .btn-primary,
    .report-actions .btn-secondary { width: 80%; }

    /* HUD面板 */
    #opponent-hud {
        width: 110px;
        padding: 6px 8px;
        left: 4px;
        top: 4px;
        gap: 4px;
    }
    .hud-type-badge { font-size: 0.6rem; padding: 2px 6px; }
    .hud-name { font-size: 0.65rem; }
    .hud-stat { padding: 2px; }
    .hud-stat-label { font-size: 0.45rem; }
    .hud-stat-value { font-size: 0.6rem; }
    .hud-exploit-tip { font-size: 0.5rem; padding: 3px 5px; }

    /* 弹窗通用 */
    .guide-modal { width: 98vw; max-height: 92vh; border-radius: 12px; }
    .guide-header { padding: 12px 14px; }
    .guide-header h2 { font-size: 1rem; }
    .guide-body { padding: 12px; font-size: 0.8rem; }
    .guide-tabs { padding: 6px 10px; gap: 1px; }
    .guide-tab { padding: 5px 10px; font-size: 0.72rem; }
    .guide-table { font-size: 0.68rem; }
    .guide-table th, .guide-table td { padding: 3px 5px; }

    /* 历史弹窗 */
    .history-body { padding: 12px; max-height: 65vh; }
    .history-record { padding: 10px 12px; gap: 10px; }
    .history-grade-letter { font-size: 1.6rem; }
    .history-record-grade { min-width: 40px; }
}

/* ============================================
   响应式 — 中等屏幕 (481px - 768px)
   ============================================ */

@media (min-width: 481px) and (max-width: 768px) {
    #menu-screen {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 20px 16px 30px;
        overflow-y: auto;
    }

    .menu-title { font-size: 1.8rem; }
    .menu-subtitle { margin-bottom: 1.5rem; }
    .menu-stage-card { width: 85vw; padding: 1.2rem 2rem; }
    .btn-primary { width: 85vw; }

    .table-felt { width: min(85vw, 550px); height: min(50vh, 380px); }

    #action-log { width: 160px; }

    .result-card { max-width: 92vw; }

    #sizing-panel .action-btn { padding: 10px 14px; font-size: 0.9rem; }
}

/* ============================================
   响应式 — 手机横屏 (高度 < 500px)
   ============================================ */

@media (max-height: 500px) {
    #top-bar { padding: 4px 12px; height: 36px; }
    #top-bar * { font-size: 0.75rem !important; }
    .table-felt { height: min(50vh, 320px); width: min(65vw, 600px); }
    .seat { width: 56px; }
    .seat-avatar-wrap { width: 32px; height: 32px; }
    .seat-avatar-wrap svg { width: 32px; height: 32px; }
    .seat-pos, .seat-stack { font-size: 0.5rem; }
    .poker-card { width: 40px; height: 56px; }
    .card-rank { font-size: 1rem; }
    .card-suit { font-size: 0.85rem; }
    .action-btn { padding: 8px 20px; font-size: 0.85rem; }
    #bottom-panel { padding: 6px 12px; }
    #scenario-desc { font-size: 0.75rem; }
    #street-bar { padding: 2px 10px; }
    .street-tab { padding: 3px 10px; font-size: 0.6rem; min-width: 70px; }
    #action-log { width: 150px; }
}

/* ============================================
   响应式 — 旧有 600px 断点兼容
   ============================================ */

@media (max-width: 600px) {
    .detail-scenario { display: none; }
}

/* ============================================
   阶段选择菜单
   ============================================ */

.menu-stage-card[data-stage] {
    cursor: pointer;
    transition: all 0.2s;
}

.menu-stage-card[data-stage]:hover {
    border-color: #f0c040;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(240, 192, 64, 0.2);
}

.menu-stage-card.selected {
    border-color: #f0c040;
    background: linear-gradient(135deg, #1a2040 0%, #2a3555 100%);
    box-shadow: 0 0 15px rgba(240, 192, 64, 0.3);
}

/* ============================================
   公共牌（阶段二）
   ============================================ */

#community-cards {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 25;
}

.community-card {
    width: 46px;
    height: 64px;
    background: #fff;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    border: 1px solid #ddd;
    animation: cardDeal 0.3s ease-out;
}

@keyframes cardDeal {
    from { transform: scale(0.3) translateY(-30px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.community-card .card-rank {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.community-card .card-suit {
    font-size: 0.95rem;
    line-height: 1;
}

/* ============================================
   阶段二尺度按钮
   ============================================ */

#sizing-panel {
    display: flex;
    gap: 10px;
    justify-content: center;
}

#sizing-panel.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.btn-check {
    background: linear-gradient(135deg, #555, #444);
    color: #ccc;
}

.btn-check:hover {
    box-shadow: 0 4px 12px rgba(100,100,100,0.3);
}

.btn-bet-33 {
    background: linear-gradient(135deg, #2980b9, #2471a3);
    color: #fff;
}

.btn-bet-33:hover {
    box-shadow: 0 4px 12px rgba(41,128,185,0.4);
}

.btn-bet-67 {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    color: #fff;
}

.btn-bet-67:hover {
    box-shadow: 0 4px 12px rgba(46,204,113,0.4);
}

.btn-bet-100 {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.btn-bet-100:hover {
    box-shadow: 0 4px 12px rgba(231,76,60,0.4);
}

/* 牌面纹理标签 */
.board-texture-badge {
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: rgba(255,255,255,0.6);
    background: rgba(0,0,0,0.5);
    padding: 2px 10px;
    border-radius: 10px;
    z-index: 26;
}

/* 玩家下注筹码显示 */
.seat-bet {
    position: absolute;
    font-size: 0.5rem;
    color: #f0c040;
    background: rgba(0,0,0,0.7);
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
    z-index: 15;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid rgba(240, 192, 64, 0.3);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 手牌强度提示（阶段二结果中显示） */
.hand-strength-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.hand-strength-badge.strong { background: rgba(46,204,113,0.2); color: #2ecc71; }
.hand-strength-badge.medium { background: rgba(241,196,15,0.2); color: #f1c40f; }
.hand-strength-badge.weak { background: rgba(231,76,60,0.2); color: #e74c3c; }
.hand-strength-badge.draw { background: rgba(52,152,219,0.2); color: #3498db; }
.hand-strength-badge.air { background: rgba(149,165,166,0.2); color: #95a5a6; }

/* ============================================
   知识要点按钮（菜单内）
   ============================================ */

.btn-guide {
    background: transparent;
    border: 1px solid #4a5580;
    color: #8892b0;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s;
}

.btn-guide:hover {
    border-color: #f0c040;
    color: #f0c040;
}

/* 顶部栏知识按钮 */
.topbar-btn {
    background: rgba(240, 192, 64, 0.15);
    border: 1px solid #f0c040;
    color: #f0c040;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.topbar-btn:hover {
    background: rgba(240, 192, 64, 0.3);
}

.topbar-btn-exit {
    background: rgba(255, 80, 80, 0.15);
    border-color: #ff6b6b;
    color: #ff6b6b;
    font-size: 0.7rem;
}

.topbar-btn-exit:hover {
    background: rgba(255, 80, 80, 0.35);
}

/* ============================================
   快速模式开关
   ============================================ */

.menu-options {
    margin-top: 0.8rem;
    margin-bottom: 0.5rem;
}

.fast-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8892b0;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
}

.fast-mode-toggle input[type="checkbox"] {
    accent-color: #f0c040;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ============================================
   知识要点弹窗
   ============================================ */

#guide-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(6px);
}

.guide-modal {
    background: linear-gradient(135deg, #141830 0%, #1a2040 100%);
    border: 1px solid #3a4570;
    border-radius: 16px;
    width: 720px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2a3050;
    flex-shrink: 0;
}

.guide-header h2 {
    color: #f0c040;
    font-size: 1.1rem;
    margin: 0;
}

.guide-close-btn {
    background: transparent;
    border: none;
    color: #8892b0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.guide-close-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.guide-tabs {
    display: flex;
    gap: 2px;
    padding: 8px 16px;
    border-bottom: 1px solid #2a3050;
    flex-shrink: 0;
    overflow-x: auto;
}

.guide-tab {
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8892b0;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.guide-tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.guide-tab.active {
    background: linear-gradient(135deg, #f0c040, #d4a020);
    color: #1a1a2e;
}

.guide-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    color: #b0b8d0;
    font-size: 0.85rem;
    line-height: 1.7;
}

.guide-body h3 {
    color: #f0c040;
    font-size: 1rem;
    margin: 0 0 12px;
}

.guide-body h4 {
    color: #e0e0e0;
    font-size: 0.9rem;
    margin: 16px 0 8px;
}

.guide-body p {
    margin: 8px 0;
}

.guide-body ul {
    margin: 6px 0;
    padding-left: 20px;
}

.guide-body li {
    margin: 4px 0;
}

.guide-body strong {
    color: #e0e0e0;
}

/* 知识表格 */
.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 0.8rem;
}

.guide-table th {
    background: rgba(240, 192, 64, 0.1);
    color: #f0c040;
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #3a4570;
}

.guide-table td {
    padding: 5px 10px;
    border-bottom: 1px solid #2a3050;
    color: #b0b8d0;
}

.guide-table tr:hover td {
    background: rgba(255,255,255,0.03);
}

.guide-table.compact td,
.guide-table.compact th {
    padding: 4px 8px;
    font-size: 0.75rem;
    text-align: center;
}

/* 范围显示 */
.range-section {
    margin: 12px 0;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
}

.range-grid-mini {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
}

.range-pair {
    color: #e74c3c;
    font-weight: 600;
}

.range-suited {
    color: #3498db;
}

.range-offsuit {
    color: #95a5a6;
}

/* 提示框 */
.guide-tip {
    background: rgba(240, 192, 64, 0.08);
    border-left: 3px solid #f0c040;
    padding: 10px 14px;
    margin: 12px 0;
    border-radius: 0 6px 6px 0;
}

.guide-section {
    margin: 16px 0;
    padding: 12px;
    background: rgba(0,0,0,0.15);
    border-radius: 6px;
}

/* 600px guide rules now covered by 480px breakpoint */

/* ============================================
   阶段三/四：位置徽章 & 手牌分类徽章
   ============================================ */

.position-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 4px;
    margin-right: 6px;
}

.position-badge.ip {
    background: rgba(46,204,113,0.2);
    color: #2ecc71;
    border: 1px solid rgba(46,204,113,0.3);
}

.position-badge.oop {
    background: rgba(231,76,60,0.2);
    color: #e74c3c;
    border: 1px solid rgba(231,76,60,0.3);
}

.hand-category-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 4px;
}

.hand-category-badge.nuts { background: rgba(155,89,182,0.2); color: #9b59b6; }
.hand-category-badge.strong_value { background: rgba(46,204,113,0.2); color: #2ecc71; }
.hand-category-badge.thin_value { background: rgba(241,196,15,0.2); color: #f1c40f; }
.hand-category-badge.bluff_catcher { background: rgba(52,152,219,0.2); color: #3498db; }
.hand-category-badge.bluff_candidate { background: rgba(230,126,34,0.2); color: #e67e22; }
.hand-category-badge.air { background: rgba(149,165,166,0.2); color: #95a5a6; }

/* 阶段四手牌分级徽章 */
.hand-category-badge.premium { background: rgba(155,89,182,0.2); color: #9b59b6; }
.hand-category-badge.strong { background: rgba(46,204,113,0.2); color: #2ecc71; }
.hand-category-badge.medium { background: rgba(241,196,15,0.2); color: #f1c40f; }
.hand-category-badge.weak { background: rgba(149,165,166,0.2); color: #95a5a6; }

/* ============================================
   阶段四：对手HUD面板
   ============================================ */

#opponent-hud {
    position: absolute;
    left: 8px;
    top: 8px;
    width: 180px;
    background: rgba(17, 22, 40, 0.95);
    border: 1px solid #3a4570;
    border-radius: 10px;
    z-index: 40;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hud-type-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    text-align: center;
    color: #fff;
    letter-spacing: 1px;
}

.hud-type-badge.type-TAG { background: #3498db; }
.hud-type-badge.type-LAG { background: #e67e22; }
.hud-type-badge.type-Rock { background: #7f8c8d; }
.hud-type-badge.type-Fish { background: #27ae60; }
.hud-type-badge.type-Maniac { background: #e74c3c; }

.hud-name {
    font-size: 0.8rem;
    color: #e0e0e0;
    text-align: center;
    font-weight: 600;
}

.hud-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.hud-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.25);
    border-radius: 4px;
    padding: 3px 4px;
}

.hud-stat-label {
    font-size: 0.55rem;
    color: #8892b0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hud-stat-value {
    font-size: 0.75rem;
    color: #f0c040;
    font-weight: 700;
}

.hud-exploit-tip {
    font-size: 0.65rem;
    color: #b0b8d0;
    background: rgba(240, 192, 64, 0.08);
    border-left: 2px solid #f0c040;
    padding: 4px 8px;
    border-radius: 0 4px 4px 0;
    line-height: 1.4;
}

/* 对手类型座位高亮环 */
.seat.opponent-highlight .seat-avatar-wrap svg {
    border-color: var(--opponent-color, #e74c3c);
    box-shadow: 0 0 10px var(--opponent-color, #e74c3c);
}

/* 底池赔率提示 */
.pot-odds-tip {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #f0c040;
    background: rgba(0,0,0,0.7);
    padding: 3px 12px;
    border-radius: 10px;
    z-index: 26;
    white-space: nowrap;
}

/* ============================================
   响应式扩展（阶段三/四）
   ============================================ */

@media (max-height: 500px) {
    #opponent-hud { width: 140px; padding: 6px 8px; }
    .hud-type-badge { font-size: 0.65rem; }
    .hud-name { font-size: 0.7rem; }
    .hud-stat-value { font-size: 0.65rem; }
    .hud-exploit-tip { font-size: 0.55rem; }
}

/* 600px hud rules now covered by 480px breakpoint */

/* ============================================
   历史记录弹窗
   ============================================ */

#history-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(6px);
}

.btn-history {
    background: transparent;
    border: 1px solid #4a5580;
    color: #8892b0;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 8px;
    margin-left: 6px;
    transition: all 0.2s;
}

.btn-history:hover {
    border-color: #3498db;
    color: #3498db;
}

.history-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: 60vh;
}

.history-empty {
    text-align: center;
    color: #8892b0;
    font-size: 0.9rem;
    padding: 3rem 1rem;
    line-height: 1.8;
}

.history-record {
    background: linear-gradient(135deg, #1a2040 0%, #252d4a 100%);
    border: 1px solid #3a4570;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: border-color 0.2s;
}

.history-record:hover {
    border-color: #5a6590;
}

.history-record-grade {
    text-align: center;
    min-width: 50px;
}

.history-grade-letter {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 0 10px currentColor;
}

.history-grade-pct {
    font-size: 0.75rem;
    color: #b0b8d0;
    margin-top: 2px;
}

.history-record-info {
    flex: 1;
}

.history-record-date {
    font-size: 0.7rem;
    color: #8892b0;
    margin-bottom: 4px;
}

.history-record-score {
    font-size: 0.9rem;
    color: #e0e0e0;
    font-weight: 600;
    margin-bottom: 4px;
}

.history-record-comment {
    font-size: 0.8rem;
    color: #b0b8d0;
    margin-bottom: 6px;
}

.history-record-weaknesses {
    font-size: 0.7rem;
    color: #e74c3c;
    line-height: 1.5;
}

.history-footer {
    padding: 12px 20px;
    border-top: 1px solid #2a3050;
    text-align: center;
    flex-shrink: 0;
}

.btn-clear-history {
    background: transparent;
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #e74c3c;
    font-size: 0.75rem;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-history:hover {
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
}
