/* ============================================================================
   RAGNAROK ONLINE 3 — STATE-OF-THE-ART MODERN MMORPG HUD & UI DESIGN SYSTEM
   Aesthetic: "Midgard Celestial Glass & Royal Brass"
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
    /* Core Surfaces — Celestial Obsidian Glass */
    --ro3-bg-deep: rgba(9, 13, 22, 0.92);
    --ro3-bg-glass: rgba(14, 20, 34, 0.82);
    --ro3-bg-glass-hover: rgba(22, 31, 52, 0.90);
    --ro3-bg-elevated: rgba(20, 28, 46, 0.94);
    --ro3-bg-slot: rgba(8, 12, 21, 0.88);
    --ro3-bg-slot-hover: rgba(26, 38, 64, 0.92);

    /* Royal Brass & Champagne Gold Accents */
    --ro3-gold-bright: #f6d88c;
    --ro3-gold: #d4af37;
    --ro3-gold-muted: #9a7b2c;
    --ro3-gold-border: rgba(212, 175, 55, 0.42);
    --ro3-gold-border-strong: rgba(246, 216, 140, 0.78);
    --ro3-gold-glow: rgba(212, 175, 55, 0.24);

    /* Prontera Rune Azure & Vital Gauges */
    --ro3-azure: #38bdf8;
    --ro3-azure-deep: #0284c7;
    --ro3-hp-start: #dc2626;
    --ro3-hp-end: #f87171;
    --ro3-sp-start: #1d4ed8;
    --ro3-sp-end: #38bdf8;
    --ro3-exp-start: #d97706;
    --ro3-exp-end: #fbbf24;
    --ro3-emerald: #10b981;

    /* Typography & Text Colors */
    --ro3-text-primary: #f1f5f9;
    --ro3-text-secondary: #94a3b8;
    --ro3-text-muted: #64748b;
    --ro3-font-display: 'Cinzel', Georgia, serif;
    --ro3-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --ro3-font-mono: 'JetBrains Mono', monospace;

    /* Shadows & Blur */
    --ro3-shadow-lg: 0 18px 42px -8px rgba(0, 0, 0, 0.78), 0 4px 14px rgba(0, 0, 0, 0.55);
    --ro3-shadow-md: 0 10px 26px -4px rgba(0, 0, 0, 0.65);
    --ro3-inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: #070a12;
    color: var(--ro3-text-primary);
    font-family: var(--ro3-font-sans);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: rgba(8, 12, 20, 0.5);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.45);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--ro3-gold-bright);
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #070a12;
}

/* Subtle cinematic vignette around the 3D viewport */
#game-container::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 62%, rgba(4, 7, 15, 0.48) 100%);
    z-index: 2;
}

canvas#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    cursor: crosshair;
    z-index: 1;
}

/* ============================================================================
   RO3 WINDOW FRAME ARCHITECTURE
   ============================================================================ */
.ro-window {
    position: absolute;
    background: linear-gradient(165deg, rgba(19, 27, 46, 0.90) 0%, rgba(10, 14, 24, 0.94) 100%);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--ro3-gold-border);
    outline: 1px solid rgba(5, 8, 15, 0.85);
    box-shadow: var(--ro3-shadow-lg), var(--ro3-inner-highlight);
    border-radius: 10px;
    color: var(--ro3-text-primary);
    z-index: 20;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.ro-window:hover {
    border-color: rgba(212, 175, 55, 0.58);
}

.ro-header {
    position: relative;
    background: linear-gradient(90deg, rgba(30, 41, 68, 0.95) 0%, rgba(16, 23, 39, 0.95) 65%, rgba(35, 29, 20, 0.88) 100%);
    padding: 9px 14px;
    font-family: var(--ro3-font-display);
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 1.2px;
    color: var(--ro3-gold-bright);
    border-bottom: 1px solid var(--ro3-gold-border);
    border-radius: 9px 9px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.ro-header::before {
    content: "◆";
    font-size: 9px;
    color: var(--ro3-gold);
    margin-right: 7px;
    opacity: 0.9;
}

.ro-header > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.ro-close-btn {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #fca5a5;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ro-close-btn:hover {
    background: #ef4444;
    border-color: #f87171;
    color: #ffffff;
    transform: scale(1.06);
}

/* ============================================================================
   TOP-LEFT HERO STATUS HUD (#char-bar) — RO3 CREST & GAUGES
   ============================================================================ */
#char-bar {
    top: 16px;
    left: 16px;
    width: 332px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(15, 22, 38, 0.88) 0%, rgba(9, 13, 23, 0.92) 100%);
    border: 1px solid var(--ro3-gold-border);
}

.ro3-hero-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.ro3-avatar-medallion {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: radial-gradient(circle at 50% 35%, #1e2d4a 0%, #090d16 100%);
    border: 1.5px solid var(--ro3-gold);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 0 12px rgba(56, 189, 248, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.ro3-avatar-medallion img {
    width: 92%;
    height: 92%;
    object-fit: contain;
    image-rendering: pixelated;
    transform: translateY(1px);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.85));
}

.ro3-lv-orb {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: linear-gradient(135deg, #f59e0b, #b45309);
    color: #fff;
    font-family: var(--ro3-font-mono);
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 6px 0 6px 0;
    border: 1px solid var(--ro3-gold-bright);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.65);
}

.ro3-hero-identity {
    flex: 1;
    min-width: 0;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
}

#char-name {
    font-family: var(--ro3-font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--ro3-gold-bright) !important;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ro3-sub-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--ro3-text-secondary);
}

