/* ===========================================================
   MajorMUD-Inspired Web Client Custom Theme
   Dark, immersive design with retro-futuristic feel
   =========================================================== */

/* Game name branding in title bar */
body::before {
    content: "⚔ RITES OF PASSAGE ⚔";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(180deg, #1a0a2e 0%, #0d0d0d 100%);
    color: #ffd700;
    text-align: center;
    font-family: 'DejaVu Sans Mono', 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 0.3em;
    padding: 4px 0;
    border-bottom: 1px solid #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Shift everything down to accommodate the title bar */
#clientwrapper {
    padding-top: 28px;
}

/* Darker background for the entire client */
body {
    background: #0a0a0a;
    color: #c0c0c0;
}

/* Stats bar - fixed at top of message area, below title bar */
#statsbar {
    position: fixed;
    top: 28px;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 2px solid #ffd700;
    padding: 6px 12px;
    font-family: 'DejaVu Sans Mono', 'Courier New', monospace;
    font-size: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    align-items: center;
    min-height: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.stat-label {
    color: #888;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
}

.stat-value {
    color: #ffd700;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.stat-value.hp { color: #ff4444; }
.stat-value.mp { color: #4488ff; }
.stat-value.sp { color: #44ff44; }
.stat-value.xp { color: #ff8800; }
.stat-value.gold { color: #ffd700; }

/* Stat bar HP bar visual */
.stat-bar {
    display: inline-block;
    width: 60px;
    height: 10px;
    background: #333;
    border: 1px solid #555;
    border-radius: 2px;
    overflow: hidden;
    vertical-align: middle;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 1px;
    transition: width 0.3s ease;
}

.stat-bar-fill.hp-fill { background: linear-gradient(90deg, #cc0000, #ff4444); }
.stat-bar-fill.mp-fill { background: linear-gradient(90deg, #0033cc, #4488ff); }
.stat-bar-fill.sp-fill { background: linear-gradient(90deg, #00aa00, #44ff44); }

/* Stat separator */
.stat-sep {
    color: #444;
    user-select: none;
}

/* Message area - adjust for stats bar */
#messagewindow {
    margin-top: 32px;
    padding: 8px 12px;
}

/* Mobile responsive: smaller stats bar */
@media screen and (max-width: 768px) {
    #statsbar {
        font-size: 0.6rem;
        padding: 4px 8px;
        gap: 2px 6px;
        min-height: 24px;
    }
    .stat-bar {
        width: 40px;
        height: 8px;
    }
    .stat-label {
        font-size: 0.55rem;
    }
    #messagewindow {
        margin-top: 24px;
        padding: 4px 8px;
    }
    body::before {
        font-size: 0.7rem;
        padding: 3px 0;
    }
    #clientwrapper {
        padding-top: 24px;
    }
    #statsbar {
        top: 24px;
    }
}

@media screen and (max-width: 480px) {
    #statsbar {
        font-size: 0.5rem;
        padding: 2px 6px;
        gap: 1px 4px;
        min-height: 20px;
    }
    .stat-bar {
        width: 30px;
        height: 6px;
    }
    .stat-label {
        display: none; /* Hide labels on very small screens */
    }
    .stat-sep {
        display: none;
    }
    body::before {
        font-size: 0.6rem;
        padding: 2px 0;
    }
    #clientwrapper {
        padding-top: 20px;
    }
    #statsbar {
        top: 20px;
    }
}

/* Input area styling */
#inputfield {
    background: #111;
    color: #fff;
    border: 1px solid #333;
    border-top: 2px solid #ffd700;
    font-size: 0.95rem;
}

#inputfield:focus {
    border-color: #ffd700;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.3);
    outline: none;
}

#inputsend {
    background: #2a1a0e;
    color: #ffd700;
    border: 1px solid #ffd700;
    font-weight: bold;
}

#inputsend:hover {
    background: #ffd700;
    color: #000;
}

/* Prompt styling */
.prompt {
    color: #ffd700;
    background: #111;
    border-top: 1px solid #333;
    padding: 2px 8px;
    font-size: 0.85rem;
}

/* Scrollbar styling */
#messagewindow::-webkit-scrollbar {
    width: 8px;
}
#messagewindow::-webkit-scrollbar-track {
    background: #111;
}
#messagewindow::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}
#messagewindow::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Dialog styling */
.dialog {
    border: 2px solid #ffd700;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}
.dialogtitle {
    background: linear-gradient(90deg, #1a0a2e, #2a1a0e);
    color: #ffd700;
    border-bottom: 1px solid #ffd700;
}

/* Toolbar button styling */
#toolbar button {
    background: transparent;
    border: 1px solid #555;
    color: #aaa;
    margin: 0 2px;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.8rem;
}
#toolbar button:hover {
    border-color: #ffd700;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

/* MXP link styling */
#mxplink {
    color: #4488ff;
    text-decoration: underline;
    cursor: pointer;
}
#mxplink:hover {
    color: #66aaff;
}

/* Typing indicator */
#istyping {
    background: rgba(26, 26, 46, 0.9);
    border: 1px solid #ffd700;
    border-radius: 4px;
    color: #ccc;
    font-size: 0.75rem;
}