* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #fff;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 等待界面 */
.waiting-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.waiting-screen h1 {
    font-size: 3.5em;
    margin-bottom: 50px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.waiting-content {
    width: 100%;
    max-width: 800px;
}

.player-count-large {
    margin-bottom: 60px;
}

.count-number {
    font-size: 6em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255,215,0,0.5);
    margin-bottom: 10px;
}

.count-label {
    font-size: 2em;
    color: rgba(255,255,255,0.9);
}

.qr-section-large {
    margin-bottom: 50px;
}

.qr-section-large h3 {
    font-size: 2em;
    margin-bottom: 30px;
    color: rgba(255,255,255,0.95);
}

.qr-code-large {
    display: inline-block;
    padding: 30px;
    background: white;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.qr-code-large img,
.qr-code-large canvas {
    width: 400px !important;
    height: 400px !important;
    max-width: 90vw;
    max-height: 90vw;
}

.qr-tip {
    font-size: 1.3em;
    color: rgba(255,255,255,0.9);
    margin-top: 20px;
}

.start-control {
    margin-top: 40px;
}

.btn-start-large {
    padding: 20px 60px;
    font-size: 1.8em;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    box-shadow: 0 6px 12px rgba(76,175,80,0.4);
}

.btn-start-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(76,175,80,0.5);
    background: #45a049;
}

.btn-start-large:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 游戏界面 */
.game-screen {
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.3);
}

.btn-start {
    background: #4CAF50;
    color: white;
}

.btn-start:hover {
    background: #45a049;
}

.btn-reset {
    background: #f44336;
    color: white;
}

.btn-reset:hover {
    background: #da190b;
}

.game-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.timer-container {
    text-align: center;
}

