* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: #000;
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* 防调试警告 */
#debugger-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: #ff0000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    font-size: 24px;
}

/* 游戏容器 */
#game-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* 星空背景 */
.starfield {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #0a0e27 0%, #1a1e3a 50%, #2a2e4a 100%);
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent);
    background-size: 200% 200%;
    animation: starsMove 120s linear infinite;
}

@keyframes starsMove {
    from { transform: translateY(0); }
    to { transform: translateY(-100%); }
}

.nebula {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at top, rgba(123, 67, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(255, 67, 123, 0.1) 0%, transparent 50%);
    animation: nebulaPulse 10s ease-in-out infinite;
}

@keyframes nebulaPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* 游戏画布 */
#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: none;
}

/* UI层 */
.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.game-ui > * {
    pointer-events: auto;
}

/* 玻璃态面板 */
.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 顶部信息栏 */
.top-bar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
    padding: 15px 30px;
    pointer-events: none;
}

.score-display, .time-display {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.score-display .label, .time-display .label {
    font-size: 14px;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-display .value, .time-display .value {
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: transform 0.2s ease;
}

/* 屏幕覆盖层 */
.screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
}

/* 主面板 */
.main-panel, .result-panel {
    padding: 40px;
    text-align: center;
    color: white;
    max-width: 90%;
    width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.5s ease-out;
}

/* 美化滚动条 */
.main-panel::-webkit-scrollbar,
.result-panel::-webkit-scrollbar,
.leaderboard-panel::-webkit-scrollbar {
    width: 8px;
}

.main-panel::-webkit-scrollbar-track,
.result-panel::-webkit-scrollbar-track,
.leaderboard-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.main-panel::-webkit-scrollbar-thumb,
.result-panel::-webkit-scrollbar-thumb,
.leaderboard-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.main-panel::-webkit-scrollbar-thumb:hover,
.result-panel::-webkit-scrollbar-thumb:hover,
.leaderboard-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 霓虹文字 */
.neon-text {
    font-size: 48px;
    font-weight: bold;
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ff00ff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: neonGlow 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
    margin-bottom: 30px;
}

@keyframes neonGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 昵称输入部分 */
.nickname-section {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nickname-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

#nicknameInput {
    padding: 12px 20px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    color: white;
    text-align: center;
    width: 200px;
    transition: all 0.3s ease;
}

#nicknameInput:focus {
    outline: none;
    border-color: #00ffff;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

#nicknameInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.nickname-btn {
    padding: 12px 30px;
    background: linear-gradient(45deg, #00ff00, #00cc00);
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nickname-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.4);
}

.nickname-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    margin-top: 10px;
}

.nickname-error {
    font-size: 13px;
    color: #ff6b6b;
    text-align: center;
    margin-top: 10px;
    min-height: 20px;
}

/* 玩家信息显示 */
.player-info {
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.player-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.player-name {
    color: #00ffff;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.change-btn {
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.change-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 排行榜按钮 */
.leaderboard-btn {
    margin: 10px 0;
    padding: 12px 30px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border: none;
    border-radius: 25px;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.leaderboard-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.5);
}

/* 排行榜面板 */
.leaderboard-panel {
    padding: 40px;
    text-align: center;
    color: white;
    max-width: 90%;
    width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.leaderboard-list {
    margin: 30px 0;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    transition: all 0.3s ease;
    animation: slideInFromRight 0.5s ease-out backwards;
}

.leaderboard-item:nth-child(1) { animation-delay: 0.1s; }
.leaderboard-item:nth-child(2) { animation-delay: 0.2s; }
.leaderboard-item:nth-child(3) { animation-delay: 0.3s; }
.leaderboard-item:nth-child(4) { animation-delay: 0.4s; }
.leaderboard-item:nth-child(5) { animation-delay: 0.5s; }
.leaderboard-item:nth-child(6) { animation-delay: 0.6s; }
.leaderboard-item:nth-child(7) { animation-delay: 0.7s; }
.leaderboard-item:nth-child(8) { animation-delay: 0.8s; }
.leaderboard-item:nth-child(9) { animation-delay: 0.9s; }
.leaderboard-item:nth-child(10) { animation-delay: 1.0s; }

@keyframes slideInFromRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.leaderboard-item.current-player {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.2), rgba(0, 255, 255, 0.1));
    border: 1px solid rgba(0, 255, 255, 0.5);
}

.leaderboard-item.top1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.leaderboard-item.top2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.3), rgba(192, 192, 192, 0.1));
    border: 1px solid rgba(192, 192, 192, 0.5);
}