#char-level {
    font-family: var(--ro3-font-mono);
    font-size: 10.5px;
    color: #cbd5e1;
}

.ro3-zeny-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--ro3-font-mono);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ro3-gold-bright);
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.32);
    padding: 1px 7px;
    border-radius: 999px;
}

/* Vital Gauge Bars */
.ro3-gauge-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
}

.ro3-gauge-label {
    font-family: var(--ro3-font-mono);
    font-size: 9.5px;
    font-weight: 700;
    width: 24px;
    letter-spacing: 0.5px;
    color: var(--ro3-text-secondary);
}

.progress-bar-bg {
    flex: 1;
    background: rgba(6, 9, 16, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 6px;
    height: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.75);
}

.progress-bar-bg.exp-slim {
    height: 11px;
}

.progress-bar-fill {
    height: 100%;
    transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.progress-bar-fill::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent);
}

.hp-fill {
    background: linear-gradient(90deg, #991b1b 0%, #dc2626 55%, #f87171 100%);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
}

.sp-fill {
    background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 55%, #38bdf8 100%);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.exp-fill {
    background: linear-gradient(90deg, #92400e 0%, #d97706 55%, #fbbf24 100%);
}

.bar-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ro3-font-mono);
    font-size: 9.5px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
    letter-spacing: 0.2px;
}

/* RO3 Menu Action Dock inside Hero Bar */
.ro3-menu-dock {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.ro3-dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 3px;
    background: rgba(18, 26, 44, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 7px;
    color: var(--ro3-text-primary);
    font-family: var(--ro3-font-sans);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ro3-dock-btn:hover {
    background: rgba(212, 175, 55, 0.16);
    border-color: var(--ro3-gold);
    color: var(--ro3-gold-bright);
    transform: translateY(-1px);
}

.ro3-dock-btn .dock-kbd {
    font-family: var(--ro3-font-mono);
    font-size: 8.5px;
    color: var(--ro3-gold);
    opacity: 0.9;
}

/* Active Buffs Strip */
#buffs-bar {
    display: flex;
    gap: 5px;
    margin-top: 7px;
    flex-wrap: wrap;
}

/* ============================================================================
   TOP-CENTER TARGET LOCK-ON BAR (#target-bar)
   ============================================================================ */
#target-bar {
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 340px;
    max-width: 420px;
    padding: 9px 16px 11px;
    display: none;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(24, 15, 25, 0.92) 0%, rgba(12, 10, 18, 0.95) 100%);
    border: 1px solid rgba(248, 113, 113, 0.55);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.72), 0 0 18px rgba(220, 38, 38, 0.2);
    text-align: center;
}

.ro3-target-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 5px;
}

.ro3-target-diamond {
    color: #f87171;
    font-size: 10px;
}

#target-name {
    font-family: var(--ro3-font-display);
    font-weight: 700;
    font-size: 13px;
    color: #fecaca !important;
    letter-spacing: 0.6px;
}

.ro3-target-hp-track {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: 999px;
    overflow: hidden;
}

#target-hp-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #fb7185);
    transition: width 0.18s ease;
}

/* ============================================================================
   TOP-RIGHT COMPASS MINIMAP & QUEST TRACKER
   ============================================================================ */
#minimap-container {
    top: 16px;
    right: 16px;
    width: 172px;
    height: 196px;
    border: 1.5px solid var(--ro3-gold-border-strong);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(8, 12, 22, 0.92);
    display: flex;
    flex-direction: column;
    box-shadow: var(--ro3-shadow-lg);
}

.ro3-minimap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    background: linear-gradient(90deg, rgba(24, 34, 56, 0.96), rgba(15, 22, 36, 0.96));
    border-bottom: 1px solid var(--ro3-gold-border);
    font-size: 10.5px;
}

#minimap-map-name {
    font-family: var(--ro3-font-display);
    font-weight: 700;
    color: var(--ro3-gold-bright);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

#minimap-coords {
    font-family: var(--ro3-font-mono);
    font-size: 9.5px;
    color: var(--ro3-azure);
}

canvas#minimapCanvas {
    flex: 1;
    width: 100%;
    height: 146px;
    display: block;
}

.ro3-minimap-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 8px;
    background: rgba(9, 13, 22, 0.95);
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    font-size: 9.5px;
    color: var(--ro3-text-secondary);
}

.ro3-mini-icon-btn {
    background: none;
    border: none;
    color: var(--ro3-text-secondary);
    cursor: pointer;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 4px;
}
.ro3-mini-icon-btn:hover {
    color: var(--ro3-gold-bright);
    background: rgba(212, 175, 55, 0.15);
}

/* Quest Tracker (Right below Minimap) */
#quest-tracker {
    position: absolute;
    top: 222px;
    right: 16px;
    width: 248px;
    max-height: 210px;
    overflow-y: auto;
    padding: 10px 12px;
    background: linear-gradient(160deg, rgba(14, 20, 34, 0.84) 0%, rgba(9, 13, 22, 0.90) 100%);
    border: 1px solid var(--ro3-gold-border);
    border-left: 3px solid var(--ro3-gold);
    border-radius: 10px;
    color: var(--ro3-text-primary);
    font-size: 11.5px;
    pointer-events: auto;
    z-index: 20;
}

