/* 다중접속 RPG 게임 CSS */

.rpg-body {
    margin: 0;
    padding: 0;
    background: #1a1a1a;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #fff;
    overflow: hidden;
}

/* RPG 헤더 */
.rpg-header {
    background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    padding: 12px 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.rpg-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rpg-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-info span {
    font-size: 16px;
    font-weight: 600;
}

.level-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
}

/* RPG 컨테이너 */
.rpg-container {
    display: flex;
    margin-top: 60px;
    height: calc(100vh - 60px);
    gap: 12px;
    padding: 12px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* 게임 영역 */
.rpg-game-area {
    flex: 1;
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* 게임 오버레이 */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.game-overlay.hidden {
    display: none;
}

.overlay-content {
    background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    max-width: 400px;
    width: 90%;
}

.overlay-content h2 {
    margin: 0 0 16px 0;
    font-size: 32px;
    color: #fff;
}

.overlay-content p {
    margin: 0 0 24px 0;
    font-size: 16px;
    color: #ddd;
}

.player-name-input {
    margin: 20px 0;
    text-align: left;
}

.player-name-input label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #ddd;
}

.player-name-input input {
    width: 100%;
    padding: 12px;
    border: 2px solid #555;
    border-radius: 8px;
    background: #1a1a1a;
    color: #fff;
    font-size: 16px;
    font-family: 'Noto Sans KR', sans-serif;
}

.btn-start {
    padding: 14px 32px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
    margin-top: 16px;
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-start:active {
    transform: translateY(0);
}

/* 사이드바 */
.rpg-sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

/* 상태 패널 */
.status-panel,
.chat-panel,
.players-panel {
    background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.status-panel h3,
.chat-panel h3,
.players-panel h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item span {
    color: #ddd;
    font-size: 14px;
}

.stat-item strong {
    color: #4CAF50;
    font-size: 16px;
}

/* 스탯 바 */
.stat-bar {
    margin: 12px 0;
}

.stat-bar label {
    display: block;
    color: #ddd;
    font-size: 14px;
    margin-bottom: 4px;
}

.bar-container {
    width: 100%;
    height: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 4px;
}

.bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.hp-bar {
    background: linear-gradient(90deg, #F44336 0%, #E91E63 100%);
}

.mp-bar {
    background: linear-gradient(90deg, #2196F3 0%, #3F51B5 100%);
}

.stat-bar span {
    color: #ddd;
    font-size: 12px;
}

/* 채팅 패널 */
.chat-messages {
    height: 300px;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 12px;
}

.chat-message {
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
}

.chat-message.normal {
    background: rgba(255,255,255,0.05);
}

.chat-message.system {
    background: rgba(255, 215, 0, 0.1);
    color: #FFD700;
    font-style: italic;
}

.chat-message.combat {
    background: rgba(244, 67, 54, 0.1);
    color: #FF6B6B;
}

.chat-time {
    color: #999;
    font-size: 11px;
    margin-right: 4px;
}

.chat-input-area {
    display: flex;
    gap: 8px;
}

.chat-input-area input {
    flex: 1;
    padding: 10px;
    border: 2px solid #555;
    border-radius: 6px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-size: 14px;
    font-family: 'Noto Sans KR', sans-serif;
}

.chat-input-area input:focus {
    outline: none;
    border-color: #4CAF50;
}

.chat-input-area button {
    padding: 10px 16px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.chat-input-area button:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
}

.chat-input-area button:active {
    transform: scale(0.98);
}

/* 온라인 플레이어 목록 */
.players-list {
    max-height: 200px;
    overflow-y: auto;
}

.player-item {
    padding: 8px;
    margin-bottom: 4px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    font-size: 14px;
    color: #ddd;
}

.player-item.me {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    font-weight: 600;
}

/* 레벨업 오버레이 */
.levelup-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    padding: 40px 60px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.5);
    z-index: 10000;
    animation: levelup 0.5s ease;
    text-align: center;
}

.levelup-overlay h2 {
    margin: 0 0 12px 0;
    font-size: 36px;
}

.levelup-overlay p {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

@keyframes levelup {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .rpg-container {
        flex-direction: column;
        height: auto;
    }
    
    .rpg-game-area {
        height: 60vh;
        min-height: 400px;
    }
    
    .rpg-sidebar {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .chat-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .rpg-sidebar {
        grid-template-columns: 1fr;
    }
    
    .rpg-header h1 {
        font-size: 18px;
    }
    
    .player-info {
        font-size: 12px;
    }
}

/* 스크롤바 스타일 */
.chat-messages::-webkit-scrollbar,
.players-list::-webkit-scrollbar,
.rpg-sidebar::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track,
.players-list::-webkit-scrollbar-track,
.rpg-sidebar::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb,
.players-list::-webkit-scrollbar-thumb,
.rpg-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.players-list::-webkit-scrollbar-thumb:hover,
.rpg-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

