/* Reset & Base */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Roboto', sans-serif;
    background-color: #121212;
    color: #e0e0e0;
}

h1, h2, h3, a {
    font-family: 'Cinzel', serif;
    color: white;
    text-decoration: none;
}

/* Landing Page Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 50px;
    background: linear-gradient(to bottom, #1a0f0a, #2c1a12);
    border-bottom: 2px solid #d35400;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo img {
    height: 50px;
}

nav a {
    margin: 0 15px;
    font-size: 14px;
    font-weight: bold;
    color: #ccc;
    transition: color 0.3s;
}

nav a:hover {
    color: #d35400;
}

.auth-buttons button {
    padding: 8px 15px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    transition: all 0.3s;
}

.btn-login {
    background: transparent;
    color: white;
    border: 1px solid #d35400 !important;
}

.btn-login:hover {
    background: rgba(211, 84, 0, 0.2);
}

.btn-register {
    background: #d35400;
    color: white;
    margin-left: 10px;
}

.btn-register:hover {
    background: #e67e22;
    transform: scale(1.05);
}

/* Hero Section */
.hero {
    height: 80vh;
    background: url('https://assets.albiononline.com/assets/images/home/hero-bg.jpg') no-repeat center center;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    text-shadow: 2px 2px 10px black;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 5px black;
}

.btn-cta {
    padding: 20px 50px;
    font-size: 1.5rem;
    background: #e67e22; /* Albion Orange */
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(230, 126, 34, 0.6);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Cinzel', serif;
}

.btn-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(230, 126, 34, 0.9);
}

.platform-icons {
    margin-top: 20px;
    font-size: 24px;
    color: #aaa;
}

.platform-icons i {
    margin: 0 10px;
}

/* Features Section */
.features {
    display: flex;
    justify-content: center;
    padding: 50px 20px;
    background: #121212;
    gap: 30px;
    flex-wrap: wrap;
}

.feature-box {
    background: #1e1e1e;
    width: 350px;
    text-align: center;
    border: 1px solid #333;
    transition: transform 0.3s;
}

.feature-box:hover {
    transform: translateY(-10px);
    border-color: #d35400;
}

.feature-box img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.feature-box h3 {
    color: #d35400;
    margin: 15px 0 5px;
}

.feature-box p {
    padding: 0 15px 15px;
    color: #bbb;
    font-size: 14px;
}

/* Footer */
footer {
    background: #0a0a0a;
    padding: 30px;
    text-align: center;
    border-top: 1px solid #333;
}

.socials {
    font-size: 24px;
    margin-bottom: 10px;
}

.socials i {
    margin: 0 10px;
    cursor: pointer;
    color: #777;
    transition: color 0.3s;
}

.socials i:hover {
    color: #d35400;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1e1e1e;
    padding: 40px;
    border: 2px solid #d35400;
    width: 350px;
    text-align: center;
    position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: white;
}

.modal input {
    width: 90%;
    padding: 12px;
    margin: 10px 0;
    background: #333;
    border: 1px solid #555;
    color: white;
    font-size: 16px;
}

.modal input:focus {
    border-color: #d35400;
    outline: none;
}

#modal-action-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: #d35400;
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
}

#modal-action-btn:hover {
    background: #e67e22;
}

.switch-auth {
    margin-top: 15px;
    color: #aaa;
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
}

/* Race Selector Styles */
.race-options {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.race-card {
    background: #2c2c2c;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    flex: 1;
    text-align: center;
    transition: all 0.3s ease;
    color: #aaa;
    font-size: 12px;
}

.race-card:hover {
    background: #3a3a3a;
    border-color: #aaa;
}

.race-card.selected {
    background: #d35400;
    color: white;
    border-color: #e67e22;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(211, 84, 0, 0.5);
}

.race-card i {
    display: block;
    font-size: 20px;
    margin-bottom: 5px;
}

.error-msg {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 14px;
}

/* Game UI (Overlay on canvas) - Mu Online Style */
#game-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5000; /* Above everything */
    background: black;
}

canvas {
    display: block;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    font-family: 'Cinzel', serif; /* Classic RPG Font */
}

/* Interactivity for UI elements */
#main-hud, .rpg-window, #menu-bar, #chat-input {
    pointer-events: auto;
}

/* --- HUD Bottom Bar --- */
#main-hud {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to top, #000 0%, transparent 100%);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 10px;
}

.orb-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 20px;
}

.orb {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #222;
    border: 4px solid #555;
    box-shadow: inset 0 0 20px #000;
    position: relative;
    overflow: hidden;
}