.ro3-quest-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--ro3-font-display);
    font-weight: 700;
    font-size: 11.5px;
    color: var(--ro3-gold-bright);
    letter-spacing: 0.7px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.22);
    padding-bottom: 5px;
    margin-bottom: 7px;
}

/* Texture Scale Tuner (Toggled from Top-Right Minimap Footer or Hero Bar) */
#ro-style-tuner {
    position: fixed;
    top: 222px;
    right: 274px;
    width: 195px;
    padding: 10px 12px;
    z-index: 120;
    font-size: 11px;
    color: var(--ro3-text-primary);
    display: none;
}

/* ============================================================================
   BOTTOM-CENTER ACTION SKILL DOCK (#quick-bar) — RO3 COMBAT BAR
   ============================================================================ */
#quick-bar-wrapper {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#quick-bar {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    display: flex;
    gap: 7px;
    padding: 8px 12px;
    background: linear-gradient(180deg, rgba(18, 26, 44, 0.92) 0%, rgba(9, 13, 23, 0.96) 100%);
    border: 1.5px solid var(--ro3-gold-border-strong);
    border-radius: 12px;
    box-shadow: var(--ro3-shadow-lg), 0 0 24px rgba(0, 0, 0, 0.65);
}

#quick-bar::before,
#quick-bar::after {
    content: "❖";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ro3-gold);
    font-size: 11px;
    pointer-events: none;
    opacity: 0.85;
}
#quick-bar::before { left: -14px; }
#quick-bar::after  { right: -14px; }

.quick-slot {
    width: 48px;
    height: 48px;
    background: radial-gradient(circle at 50% 30%, #1a2640 0%, #0b101c 100%);
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.75);
    transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.quick-slot:hover {
    border-color: var(--ro3-gold-bright);
    background: radial-gradient(circle at 50% 30%, #243558 0%, #101728 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6), 0 0 10px var(--ro3-gold-glow);
}

.quick-slot:active {
    transform: translateY(0px) scale(0.95);
}

.slot-key {
    position: absolute;
    top: 2px;
    left: 4px;
    font-family: var(--ro3-font-mono);
    font-size: 9.5px;
    color: var(--ro3-gold-bright);
    font-weight: 700;
    background: rgba(8, 12, 20, 0.78);
    padding: 0 3.5px;
    border-radius: 3px;
    line-height: 13px;
}

.slot-icon {
    font-size: 20px;
}

.quick-slot.empty {
    opacity: 0.52;
    border: 1px dashed rgba(148, 163, 184, 0.26);
}

.quick-slot.empty:hover {
    opacity: 0.85;
    border-color: var(--ro3-gold);
}

.quick-slot.no-sp {
    opacity: 0.48;
    filter: grayscale(0.85);
}

.quick-slot.no-sp .slot-sp {
    color: #f87171 !important;
}

.slot-sp {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-family: var(--ro3-font-mono);
    font-size: 8.5px;
    color: var(--ro3-azure);
    font-weight: 700;
    pointer-events: none;
    text-shadow: 0 1px 2px #000;
}

.item-slot.utility-item-draggable {
    cursor: grab;
}

.item-slot.utility-item-draggable:active,
.item-slot.utility-item-draggable.dragging {
    cursor: grabbing;
    opacity: 0.72;
    border-color: #00f5d4 !important;
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.5);
}

#quick-bar.hotbar-drop-ready {
    border-color: #00f5d4;
    box-shadow: var(--ro3-shadow-lg), 0 0 22px rgba(0, 245, 212, 0.42);
}

.quick-slot.drag-over {
    opacity: 1 !important;
    border: 1.5px solid #00f5d4 !important;
    background: radial-gradient(circle at 50% 30%, rgba(0, 245, 212, 0.35) 0%, #101728 100%) !important;
    transform: translateY(-4px) scale(1.06) !important;
    box-shadow: 0 0 16px #00f5d4, inset 0 0 10px rgba(0, 245, 212, 0.45) !important;
}

.quick-slot.quick-slot-item {
    border-color: rgba(46, 204, 113, 0.48);
}


/* ============================================================================
   BOTTOM-LEFT CHAT CONSOLE (#chat-window)
   ============================================================================ */
#chat-window {
    bottom: 14px;
    left: 16px;
    width: 400px;
    height: 224px;
    background: linear-gradient(180deg, rgba(11, 16, 28, 0.78) 0%, rgba(7, 11, 20, 0.92) 100%);
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    transition: opacity 0.25s ease, border-color 0.2s ease, background 0.2s ease;
}

#chat-window:hover,
#chat-window:focus-within {
    background: linear-gradient(180deg, rgba(14, 20, 35, 0.92) 0%, rgba(9, 13, 24, 0.97) 100%);
    border-color: var(--ro3-gold-border-strong);
}

.ro3-chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    background: rgba(16, 23, 39, 0.88);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 9px 9px 0 0;
    cursor: move;
}

.ro3-chat-tabs {
    display: flex;
    gap: 4px;
}

