/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* 화면 레이아웃 */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* 로그인 화면 */
#login-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: backgroundShift 10s ease-in-out infinite alternate;
}

@keyframes backgroundShift {
    0% { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
    100% { background: linear-gradient(135deg, #764ba2 0%, #667eea 100%); }
}

.login-container, .menu-container, .pause-container {
    background: rgba(0, 0, 0, 0.85);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    min-width: 400px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.login-container h1, .menu-container h1 {
    color: #fff;
    font-size: 48px;
    margin-bottom: 30px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    font-weight: bold;
}

/* 버튼 스타일 */
button {
    padding: 15px 25px;
    margin: 10px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.login-btn {
    background: #4285f4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn:hover {
    background: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(66, 133, 244, 0.4);
}

.demo-btn {
    background: #34a853;
    color: white;
}

.demo-btn:hover {
    background: #2d8f47;
}

.menu-buttons button {
    background: #ff6b6b;
    color: white;
    display: block;
    width: 100%;
    margin: 15px 0;
}

.menu-buttons button:hover {
    background: #ee5a5a;
    transform: scale(1.05);
}

#auth-status {
    color: #ccc;
    margin: 20px 0;
    font-size: 16px;
}

/* 게임 화면 */
#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: none;
}

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

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 32px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

#health-bar, #hunger-bar {
    position: absolute;
    top: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 20px;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#health-bar {
    left: 20px;
}

#hunger-bar {
    right: 20px;
}

#hotbar {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.hotbar-slot {
    width: 70px;
    height: 70px;
    border: 3px solid #555;
    background: rgba(139, 139, 139, 0.3);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: all 0.2s ease;
    font-size: 24px;
}

.hotbar-slot.selected {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.hotbar-slot .item-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

#debug-info {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #0f0;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #0f0;
    text-align: left;
}

#controls-help {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

/* 오버레이 (인벤토리, 일시정지) */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: all;
    z-index: 200;
}

.inventory-container {
    background: rgba(30, 30, 30, 0.95);
    padding: 30px;
    border-radius: 15px;
    color: white;
    min-width: 600px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.inventory-container h2, .inventory-container h3 {
    margin-bottom: 20px;
    text-align: center;
}

#inventory-grid {
    display: grid;
    grid-template-columns: repeat(9, 70px);
    gap: 5px;
    margin-bottom: 30px;
    justify-content: center;
}

.inventory-slot {
    width: 70px;
    height: 70px;
    border: 2px solid #555;
    background: rgba(139, 139, 139, 0.3);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    transition: all 0.2s ease;
}

.inventory-slot:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

#crafting-section {
    text-align: center;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    padding-top: 20px;
}

#crafting-grid {
    display: grid;
    grid-template-columns: repeat(3, 70px);
    gap: 5px;
    justify-content: center;
    margin: 20px 0;
}

#crafting-result {
    width: 70px;
    height: 70px;
    border: 3px solid #4CAF50;
    background: rgba(76, 175, 80, 0.3);
    border-radius: 5px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .login-container, .menu-container {
        min-width: 90%;
        padding: 20px;
    }
    
    .login-container h1, .menu-container h1 {
        font-size: 36px;
    }
    
    #hotbar {
        bottom: 10px;
        padding: 10px;
    }
    
    .hotbar-slot {
        width: 60px;
        height: 60px;
    }
}