.orb.hp-orb { border-color: #500; }
.orb.mp-orb { border-color: #005; }

.liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    transition: height 0.3s ease-out;
}

#hp-liquid { background: linear-gradient(to top, #800, #f00); box-shadow: 0 0 20px #f00; }
#mp-liquid { background: linear-gradient(to top, #008, #00f); box-shadow: 0 0 20px #00f; }

.orb-label {
    position: absolute;
    bottom: -20px;
    width: 100%;
    text-align: center;
    color: #aaa;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

.middle-bar {
    width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.action-bar {
    display: flex;
    gap: 5px;
    background: rgba(0,0,0,0.6);
    padding: 5px;
    border: 1px solid #444;
    border-radius: 5px;
}

.skill-slot {
    width: 40px;
    height: 40px;
    background: #222;
    border: 1px solid #666;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
}

.skill-slot:hover { border-color: #d35400; color: #d35400; }

.xp-bar-container {
    width: 100%;
    height: 8px;
    background: #111;
    border: 1px solid #444;
    border-radius: 4px;
    overflow: hidden;
}

.xp-bar {
    height: 100%;
    background: #f39c12;
    box-shadow: 0 0 5px #f39c12;
}

.chat-preview {
    width: 100%;
    height: 100px;
    background: rgba(0,0,0,0.5);
    border: 1px solid #333;
    overflow-y: auto;
    font-size: 12px;
    color: #ddd;
    text-shadow: 1px 1px 1px black;
    padding: 5px;
    margin-bottom: 5px;
}

#chat-input {
    width: 100%;
    background: rgba(0,0,0,0.7);
    border: 1px solid #444;
    color: white;
    padding: 5px;
    font-family: inherit;
}

/* --- Floating Menu Bar --- */
#menu-bar {
    position: absolute;
    bottom: 140px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#menu-bar button {
    background: rgba(0,0,0,0.8);
    border: 1px solid #d35400;
    color: #d35400;
    padding: 8px 15px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    text-align: right;
    transition: all 0.2s;
}

#menu-bar button:hover {
    background: #d35400;
    color: black;
}

/* --- RPG Windows (Inventory, Market, etc.) --- */
.rpg-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 10, 0.95);
    border: 2px solid #555;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    color: #ccc;
    min-width: 300px;
    z-index: 6000;
    border-radius: 2px;
}

/* Special styling for Character Window */
#character-window {
    width: 600px;
    height: 450px;
}

.window-header {
    background: linear-gradient(to right, #222, #444, #222);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #d35400;
    color: #f39c12;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.close-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
}

.close-btn:hover { color: white; }

.window-content {
    padding: 15px;
    display: flex;
    gap: 20px;
    height: calc(100% - 40px); /* Adjust for header */
}

/* Paperdoll Section */
.char-paperdoll {
    width: 250px;
    position: relative;
    background: url('https://via.placeholder.com/250x350/111/333?text=Silhouette') no-repeat center center;
    background-size: contain;
    border: 1px solid #333;
    height: 100%;
}

.equip-slot {
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.6);
    border: 1px solid #666;
    cursor: pointer;
    transition: border-color 0.2s;
}

.equip-slot:hover { border-color: #f39c12; }

/* Positioning slots around silhouette */
.slot-helm { top: 20px; left: 50%; transform: translateX(-50%); }
.slot-armor { top: 80px; left: 50%; transform: translateX(-50%); }
.slot-weapon { top: 80px; left: 20px; }
.slot-shield { top: 80px; right: 20px; }
.slot-boots { bottom: 80px; left: 50%; transform: translateX(-50%); }

.char-stats-summary {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: #aaa;
}

/* Inventory Grid Section */
.inventory-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-gap: 5px;
    margin-top: 10px;
    overflow-y: auto;
    height: 300px;
    background: rgba(0,0,0,0.3);
    padding: 5px;
}

.inv-slot {
    width: 40px;
    height: 40px;
    background: #222;
    border: 1px solid #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.inv-slot:hover { border-color: #ccc; }
.inv-slot img { max-width: 90%; max-height: 90%; }
.inv-slot .qty { 
    position: absolute; 
    bottom: 1px; 
    right: 2px; 
    font-size: 10px; 
    color: white; 
    text-shadow: 1px 1px 0 #000;
}

.gold-display {
    color: #f1c40f;
    font-weight: bold;
    margin-bottom: 5px;
    text-align: right;
    font-size: 14px;
}

/* Market & Crafting styles update */
.market-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.market-controls button {
    flex: 1;
    background: #333;
    border: 1px solid #555;
    color: #ccc;
    padding: 8px;
    cursor: pointer;
}

.market-controls button:hover {
    background: #444;
    color: white;
}

#market-list, #recipes-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

#market-list li, #recipes-list li {
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid #333;
    padding: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

#market-list li:hover, #recipes-list li:hover {
    background: rgba(255,255,255,0.05);
}