.ro3-chat-tab {
    background: transparent;
    border: 1px solid transparent;
    color: var(--ro3-text-secondary);
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 5px;
    cursor: pointer;
}

.ro3-chat-tab.active,
.ro3-chat-tab:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.38);
    color: var(--ro3-gold-bright);
}

.ro3-chat-quickcmds {
    display: flex;
    gap: 3px;
}

.ro3-cmd-pill {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #7dd3fc;
    font-family: var(--ro3-font-mono);
    font-size: 9.5px;
    padding: 1px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.12s ease;
}
.ro3-cmd-pill:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #fff;
}

#chat-log {
    flex: 1;
    padding: 8px 11px;
    overflow-y: auto;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.chat-msg {
    line-height: 1.42;
    word-break: break-word;
}

#chat-input-container {
    display: flex;
    align-items: center;
    background: rgba(6, 9, 17, 0.9);
    border-top: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 0 0 9px 9px;
    padding: 0 8px;
}

.ro3-chat-prompt {
    font-family: var(--ro3-font-mono);
    font-size: 10px;
    color: var(--ro3-gold);
    margin-right: 6px;
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 4px;
    color: var(--ro3-text-primary);
    outline: none;
    font-family: var(--ro3-font-sans);
    font-size: 12px;
}

/* ============================================================================
   STATS WINDOW (#stats-window)
   ============================================================================ */
#stats-window {
    top: 120px;
    left: 362px;
    width: 340px;
    display: none;
}

.stat-grid {
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    font-size: 12.5px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(8, 12, 22, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.16);
    padding: 6px 10px;
    border-radius: 7px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.stat-item:hover {
    border-color: rgba(212, 175, 55, 0.42);
}

.stat-item.has-mod {
    border-color: rgba(74, 222, 128, 0.35);
    background: rgba(12, 24, 28, 0.82);
}

.stat-item.has-neg-mod {
    border-color: rgba(248, 113, 113, 0.35);
}

.stat-item > span:first-child {
    font-family: var(--ro3-font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--ro3-gold-bright);
    letter-spacing: 0.4px;
}

.stat-val-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-item strong {
    font-family: var(--ro3-font-mono);
    font-size: 12.5px;
    color: #fff;
}

.stat-mod {
    font-family: var(--ro3-font-mono);
    font-size: 11px;
    font-weight: 700;
    display: none;
    padding: 1px 4px;
    border-radius: 4px;
    line-height: 1.2;
}

.stat-mod.positive {
    display: inline-block;
    color: #4ade80;
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(74, 222, 128, 0.32);
}

.stat-mod.negative {
    display: inline-block;
    color: #f87171;
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(248, 113, 113, 0.32);
}

.stat-modifiers-panel {
    margin: 0 12px 10px 12px;
    padding: 8px 10px;
    background: rgba(7, 11, 20, 0.82);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 7px;
    font-size: 11px;
    color: #cbd5e1;
    max-height: 150px;
    overflow-y: auto;
}

.stat-modifiers-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ro3-gold-bright);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-modifiers-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.stat-mod-pill {
    font-family: var(--ro3-font-mono);
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(74, 222, 128, 0.32);
    color: #4ade80;
}

.stat-mod-pill.neg {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(248, 113, 113, 0.32);
    color: #f87171;
}

.stat-mod-source-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    border-top: 1px dashed rgba(148, 163, 184, 0.12);
    font-size: 10.5px;
    color: #94a3b8;
}

.stat-mod-source-row strong {
    color: #e2e8f0;
    font-weight: 600;
}

.btn-add-stat {
    background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
    border: 1px solid var(--ro3-gold-bright);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 800;
    font-size: 12px;
    line-height: 18px;
    margin-left: 3px;
    transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-add-stat:hover {
    filter: brightness(1.15);
    transform: scale(1.08);
}

.ro3-window-footer {
    padding: 9px 14px;
    background: rgba(7, 10, 18, 0.85);
    border-top: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 0 0 9px 9px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--ro3-text-secondary);
}

/* ============================================================================
   INVENTORY WINDOW (#inventory-window)
   ============================================================================ */
#inventory-window {
    top: 120px;
    right: 280px;
    width: 336px;
    display: none;
}

.ro3-inv-tabs {
    display: flex;
    gap: 5px;
    padding: 8px 12px 2px;
}

.ro3-inv-tab {
    flex: 1;
    background: rgba(10, 15, 26, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: var(--ro3-text-secondary);
    font-size: 10.5px;
    font-weight: 600;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.14s ease;
}

.ro3-inv-tab.active,
.ro3-inv-tab:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: var(--ro3-gold);
    color: var(--ro3-gold-bright);
}

.item-grid {
    padding: 10px 12px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-height: 270px;
    min-height: 170px;
    overflow-y: auto;
}

.item-slot {
    width: 52px;
    height: 52px;
    background: radial-gradient(circle at 50% 35%, #1a253d 0%, #0b101d 100%);
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.14s ease;
}

.item-slot:hover {
    border-color: var(--ro3-gold-bright);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.55), 0 0 8px var(--ro3-gold-glow);
}

.item-slot.equipped {
    border-color: var(--ro3-gold);
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.35);
}

