/* 移动端适配样式 */

/* iPhone适配 */
@supports (padding: max(0px)) {
    .game-header {
        padding-top: max(20px, env(safe-area-inset-top));
    }
    
    .result-container {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* 响应式设计 */
@media (max-width: 480px) {
    .game-container {
        padding: 15px;
    }
    
    .game-title {
        font-size: 22px;
    }
    
    #wheel {
        width: min(280px, 80vw);
        height: min(280px, 80vw);
    }
    
    .spin-button {
        padding: 12px 35px;
        font-size: 15px;
        min-width: 140px;
        min-height: 48px;
    }
    
    .result-display {
        font-size: 18px;
        max-width: 180px;
    }
}

@media (max-width: 375px) {
    .game-container {
        padding: 10px;
    }
    
    .game-title {
        font-size: 20px;
    }
    
    #wheel {
        width: min(250px, 75vw);
        height: min(250px, 75vw);
    }
    
    .wheel-container {
        margin-bottom: 30px;
    }
    
    .controls {
        margin-bottom: 25px;
    }
    
    .spin-button {
        padding: 10px 30px;
        font-size: 14px;
        min-width: 120px;
        min-height: 44px;
    }
    
    .result-display {
        font-size: 16px;
        max-width: 160px;
    }
}

/* iPhone SE等小屏设备 */
@media (max-width: 320px) {
    #wheel {
        width: min(220px, 70vw);
        height: min(220px, 70vw);
    }
    
    .game-title {
        font-size: 18px;
    }
    
    .pointer {
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-top: 16px solid #ff4757;
    }
    
    .pointer::after {
        width: 16px;
        height: 16px;
        left: -8px;
        top: -14px;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .game-container {
        display: flex;
        flex-direction: row;
        align-items: center;
        max-width: 100vw;
        padding: 10px 20px;
    }
    
    .game-header {
        flex: 0 0 auto;
        margin-bottom: 0;
        margin-right: 20px;
        padding-top: 0;
    }
    
    .game-title {
        font-size: 18px;
        writing-mode: vertical-rl;
        text-orientation: mixed;
    }
    
    .wheel-container {
        flex: 1;
        margin-bottom: 0;
    }
    
    #wheel {
        width: min(200px, 40vh);
        height: min(200px, 40vh);
    }
    
    .controls {
        flex: 0 0 auto;
        margin-bottom: 0;
        margin-left: 20px;
    }
    
    .result-container {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        margin-bottom: 0;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #wheel {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 触摸优化 */
@media (pointer: coarse) {
    .spin-button {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
}