.timer-label {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.timer {
    font-size: 4em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.timer-unit {
    font-size: 1.2em;
    margin-top: 5px;
}

.player-count {
    font-size: 1.5em;
    font-weight: bold;
}

.rankings-container {
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.rankings-container h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2em;
}

.rankings {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

/* 平滑滚动 */
.rankings {
    scroll-behavior: smooth;
}

/* 排名列表滚动动画 */
@keyframes rankSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 排名变化时的闪烁效果 */
.rank-item.first {
    animation: firstPlaceGlow 2s ease-in-out infinite;
}

@keyframes firstPlaceGlow {
    0%, 100% {
        box-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 0 0 rgba(255,215,0,0);
    }
    50% {
        box-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 0 20px rgba(255,215,0,0.6);
    }
}

.rank-item {
    display: flex;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    border-radius: 15px;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.rank-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(180deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s;
}

.rank-item:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.3), rgba(255,255,255,0.2));
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.rank-item:hover::before {
    opacity: 1;
}

.rank-item.first {
    background: linear-gradient(135deg, rgba(255,215,0,0.3), rgba(255,215,0,0.15));
    border: 2px solid rgba(255,215,0,0.5);
}

.rank-item.second {
    background: linear-gradient(135deg, rgba(192,192,192,0.3), rgba(192,192,192,0.15));
    border: 2px solid rgba(192,192,192,0.5);
}

.rank-item.third {
    background: linear-gradient(135deg, rgba(205,127,50,0.3), rgba(205,127,50,0.15));
    border: 2px solid rgba(205,127,50,0.5);
}

.rank-number {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    min-width: 70px;
    text-align: center;
    position: relative;
}

.rank-icon {
    font-size: 2em;
    line-height: 1;
    margin-bottom: 5px;
}

.rank-text {
    font-size: 1.5em;
    font-weight: bold;
}

.rank-number.first .rank-text {
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.rank-number.second .rank-text {
    color: #C0C0C0;
    text-shadow: 0 0 10px rgba(192,192,192,0.5);
}

.rank-number.third .rank-text {
    color: #CD7F32;
    text-shadow: 0 0 10px rgba(205,127,50,0.5);
}

.player-avatar {
    width: 64px;
    height: 64px;
    min-width: 64px;
    margin: 0 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.rank-item:hover .player-avatar {
    transform: scale(1.1);
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.player-name {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 8px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.player-count-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1em;
    color: rgba(255,255,255,0.9);
}

.count-icon {
    font-size: 1.2em;
}

.count-number {
    font-size: 1.3em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 0 8px rgba(255,215,0,0.5);
}

.count-unit {
    color: rgba(255,255,255,0.7);
}

.no-players {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: rgba(255,255,255,0.7);
}

.qr-section {
    text-align: center;
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.qr-section h3 {
    margin-bottom: 20px;
    font-size: 1.5em;
}

.qr-code {
    display: inline-block;
    padding: 20px;
    background: white;
    border-radius: 10px;
    margin-bottom: 15px;
}

.qr-placeholder {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.qr-tip {
    font-size: 1.1em;
    color: rgba(255,255,255,0.9);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.winner-info {
    font-size: 1.5em;
    margin: 20px 0;
    padding: 20px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.btn-close {
    background: #4CAF50;
    color: white;
    margin-top: 20px;
}

/* 滚动条样式 */
.rankings::-webkit-scrollbar {
    width: 8px;
}

.rankings::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.rankings::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}

.rankings::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* 网页端倒计时界面 */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000 !important; /* 确保在最上层 */
    animation: fadeIn 0.3s;
    pointer-events: auto; /* 确保可以显示 */
}

.countdown-number {
    font-size: 20em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 
        0 0 30px rgba(255,215,0,0.8),
        0 0 60px rgba(255,215,0,0.6),
        0 0 90px rgba(255,215,0,0.4);
    animation: countdownPulse 1s ease-out;
}

.countdown-number.pulse {
    animation: countdownPulse 1s ease-out;
}

@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 排行榜界面 */
.leaderboard-screen {
    min-height: 100vh;
    padding: 20px;
}

.leaderboard-screen header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.leaderboard-screen h1 {
    font-size: 3em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.leaderboard-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* 领奖台容器 */
.podium-container {
    margin-bottom: 60px;
}

.podium-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    margin: 40px 0;
    min-height: 400px;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* 领奖台底座 */
.podium-stand {
    position: relative;
    width: 200px;
}

.podium-base {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px 10px 0 0;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.podium-base-1 {
    height: 200px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border: 3px solid #FFD700;
}

.podium-base-2 {
    height: 150px;
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    border: 3px solid #C0C0C0;
}

.podium-base-3 {
    height: 120px;
    background: linear-gradient(135deg, #CD7F32 0%, #A0522D 100%);
    border: 3px solid #CD7F32;
}

.podium-rank-number {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 4em;
    font-weight: bold;
    color: rgba(255,255,255,0.9);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* 领奖台上的玩家信息 */
.podium-player {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    margin-bottom: 20px;
    width: 200px;
}

.podium-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255,255,255,0.9);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
}

.podium-medal {
    font-size: 3em;
    margin: 10px 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.podium-name {
    font-size: 1.5em;
    font-weight: bold;
    margin: 10px 0 5px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    word-break: break-word;
}

.podium-rank-text {
    font-size: 1.2em;
    color: rgba(255,255,255,0.9);
    margin-bottom: 5px;
}

.podium-count {
    font-size: 1.1em;
    color: #FFD700;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* 其余玩家排行榜 */
.other-rankings-container {
    margin-top: 60px;
}

.other-rankings-container h2 {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.other-rankings {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
}

.other-ranking-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    transition: transform 0.2s, background 0.2s;
}

.other-ranking-item:hover {
    transform: translateX(10px);
    background: rgba(255,255,255,0.2);
}

.other-ranking-rank {
    font-size: 2em;
    font-weight: bold;
    color: #FFD700;
    min-width: 60px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.other-ranking-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    flex-shrink: 0;
}

.other-ranking-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.other-ranking-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.other-ranking-count {
    font-size: 1.2em;
    color: #FFD700;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.no-podium,
.no-rankings {
    text-align: center;
    font-size: 1.5em;
    color: rgba(255,255,255,0.7);
    padding: 40px;
}

.btn-back {
    background: #4CAF50;
    color: white;
    padding: 12px 30px;
    font-size: 1.1em;
}

.btn-back:hover {
    background: #45a049;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .podium-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .podium-item {
        width: 100%;
        max-width: 300px;
    }
    
    .podium-stand {
        width: 100%;
    }
    
    .podium-base-1 {
        height: 150px;
    }
    
    .podium-base-2 {
        height: 120px;
    }
    
    .podium-base-3 {
        height: 100px;
    }
    
    .podium-rank-number {
        font-size: 3em;
    }
    
    .podium-name {
        font-size: 1.2em;
    }
}
