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

body {
    overflow: hidden;
    background: #000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
}

canvas {
    display: block;
}

/* 시작 화면 */
#blocker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

#blocker.hidden {
    display: none;
}

#start-screen {
    text-align: center;
    max-width: 500px;
    padding: 40px;
}

#start-screen h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

#start-screen .subtitle {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 32px;
}

#start-screen .controls-info {
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#start-screen .controls-info h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
    margin-bottom: 12px;
}

#start-screen .control-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.95rem;
}

#start-screen .control-row .key {
    color: #667eea;
    font-weight: 600;
}

#start-screen .start-btn {
    display: inline-block;
    padding: 14px 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#start-screen .start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

/* HUD */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    display: none;
}

#hud.active {
    display: block;
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

#checkpoint-display {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#timer {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#death-message {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff4444;
    text-shadow: 0 2px 8px rgba(255, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s;
}

#death-message.show {
    opacity: 1;
}

/* 클리어 화면 */
#clear-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(8px);
}

#clear-screen.active {
    display: flex;
}

#clear-screen .clear-content {
    text-align: center;
}

#clear-screen h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f9d423, #ff4e50);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

#clear-screen .clear-time {
    font-size: 2rem;
    color: #ccc;
    margin-bottom: 32px;
}

#clear-screen .restart-btn {
    padding: 14px 40px;
    background: linear-gradient(135deg, #f9d423, #ff4e50);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

#clear-screen .restart-btn:hover {
    transform: translateY(-2px);
}

/* 페이드 오버레이 */
#fade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#fade-overlay.active {
    opacity: 1;
}

/* 튜토리얼 힌트 */
#tutorial-container {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tutorial-hint {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 28px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s, transform 0.5s;
    text-align: center;
}

.tutorial-hint.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.tutorial-hint.fading {
    opacity: 0;
    transform: translateY(-10px);
}

.tutorial-hint p {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.5;
}

.tutorial-hint p small {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.hint-keys {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hint-key-row {
    display: flex;
    gap: 4px;
}

.hint-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.5);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
}

.hint-key.wide {
    min-width: 100px;
}

.hint-icon {
    font-size: 1.8rem;
    line-height: 1;
}

/* 섹션 이름 표시 */
#section-name {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.3rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.5s;
}

#section-name.show {
    opacity: 1;
}
