/**
 * Y.Mine · Poker Egg (表层 / Surface UI)
 * 德州扑克彩蛋 · Modal窗口 + 牌桌 + 映射仪表
 * 风格：继承主站暗紫基调，极简扑克风（黑红牌色，霓虹凯利指示器）
 */

/* ===== 入口触发按钮（首页浮动） ===== */
.poker-egg-trigger {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(167,139,250,0.25), rgba(239,68,68,0.15));
    border: 1.5px solid rgba(167,139,250,0.4);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(167,139,250,0.25);
    transition: all .3s;
    animation: pokerPulse 3s ease-in-out infinite;
}
.poker-egg-trigger:hover {
    transform: scale(1.1) rotate(-8deg);
    box-shadow: 0 6px 32px rgba(239,68,68,0.4);
    border-color: rgba(239,68,68,0.6);
}
.poker-egg-trigger .egg-hint {
    position: absolute;
    right: 70px;
    background: rgba(20,16,40,0.95);
    border: 1px solid rgba(167,139,250,0.3);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    white-space: nowrap;
    color: rgba(255,255,255,0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.poker-egg-trigger:hover .egg-hint { opacity: 1; }

@keyframes pokerPulse {
    0%, 100% { box-shadow: 0 4px 24px rgba(167,139,250,0.25); }
    50%      { box-shadow: 0 4px 32px rgba(239,68,68,0.35); }
}

/* ===== Modal遮罩 + 窗口 ===== */
.poker-modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .25s;
}
.poker-modal-mask.open {
    display: flex;
    opacity: 1;
}
.poker-modal {
    width: min(880px, 95vw);
    max-height: 92vh;
    overflow-y: auto;
    background: linear-gradient(160deg, #0f0c24 0%, #1a1333 50%, #0d0a1e 100%);
    border: 1px solid rgba(167,139,250,0.25);
    border-radius: 20px;
    box-shadow: 0 20px 80px rgba(167,139,250,0.2), 0 0 0 1px rgba(255,255,255,0.04) inset;
    padding: 0;
    position: relative;
    transform: scale(0.9);
    transition: transform .3s cubic-bezier(.2,.9,.3,1.2);
}
.poker-modal-mask.open .poker-modal { transform: scale(1); }

.poker-modal-header {
    padding: 20px 28px 16px;
    border-bottom: 1px solid rgba(167,139,250,0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.poker-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}
.poker-modal-title .sub {
    font-size: 11px;
    font-weight: 400;
    color: rgba(255,255,255,0.4);
    margin-left: 10px;
    letter-spacing: 0.3px;
}
.poker-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 18px;
    cursor: pointer;
    transition: all .2s;
}
.poker-close:hover {
    background: rgba(239,68,68,0.2);
    border-color: rgba(239,68,68,0.5);
    color: #fff;
}

.poker-modal-body { padding: 22px 28px 26px; }

/* ===== 牌桌 ===== */
.poker-table {
    background: radial-gradient(ellipse at center, #0f4c3a 0%, #0a3328 60%, #051e18 100%);
    border: 6px solid #5c3a1e;
    border-radius: 120px;
    padding: 28px 24px 22px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), inset 0 0 40px rgba(0,0,0,0.3);
    position: relative;
    margin-bottom: 18px;
}
.poker-table::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px dashed rgba(255,255,255,0.08);
    border-radius: 110px;
    pointer-events: none;
}

.poker-board-area {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: 96px;
    margin-bottom: 18px;
    align-items: center;
}

.poker-hole-area {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    min-height: 88px;
    align-items: center;
}

.poker-pot {
    text-align: center;
    color: rgba(255,215,0,0.9);
    font-size: 13px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.poker-pot .amt {
    font-size: 18px;
    font-weight: 700;
    color: #ffd700;
    margin-left: 6px;
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

/* ===== 卡牌 ===== */
.poker-card {
    width: 62px;
    height: 86px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 6px 7px;
    font-weight: 700;
    position: relative;
    transition: transform .2s;
    user-select: none;
}
.poker-card:hover { transform: translateY(-4px); }
.poker-card.back {
    background: linear-gradient(135deg, #6b21a8 0%, #4c1d95 50%, #3b0764 100%);
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.06) 0 6px, transparent 6px 12px);
    border: 2px solid rgba(167,139,250,0.4);
}
.poker-card.slot {
    background: rgba(255,255,255,0.03);
    border: 2px dashed rgba(255,255,255,0.15);
    box-shadow: none;
    color: rgba(255,255,255,0.2);
    font-size: 22px;
    align-items: center;
    justify-content: center;
    font-weight: 400;
}
.poker-card .corner-tl { font-size: 14px; line-height: 1; }
.poker-card .corner-br { font-size: 14px; line-height: 1; align-self: flex-end; transform: rotate(180deg); }
.poker-card .center-suit { font-size: 26px; text-align: center; }
.poker-card.red { color: #dc2626; }
.poker-card.black { color: #1a1a1a; }
.poker-card.dealing { animation: cardDeal .4s ease-out; }
@keyframes cardDeal {
    0%   { transform: translateY(-40px) rotate(-15deg); opacity: 0; }
    100% { transform: translateY(0) rotate(0); opacity: 1; }
}

/* ===== 玩家信息条 ===== */
.poker-player-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0,0,0,0.35);
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 12px;
}
.poker-player-bar .me {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 600;
}
.poker-player-bar .avatar-dot {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.poker-player-bar .chips {
    color: #ffd700;
    font-weight: 700;
    font-size: 14px;
}
.poker-stage-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: rgba(167,139,250,0.15);
    color: #c4b5fd;
    border: 1px solid rgba(167,139,250,0.3);
    text-transform: uppercase;
}
.poker-stage-tag.state-meltdown { background: rgba(239,68,68,0.2); color: #fca5a5; border-color: rgba(239,68,68,0.5); animation: meltdownPulse .6s infinite; }
.poker-stage-tag.state-black_swan { background: rgba(249,115,22,0.2); color: #fdba74; border-color: rgba(249,115,22,0.5); }
.poker-stage-tag.state-extreme { background: rgba(234,179,8,0.2); color: #fde047; border-color: rgba(234,179,8,0.5); }
.poker-stage-tag.state-tension { background: rgba(59,130,246,0.2); color: #93c5fd; border-color: rgba(59,130,246,0.5); }
@keyframes meltdownPulse {
    0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,0.6);}
    50%{box-shadow:0 0 0 8px rgba(239,68,68,0);}
}

/* ===== 凯利仪表 ===== */
.poker-meters {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.poker-meter {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 10px 12px;
}
.poker-meter .label {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.poker-meter .value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.poker-meter .value.win { color: #22c55e; }
.poker-meter .value.lose { color: #ef4444; }
.poker-meter .value.kelly { color: #a78bfa; }
.poker-meter .sub {
    font-size: 10px;
    color: rgba(255,255,255,0.35);
    margin-top: 2px;
}
.poker-meter.kelly-rec {
    background: linear-gradient(135deg, rgba(167,139,250,0.15), rgba(167,139,250,0.04));
    border-color: rgba(167,139,250,0.3);
}
.poker-meter.gt-meter {
    background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(251,191,36,0.03));
    border-color: rgba(251,191,36,0.25);
}
.poker-meter.gt-meter .value { color: #fbbf24; }
.poker-meter.dcf-warn {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.4);
}
.poker-meter.dcf-warn .value { color: #fca5a5; }

/* 凯利条 */
.kelly-bar {
    margin-top: 6px;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.kelly-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #a78bfa, #ef4444);
    border-radius: 3px;
    transition: width .4s;
}
.kelly-bar-marker {
    position: absolute;
    top: -2px;
    width: 2px;
    height: 10px;
    background: #fff;
    box-shadow: 0 0 6px rgba(255,255,255,0.6);
}

/* ===== 操作按钮区 ===== */
.poker-actions {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.poker-btn {
    padding: 12px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    letter-spacing: 0.3px;
}
.poker-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}
.poker-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.poker-btn.fold { color: #fca5a5; border-color: rgba(239,68,68,0.3); }
.poker-btn.fold:hover:not(:disabled) { background: rgba(239,68,68,0.15); }
.poker-btn.call { color: #93c5fd; border-color: rgba(59,130,246,0.3); }
.poker-btn.call:hover:not(:disabled) { background: rgba(59,130,246,0.15); }
.poker-btn.raise { color: #c4b5fd; border-color: rgba(167,139,250,0.4); }
.poker-btn.raise:hover:not(:disabled) { background: rgba(167,139,250,0.2); }
.poker-btn.allin {
    grid-column: span 1;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    border-color: #ef4444;
    color: #fff;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: allinGlow 2s ease-in-out infinite;
}
.poker-btn.allin:disabled { animation: none; background: rgba(239,68,68,0.2); }
.poker-btn.allin:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 0 24px rgba(239,68,68,0.6);
}
.poker-btn.next-street {
    color: #86efac;
    border-color: rgba(34,197,94,0.4);
    background: rgba(34,197,94,0.08);
}
.poker-btn.next-street:hover:not(:disabled) { background: rgba(34,197,94,0.2); }
@keyframes allinGlow {
    0%,100% { box-shadow: 0 0 12px rgba(239,68,68,0.4); }
    50% { box-shadow: 0 0 24px rgba(239,68,68,0.8); }
}

.poker-deal-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.poker-btn.new-hand {
    flex: 1;
    background: linear-gradient(135deg, rgba(167,139,250,0.2), rgba(167,139,250,0.08));
    border-color: rgba(167,139,250,0.4);
    color: #c4b5fd;
}

/* ===== 表理映射面板（核心"里"可视化） ===== */
.poker-bridge-panel {
    background: rgba(167,139,250,0.04);
    border: 1px solid rgba(167,139,250,0.15);
    border-radius: 12px;
    padding: 14px 16px;
}
.poker-bridge-title {
    font-size: 11px;
    color: #a78bfa;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.poker-bridge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.bridge-item {
    background: rgba(0,0,0,0.25);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 11px;
}
.bridge-item .b-label {
    color: rgba(255,255,255,0.4);
    margin-bottom: 3px;
    letter-spacing: 0.3px;
}
.bridge-item .b-value {
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.bridge-item .b-value.good { color: #86efac; }
.bridge-item .b-value.warn { color: #fbbf24; }
.bridge-item .b-value.bad  { color: #fca5a5; }

.poker-dcf-alert {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 11px;
    display: none;
}
.poker-dcf-alert.show { display: block; animation: shake .4s; }
@keyframes shake {
    0%,100%{transform:translateX(0);}
    25%{transform:translateX(-4px);}
    75%{transform:translateX(4px);}
}

.poker-log {
    margin-top: 10px;
    max-height: 90px;
    overflow-y: auto;
    font-family: ui-monospace, monospace;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    padding: 8px 10px;
    line-height: 1.6;
}
.poker-log .win { color: #86efac; }
.poker-log .lose { color: #fca5a5; }
.poker-log .sys { color: #a78bfa; }

/* ===== 结算弹层 ===== */
.poker-settle-banner {
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 12px;
    font-weight: 700;
    display: none;
}
.poker-settle-banner.win {
    display: block;
    background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(34,197,94,0.05));
    border: 1px solid rgba(34,197,94,0.4);
    color: #86efac;
}
.poker-settle-banner.lose {
    display: block;
    background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(239,68,68,0.05));
    border: 1px solid rgba(239,68,68,0.4);
    color: #fca5a5;
}
.poker-settle-banner .big { font-size: 28px; display: block; margin-bottom: 4px; }

/* ===== 响应式 ===== */
@media (max-width: 720px) {
    .poker-meters { grid-template-columns: repeat(2, 1fr); }
    .poker-bridge-grid { grid-template-columns: repeat(2, 1fr); }
    .poker-actions { grid-template-columns: repeat(3, 1fr); }
    .poker-btn.allin { grid-column: span 3; }
    .poker-card { width: 48px; height: 68px; padding: 4px 5px; }
    .poker-card .center-suit { font-size: 20px; }
    .poker-card .corner-tl, .poker-card .corner-br { font-size: 11px; }
    .poker-table { padding: 18px 12px 14px; border-radius: 60px; }
    .poker-modal-body { padding: 16px; }
    .poker-modal-header { padding: 16px 18px 12px; }
}
