/* =========================================
   기본 설정
   ========================================= */
body {
    margin: 0;
    overflow: hidden;
    background-color: #222;
    font-family: "Pretendard", sans-serif;
    user-select: none; /* 텍스트 선택 방지 */
}

/* =========================================
   좌측 툴박스 (큐브 창고)
   ========================================= */
#toolbox {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 200px;
    background: rgba(30, 30, 30, 0.9);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #444;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

#toolbox h3 {
    margin-top: 0;
    font-size: 1.1rem;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    text-align: center;
}

.cube-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: #444;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cube-btn:hover {
    background: #666;
}

.cube-btn:active {
    background: #888;
}

.description {
    font-size: 0.8rem;
    color: #aaa;
    text-align: center;
    line-height: 1.4;
    margin-top: 10px;
}

/* =========================================
   우측 상단 상태 패널
   ========================================= */
#status-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 180px;
    background: rgba(30, 30, 30, 0.9);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #444;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
}

#life-text { color: #ff5555; }
#camera-text { color: #55aaff; font-size: 0.9rem; }
#laser-text { color: #ffff55; }

/* 기존 카메라 상태 텍스트 숨김 (우측 패널로 통합) */
#camera-status { display: none; }

/* =========================================
   중앙 하단 정보 (UI Layer)
   ========================================= */
#ui-layer {
    position: absolute;
    bottom: 20px;
    width: 100%;
    pointer-events: none;
    display: flex;
    justify-content: center;
    z-index: 20;
}

#info {
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.5);
    color: #00ff00;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid #333;
}

/* =========================================
   스테이지 전환 오버레이
   ========================================= */
#stage-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 5000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.0s ease-in-out;
}

#stage-transition.active {
    opacity: 1;
    pointer-events: auto;
}

#st-stage-num {
    font-size: 1.5rem;
    color: #888;
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#st-title {
    font-size: 3.5rem;
    margin: 10px 0;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.separator {
    width: 100px;
    height: 2px;
    background: #00ff00;
    margin: 20px 0;
}

#st-desc {
    font-size: 1.2rem;
    color: #ccc;
    max-width: 600px;
    line-height: 1.6;
}

/* =========================================
   게임 시작 화면
   ========================================= */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    color: white;
    text-align: center;
}

/* 시작 화면 전체 컨테이너 */
#start-screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: white;
    font-family: 'Noto Sans KR', sans-serif;
}

.title-box {
    margin-bottom: 40px;
    text-align: center;
}

.title-box h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #ffffff;
}

/* 스테이지 선택 그리드 */
#stage-select-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 한 줄에 3개씩 */
    gap: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 60vh;
    overflow-y: auto; /* 스테이지 많으면 스크롤 */
    padding: 10px;
}

/* 개별 스테이지 버튼 */
.stage-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #444;
    color: #ddd;
    padding: 15px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    text-align: left;
}

.stage-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.stage-btn .stage-id {
    font-size: 0.8em;
    color: #888;
    margin-bottom: 5px;
    display: block;
}

.stage-btn .stage-title {
    font-weight: bold;
    font-size: 1.1em;
}

.controls-hint {
    color: #888;
    margin-bottom: 30px;
}

#btn-start {
    padding: 15px 40px;
    font-size: 1.2rem;
    cursor: pointer;
    background: #00ff00;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    transition: transform 0.2s;
}

#btn-start:hover {
    transform: scale(1.05);
}

/* =========================================
   게임 오버 및 기타
   ========================================= */
#game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    color: white;
    text-align: center;
}

#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border: 2px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1500;
}

