/**
 * GameShare Realms - Browser MMORPG Styles
 * Pixel art game panel with sidebar UI
 */

/* ============================================================================
   GAME LAYOUT
   ============================================================================ */

.game-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 500px;
}

.game-main {
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
    border: 2px solid #5a4a36;
    border-radius: 3px 0 0 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px #1a1610;
}

/* ============================================================================
   TOP BAR
   ============================================================================ */

.game-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(180deg, #3a3226, #2e281e);
    border-bottom: 2px solid #5a4a36;
    gap: 12px;
    flex-wrap: wrap;
}

.game-zone-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.game-zone-name i {
    color: #c8a035;
}

.game-hp-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-hp-bar {
    width: 120px;
    height: 16px;
    background: #8a2222;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid #5a4a36;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

.game-hp-fill {
    height: 100%;
    background: linear-gradient(180deg, #2d8a2d, #1a6a1a);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.game-hp-fill.low {
    background: linear-gradient(180deg, #cc2222, #8a1a1a);
}

.game-hp-fill.medium {
    background: linear-gradient(180deg, #d4a020, #a07a10);
}

.game-hp-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 50px;
}

.game-karma-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #f59e0b;
}

.game-karma-display i {
    color: #f59e0b;
}

/* ============================================================================
   CANVAS
   ============================================================================ */

.game-canvas-container {
    position: relative;
    width: 100%;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#gameCanvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
    width: 100%;
    max-width: 960px;
    aspect-ratio: 480 / 352;
    cursor: crosshair;
    background: #111;
}

/* ============================================================================
   CHAT PANEL
   ============================================================================ */

.game-chat-panel {
    display: flex;
    flex-direction: column;
    max-height: 160px;
    border-top: 2px solid #5a4a36;
    background: #1a1610;
}

.game-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 6px 10px;
    font-size: 0.8rem;
    line-height: 1.5;
    min-height: 60px;
    max-height: 110px;
}

.game-chat-msg {
    padding: 2px 0;
    word-break: break-word;
}

.game-chat-msg .chat-name {
    font-weight: 700;
    color: var(--primary-color);
}

.game-chat-msg .chat-text {
    color: var(--text-primary);
}

.game-chat-msg.system-msg {
    color: #f59e0b;
    font-style: italic;
}

.game-chat-msg.ambient-msg {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.7rem;
}

.game-chat-input {
    display: flex;
    border-top: 1px solid var(--border-color);
}

.game-chat-input input {
    flex: 1;
    padding: 6px 10px;
    background: #0f0d08;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
}

.game-chat-input input::placeholder {
    color: var(--text-secondary);
}

.game-chat-input button {
    padding: 6px 12px;
    background: linear-gradient(180deg, #6a5a3a, #4a3e30);
    color: #e8d8b0;
    border: none;
    border-left: 1px solid #5a4a36;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.game-chat-input button:hover {
    background: linear-gradient(180deg, #7a6a4a, #5a4e40);
    color: #fff;
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */

.game-sidebar {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #3a3226, #2e281e);
    border: 2px solid #5a4a36;
    border-left: none;
    border-radius: 0 3px 3px 0;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px #1a1610;
}

.game-sidebar-tabs {
    display: flex;
    border-bottom: 2px solid #5a4a36;
    background: linear-gradient(180deg, #4a3e30, #3a3226);
}

.game-sidebar-tab {
    flex: 1;
    padding: 8px 4px;
    text-align: center;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    color: #8a7a5a;
    border: none;
    background: none;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.game-sidebar-tab:hover {
    color: #e8d8b0;
    background: rgba(200, 160, 53, 0.08);
}

.game-sidebar-tab.active {
    color: #c8a035;
    border-bottom-color: #c8a035;
    background: rgba(200, 160, 53, 0.1);
}

.game-sidebar-tab i {
    display: block;
    font-size: 1rem;
    margin-bottom: 2px;
    color: inherit;
}

.game-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: none;
}

.game-tab-content.active {
    display: block;
}

/* ============================================================================
   INVENTORY TAB
   ============================================================================ */

.game-inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 8px;
}

.game-inv-slot {
    aspect-ratio: 1;
    background: #2e281e;
    border: 1px solid #4a3e30;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    min-height: 48px;
    padding: 2px;
    box-shadow: inset 1px 1px 0 #1a1610;
}

.game-inv-slot:hover {
    border-color: #c8a035;
    background: rgba(200, 160, 53, 0.12);
    box-shadow: 0 0 6px rgba(200, 160, 53, 0.3), inset 1px 1px 0 #1a1610;
}

.game-inv-slot.dragging {
    opacity: 0.3;
    border: 1px dashed #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.game-inv-slot.drag-over {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.2);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.game-inv-slot.empty {
    cursor: default;
    opacity: 0.5;
}

.game-inv-slot.empty.drag-over {
    opacity: 1;
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.2);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
    cursor: pointer;
}

.game-inv-slot.empty:hover {
    border-color: #4a3e30;
    background: #2e281e;
    box-shadow: inset 1px 1px 0 #1a1610;
}

.game-inv-slot .inv-item-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.inv-item-icon img,
.shop-item-icon img,
.equip-icon img {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.game-inv-slot .inv-item-name {
    font-size: 0.55rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.1;
    overflow: hidden;
    max-height: 1.2rem;
}

.game-inv-slot .inv-item-qty {
    position: absolute;
    bottom: 1px;
    right: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #f59e0b;
}

/* ============================================================================
   OSRS-STYLE BANK
   ============================================================================ */

.bank-container {
    display: flex;
    gap: 10px;
    min-height: 280px;
}

.bank-grid-panel {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.bank-inv-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.bank-panel-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bank-search {
    width: 100%;
    padding: 4px 8px;
    margin-bottom: 4px;
    font-size: 0.7rem;
    background: #2e281e;
    border: 1px solid #4a3e30;
    border-radius: 2px;
    color: var(--text-primary);
    outline: none;
}

.bank-search:focus {
    border-color: #c8a035;
}

.bank-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    max-height: 260px;
    overflow-y: auto;
    flex: 1;
}

.bank-inv-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    flex: 1;
    max-height: 260px;
    overflow-y: auto;
}

.bank-slot {
    aspect-ratio: 1;
    background: #2e281e;
    border: 1px solid #4a3e30;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    transition: all 0.15s;
    box-shadow: inset 1px 1px 0 #1a1610;
}

.bank-slot:hover {
    border-color: #c8a035;
    background: rgba(200, 160, 53, 0.12);
}

.bank-slot img {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.bank-slot .bank-qty {
    position: absolute;
    top: 0;
    left: 2px;
    font-size: 0.5rem;
    font-weight: 700;
    color: #f59e0b;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    line-height: 1;
}

.bank-slot.empty-bank-slot {
    opacity: 0.3;
    cursor: default;
}

.bank-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 8px;
    flex-wrap: wrap;
}

.bank-qty-selector {
    display: flex;
    gap: 3px;
    align-items: center;
}

.bank-qty-selector span {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 700;
    margin-right: 2px;
}

.bank-qty-btn {
    padding: 3px 8px;
    border: 1px solid #4a3e30;
    border-radius: 2px;
    background: #2e281e;
    color: #8a7a5a;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.15s;
}

.bank-qty-btn:hover {
    border-color: #c8a035;
    color: #e8d8b0;
}

.bank-qty-btn.active {
    background: linear-gradient(180deg, #6a5a3a, #4a3e30);
    color: #e8d8b0;
    border-color: #c8a035;
}

.bank-action-btns {
    display: flex;
    gap: 4px;
}

.bank-action-btn {
    padding: 3px 10px;
    border: 1px solid #4a3e30;
    border-radius: 2px;
    background: #2e281e;
    color: #8a7a5a;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 700;
    transition: all 0.15s;
}

.bank-action-btn:hover {
    border-color: #4a7a4a;
    color: #4ade80;
    background: rgba(34, 197, 94, 0.1);
}

@media (max-width: 600px) {
    .bank-container {
        flex-direction: column;
    }
    .bank-grid {
        grid-template-columns: repeat(6, 1fr);
        max-height: 180px;
    }
    .bank-inv-grid {
        grid-template-columns: repeat(7, 1fr);
        max-height: 140px;
    }
}

/* ============================================================================
   SKILLS TAB
   ============================================================================ */

.game-skills-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.game-skill-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: linear-gradient(90deg, #2e281e, #342e24);
    border-radius: 2px;
    border: 1px solid #4a3e30;
    box-shadow: inset 1px 1px 0 rgba(255,255,255,0.03);
}

.game-skill-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.game-skill-info {
    flex: 1;
    min-width: 0;
}

.game-skill-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

.game-skill-level {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.game-skill-bar {
    width: 100%;
    height: 4px;
    background: rgba(0,0,0,0.3);
    border-radius: 2px;
    margin-top: 2px;
    overflow: hidden;
    border: 1px solid rgba(90,74,54,0.5);
}

.game-skill-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #c8a035, #e8c855);
    border-radius: 2px;
    transition: width 0.3s;
}

/* ============================================================================
   EQUIPMENT TAB
   ============================================================================ */

.game-equipment-panel {
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.game-equip-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.game-equip-slot {
    width: 52px;
    height: 52px;
    background: #2e281e;
    border: 2px solid #4a3e30;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    box-shadow: inset 1px 1px 0 #1a1610;
}

.game-equip-slot:hover {
    border-color: #c8a035;
    box-shadow: 0 0 6px rgba(200, 160, 53, 0.3), inset 1px 1px 0 #1a1610;
}

.game-equip-slot .equip-label {
    font-size: 0.5rem;
    color: var(--text-secondary);
    position: absolute;
    bottom: 1px;
    text-transform: capitalize;
}

.game-equip-slot .equip-icon {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.game-equip-slot.equipped .equip-icon {
    color: #c8a035;
}

/* ============================================================================
   QUEST TAB
   ============================================================================ */

.game-quest-list {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.game-quest-item {
    padding: 8px;
    background: #2e281e;
    border-radius: 2px;
    border: 1px solid #4a3e30;
}

.game-quest-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.game-quest-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 2px;
    display: inline-block;
    margin-bottom: 4px;
}

.game-quest-status.in-progress {
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
}

.game-quest-status.completed {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.game-quest-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.game-no-quests {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ============================================================================
   CHARACTER CREATION
   ============================================================================ */

.game-create-character {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.game-create-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #2563eb, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-create-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.game-create-form {
    width: 100%;
    max-width: 320px;
}

.game-create-form .form-group {
    margin-bottom: 1rem;
}

.game-create-form input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.game-create-form input:focus {
    border-color: var(--primary-color);
}

.game-create-form .btn {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
}

.game-create-error {
    color: var(--error, #ef4444);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 1.2rem;
}

/* ============================================================================
   NOTIFICATIONS / TOASTS
   ============================================================================ */

.game-notification {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 100;
    animation: gameToastIn 0.3s ease, gameToastOut 0.3s ease 2.7s forwards;
    pointer-events: none;
    white-space: nowrap;
}

.game-notification.xp-gain {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

.game-notification.level-up {
    background: rgba(245, 158, 11, 0.95);
    color: white;
    font-size: 1rem;
}

.game-notification.item-gain {
    background: rgba(37, 99, 235, 0.9);
    color: white;
}

.game-notification.error {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.game-notification.zone-change {
    background: rgba(168, 85, 247, 0.9);
    color: white;
    font-size: 1.1rem;
}

@keyframes gameToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes gameToastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ============================================================================
   TOOLTIP
   ============================================================================ */

.game-tooltip {
    position: fixed;
    background: #3a3226;
    border: 1px solid #c8a035;
    border-radius: 3px;
    padding: 8px 12px;
    z-index: 1000;
    pointer-events: none;
    max-width: 200px;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.game-tooltip .tooltip-name {
    font-weight: 700;
    color: #e8a020;
    margin-bottom: 2px;
}

.game-tooltip .tooltip-desc {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.3;
}

.game-tooltip .tooltip-stats {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.7rem;
    color: #4ade80;
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

.game-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.game-loading i {
    font-size: 2rem;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

.game-loading-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================================================
   FLEE BUTTON
   ============================================================================ */

.game-flee-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    animation: fleePulse 1s ease infinite;
}

.game-flee-btn:hover {
    background: #dc2626;
}

@keyframes fleePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* ============================================================================
   ITEM CONTEXT MENU
   ============================================================================ */

.game-item-menu {
    position: fixed;
    z-index: 2000;
    background: #3a3226;
    border: 1px solid #5a4a36;
    border-radius: 3px;
    min-width: 120px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.game-item-menu-title {
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #e8a020;
    border-bottom: 1px solid #5a4a36;
    background: #4a3e30;
}

.game-item-menu button {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 6px 10px;
    background: none;
    border: none;
    color: var(--text-primary, #eee);
    font-size: 0.75rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.game-item-menu button:hover {
    background: rgba(200, 160, 53, 0.15);
}

.game-item-menu button i {
    width: 14px;
    text-align: center;
    color: var(--text-secondary, #999);
}

/* ============================================================================
   GAME MODAL (Shop / Quest Dialogue)
   ============================================================================ */

.game-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gameModalFadeIn 0.2s ease;
}

@keyframes gameModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-modal {
    background: linear-gradient(180deg, #3a3226, #2e281e);
    border: 2px solid #5a4a36;
    border-radius: 4px;
    width: 90%;
    max-width: 440px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 0 1px #1a1610;
}

.game-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 2px solid #5a4a36;
    background: linear-gradient(180deg, #4a3e30, #3a3226);
}

.game-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e8d8b0;
}

.game-modal-header h3 i {
    color: #c8a035;
}

.game-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary, #888);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.game-modal-close:hover {
    color: var(--text-primary, #eee);
}

.game-modal-body {
    padding: 16px;
}

/* ============================================================================
   SHOP UI
   ============================================================================ */

.game-shop-karma {
    padding: 8px 12px;
    margin-bottom: 12px;
    background: #2e281e;
    border: 1px solid #4a3e30;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.game-shop-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.game-shop-tab {
    flex: 1;
    padding: 6px 12px;
    background: #2e281e;
    border: 1px solid #4a3e30;
    border-radius: 3px;
    color: #8a7a5a;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.game-shop-tab.active {
    background: rgba(200, 160, 53, 0.15);
    color: #c8a035;
    border-color: #c8a035;
}

.game-shop-section {
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.game-shop-section.active {
    display: block;
}

.game-shop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s;
}

.game-shop-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.game-shop-item:last-child {
    border-bottom: none;
}

.shop-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: #2e281e;
    border: 1px solid #4a3e30;
    border-radius: 2px;
    flex-shrink: 0;
}

.shop-item-info {
    flex: 1;
    min-width: 0;
}

.shop-item-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary, #eee);
}

.shop-item-desc {
    font-size: 0.7rem;
    color: var(--text-secondary, #888);
    line-height: 1.3;
}

.shop-item-stat {
    font-size: 0.65rem;
    color: #4ade80;
    margin-top: 2px;
}

.shop-item-price {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.shop-price-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 3px;
}

.shop-price-tag.sell {
    color: #4ade80;
}

.shop-buy-btn,
.shop-sell-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.shop-buy-btn {
    background: linear-gradient(180deg, #6a5a3a, #4a3e30);
    color: #e8d8b0;
    border: 1px solid #5a4a36;
}

.shop-buy-btn:hover {
    background: linear-gradient(180deg, #7a6a4a, #5a4e40);
    color: #fff;
}

.shop-sell-btn {
    background: linear-gradient(180deg, #3a6a3a, #2a5a2a);
    color: #b0e8b0;
    border: 1px solid #4a7a4a;
}

.shop-sell-btn:hover {
    background: linear-gradient(180deg, #4a7a4a, #3a6a3a);
    color: #fff;
}

.game-shop-empty {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary, #888);
    font-size: 0.8rem;
}

/* ============================================================================
   QUEST DIALOGUE UI
   ============================================================================ */

.game-quest-npc-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #c8a035;
    margin-bottom: 8px;
}

.game-quest-dialogue {
    padding: 12px;
    background: #2e281e;
    border-radius: 3px;
    border-left: 3px solid #c8a035;
    font-size: 0.85rem;
    color: #e8d8b0;
    line-height: 1.5;
    margin-bottom: 12px;
    font-style: italic;
}

.game-quest-desc-text {
    font-size: 0.8rem;
    color: var(--text-secondary, #888);
    margin-bottom: 12px;
    line-height: 1.4;
}

.game-quest-objectives {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.game-quest-obj {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #2e281e;
    border: 1px solid #4a3e30;
    border-radius: 2px;
    font-size: 0.8rem;
    color: #8a7a5a;
}

.game-quest-obj i {
    flex-shrink: 0;
    font-size: 0.9rem;
}

.game-quest-obj.complete {
    color: #4ade80;
}

.game-quest-obj.complete i {
    color: #4ade80;
}

.game-quest-rewards {
    padding: 8px 10px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 2px;
    font-size: 0.8rem;
    color: var(--text-primary, #eee);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.reward-karma {
    color: #f59e0b;
    font-weight: 600;
}

.reward-xp {
    color: #4ade80;
    font-weight: 600;
}

.reward-items {
    color: var(--primary-color, #2563eb);
    font-weight: 600;
}

.game-quest-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.game-quest-actions .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s;
}

.game-quest-actions .btn-primary {
    background: linear-gradient(180deg, #6a5a3a, #4a3e30);
    color: #e8d8b0;
    border: 1px solid #5a4a36;
}

.game-quest-actions .btn-primary:hover {
    background: linear-gradient(180deg, #7a6a4a, #5a4e40);
    color: #fff;
}

.game-quest-actions .btn:not(.btn-primary) {
    background: #2e281e;
    color: #8a7a5a;
    border: 1px solid #4a3e30;
}

.game-quest-actions .btn:not(.btn-primary):hover {
    color: var(--text-primary, #eee);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .game-layout {
        grid-template-columns: 1fr;
        padding: 0.5rem;
    }

    .game-main {
        border-radius: 3px 3px 0 0;
    }

    .game-sidebar {
        border-left: 2px solid #5a4a36;
        border-radius: 0 0 3px 3px;
        max-height: 300px;
    }

    .game-topbar {
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    .game-hp-bar {
        width: 80px;
    }

    .game-inventory-grid {
        grid-template-columns: repeat(7, 1fr);
        padding: 4px;
    }

    .game-inv-slot {
        min-height: 36px;
    }

    .game-create-character {
        padding: 2rem 1rem;
    }
}

/* ========================================================================
   PHASE 4: Trade Window & PvP Styles
   ======================================================================== */

/* Trade Window - Two-column layout */
.trade-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.trade-col {
    background: var(--bg-dark, #0a0a0a);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 10px;
    min-height: 120px;
}

.trade-col-header {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.trade-offer-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 60px;
    margin-bottom: 8px;
}

.trade-offer-item {
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 2px;
    font-size: 0.8rem;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.trade-empty {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-style: italic;
    text-align: center;
    padding: 12px 0;
}

.trade-karma-input {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.8rem;
}

.trade-karma-input label {
    color: var(--text-secondary);
    white-space: nowrap;
}

.trade-karma-input input {
    width: 80px;
    padding: 3px 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    color: var(--text-primary);
    font-size: 0.8rem;
}

.trade-karma-display {
    font-size: 0.8rem;
    color: #facc15;
    margin-top: 8px;
}

.trade-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 8px;
    padding: 4px;
    border-radius: 2px;
    background: var(--bg-secondary);
}

.trade-status.accepted {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    font-weight: 700;
}

/* Trade inventory selection */
.trade-inventory {
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 10px;
    background: var(--bg-dark, #0a0a0a);
    margin-bottom: 12px;
}

.trade-inv-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.trade-inv-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 140px;
    overflow-y: auto;
}

.trade-inv-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.trade-inv-item:hover {
    background: var(--bg-light);
    border-color: var(--accent-purple, #2563eb);
}

.trade-inv-item.offered {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
}

/* Trade action buttons */
.trade-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.trade-actions .btn {
    min-width: 100px;
}

/* Player context menu (reuse item menu styles) */
.game-player-menu {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 4px 0;
    z-index: 10000;
    min-width: 130px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.game-player-menu button {
    display: block;
    width: 100%;
    padding: 6px 14px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.game-player-menu button:hover {
    background: var(--bg-light);
}

.game-player-menu button i {
    width: 18px;
    margin-right: 6px;
    text-align: center;
}

/* Wilderness zone visual indicator */
.game-zone-name .wilderness {
    color: #ef4444;
    font-weight: 700;
}

/* PvP death notification */
.game-notification.pvp-death {
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
}

.game-notification.pvp-kill {
    background: rgba(74, 222, 128, 0.9);
    color: #000;
}

/* Sound toggle button */
.game-sound-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: color 0.15s ease, border-color 0.15s ease;
    margin-left: auto;
}

.game-sound-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* ========================================================================
   FULLSCREEN MODE
   ======================================================================== */
.game-layout:fullscreen {
    max-width: none;
    padding: 0;
    background: #0a0a0a;
    grid-template-columns: 1fr 300px;
    height: 100vh;
}

.game-layout:fullscreen .game-main {
    border-radius: 0;
}

.game-layout:fullscreen .game-sidebar {
    border-radius: 0;
}

.game-layout:fullscreen .game-canvas-container {
    flex: 1;
}

.game-layout:fullscreen #gameCanvas {
    max-width: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ========================================================================
   PHASE 5: Minimap
   ======================================================================== */
.game-minimap-container {
    padding: 8px;
    text-align: center;
}

.game-minimap-zone {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

#minimapCanvas {
    border: 1px solid var(--border-color);
    border-radius: 2px;
    background: #111;
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.game-minimap-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.game-minimap-legend span {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ============================================================================
   BUILD MODE
   ============================================================================ */
.build-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.15s ease;
}
.build-mode-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
    color: #bfdbfe;
}
.build-mode-btn.active {
    background: rgba(59, 130, 246, 0.35);
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.build-panel {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 180px;
    max-height: 320px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-size: 0.75rem;
}

.build-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: rgba(59, 130, 246, 0.15);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    font-weight: 700;
    color: #93c5fd;
    gap: 6px;
}
.build-block-count {
    font-size: 0.65rem;
    color: var(--text-secondary);
}
.build-panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.75rem;
}
.build-panel-close:hover {
    color: #ef4444;
}

.build-panel-grid {
    overflow-y: auto;
    flex: 1;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.build-block-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}
.build-block-option:hover {
    background: rgba(59, 130, 246, 0.1);
}
.build-block-option.selected {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}
.build-block-option.locked {
    opacity: 0.35;
    cursor: not-allowed;
}
.build-block-option.no-resources {
    opacity: 0.55;
}

.build-block-swatch {
    width: 20px;
    height: 20px;
    border-radius: 2px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.1);
}

.build-block-info {
    flex: 1;
    min-width: 0;
}
.build-block-name {
    color: #e2e8f0;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.build-block-level {
    color: var(--text-secondary);
    font-size: 0.6rem;
}

.build-panel-footer {
    padding: 4px 6px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.build-maintain-btn {
    width: 100%;
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 3px;
    color: #93c5fd;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    transition: background 0.15s;
}
.build-maintain-btn:hover {
    background: rgba(59, 130, 246, 0.25);
}
