/* Knight Online v1299 KOPanel - Dark Fantasy Stylesheet */
:root {
    --bg-void: #08090e;
    --bg-panel: rgba(16, 18, 26, 0.92);
    --bg-card: rgba(21, 24, 34, 0.94);
    --bg-elev: #1b1f2d;
    --border-gold: rgba(212, 168, 79, 0.34);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --gold: #eab95c;
    --gold-bright: #ffd984;
    --gold-dim: #9e7b3a;
    --karus: #e0523c;
    --karus-glow: rgba(224, 82, 60, 0.35);
    --elmo: #4895f5;
    --elmo-glow: rgba(72, 149, 245, 0.35);
    --online: #2ecc71;
    --text: #e6e3dc;
    --text-muted: #98959e;
    --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg-void);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--gold-bright); }

/* Ambient Video Backdrop (reuses htdocs k2homekobg.mp4) */
.bg-video-wrap {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background: radial-gradient(circle at 50% 15%, #1d1522 0%, #08090e 70%);
}
.bg-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.22;
    filter: saturate(1.15) contrast(1.05);
}
.bg-vignette {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(ellipse at top, rgba(24, 18, 28, 0.45), rgba(8, 9, 14, 0.94) 70%);
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Top Status Strip */
.topbar {
    background: rgba(7, 8, 13, 0.96);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12.5px;
    padding: 7px 0;
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.status-pills { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.status-dot.on { background: var(--online); box-shadow: 0 0 8px var(--online); }
.status-dot.off { background: #e74c3c; box-shadow: 0 0 8px #e74c3c; }

/* Main Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(12, 14, 21, 0.93);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-gold);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 70px;
}
.brand-logo { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-logo img { height: 48px; width: 48px; object-fit: contain; display: block; border-radius: 8px; }
.brand-text strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16.5px;
    letter-spacing: 0.9px;
    color: var(--gold-bright);
    line-height: 1.1;
}
.brand-text small {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1.4px;
    margin-top: 2px;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    flex-wrap: wrap;
}
.nav-links > li { position: relative; }
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 13px;
    border-radius: 7px;
    color: #dad6cd;
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: 0.2px;
}
.nav-link:hover, .nav-link.active {
    background: rgba(234, 185, 92, 0.12);
    color: var(--gold-bright);
}
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: #141722;
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.72);
    display: none;
    z-index: 90;
}
.nav-links > li:hover .dropdown { display: block; }
.dropdown a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: #d6d2c9;
    font-size: 13px;
}
.dropdown a:hover { background: rgba(234, 185, 92, 0.14); color: var(--gold-bright); }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.18s ease;
}
.btn-gold {
    background: linear-gradient(180deg, #e7b557 0%, #b98229 100%);
    color: #140f08;
    border-color: #f4cf7c;
    box-shadow: 0 4px 14px rgba(234, 185, 92, 0.28);
}
.btn-gold:hover { filter: brightness(1.08); color: #0c0804; transform: translateY(-1px); }
.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-color: var(--border-subtle);
}
.btn-ghost:hover { border-color: var(--border-gold); color: var(--gold-bright); }
.btn-karus { background: rgba(224, 82, 60, 0.16); color: #ff8c78; border-color: rgba(224, 82, 60, 0.45); }
.btn-elmo { background: rgba(72, 149, 245, 0.16); color: #8bc0ff; border-color: rgba(72, 149, 245, 0.45); }

/* Hero Section */
.hero {
    position: relative;
    margin: 22px 0 28px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-gold);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
    min-height: 360px;
    display: flex;
    align-items: flex-end;
    background: #0c0d14;
}
.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.82;
    transition: opacity 0.6s ease;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 9, 14, 0.25) 0%, rgba(8, 9, 14, 0.76) 55%, rgba(8, 9, 14, 0.96) 100%);
}
.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 32px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(234, 185, 92, 0.16);
    border: 1px solid var(--border-gold);
    color: var(--gold-bright);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.hero h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(26px, 3.6vw, 42px);
    color: #fff6e0;
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.85);
    line-height: 1.15;
    margin-bottom: 10px;
}
.hero p { max-width: 620px; color: #cbc6bc; font-size: 14.5px; margin-bottom: 18px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }

.nation-card {
    background: rgba(13, 15, 23, 0.88);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 310px;
    backdrop-filter: blur(8px);
}
.nation-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; }
.nation-crest-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.nation-side { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; }
.nation-side img { width: 32px; height: 32px; }
.balance-bar {
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    display: flex;
    background: #101219;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.bar-karus { background: linear-gradient(90deg, #a62519, #e4573e); }
.bar-elmo { background: linear-gradient(90deg, #2b71cb, #58a6ff); }

/* Layout Grid */
.main-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    margin-bottom: 48px;
}
@media (max-width: 960px) {
    .main-grid { grid-template-columns: 1fr; }
}

.panel-box {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-top: 2px solid var(--border-gold);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
}
.panel-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    color: var(--gold-bright);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* Form Elements */
.input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: #0d0f17;
    color: var(--text);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.15s ease;
}
.input:focus, select:focus, textarea:focus { border-color: var(--gold); }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12.5px; color: var(--text-muted); margin-bottom: 5px; }