.item-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-family: var(--ro3-font-mono);
    font-size: 9.5px;
    font-weight: 700;
    color: #f8fafc;
    background: rgba(7, 10, 18, 0.82);
    padding: 0 3.5px;
    border-radius: 3px;
}

/* ============================================================================
   EQUIPMENT WINDOW (#equipment-window) — RO3 PAPERDOLL SILHOUETTE
   ============================================================================ */
#equipment-window {
    top: 120px;
    left: 640px;
    width: 460px;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
    overflow: hidden;
    display: none;
}

.ro3-paperdoll-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 106px minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
}

.ro3-paperdoll-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.ro3-paperdoll-stage {
    background: radial-gradient(ellipse at 50% 60%, rgba(56, 189, 248, 0.16) 0%, rgba(10, 15, 28, 0.92) 75%);
    border: 1px solid var(--ro3-gold-border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 8px 4px;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.8);
}

.ro3-paperdoll-stage::after {
    content: "";
    width: 58px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.45) 0%, transparent 72%);
    margin-top: -6px;
}

#equip-paperdoll-img {
    width: 64px;
    height: 120px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.85));
    z-index: 1;
}

.ro3-paperdoll-job {
    font-family: var(--ro3-font-display);
    font-size: 9.5px;
    color: var(--ro3-gold-bright);
    letter-spacing: 0.8px;
    margin-top: 6px;
    text-transform: uppercase;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.equip-container {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.equip-slot-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(9, 14, 24, 0.78);
    padding: 5px 8px;
    border-radius: 7px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    transition: border-color 0.15s ease;
    min-width: 0;
}

.equip-slot-row:hover {
    border-color: var(--ro3-gold-border);
}

.equip-slot-label {
    font-size: 9.5px;
    color: var(--ro3-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.equip-slot-box {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(6, 9, 16, 0.85);
    padding: 4px 6px;
    border-radius: 5px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    font-size: 11px;
    min-height: 28px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.equip-slot-box img {
    flex-shrink: 0;
}

.equip-slot-box.equip-drop-ready {
    border: 1px dashed rgba(0, 245, 212, 0.75) !important;
    background: rgba(0, 245, 212, 0.08) !important;
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.25);
    transition: all 0.14s ease;
}

.equip-slot-box.drag-over {
    border: 2px solid #00f5d4 !important;
    background: rgba(0, 245, 212, 0.22) !important;
    box-shadow: 0 0 16px rgba(0, 245, 212, 0.65), inset 0 0 8px rgba(0, 245, 212, 0.3) !important;
    transform: scale(1.02);
}

.equip-slot-name {
    color: #34d399;
    font-weight: 700;
    margin-left: 1px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.equip-2h-badge {
    flex-shrink: 0;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.3px;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.22);
    border: 1px solid rgba(245, 158, 11, 0.55);
    color: #fbbf24;
    text-transform: uppercase;
}

.equip-slot-box:hover {
    border-color: var(--ro3-gold-bright);
    background: rgba(24, 34, 56, 0.85);
}

.equip-slot-box.equipped {
    border-color: rgba(16, 185, 129, 0.6);
    background: rgba(16, 185, 129, 0.12);
}

.equip-slot-box.equipped.two-handed-offhand {
    border-color: rgba(16, 185, 129, 0.45);
    border-style: dashed;
    background: rgba(16, 185, 129, 0.08);
}

.equip-slot-box.equipped.two-handed-offhand .equip-slot-name {
    color: #6ee7b7;
}

/* ============================================================================
   SKILLS WINDOW (#skills-window)
   ============================================================================ */
#skills-window {
    top: 120px;
    left: 362px;
    width: 490px !important;
    max-width: calc(100vw - 32px) !important;
    box-sizing: border-box;
    display: none;
}

#skills-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 6px;
    padding: 10px 12px !important;
    max-height: min(420px, calc(100vh - 210px)) !important;
    overflow-y: auto;
    overflow-x: hidden !important;
    box-sizing: border-box;
}

/* ============================================================================
   NPC DIALOG & SHOP MODALS
   ============================================================================ */
#npc-dialog {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 440px;
    display: none;
    z-index: 50;
}

.dialog-body {
    padding: 16px;
    font-size: 13.5px;
    line-height: 1.55;
}

.dialog-options {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dialog-btn {
    background: rgba(20, 29, 48, 0.9);
    border: 1px solid var(--ro3-gold-border);
    color: var(--ro3-text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    font-family: var(--ro3-font-sans);
    transition: all 0.15s;
}

.dialog-btn:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: var(--ro3-gold-bright);
    color: var(--ro3-gold-bright);
}

#shop-window {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    display: none;
    z-index: 50;
}

.shop-list {
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(14, 20, 34, 0.85);
    padding: 8px 10px;
    border-radius: 7px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.btn-buy {
    background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
    border: 1px solid var(--ro3-gold-bright);
    color: white;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    font-size: 11.5px;
}

.btn-buy:hover {
    filter: brightness(1.12);
}

/* ============================================================================
   RO3 CHARACTER CREATION / LOGIN SCREEN (#login-modal)
   ============================================================================ */
#login-modal {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 50% 22%, rgba(56, 189, 248, 0.16) 0%, transparent 52%),
        radial-gradient(circle at 50% 85%, rgba(212, 175, 55, 0.14) 0%, transparent 48%),
        radial-gradient(circle at center, #11192c 0%, #050811 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    background: linear-gradient(165deg, rgba(18, 26, 44, 0.94) 0%, rgba(9, 13, 24, 0.98) 100%);
    border: 1.5px solid var(--ro3-gold-border-strong);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85), 0 0 42px rgba(212, 175, 55, 0.18), var(--ro3-inner-highlight);
    padding: 28px 30px;
    border-radius: 16px;
    width: 440px;
    text-align: center;
    position: relative;
}

