/* main.css —— 全局样式、开始界面、游戏容器 */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    color: #fff;
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#game-container canvas {
    display: block;
}

/* 覆盖层（开始/暂停界面） */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 25, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.overlay.hidden {
    display: none;
}

.start-card {
    background: rgba(20, 30, 45, 0.95);
    border: 1px solid rgba(100, 200, 255, 0.3);
    border-radius: 12px;
    padding: 40px 50px;
    text-align: center;
    max-width: 520px;
    box-shadow: 0 0 40px rgba(0, 150, 255, 0.2);
}

.start-card h1 {
    font-size: 36px;
    margin-bottom: 8px;
    color: #00ddff;
    text-shadow: 0 0 20px rgba(0, 221, 255, 0.5);
}

.subtitle {
    color: #88aacc;
    font-size: 14px;
    margin-bottom: 24px;
}

.keybind-hint {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 24px;
    margin-bottom: 28px;
    text-align: left;
    font-size: 13px;
    color: #aabbcc;
}

.keybind-hint div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.keybind-hint span {
    display: inline-block;
    min-width: 60px;
    padding: 2px 8px;
    background: rgba(100, 200, 255, 0.15);
    border: 1px solid rgba(100, 200, 255, 0.3);
    border-radius: 4px;
    color: #00ddff;
    font-family: monospace;
    font-size: 12px;
    text-align: center;
}

.primary-btn, .secondary-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-btn {
    background: linear-gradient(135deg, #00aaff, #0066cc);
    color: #fff;
}

.primary-btn:hover {
    background: linear-gradient(135deg, #00bbff, #0077dd);
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.5);
}

.secondary-btn {
    background: rgba(100, 200, 255, 0.1);
    color: #00ddff;
    border: 1px solid rgba(100, 200, 255, 0.3);
}

.secondary-btn:hover {
    background: rgba(100, 200, 255, 0.2);
}

/* 恢复 PointerLock 的悬浮等待弹窗（Esc 后浏览器有约 1.25s 冷却，锁定成功即隐藏） */
.lock-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200; /* 高于开始菜单（100），作为独立浮层盖在其上 */
    background: rgba(10, 15, 25, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.lock-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 28px;
    background: rgba(20, 30, 45, 0.97);
    border: 1px solid rgba(100, 200, 255, 0.35);
    border-radius: 10px;
    box-shadow: 0 0 40px rgba(0, 150, 255, 0.35);
    color: #00ddff;
    font-size: 15px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(100, 200, 255, 0.25);
    border-top-color: #00ddff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: default;
    box-shadow: none;
}

.hint {
    margin-top: 16px;
    font-size: 12px;
    color: #667788;
}
