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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-container {
    width: 100%;
    max-width: 500px;
    height: 100vh;
    max-height: 800px;
    background: #16213e;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 顶部信息栏 */
#top-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 20px;
    background: #0f3460;
    border-bottom: 2px solid #e94560;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.label {
    font-size: 12px;
    color: #a0a0a0;
    text-transform: uppercase;
}

.value {
    font-size: 24px;
    font-weight: bold;
    color: #e94560;
}

#next-ball-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #4a9eff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    font-size: 14px;
}

/* 画布区域 */
#canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #0a1628;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* 安全线 */
#safe-line {
    position: absolute;
    top: 100px;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(
        90deg,
        #e94560 0px,
        #e94560 10px,
        transparent 10px,
        transparent 20px
    );
    pointer-events: none;
    z-index: 10;
}

/* 状态消息 */
#status-message {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    z-index: 20;
    pointer-events: none;
}

#status-message:not(.hidden) {
    display: block;
    animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { transform: translate(-50%, -50%) scale(1); }
    to { transform: translate(-50%, -50%) scale(1.1); }
}

/* 弹窗 */
#modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#modal.hidden {
    display: none;
}

.modal-content {
    background: #1a1a2e;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #e94560;
    min-width: 280px;
}

#modal-title {
    color: #e94560;
    font-size: 28px;
    margin-bottom: 15px;
}

#modal-message {
    color: #ffffff;
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.5;
}

#modal-btn {
    background: #e94560;
    color: white;
    border: none;
    padding: 12px 40px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

#modal-btn:hover {
    background: #ff6b8a;
}

/* 响应式 */
@media (max-width: 500px) {
    #game-container {
        max-height: 100vh;
    }

    .value {
        font-size: 20px;
    }

    #next-ball-preview {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
}