.ro3-crest-subtitle {
    font-family: var(--ro3-font-mono);
    font-size: 10px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--ro3-gold);
    margin-bottom: 4px;
}

.login-box h1 {
    font-family: var(--ro3-font-display);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2.5px;
    color: var(--ro3-gold-bright);
    margin-bottom: 6px;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.35);
}

.login-input {
    width: 100%;
    padding: 11px 14px;
    margin-bottom: 14px;
    background: rgba(7, 10, 18, 0.9);
    border: 1px solid var(--ro3-gold-border);
    border-radius: 8px;
    color: var(--ro3-text-primary);
    font-family: var(--ro3-font-sans);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-input:focus {
    border-color: var(--ro3-gold-bright);
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.25);
}

.ro3-customizer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    margin-bottom: 8px;
    background: rgba(10, 15, 26, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    font-size: 12.5px;
    color: var(--ro3-text-secondary);
}

.ro3-cycle-btn {
    padding: 3px 9px;
    background: rgba(24, 34, 56, 0.9);
    color: var(--ro3-gold-bright);
    border: 1px solid var(--ro3-gold-border);
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.14s ease;
}
.ro3-cycle-btn:hover {
    background: rgba(212, 175, 55, 0.22);
    border-color: var(--ro3-gold-bright);
}

.ro3-gender-btn {
    padding: 4px 12px;
    background: rgba(18, 26, 44, 0.85);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--ro3-font-sans);
    font-size: 12px;
    font-weight: 700;
    transition: all 0.16s ease;
}
.ro3-gender-btn:hover {
    color: #f8fafc;
    border-color: var(--ro3-gold-border-strong);
    background: rgba(212, 175, 55, 0.15);
}
#btn-gender-male.ro3-gender-btn.active {
    background: linear-gradient(135deg, rgba(14, 116, 144, 0.85), rgba(2, 132, 199, 0.92));
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}
#btn-gender-female.ro3-gender-btn.active {
    background: linear-gradient(135deg, rgba(190, 24, 93, 0.85), rgba(236, 72, 153, 0.92));
    color: #ffffff;
    border-color: #f472b6;
    box-shadow: 0 0 12px rgba(244, 114, 182, 0.45);
}

.login-btn {
    width: 100%;
    margin-top: 8px;
    padding: 13px;
    background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
    border: 1px solid var(--ro3-gold-bright);
    border-radius: 9px;
    color: #ffffff;
    font-family: var(--ro3-font-display);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 1.5px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(180, 83, 9, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.login-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

/* ============================================================================
   BOTTOM-LEFT & BOTTOM-RIGHT LEVEL UP / STAT & SKILL POINT NOTIFICATIONS
   ============================================================================ */
@keyframes roNotifPopIn {
    0%   { opacity: 0; transform: translateY(14px) scale(0.92); }
    65%  { opacity: 1; transform: translateY(-2px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes roGoldPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.78), 0 0 14px rgba(251, 191, 36, 0.32); border-color: rgba(251, 191, 36, 0.72); }
    50%      { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.85), 0 0 24px rgba(254, 240, 138, 0.72); border-color: #fef08a; }
}

@keyframes roCyanPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.78), 0 0 14px rgba(56, 189, 248, 0.32); border-color: rgba(56, 189, 248, 0.72); }
    50%      { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.85), 0 0 24px rgba(125, 211, 252, 0.72); border-color: #bae6fd; }
}


