* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #667eea;
    color: #fff;
    overflow: hidden;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    transition: background 0.3s ease;
}

.container {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
    justify-content: center;
    align-items: center;
}

/* 游戏区域 */
.game-area {
    display: flex;
    flex-direction: column;
    padding: 30px;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    max-width: 600px;
    width: 100%;
}

/* 游戏信息栏 */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 15px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.15);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.info-item:nth-child(1),
.info-item:nth-child(2) {
    justify-content: flex-start;
}

.info-item:nth-child(3) {
    justify-content: flex-end;
}

.label {
    color: #ffd700;
    text-shadow: none;
}

#score, #highScore, #speed, #missedCoins {
    color: inherit;
    min-width: 50px;
    text-align: right;
    text-shadow: none;
}

#speed {
    text-align: left;
}

/* 信息栏分隔符 */
.info-divider {
    width: 2px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
    margin: 0 15px;
}

/* 游戏画布 */
.game-canvas {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* 速度显示 */
.speed-display {
    position: absolute;
    left: 20px;
    bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.15);
    z-index: 10;
}

.speed-display .label {
    color: #ffd700;
    text-shadow: none;
}

.speed-display #speed {
    color: #fff;
    text-shadow: none;
    min-width: 30px;
    text-align: left;
}

/* 盘子 - 钱袋子图标 💰 */
.plate {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 100px;
    font-size: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8B4513; /* 棕色 */
    text-shadow: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.plate::before {
    content: '💰';
    animation: bounce 1s infinite;
}

.plate::after {
    content: '';
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* 掉落物品 */
.falling-item {
    position: absolute;
    border-radius: 50%;
    transition: transform 0.1s;
}

.big-coin {
    width: 40px;
    height: 40px;
    background: #ffd700;
    border: 3px solid #ffed4e;
    box-shadow: 
        inset -5px -5px 0 rgba(0, 0, 0, 0.3),
        0 0 10px rgba(255, 215, 0, 0.5);
}

.big-coin::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ffed4e;
    border-radius: 50%;
}

.small-coin {
    width: 25px;
    height: 25px;
    background: #ffd700;
    border: 2px solid #ffed4e;
    box-shadow: 
        inset -3px -3px 0 rgba(0, 0, 0, 0.3),
        0 0 8px rgba(255, 215, 0, 0.5);
}

.small-coin::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border: 1px solid #ffed4e;
    border-radius: 50%;
}

.stone {
    width: 35px;
    height: 35px;
    background: #696969;
    border: 3px solid #555;
    border-radius: 5px;
    box-shadow: 
        inset -4px -4px 0 rgba(0, 0, 0, 0.5),
        0 2px 5px rgba(0, 0, 0, 0.3);
}

.stone::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 8px;
    height: 8px;
    background: #555;
    border-radius: 50%;
}

.stone::after {
    content: '';
    position: absolute;
    top: 60%;
    right: 20%;
    width: 6px;
    height: 6px;
    background: #555;
    border-radius: 50%;
}



/* 控制区域 */
.controls-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

/* 速度显示 */
.speed-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.15);
    z-index: 10;
}

/* 控制按钮 */
.controls {
    display: flex;
    gap: 20px;
}

.btn {
    padding: 12px 28px;
    font-size: 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    color: currentColor;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.3);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.2);
}

.btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    box-shadow: none;
}

/* 图标按钮 */
.icon-btn {
    padding: 12px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.icon-btn::before {
    content: none;
}

.icon-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.3);
    animation: none;
}

.icon-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.2);
}

/* 开始/暂停按钮特殊样式 */
#playPauseBtn {
    background: rgba(255, 255, 255, 0.2);
    color: currentColor;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#playPauseBtn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* 重玩按钮特殊样式 */
#restartBtn {
    background: rgba(255, 255, 255, 0.2);
    color: currentColor;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#restartBtn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.icon-btn .icon-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.icon-btn .icon, .icon-btn canvas, .icon-btn img.icon {
    width: 90px;
    height: 90px;
    fill: currentColor;
    stroke: none;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
    display: block;
    position: static;
    z-index: auto;
    object-fit: contain;
}

.icon-btn:hover .icon, .icon-btn:hover canvas, .icon-btn:hover img.icon {
    transform: scale(1.1);
}

/* 确保SVG图标颜色随主题变化 */
.icon-btn svg path {
    fill: currentColor;
    stroke: none;
}

/* 设置按钮的齿轮图标 */
.settings-btn .icon, .settings-btn canvas {
    width: 24px;
    height: 24px;
    fill: none;
}

/* 设置按钮 */
.settings-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    color: currentColor;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* 设置面板 */
.settings-panel {
    position: absolute;
    top: 0;
    right: -350px;
    width: 320px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    padding: 30px;
    transition: right 0.3s ease;
    z-index: 200;
    overflow-y: auto;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.settings-header h2 {
    font-size: 26px;
    color: #ffd700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.close-btn {
    width: 35px;
    height: 35px;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-item label {
    font-size: 16px;
    color: #ffd700;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.setting-item input[type="color"] {
    width: 100%;
    height: 60px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* 主题按钮 */
.theme-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.theme-btn {
    padding: 15px;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.theme-btn.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

/* 得分动画 */
.score-popup {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    pointer-events: none;
    animation: popup 1s ease-out forwards;
    z-index: 50;
}

.score-popup.positive {
    color: #00ff00;
}

.score-popup.negative {
    color: #ff0000;
}

@keyframes popup {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.5);
    }
}

/* 游戏结束弹窗 */
.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.game-over-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
    color: #fff;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease;
}

.game-over-content h2 {
    font-size: 32px;
    margin-bottom: 15px;
    color: inherit;
    text-shadow: none;
}

.game-over-content p {
    font-size: 18px;
    margin-bottom: 25px;
    color: inherit;
    text-shadow: none;
}

.final-score {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    color: var(--accent-color, #ffd700);
    text-shadow: none;
}

.final-score span {
    font-size: 36px;
    margin-left: 10px;
}

.game-over-content .btn {
    padding: 15px 40px;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.2);
    color: currentColor;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.game-over-content .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

