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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #FFE5CC 0%, #FFD4A3 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    overflow-y: auto;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 900px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    animation: fadeIn 0.5s ease;
}

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

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h1 {
    color: #FF6B6B;
    font-size: 36px;
    margin-bottom: 10px;
    font-weight: 800;
}

.game-header h2 {
    color: #4ECDC4;
    font-size: 28px;
    margin-bottom: 15px;
}

.description {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.game-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.tag {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    transition: transform 0.3s ease;
}

.tag:hover {
    transform: translateY(-2px);
}

.tag:nth-child(2n) {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.tag:nth-child(3n) {
    background: linear-gradient(135deg, #FFD93D, #F6B93B);
    box-shadow: 0 4px 15px rgba(255, 217, 61, 0.3);
}

.game-area {
    margin-bottom: 30px;
}

.game-board {
    position: relative;
    height: min(400px, 40vh);
    min-height: 300px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(240, 240, 240, 0.8) 100%);
    border-radius: 20px;
    margin: 0 auto 30px;
    max-width: 600px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.stick-container {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: min(500px, 80%);
    height: calc(100% - 100px);
    max-height: 300px;
    pointer-events: none;
}

.stick-container .stick {
    pointer-events: auto;
}

.stick {
    width: 30px;
    height: min(200px, 60%);
    background: linear-gradient(180deg, #4ECDC4 0%, #44A08D 100%);
    border-radius: 15px;
    position: absolute;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 20px rgba(78, 205, 196, 0.4);
    z-index: 10;
}

.stick:hover {
    transform: scale(1.05);
}

.stick.falling {
    pointer-events: none;
}

.stick.caught {
    background: linear-gradient(180deg, #FFD93D 0%, #F6B93B 100%);
    box-shadow: 0 5px 20px rgba(255, 217, 61, 0.4);
}

.stick-top {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 40px;
    background: #FFD93D;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.base-platform {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(180deg, #8B7355 0%, #6B5A45 100%);
    border-radius: 0 0 20px 20px;
}

.speed-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.speed-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #F0F0F0;
    color: #666;
}

.speed-btn.active {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
}

.speed-btn:hover:not(.active) {
    background: #E0E0E0;
    transform: translateY(-2px);
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    color: #999;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: #4ECDC4;
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.control-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-btn {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
    box-shadow: 0 5px 20px rgba(78, 205, 196, 0.4);
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.5);
}

.reset-btn {
    background: linear-gradient(135deg, #FFD93D, #F6B93B);
    color: #333;
    box-shadow: 0 5px 20px rgba(255, 217, 61, 0.4);
}

.reset-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 217, 61, 0.5);
}

.pause-btn {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
}

.pause-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

.resume-btn {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
    box-shadow: 0 5px 20px rgba(78, 205, 196, 0.4);
}

.resume-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.5);
}

/* 音效控制樣式 */
.sound-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.sound-btn, .music-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.sound-btn:hover, .music-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sound-btn.active {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-color: #28a745;
}

.music-btn.active {
    background: linear-gradient(135deg, #6f42c1, #e83e8c);
    color: white;
    border-color: #6f42c1;
}

/* 暫停遮罩樣式 */
.pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.pause-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: pauseContentFadeIn 0.3s ease;
    max-width: 400px;
    width: 90%;
}

@keyframes pauseContentFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pause-content h2 {
    color: #FF6B6B;
    font-size: 32px;
    margin-bottom: 15px;
    font-weight: 800;
}

.pause-content p {
    color: #666;
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.keyboard-hints {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.keyboard-hints p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}

kbd {
    background: #343a40;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 響應式設計 */
/* 大桌機螢幕 */
@media (min-width: 1200px) {
    .game-container {
        padding: 50px;
        max-width: 1000px;
    }
    
    .game-board {
        height: min(450px, 40vh);
        max-width: 700px;
    }
    
    .stick-container {
        width: 600px;
        height: 350px;
    }
    
    .game-header h1 {
        font-size: 42px;
    }
    
    .game-header h2 {
        font-size: 32px;
    }
}

/* 中等桌機螢幕 */
@media (min-width: 992px) and (max-width: 1199px) {
    .game-container {
        padding: 45px;
    }
    
    .game-board {
        height: min(420px, 40vh);
    }
    
    .stick-container {
        width: 550px;
        height: 320px;
    }
}

/* 平板和小螢幕桌機 */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
    }

    .game-header h1 {
        font-size: 28px;
    }

    .game-header h2 {
        font-size: 22px;
    }

    .description {
        font-size: 14px;
    }

    .game-board {
        height: 350px;
    }

    .stick-container {
        width: 90%;
        max-width: 400px;
    }

    .stick {
        width: 25px;
        height: 160px;
    }

    .speed-btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .control-btn {
        padding: 12px 30px;
        font-size: 16px;
    }

    .stat-value {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .game-tags {
        gap: 5px;
    }

    .tag {
        padding: 6px 15px;
        font-size: 12px;
    }

    .game-stats {
        gap: 20px;
    }

    .speed-controls {
        flex-direction: column;
        align-items: center;
    }

    .speed-btn {
        width: 200px;
    }
}

/* 極矮螢幕 */
@media (max-height: 600px) {
    body {
        padding: 10px;
    }
    
    .game-container {
        padding: 20px;
        max-height: 98vh;
    }
    
    .game-header {
        margin-bottom: 15px;
    }
    
    .game-header h1 {
        font-size: 24px;
        margin-bottom: 5px;
    }
    
    .game-header h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .description {
        font-size: 14px;
        display: none; /* Hide description on very short screens */
    }
    
    .game-tags {
        margin-bottom: 15px;
    }
    
    .game-area {
        margin-bottom: 15px;
    }
    
    .game-board {
        height: min(250px, 30vh);
        min-height: 200px;
        margin-bottom: 15px;
    }
    
    .game-stats {
        margin-bottom: 15px;
    }
    
    .stat-value {
        font-size: 20px;
    }
}