/* Tab Bar & Faction Tags */
.race-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab-btn {
    padding: 7px 14px;
    border-radius: 7px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}
.tab-btn.active {
    background: rgba(234, 185, 92, 0.16);
    border-color: var(--gold);
    color: var(--gold-bright);
}

.race-faction-tag {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    margin-bottom: 4px;
}
.tag-karus { background: rgba(224, 82, 60, 0.2); color: #ff8e7c; border: 1px solid rgba(224, 82, 60, 0.45); }
.tag-elmo { background: rgba(72, 149, 245, 0.2); color: #8ec5ff; border: 1px solid rgba(72, 149, 245, 0.45); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.ko-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.ko-table th {
    text-align: left;
    padding: 11px 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--gold);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-gold);
}
.ko-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}
.ko-table tr:hover td { background: rgba(234, 185, 92, 0.05); }

.inline-icon { width: 20px; height: 20px; vertical-align: middle; margin-right: 4px; border-radius: 3px; }
.online-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    color: var(--online);
    background: rgba(46, 204, 113, 0.14);
    border: 1px solid rgba(46, 204, 113, 0.36);
    margin-left: 6px;
}

/* Character Paperdoll & Bag */
.profile-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
}
@media (max-width: 860px) { .profile-grid { grid-template-columns: 1fr; } }

.paperdoll-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.equip-grid {
    display: grid;
    grid-template-columns: repeat(3, 56px);
    gap: 8px;
    background: radial-gradient(circle at center, rgba(234, 185, 92, 0.09), rgba(10, 12, 18, 0.96));
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border-gold);
    width: fit-content;
}
.bag-grid {
    display: grid;
    grid-template-columns: repeat(7, 48px);
    gap: 6px;
    background: #0c0e15;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
}
.item-slot {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 6px;
    background: #141722;
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
}
.bag-grid .item-slot { width: 48px; height: 48px; }
.item-slot.filled { border-color: var(--border-gold); cursor: pointer; }
.item-slot img { width: 42px; height: 42px; border-radius: 4px; display: block; }
.bag-grid .item-slot img { width: 38px; height: 38px; }
.item-count {
    position: absolute;
    right: 3px;
    bottom: 2px;
    font-size: 10.5px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.78);
    padding: 0 3px;
    border-radius: 3px;
}

/* Floating Tooltip */
#ko-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    display: none;
    min-width: 220px;
    max-width: 310px;
    background: rgba(11, 13, 20, 0.97);
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
    font-size: 12.5px;
}

/* Stat Bars */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}
.stat-pill {
    background: #11141e;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 7px 10px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}
.stat-pill span { color: var(--text-muted); }
.stat-pill strong { color: var(--gold-bright); }

.hp-bar, .mp-bar, .exp-bar {
    height: 18px;
    background: #11131b;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    margin-bottom: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.hp-fill { height: 100%; background: linear-gradient(90deg, #991b1b, #ef4444); }
.mp-fill { height: 100%; background: linear-gradient(90deg, #1d4ed8, #3b82f6); }
.exp-fill { height: 100%; background: linear-gradient(90deg, #a16207, #eab308); }
.bar-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px #000;
}

/* Item Cards (Exchange / Upgrades / PUS) */
.icon-selector { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.icon-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #11141f;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    min-width: 96px;
    text-align: center;
    font-size: 11.5px;
    color: var(--text-muted);
}
.icon-choice img { width: 40px; height: 40px; border-radius: 5px; }
.icon-choice.active, .icon-choice:hover {
    border-color: var(--gold);
    color: var(--gold-bright);
    background: rgba(234, 185, 92, 0.10);
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13.5px;
}
.alert-ok { background: rgba(46, 204, 113, 0.14); border: 1px solid rgba(46, 204, 113, 0.45); color: #8ff0b3; }
.alert-err { background: rgba(231, 76, 60, 0.16); border: 1px solid rgba(231, 76, 60, 0.45); color: #ff9c91; }

.drop-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.drop-chip {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: #d6d2c9;
    font-size: 12px;
    font-weight: 600;
}
.drop-chip:hover, .drop-chip.active {
    border-color: var(--gold);
    color: var(--gold-bright);
    background: rgba(234, 185, 92, 0.14);
}

.admin-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}
.admin-inline-form label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    color: var(--text-muted);
}
.admin-inline-form .input,
.admin-inline-form select {
    padding: 5px 8px;
    font-size: 12.5px;
}
@media (max-width: 900px) {
    .admin-two-col { grid-template-columns: 1fr !important; }
}

.footer {
    border-top: 1px solid var(--border-gold);
    background: rgba(8, 9, 14, 0.96);
    padding: 26px 0;
    color: var(--text-muted);
    font-size: 13px;
}
