/* ===== 硬币样式 ===== */
.coin-wrapper {
    perspective: 800px;
    width: 180px;
    height: 180px;
    margin: 0 auto;
    cursor: pointer;
    user-select: none;
}
.coin {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}
.coin.flipping {
    transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-sizing: border-box;
}
.coin-front {
    background: radial-gradient(ellipse at 30% 30%, #fce181, #e6b800 60%, #b8860b);
    transform: rotateY(0deg);
}
.coin-front::after {
    content: "正";
    font-size: 56px;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.coin-back {
    background: radial-gradient(ellipse at 30% 30%, #f0f0f0, #c0c0c0 60%, #8a8a8a);
    transform: rotateY(180deg);
}
.coin-back::after {
    content: "反";
    font-size: 56px;
    color: #333;
    text-shadow: 0 2px 12px rgba(255, 255, 255, 0.3);
}
.coin::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), transparent 40%, transparent 60%, rgba(0, 0, 0, 0.2));
    pointer-events: none;
    z-index: 2;
}
/* ===== 结果标签 ===== */
.result-badge {
    font-size: 1.1rem;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
}
.result-badge.heads {
    background: #f9d423;
    color: #7a5a00;
}
.result-badge.tails {
    background: #d0d0d0;
    color: #444;
}
.result-badge.waiting {
    background: #e9ecef;
    color: #6c757d;
}
/* ===== 统计卡片 ===== */
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.2rem 0.8rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    text-align: center;
    height: 100%;
    transition: transform 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
}
.stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1a1a2e;
}
.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.2rem;
}
.stat-number.heads-color {
    color: #e6b800;
}
.stat-number.tails-color {
    color: #8a8a8a;
}
/* ===== 概率条 ===== */
.probability-bar {
    height: 8px;
    border-radius: 10px;
    background: #e9ecef;
    overflow: hidden;
    margin-top: 0.5rem;
}
.probability-bar .bar-heads {
    height: 100%;
    background: linear-gradient(90deg, #f9d423, #e6b800);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 50%;
}
/* ===== 历史记录圆点 ===== */
.history-dot {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    line-height: 28px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    margin: 3px;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.history-dot.heads {
    background: linear-gradient(135deg, #f9d423, #e6b800);
}
.history-dot.tails {
    background: linear-gradient(135deg, #d0d0d0, #a0a0a0);
    color: #444;
}
.history-dot.empty {
    background: #f1f3f5;
    color: #ced4da;
    border: 2px dashed #dee2e6;
}
/* ===== 按钮 ===== */
.btn-toss {
    background: linear-gradient(135deg, #f9d423, #e6b800);
    border: none;
    color: #3d2e00;
    font-weight: 700;
    padding: 0.7rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    transition: all 0.3s;
}
.btn-toss:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(230, 184, 0, 0.4);
    color: #3d2e00;
}
.btn-toss:active {
    transform: scale(0.96);
}
.btn-toss:disabled {
    opacity: 0.6;
    transform: none !important;
    box-shadow: none !important;
    cursor: not-allowed;
}
.btn-reset {
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    color: #6c757d;
    border-color: #dee2e6;
}
.btn-reset:hover {
    background: #f8f9fa;
    color: #495057;
}
.key-hint {
    font-size: 0.8rem;
    color: #adb5bd;
    background: #f8f9fa;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: inline-block;
}
/* ===== 响应式 ===== */
@media (max-width: 576px) {
    .coin-wrapper {
        width: 140px;
        height: 140px;
    }
    .coin-face {
        font-size: 40px;
    }
    .coin-front::after,
    .coin-back::after {
        font-size: 42px;
    }
    .stat-number {
        font-size: 1.5rem;
    }
    .result-badge {
        font-size: 0.95rem;
        padding: 0.35rem 1rem;
    }
}
/* ===== 动画 ===== */
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(220, 180, 50, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(220, 180, 50, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 180, 50, 0); }
}
.btn-toss:not(:disabled):active {
    animation: pulse-ring 0.6s ease-out;
}
@keyframes countUp {
    0% { opacity: 0.3; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}
.stat-number.updated {
    animation: countUp 0.3s ease-out;
}
@keyframes resultFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.result-flash {
    animation: resultFlash 0.4s ease 2;
}
