/* 重置和基本样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    color: #e0e0e0;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 图标样式 */
.button-icon {
    width: 24px;
    height: 24px;
    fill: white;
}

.boredom-icon {
    width: 18px;
    height: 18px;
    fill: #ffcc00;
}

/* 顶部信息栏 */
.header {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.game-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ff6b6b;
    text-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

.boredom-indicator {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 游戏画布区域 */
.game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #0a1a2a 0%, #1a2a3a 100%);
}

/* 游戏状态覆盖层 */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.time-display {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    letter-spacing: 2px;
}

.distance-display {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
}

.game-message {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 25px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.5s;
    max-width: 80%;
    line-height: 1.4;
}

/* 底部控制区域 */
.controls-area {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.speed-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    transition: all 0.1s;
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

.control-button:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

.brake-button {
    background: rgba(255, 107, 107, 0.3);
    border-color: rgba(255, 107, 107, 0.5);
}

.accelerate-button {
    background: rgba(78, 205, 196, 0.3);
    border-color: rgba(78, 205, 196, 0.5);
}

.direction-control {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.reset-button {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 5px;
    transition: background 0.2s;
    touch-action: manipulation;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.reset-button:active {
    background: rgba(255, 255, 255, 0.2);
}

/* 游戏介绍页面 */
.intro-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 100%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.intro-content {
    max-width: 500px;
    width: 90%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.intro-title {
    color: #ff6b6b;
    font-size: 2.2rem;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.intro-subtitle {
    color: #aaa;
    font-size: 1.1rem;
    margin-bottom: 25px;
    font-style: italic;
}

.intro-description {
    line-height: 1.6;
    margin-bottom: 25px;
    color: #ccc;
}

.feature-list {
    text-align: left;
    margin: 20px 0;
    padding-left: 20px;
    color: #aaa;
    list-style: none;
}

.feature-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-list a {
    color: #4ecdc4;
    text-decoration: none;
}

.feature-list a:hover {
    text-decoration: underline;
}

.highlight {
    color: #ffcc00;
    font-weight: bold;
}

.start-button {
    background: linear-gradient(to right, #ff6b6b, #ff8e53);
    color: white;
    border: none;
    padding: 16px 30px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    touch-action: manipulation;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.start-button:active {
    transform: scale(0.98);
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.4);
}

/* 响应式调整 */
@media (max-height: 700px) {
    .control-button {
        width: 60px;
        height: 60px;
    }
    
    .time-display {
        font-size: 1.7rem;
        top: 15px;
    }
    
    .distance-display {
        font-size: 1rem;
        top: 55px;
    }
}

@media (max-width: 350px) {
    .control-button {
        width: 55px;
        height: 55px;
    }
    
    .game-title {
        font-size: 1.1rem;
    }
}
