/* CSS: 게임의 겉모습을 꾸미는 부분입니다. */
body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #e0f7fa;
    /* 연한 하늘색 배경 */
    font-family: 'Arial', sans-serif;
    overflow: hidden;
}

#game-container {
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    overflow: hidden;
    border: 5px solid #fff;
}

canvas {
    display: block;
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 100%);
    /* 하늘 그라데이션 */
}

/* UI 영역: 점수와 눈덩이 개수를 보여줍니다. */
.ui-panel {
    position: absolute;
    top: 20px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

#p1-ui {
    left: 20px;
    border-left: 5px solid #FF5252;
}

#p2-ui {
    right: 20px;
    border-right: 5px solid #448AFF;
    text-align: right;
}

.snow-count {
    color: #00BCD4;
    font-size: 24px;
}

#timer-ui {
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    border: 2px solid #ccc;
    padding: 10px 30px;
}

#game-timer {
    color: #E65100;
    font-size: 28px;
    font-weight: 900;
}

.hp-bar {
    width: 150px;
    height: 15px;
    background: #ddd;
    border-radius: 10px;
    margin-top: 5px;
    overflow: hidden;
}

.hp-inner {
    height: 100%;
    transition: width 0.3s;
}

#p1-hp {
    background: #FF5252;
}

#p2-hp {
    background: #448AFF;
}

/* 안내 문구 */
#instructions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    text-align: center;
}

/* 메인 메뉴 및 게임 종료 화면 공통 스타일 */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 20;
    text-align: center;
}

#main-menu {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.9), rgba(42, 75, 124, 0.9));
}

.modal-overlay h1 {
    font-size: 70px;
    margin-bottom: 10px;
    text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
    color: #fff;
}

.menu-controls {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    font-size: 16px;
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.button-group {
    display: flex;
    gap: 15px;
}

button {
    padding: 15px 40px;
    font-size: 22px;
    cursor: pointer;
    border-radius: 10px;
    border: none;
    transition: transform 0.2s, background 0.2s;
    font-weight: bold;
}

button:hover {
    transform: scale(1.05);
}

.btn-start {
    background: #4CAF50;
    color: white;
}

.btn-restart {
    background: #2196F3;
    color: white;
}

.btn-main {
    background: #FF9800;
    color: white;
}

/* 중앙 방벽 시각화 (선택 사항) */
.center-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-left: 1px dashed rgba(255, 255, 255, 0.5);
    pointer-events: none;
}