.leaderboard-item.top3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.3), rgba(205, 127, 50, 0.1));
    border: 1px solid rgba(205, 127, 50, 0.5);
}

.rank-number {
    font-size: 24px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.rank-number.top1 { color: #ffd700; }
.rank-number.top1::before { content: '🥇 '; }

.rank-number.top2 { color: #c0c0c0; }
.rank-number.top2::before { content: '🥈 '; }

.rank-number.top3 { color: #cd7f32; }
.rank-number.top3::before { content: '🥉 '; }

.player-nickname {
    flex: 1;
    text-align: left;
    margin: 0 20px;
    font-size: 18px;
}

.player-score {
    font-size: 20px;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.close-leaderboard-btn {
    padding: 12px 40px;
    background: linear-gradient(45deg, #666, #999);
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.close-leaderboard-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(45deg, #777, #aaa);
}

.leaderboard-empty {
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
}

/* 排名提示 */
.rank-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 40px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 215, 0, 0.7));
    border-radius: 20px;
    color: #333;
    font-size: 24px;
    font-weight: bold;
    z-index: 1000;
    animation: rankPop 0.5s ease-out;
}

@keyframes rankPop {
    from {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* 规则说明 */
.rules {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
}

.rules h3 {
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 20px;
}

.rules p {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.rule-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    font-size: 18px;
    transition: transform 0.3s ease;
}

.rule-item:hover {
    transform: translateX(5px);
}

.star-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 5px currentColor);
}

.star-icon.pink { 
    color: #ff69b4; 
    animation: twinkle 2s ease-in-out infinite;
}

.star-icon.green { 
    color: #00ff00;
    animation: twinkle 2s ease-in-out infinite 0.5s;
}

.star-icon.rainbow {
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbowShift 3s linear infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes rainbowShift {
    0% { filter: hue-rotate(0deg) drop-shadow(0 0 5px currentColor); }
    100% { filter: hue-rotate(360deg) drop-shadow(0 0 5px currentColor); }
}

.black-hole {
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, #000000 30%, #4a0080 70%);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #4a0080;
    animation: blackHolePulse 2s ease-in-out infinite;
}

@keyframes blackHolePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 奖励信息 */
.reward-info {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.reward-info h4 {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    margin-bottom: 10px;
}

.reward-info div {
    transition: all 0.3s ease;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.reward-info div:hover {
    transform: translateX(5px);
    color: rgba(255, 255, 255, 0.9);
}

/* 最高分显示 */
.high-score-display {
    margin: 15px 0;
    padding: 12px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    text-align: center;
}

.high-score-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.high-score-value {
    font-size: 32px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* 游戏次数限制显示 */
.play-limit-info {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.limit-display {
    font-size: 16px;
    color: #00ffff;
    text-align: center;
    font-weight: bold;
}

.limit-display.no-reward {
    color: #4fc3f7;
}

.limit-display.exceeded {
    color: #ff6b6b;
}

.remaining-count {
    font-size: 24px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    margin: 0 5px;
}

.sub-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
}

.play-count {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 5px;
}

.reset-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 10px;
}

.play-again-text {
    margin: 10px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* 霓虹按钮 */
.neon-btn, .play-btn, .play-again-btn, .view-leaderboard-btn {
    position: relative;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background: linear-gradient(45deg, #ff00ff, #00ffff);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 20px 10px 10px;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
}

.neon-btn:hover:not(:disabled),
.play-btn:hover:not(:disabled),
.play-again-btn:hover:not(:disabled),
.view-leaderboard-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 255, 255, 0.5);
}

.neon-btn:active:not(:disabled),
.play-btn:active:not(:disabled),
.play-again-btn:active:not(:disabled),
.view-leaderboard-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.neon-btn:disabled,
.play-btn:disabled,
.play-again-btn:disabled,
.view-leaderboard-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background: linear-gradient(45deg, #666, #999);
}

/* 结束界面按钮组 */
.end-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.play-again-btn,
.view-leaderboard-btn {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
}

.view-leaderboard-btn {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
}

.view-leaderboard-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.view-leaderboard-btn span {
    color: #333;
    font-weight: bold;
}

.btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.neon-btn:hover:not(:disabled) .btn-glow,
.play-btn:hover:not(:disabled) .btn-glow,
.play-again-btn:hover:not(:disabled) .btn-glow,
.view-leaderboard-btn:hover:not(:disabled) .btn-glow {
    opacity: 1;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 结果面板 */
.final-score {
    margin: 30px 0;
}

.final-score span {
    display: block;
    font-size: 20px;
    opacity: 0.8;
    margin-bottom: 10px;
}

.score-value {
    font-size: 72px;
    font-weight: bold;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    animation: scoreGlow 2s ease-in-out infinite;
}

@keyframes scoreGlow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 新纪录显示 */
.new-record {
    font-size: 20px;
    color: #ffd700;
    margin-top: 10px;
    animation: recordPulse 1s ease-in-out infinite;
}

@keyframes recordPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.best-record {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 10px;
}

/* 排行榜排名显示 */
.leaderboard-rank {
    font-size: 16px;
    color: #ffd700;
    margin-top: 8px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* 奖励部分 */
.reward-section {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
}

.reward-level {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* 奖励选择 */
.reward-choice {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.reward-choice p {
    margin: 10px 0;
    color: rgba(255, 255, 255, 0.9);
}

.choice-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.choice-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.choice-btn.accept {
    background: linear-gradient(135deg, #4caf50, #8bc34a);
}

.choice-btn.accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.4);
}

.choice-btn.skip {
    background: linear-gradient(135deg, #757575, #9e9e9e);
}

.choice-btn.skip:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(117, 117, 117, 0.4);
}

.choice-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.skipped-reward {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
}

/* 兑换码显示 */
.reward-code label {
    display: block;
    margin-bottom: 10px;
    opacity: 0.8;
}

.code-display {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.code-display input {
    padding: 10px 15px;
    font-size: 18px;
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    text-align: center;
    width: 250px;
}

.copy-btn {
    padding: 10px 20px;
    background: linear-gradient(45deg, #00ff00, #00cc00);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.3);
}

.copy-btn:active {
    transform: scale(0.95);
}

.no-stock {
    padding: 20px;
    font-size: 20px;
    color: #ff6b6b;
}

.no-stock p {
    margin: 5px 0;
}

/* 练习模式 */
.practice-mode {
    text-align: center;
    padding: 20px;
}

.practice-mode h3 {
    color: #4fc3f7;
    margin-bottom: 15px;
    font-size: 24px;
}

.practice-mode p {
    color: rgba(255, 255, 255, 0.7);
    margin: 8px 0;
}

/* 粒子效果容器 */
#particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 200;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFly 1s ease-out forwards;
}

@keyframes particleFly {
    to {
        transform: translate(var(--tx), var(--ty));
        opacity: 0;
    }
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00ffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* 响应式设计 - 平板 */
@media (max-width: 1024px) and (min-width: 769px) {
    .main-panel, .result-panel {
        width: 700px;
        padding: 35px;
    }
    
    .neon-text {
        font-size: 42px;
    }
    
    .leaderboard-panel {
        width: 600px;
    }
}

/* 响应式设计 - 手机横屏 */
@media (max-width: 768px) and (orientation: landscape) {
    .main-panel, .result-panel {
        padding: 20px;
        max-height: 85vh;
    }
    
    .neon-text {
        font-size: 32px;
        margin-bottom: 20px;
    }
    
    .rules {
        padding: 15px;
    }
    
    .reward-info {
        padding: 10px;
    }
    
    .play-limit-info {
        padding: 10px;
    }
    
    .nickname-section {
        padding: 15px;
    }
}

/* 响应式设计 - 手机竖屏 */
@media (max-width: 768px) {
    .neon-text {
        font-size: 36px;
    }
    
    .main-panel, .result-panel {
        padding: 30px 20px;
        width: 95%;
    }
    
    .score-value {
        font-size: 56px;
    }
    
    .top-bar {
        padding: 10px 20px;
        gap: 20px;
    }
    
    .score-display .value, .time-display .value {
        font-size: 24px;
    }
    
    .code-display {
        flex-direction: column;
    }
    
    .code-display input {
        width: 100%;
    }
    
    .reward-info {
        padding: 12px;
    }
    
    .reward-info div {
        font-size: 12px !important;
        line-height: 1.5 !important;
    }
    
    .rule-item {
        font-size: 16px;
    }
    
    .rules {
        padding: 15px;
    }
    
    .rules h3 {
        font-size: 18px;
    }
    
    .play-limit-info {
        padding: 12px;
    }
    
    .limit-display {
        font-size: 14px;
    }
    
    .remaining-count {
        font-size: 20px;
    }
    
    .high-score-value {
        font-size: 28px;
    }
    
    .choice-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .choice-btn {
        width: 100%;
    }
    
    .high-score-display {
        margin: 10px 0;
        padding: 10px;
    }
    
    /* 昵称输入响应式 */
    #nicknameInput {
        width: 150px;
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .nickname-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .leaderboard-panel {
        padding: 30px 20px;
        width: 95%;
    }
    
    .leaderboard-item {
        padding: 12px 15px;
    }
    
    .rank-number {
        font-size: 20px;
    }
    
    .player-nickname {
        font-size: 16px;
        margin: 0 10px;
    }
    
    .player-score {
        font-size: 18px;
    }
    
    .player-info {
        flex-direction: column;
        gap: 5px;
    }
    
    /* 结束界面按钮组响应式 */
    .end-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .play-again-btn,
    .view-leaderboard-btn {
        width: 100%;
        max-width: none;
    }
}

/* 响应式设计 - 小手机 */
@media (max-width: 480px) {
    .neon-text {
        font-size: 28px;
    }
    
    .rule-item {
        font-size: 14px;
    }
    
    .star-icon {
        font-size: 20px;
    }
    
    .neon-btn, .play-btn, .play-again-btn, .view-leaderboard-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
    
    .score-value {
        font-size: 48px;
    }
    
    .reward-level {
        font-size: 20px;
    }
    
    .top-bar {
        padding: 8px 15px;
        gap: 15px;
    }
    
    .score-display .label, .time-display .label {
        font-size: 12px;
    }
    
    .score-display .value, .time-display .value {
        font-size: 20px;
    }
    
    .play-limit-info {
        margin: 15px 0;
        padding: 10px;
    }
    
    .limit-display {
        font-size: 13px;
    }
    
    .remaining-count {
        font-size: 18px;
    }
    
    .high-score-display {
        padding: 10px;
    }
    
    .high-score-value {
        font-size: 24px;
    }
    
    .choice-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    /* 昵称输入响应式 */
    .nickname-input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    #nicknameInput {
        width: 100%;
    }
    
    .nickname-btn {
        width: 100%;
    }
    
    .leaderboard-item {
        padding: 10px;
    }
    
    .rank-number {
        font-size: 18px;
        min-width: 30px;
    }
    
    .player-nickname {
        font-size: 14px;
    }
    
    .player-score {
        font-size: 16px;
    }
    
    /* 结束界面按钮 */
    .end-buttons {
        margin-top: 15px;
    }
    
    .play-again-btn,
    .view-leaderboard-btn {
        padding: 12px 25px;
        font-size: 15px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .main-panel, .result-panel {
        padding: 20px 15px;
    }
    
    .neon-text {
        font-size: 24px;
    }
    
    .rules {
        padding: 12px;
    }
    
    .reward-info {
        padding: 10px;
        font-size: 11px;
    }
    
    .reward-info div {
        font-size: 11px !important;
    }
    
    .play-limit-info {
        padding: 8px;
    }
    
    .limit-display {
        font-size: 12px;
    }
    
    .remaining-count {
        font-size: 16px;
    }
    
    .nickname-section {
        padding: 12px;
    }
    
    .nickname-hint {
        font-size: 11px;
    }
    
    .leaderboard-panel {
        padding: 20px 15px;
    }
    
    .leaderboard-item {
        padding: 8px;
        font-size: 12px;
    }
    
    .rank-number {
        font-size: 16px;
        min-width: 25px;
    }
    
    .player-nickname {
        font-size: 13px;
        margin: 0 8px;
    }
    
    .player-score {
        font-size: 14px;
    }
}

/* 高分辨率屏幕优化 */
@media (min-width: 1920px) {
    .main-panel, .result-panel {
        width: 800px;
        padding: 50px;
    }
    
    .neon-text {
        font-size: 56px;
    }
    
    .rule-item {
        font-size: 20px;
    }
    
    .star-icon {
        font-size: 28px;
    }
    
    .play-limit-info {
        padding: 20px;
    }
    
    .limit-display {
        font-size: 18px;
    }
    
    .remaining-count {
        font-size: 28px;
    }
    
    .leaderboard-panel {
        width: 600px;
        padding: 50px;
    }
    
    .leaderboard-item {
        padding: 20px 25px;
    }
    
    .rank-number {
        font-size: 28px;
        min-width: 50px;
    }
    
    .player-nickname {
        font-size: 20px;
        margin: 0 25px;
    }
    
    .player-score {
        font-size: 24px;
    }
}

/* 确保所有按钮在禁用时显示正确的样式 */
button:disabled {
    cursor: not-allowed !important;
    opacity: 0.5 !important;
}

/* 修复iOS Safari的点击延迟 */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* 确保画布在所有设备上正确显示 */
canvas {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* 防止文本选择 */
.game-ui * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 输入框可以选择文本 */
input[type="text"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
