@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@400;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', sans-serif;
}

body {
    background: #0f172a;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
}

.logo {
    text-align: center;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.logo-icon {
    font-size: 64px;
    margin-bottom: -10px;
}

h1 {
    font-size: 56px;
    font-weight: 900;
    background: linear-gradient(to right, #00f2fe, #4facfe, #00f2fe);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientFlow 3s linear infinite;
}

p {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 40px;
    color: #cbd5e1;
    text-align: center;
}

.buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* 모바일 등 작은 화면에서 줄바꿈 방지용 */
    justify-content: center;
}

button {
    pointer-events: all;
    background: linear-gradient(45deg, #00c6ff, #0072ff);
    border: none;
    padding: 16px 32px;
    white-space: nowrap; /* 텍스트 줄바꿈 방지 */
    font-size: 18px;
    font-weight: 700;
    color: white;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 114, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 114, 255, 0.5);
}

button:hover::after {
    left: 100%;
}

.warning {
    margin-top: 30px;
    font-size: 14px;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

#hud {
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.3s;
    opacity: 0;
}

#hud:not(.hidden) {
    opacity: 1;
}

.score {
    font-size: 28px;
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 8px rgba(0,0,0,0.5);
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 16px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
}

.score-display {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 40px;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.vol-meter {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 16px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
}

.vol-bar-bg {
    width: 180px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.vol-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00ff87, #60efff);
    transition: width 0.05s linear;
    box-shadow: 0 0 10px rgba(96, 239, 255, 0.8);
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: white;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 16px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
    pointer-events: all;
}

.controls input[type=range] {
    accent-color: #00f2fe;
    cursor: pointer;
}