/* --- BOTTOM-RIGHT ZONE (Ragnarok Classic Allocation & Level Up Dock) --- */
.ro-levelup-notif-zone-right {
    position: fixed;
    bottom: 16px;
    right: 18px;
    width: 310px;
    z-index: 8600;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.ro-br-points-dock {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ro-br-notif-card {
    pointer-events: auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(18, 26, 46, 0.95) 0%, rgba(8, 12, 22, 0.98) 100%);
    border: 1.5px solid rgba(251, 191, 36, 0.82);
    backdrop-filter: blur(12px);
    cursor: pointer;
    animation: roGoldPulse 2.2s ease-in-out infinite;
    transition: transform 0.16s ease, filter 0.16s ease;
}

.ro-br-notif-card.skill-card {
    border-color: rgba(56, 189, 248, 0.82);
    animation: roCyanPulse 2.2s ease-in-out infinite;
}

.ro-br-notif-card:hover {
    transform: translateY(-2px) scale(1.01);
    filter: brightness(1.1);
}

.ro-br-crest {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: radial-gradient(circle at 50% 35%, rgba(251, 191, 36, 0.32), rgba(15, 23, 42, 0.95));
    border: 1.5px solid #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    flex-shrink: 0;
}

.ro-br-crest.skill-crest {
    background: radial-gradient(circle at 50% 35%, rgba(56, 189, 248, 0.32), rgba(15, 23, 42, 0.95));
    border-color: #38bdf8;
}

.ro-br-count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
    border: 1.5px solid #fef08a;
    color: #ffffff;
    font-family: var(--ro3-font-mono);
    font-size: 10.5px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.ro-br-count-badge.skill-badge {
    background: linear-gradient(180deg, #0284c7 0%, #1d4ed8 100%);
    border-color: #bae6fd;
}

.ro-br-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.ro-br-tag {
    font-family: var(--ro3-font-display);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fde047;
}

.ro-br-tag.skill-tag {
    color: #7dd3fc;
}

.ro-br-main {
    font-family: var(--ro3-font-sans);
    font-size: 12px;
    color: #f8fafc;
}

.ro-br-main strong {
    color: #fef08a;
    font-family: var(--ro3-font-mono);
    font-size: 13.5px;
}

.ro-br-notif-card.skill-card .ro-br-main strong {
    color: #bae6fd;
}

.ro-br-cta {
    font-family: var(--ro3-font-mono);
    font-size: 10px;
    color: #fbbf24;
    font-weight: 700;
}

.ro-br-cta.skill-cta {
    color: #38bdf8;
}

/* --- ANIMATED LEVEL UP TOAST BANNERS (BOTTOM-LEFT & BOTTOM-RIGHT) --- */
.ro-notif-toast-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ro-lvup-toast-banner {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(30, 22, 8, 0.96) 0%, rgba(12, 16, 28, 0.98) 100%);
    border: 1.5px solid #fef08a;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.85), 0 0 22px rgba(251, 191, 36, 0.45);
    color: #f8fafc;
    cursor: pointer;
    animation: roNotifPopIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.ro-lvup-toast-banner.job-toast {
    background: linear-gradient(135deg, rgba(8, 25, 44, 0.96) 0%, rgba(10, 15, 28, 0.98) 100%);
    border-color: #7dd3fc;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.85), 0 0 22px rgba(56, 189, 248, 0.45);
}

/* ============================================================================
   RO3 FALLEN HERO / DEATH & RESPAWN MODAL (#ro-death-modal)
   ============================================================================ */
.ro-death-overlay {
    position: fixed;
    inset: 0;
    z-index: 85;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 96px;
    animation: roDeathFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes roDeathFadeIn {
    0% { opacity: 0; transform: translateY(14px); }
    100% { opacity: 1; transform: translateY(0); }
}

.ro-death-vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(
        circle at 50% 45%,
        rgba(15, 6, 10, 0.05) 0%,
        rgba(45, 8, 14, 0.32) 55%,
        rgba(95, 12, 22, 0.68) 100%
    );
    box-shadow: inset 0 0 120px rgba(180, 20, 35, 0.45);
}

.ro-death-card {
    position: relative;
    pointer-events: auto;
    width: 420px;
    max-width: 92vw;
    background: linear-gradient(165deg, rgba(18, 12, 24, 0.94) 0%, rgba(9, 8, 15, 0.98) 100%);
    border: 1.5px solid rgba(231, 76, 60, 0.65);
    border-top: 2px solid #f6d88c;
    border-radius: 14px;
    padding: 18px 22px 20px;
    box-shadow:
        0 20px 55px rgba(0, 0, 0, 0.92),
        0 0 38px rgba(231, 76, 60, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
    text-align: center;
    color: #f8fafc;
}

.ro-death-crest {
    font-family: var(--ro3-font-display);
    font-size: 10px;
    letter-spacing: 2px;
    color: #f6d88c;
    opacity: 0.9;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.ro-death-title {
    font-family: var(--ro3-font-display);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin: 0 0 4px 0;
    background: linear-gradient(180deg, #fff5f5 0%, #ff8787 55%, #e03131 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 14px rgba(231, 76, 60, 0.45);
}

.ro-death-subtitle {
    font-size: 12px;
    color: #fda4af;
    margin-bottom: 12px;
    font-weight: 500;
}

.ro-death-stage {
    position: relative;
    height: 126px;
    margin: 0 auto 14px;
    border-radius: 12px;
    background:
        radial-gradient(ellipse at 50% 68%, rgba(225, 29, 72, 0.24) 0%, rgba(15, 23, 42, 0.72) 58%, rgba(6, 9, 16, 0.95) 100%);
    border: 1px solid rgba(246, 216, 140, 0.32);
    box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ro-death-rune-ring {
    position: absolute;
    bottom: 20px;
    width: 170px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px dashed rgba(246, 216, 140, 0.55);
    background: radial-gradient(ellipse at center, rgba(246, 216, 140, 0.18) 0%, rgba(231, 76, 60, 0.12) 60%, transparent 75%);
    box-shadow: 0 0 22px rgba(246, 216, 140, 0.25);
    animation: roDeathRingPulse 3s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes roDeathRingPulse {
    0% { transform: scale(0.96); opacity: 0.7; }
    100% { transform: scale(1.05); opacity: 1; }
}

.ro-death-soul-flame {
    position: absolute;
    top: 14px;
    width: 85px;
    height: 85px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(125, 211, 252, 0.22) 0%, rgba(56, 189, 248, 0.05) 55%, transparent 75%);
    filter: blur(4px);
    animation: roSoulFloat 2.6s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes roSoulFloat {
    0% { transform: translateY(4px) scale(0.95); opacity: 0.65; }
    100% { transform: translateY(-6px) scale(1.08); opacity: 1; }
}

.ro-death-sprite-img {
    position: relative;
    z-index: 2;
    max-width: 168px;
    max-height: 92px;
    width: auto;
    height: auto;
    transform: scale(1.55);
    transform-origin: center center;
    image-rendering: pixelated;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.88)) drop-shadow(0 0 10px rgba(246, 216, 140, 0.25));
    user-select: none;
    pointer-events: none;
}

.ro-death-dir-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(246, 216, 140, 0.45);
    color: #f6d88c;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.ro-death-dir-btn:hover {
    background: rgba(246, 216, 140, 0.22);
    border-color: #f6d88c;
    color: #ffffff;
}

.ro-death-dir-btn.left { left: 10px; }
.ro-death-dir-btn.right { right: 10px; }

.ro-death-char-badge {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-size: 10.5px;
    font-weight: 700;
    color: #f6d88c;
    background: rgba(6, 9, 16, 0.82);
    border: 1px solid rgba(246, 216, 140, 0.35);
    border-radius: 999px;
    padding: 2px 10px;
    white-space: nowrap;
}

.ro-death-info-box {
    background: rgba(8, 12, 22, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 9px;
    padding: 8px 12px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ro-death-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
}

.ro-death-info-label {
    color: #94a3b8;
}

.ro-death-info-value {
    color: #f8fafc;
    font-weight: 700;
}

.ro-death-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ro-death-btn {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    font-family: var(--ro3-font-display);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.18s ease;
}

.ro-death-btn.primary {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border: 1px solid #fef08a;
    color: #090d16;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
}

.ro-death-btn.primary:hover {
    background: linear-gradient(135deg, #f6d88c 0%, #d4af37 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(246, 216, 140, 0.6);
}

.ro-death-btn.primary kbd {
    font-family: var(--ro3-font-mono);
    font-size: 9.5px;
    background: rgba(9, 13, 22, 0.22);
    border: 1px solid rgba(9, 13, 22, 0.35);
    border-radius: 4px;
    padding: 1px 5px;
    color: #090d16;
}

.ro-death-btn.secondary {
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #6ee7b7;
    font-family: var(--ro3-font-sans);
    font-size: 11.5px;
    font-weight: 700;
}

.ro-death-btn.secondary:hover {
    background: rgba(16, 185, 129, 0.26);
    border-color: #34d399;
    color: #ecfdf5;
}

/* ============================================================================
   RO ITEM HOVER PREVIEW & SOURCE DESCRIPTION TOOLTIP (#ro-item-tooltip)
   ============================================================================ */
#ro-item-tooltip {
    position: fixed;
    top: 0;
    left: 0;
    width: 340px;
    max-width: calc(100vw - 24px);
    background: linear-gradient(165deg, rgba(16, 23, 39, 0.97) 0%, rgba(9, 13, 22, 0.98) 100%);
    border: 1.5px solid rgba(246, 216, 140, 0.72);
    border-radius: 10px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.88), 0 0 18px rgba(212, 175, 55, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
    color: #f1f5f9;
    z-index: 99999;
    pointer-events: none;
    display: none;
    overflow: hidden;
    font-family: var(--ro3-font-sans);
    animation: roTooltipFadeIn 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes roTooltipFadeIn {
    from { opacity: 0; transform: translateY(4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ro-itt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 11px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.22) 0%, rgba(30, 41, 69, 0.65) 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.38);
}

.ro-itt-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.ro-itt-title {
    font-family: var(--ro3-font-display);
    font-size: 13px;
    font-weight: 700;
    color: #f6d88c;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ro-itt-slots {
    color: #38bdf8;
    font-family: var(--ro3-font-mono);
    font-size: 11px;
    font-weight: 700;
    margin-left: 3px;
}

.ro-itt-type-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.ro-itt-body {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 11px;
}

.ro-itt-artwork-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.ro-itt-artwork-frame {
    width: 79px;
    height: 104px;
    background: #ffffff;
    border: 2px solid #c8a858;
    border-radius: 6px;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.ro-itt-artwork-frame img {
    width: 75px;
    height: 100px;
    object-fit: contain;
    image-rendering: auto;
    display: block;
}

.ro-itt-id-tag {
    font-family: var(--ro3-font-mono);
    font-size: 9px;
    color: #64748b;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(100, 116, 139, 0.25);
    padding: 1px 5px;
    border-radius: 3px;
}

.ro-itt-desc-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ro-itt-source-desc {
    font-size: 11.5px;
    line-height: 1.42;
    color: #e2e8f0;
    word-break: break-word;
}

.ro-itt-source-line {
    margin-bottom: 2px;
}

.ro-itt-divider {
    border: none;
    border-top: 1px dashed rgba(148, 163, 184, 0.26);
    margin: 5px 0;
}

.ro-itt-stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.ro-itt-stat-pill {
    font-size: 10px;
    font-family: var(--ro3-font-mono);
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 2px 6px;
    border-radius: 4px;
    color: #cbd5e1;
}

.ro-itt-stat-pill strong {
    color: #f6d88c;
}

.ro-itt-footer {
    padding: 6px 11px;
    background: rgba(8, 12, 21, 0.9);
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    color: #94a3b8;
}



