* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#game-container {
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
    max-width: 100vw;
    max-height: 100vh;
}

#game-container canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

#chat-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 10px;
    pointer-events: all;
}

#chat-messages {
    height: 150px;
    overflow-y: auto;
    margin-bottom: 10px;
    color: white;
    font-size: 14px;
}

#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.chat-message {
    margin-bottom: 5px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.chat-message .player-name {
    color: #4fc3f7;
    font-weight: bold;
    margin-right: 5px;
}

#chat-input {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: white;
    font-size: 14px;
}

#chat-input:focus {
    outline: none;
    border-color: #4fc3f7;
    background: rgba(255, 255, 255, 0.15);
}

#chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* 게임 UI 스타일 */
.game-ui-text {
    font-family: Arial, sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* 모바일 반응형 스타일 */
@media screen and (max-width: 768px) {
    body {
        padding: 0;
        align-items: flex-start;
    }
    
    #game-container {
        border-radius: 0;
        box-shadow: none;
        width: 100vw;
        height: 100vh;
    }
    
    #chat-container {
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        font-size: 12px;
    }
    
    #chat-messages {
        height: 100px;
        font-size: 12px;
    }
    
    #chat-input {
        font-size: 12px;
        padding: 6px;
    }
}

@media screen and (max-width: 480px) {
    #chat-container {
        bottom: 5px;
        left: 5px;
        right: 5px;
        padding: 8px;
    }
    
    #chat-messages {
        height: 80px;
        font-size: 11px;
    }
}

.button {
    cursor: pointer;
    transition: all 0.2s;
}

.button:hover {
    transform: scale(1.05);
}

.button:active {
    transform: scale(0.95);
}

/* 로딩 애니메이션 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
