/* 硬币游戏容器 */
.coin-game {
    text-align: center;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* 硬币容器 */
.coin-container {
    width: 200px;
    height: 200px;
    background: rgba(var(--surface-rgb), 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin: 20px auto;
    perspective: 1000px;
}

/* 硬币样式 */
.coin {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.5s ease-out;
}

.coin.flipping {
    animation: flip 1.5s ease-out forwards;
}

/* 硬币面 */
.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border: 8px solid #DAA520;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(0, 0, 0, 0.1);
}

.coin-face::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #DAA520;
    border-radius: 50%;
    opacity: 0.3;
    transform: rotate(5deg);
}

.coin-front { transform: rotateY(0deg); }
.coin-back { transform: rotateY(180deg); }

/* 硬币动画 */
@keyframes flip {
    0% { transform: rotateY(0) rotateZ(0); }
    100% { transform: rotateY(720deg) rotateZ(360deg); }
}

/* 结果显示 */
.coin-result {
    font-family: 'Patrick Hand', cursive;
    font-size: 28px;
    min-height: 40px;
    color: var(--primary-color);
    margin: 20px 0;
    padding: 10px;
    position: relative;
}

.coin-result::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 100px;
    height: 2px;
    background: var(--text-color);
    transform: translateX(-50%) rotate(-1deg);
    opacity: 0.3;
}

/* 统计信息 */
.coin-stats {
    background: rgba(var(--surface-rgb), 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-top: 30px;
}

.stats-title {
    font-family: 'Patrick Hand', cursive;
    color: var(--text-color);
    font-size: 24px;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.stats-title::after {
    content: '';
    position: absolute;
    left: -10px;
    right: -10px;
    bottom: -5px;
    height: 2px;
    background: var(--primary-color);
    transform: rotate(-1deg);
    opacity: 0.5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 10px;
}

.stat-item {
    background-color: var(--background-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transform: rotate(-1deg);
    z-index: 0;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    z-index: 1;
}

.stat-count {
    font-family: 'Patrick Hand', cursive;
    font-size: 24px;
    color: var(--primary-color);
    z-index: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-title {
        font-size: 2em;
    }

    .coin-container {
        width: 150px;
        height: 150px;
        padding: 20px;
    }

    .coin-face {
        font-size: 3em;
        border-width: 6px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item {
        padding: 10px;
    }
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    .coin {
        transition: none;
    }

    .coin.flipping {
        animation: none;
    }
}

/* 导航栏样式 */
.top-nav {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 1.5em;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.nav-brand:hover {
    transform: scale(1.05);
}

.brand-icon {
    width: 28px;
    height: 28px;
    margin-right: 10px;
    color: #4CAF50;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #666;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(76, 175, 80, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.nav-link:hover::before {
    transform: translateY(0);
}

.nav-link:hover {
    color: #4CAF50;
}

.nav-link.active {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.nav-link.active .nav-icon {
    color: #4CAF50;
}

.nav-icon {
    width: 20px;
    height: 20px;
    color: #666;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.nav-link:hover .nav-icon {
    color: #4CAF50;
}

.nav-text {
    position: relative;
    z-index: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 0.9em;
    }
}