* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #12141a;
  color: #e6e6e6;
  font: 13px/1.35 "Segoe UI", Tahoma, Verdana, sans-serif;
  user-select: none;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: #9aa4b5; margin-bottom: 6px; }
input { font: inherit; }

#app { min-height: 100%; display: flex; align-items: flex-start; justify-content: center; padding: 10px; }

.panel { background: #1c2029; border: 1px solid #2d3340; border-radius: 6px; padding: 8px; }
.hint { margin: 6px 0 0; font-size: 11px; color: #7b8496; }

.btn {
  background: #2a3040; color: #e6e6e6; border: 1px solid #3b4358; border-radius: 4px;
  padding: 6px 12px; cursor: pointer; font: inherit;
}
.btn:hover { background: #343c52; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: #3c6cd3; border-color: #5584ea; }
.btn.primary:hover { background: #4a7ae6; }
.btn.small { padding: 3px 8px; font-size: 12px; }
.btn.danger { background: #8a2f2f; border-color: #b04545; }
.row { display: flex; gap: 8px; margin-top: 10px; }

/* ---- Login ---- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #12141a; z-index: 50; overflow-y: auto; }
.login-box { width: 320px; padding: 20px; display: flex; flex-direction: column; max-height: 100vh; overflow-y: auto; }
.login-box.wide { width: 760px; max-width: 96vw; }
.login-box h1 { text-align: center; font-size: 26px; color: #f2c94c; }
.login-box .subtitle { text-align: center; color: #7b8496; margin: 2px 0 14px; }
.login-box label { margin: 8px 0 3px; color: #9aa4b5; }
.login-box input { background: #12141a; border: 1px solid #3b4358; color: #fff; padding: 7px; border-radius: 4px; user-select: text; }
.login-box .btn { flex: 1; }
.form-error { margin-top: 10px; padding: 6px 8px; background: #4a1f1f; border: 1px solid #8a2f2f; border-radius: 4px; color: #ffb3b3; }
.form-info { background: #1f3a4a; border-color: #2f6a8a; color: #b3dcff; }

/* Selector de clase */
.class-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.class-card {
  display: flex; gap: 8px; align-items: flex-start; text-align: left; padding: 8px; color: #e6e6e6;
  background: #12141a; border: 2px solid #2d3340; border-radius: 6px; cursor: pointer; font: inherit;
}
.class-card:hover { border-color: #4a546c; }
.class-card.selected { border-color: #f2c94c; background: #1d2230; }
.class-preview { flex: none; width: 72px; height: 72px; image-rendering: auto; }
.class-body { min-width: 0; }
.class-name { font-weight: 700; font-size: 15px; color: #f2c94c; }
.class-role { color: #8fb4ff; font-size: 11.5px; margin-bottom: 2px; }
.class-desc { font-size: 11.5px; color: #c9ced8; }
.class-stats { font-size: 11px; color: #6fe0a0; margin-top: 3px; }
.class-spells { font-size: 11px; color: #9aa4b5; margin-top: 2px; }

/* ---- Juego ---- */
#game { display: flex; gap: 10px; align-items: flex-start; }
#main-col { flex: none; }
/* El canvas interno es 960x704; se escala por CSS para entrar en la ventana (1366x768 sin scroll). */
#canvas-wrap {
  position: relative;
  width: min(calc(100vw - 304px), calc((100vh - 24px) * 960 / 704), 1280px);
  aspect-ratio: 960 / 704;
  border: 2px solid #2d3340; border-radius: 4px; overflow: hidden; background: #000;
}
#game-canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
#game-canvas[hidden] { display: none; }
/* Modo 3D: WebGL abajo (recibe el ratón) y overlay 2D encima (solo texto, sin eventos). */
#world-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
#world-canvas.hover-entity { cursor: pointer; }
#overlay-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
#world-canvas[hidden], #overlay-canvas[hidden] { display: none; }

/* Chat superpuesto (abajo a la izquierda del canvas) */
#chat {
  position: absolute; left: 0; bottom: 0; width: 44%; z-index: 8;
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
  background: linear-gradient(to top, rgba(10, 12, 18, 0.72), rgba(10, 12, 18, 0.35));
  pointer-events: none;
}
#chat-log { height: 108px; overflow-y: auto; font-size: 12px; user-select: text; word-break: break-word; pointer-events: auto; text-shadow: 0 0 3px #000; }
#chat-log .line { padding: 1px 0; }
#chat-input { background: rgba(18, 20, 26, 0.85); border: 1px solid #3b4358; color: #fff; padding: 4px 6px; border-radius: 4px; user-select: text; pointer-events: auto; }
.chat-local { color: #e6e6e6; }
.chat-global { color: #f2c94c; }
.chat-party { color: #6fe0a0; }
.chat-system { color: #8fb4ff; }
.chat-warn { color: #ffb36b; }
.chat-error { color: #ff7b7b; }
.chat-xp { color: #c58bff; }
.chat-loot { color: #f2c94c; }
.chat-level { color: #ffe27a; font-weight: 600; }
.chat-death { color: #ff6060; font-weight: 600; }
.chat-card { color: #9fffe0; font-weight: 600; }
.chat-from { font-weight: 600; }

#side { width: 270px; flex: none; display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 20px); overflow-y: auto; }
.side-buttons { display: flex; gap: 6px; }
.side-buttons .btn { flex: 1; }

/* Barras */
.bar { position: relative; height: 19px; background: #0d0f14; border: 1px solid #2d3340; border-radius: 3px; margin-top: 4px; overflow: hidden; }
.bar .fill { height: 100%; width: 0%; transition: width 0.15s; }
.bar.hp .fill { background: #c93c3c; }
.bar.mp .fill { background: #3c6cd3; }
.bar.xp .fill { background: #8a5ad6; }
.bar-text { position: absolute; inset: 0; text-align: center; font-size: 13px; line-height: 17px; text-shadow: 0 0 3px #000; }

.hud-top { display: flex; justify-content: space-between; align-items: baseline; }
.hud-name { font-weight: 600; font-size: 15px; }
.hud-level { color: #f2c94c; font-size: 12px; }
.hud-map { color: #7b8496; font-size: 11.5px; margin-bottom: 2px; }
.hud-stats { display: flex; justify-content: space-between; margin-top: 6px; }
.gold { color: #f2c94c; }
.ping { color: #7b8496; font-size: 11.5px; }
.hud-combat { margin-top: 4px; font-size: 11.5px; color: #9aa4b5; }

/* Estados */
.chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.chips:empty { display: none; }
.chip { font-size: 10.5px; padding: 1px 6px; border-radius: 9px; border: 1px solid #5584ea; background: rgba(0, 0, 0, 0.45); }
.chip.buff { color: #b8f0c8; }
.chip.debuff { color: #ffb3b3; }

/* Barra de habilidades */
#hotbar-items, #hotbar-powers { position: absolute; bottom: 8px; display: flex; z-index: 9; }
#hotbar-items { right: 264px; }
#hotbar-powers { right: 8px; }
.hotbar-group { display: flex; gap: 6px; }
.dockable.vertical .hotbar-group { flex-direction: column; }
.hotbar-slot.item.equipped { border-color: #6fe0a0; }
.hotbar-slot.item.empty-stock canvas { filter: grayscale(1) brightness(0.5); }
.hotbar-count { position: absolute; right: 3px; bottom: 1px; font-size: 11px; font-weight: 700; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.chat-world { color: #e8cf9a; }
.hotbar-slot {
  position: relative; width: 56px; height: 56px; padding: 0; background: #0d0f14; color: #e6e6e6;
  border: 2px solid #4a546c; border-radius: 6px; cursor: pointer; overflow: hidden; font: inherit;
}
.hotbar-slot:hover { border-color: #f2c94c; }
.hotbar-slot canvas { display: block; width: 100%; height: 100%; }
.hotbar-slot.locked canvas { filter: grayscale(1) brightness(0.55); }
.hotbar-slot.nomana { border-color: #3c4f8f; }
.hotbar-slot.nomana canvas { filter: brightness(0.6) saturate(0.6); }
.hotbar-key { position: absolute; left: 3px; top: 1px; font-weight: 700; font-size: 12px; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.hotbar-cost { position: absolute; right: 3px; bottom: 1px; font-size: 11px; color: #8fb4ff; font-weight: 600; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.hotbar-cd { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.hotbar-cdtext { font-size: 20px; font-weight: 700; text-shadow: 0 0 4px #000, 0 0 4px #000; }
.hotbar-lock { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; font-size: 11px; font-weight: 700; color: #ffb36b; text-shadow: 0 0 3px #000; }

/* Equipo e inventario */
#equip-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.equip-slot, .inv-slot, .shop-icon {
  position: relative; background: #12141a; border: 1px solid #343b4c; border-radius: 3px;
  width: 100%; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
}
.equip-slot .slot-label { position: absolute; bottom: 1px; left: 0; right: 0; text-align: center; font-size: 9px; color: #566074; pointer-events: none; }
.equip-slot canvas, .inv-slot canvas { pointer-events: none; }
#inv-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.inv-slot.filled { cursor: pointer; border-color: #4a546c; }
.inv-slot.filled:hover, .equip-slot.filled:hover { border-color: #f2c94c; }
.equip-slot.filled { cursor: pointer; border-color: #4a546c; }
.inv-slot.dragover, .equip-slot.dragover { border-color: #6fe0a0; }
.qty { position: absolute; right: 2px; bottom: 0; font-size: 11px; font-weight: 600; text-shadow: 0 0 3px #000, 0 0 3px #000; pointer-events: none; }
.card-pips { position: absolute; left: 2px; top: 0; font-size: 9px; color: #ffe27a; letter-spacing: -1px; text-shadow: 0 0 3px #000, 0 0 3px #000; pointer-events: none; }

/* Party */
.party-row { margin-bottom: 6px; }
.party-row .party-name { display: flex; justify-content: space-between; font-size: 12px; }
.party-row .bar { height: 8px; margin-top: 2px; }

/* Objetivo */
#target-frame { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 240px; padding: 4px 8px; background: rgba(20, 22, 30, 0.85); border: 1px solid #3b4358; border-radius: 4px; text-align: center; pointer-events: none; z-index: 7; }
#target-frame .bar { height: 8px; }
.target-info { font-size: 11px; color: #9aa4b5; }
.rank-elite { color: #ffd24a; }
.rank-boss { color: #ff5a5a; }
.rank-finalboss { color: #ff3df0; }
#target-frame .chips { justify-content: center; }

/* Avisos de invitación */
#toasts { position: absolute; top: 8px; right: 8px; width: 240px; display: flex; flex-direction: column; gap: 6px; z-index: 10; }
.toast { background: rgba(20, 22, 30, 0.95); border: 1px solid #5584ea; border-radius: 4px; padding: 6px 8px; margin-bottom: 6px; }
.toast .row { margin-top: 6px; }
.toast .btn { flex: 1; padding: 3px 6px; }

/* Ventanas modales */
.window { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #1c2029; border: 2px solid #4a546c; border-radius: 6px; padding: 10px; z-index: 20; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6); max-width: 96%; max-height: 96%; overflow-y: auto; }
.window-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 15px; font-weight: 600; }
#shop-window, #corpse-window, #extractor-window { width: 420px; max-height: 520px; overflow-y: auto; }
.shop-row { display: flex; align-items: center; gap: 8px; padding: 4px; border-bottom: 1px solid #2d3340; }
.shop-row .shop-icon { width: 38px; flex: none; }
.shop-row .shop-name { flex: 1; }
.shop-row .shop-price { color: #f2c94c; width: 60px; text-align: right; }
.shop-row input { width: 46px; background: #12141a; border: 1px solid #3b4358; color: #fff; padding: 3px; border-radius: 3px; }
#trade-window { width: 560px; }
.trade-cols { display: flex; gap: 10px; }
.trade-col { flex: 1; background: #12141a; border: 1px solid #2d3340; border-radius: 4px; padding: 6px; min-height: 200px; }
.trade-col h4 { margin: 0 0 6px; font-size: 13px; }
.trade-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.trade-gold { margin-top: 8px; color: #f2c94c; }
.trade-gold input { width: 90px; background: #1c2029; border: 1px solid #3b4358; color: #fff; padding: 3px; border-radius: 3px; }
.trade-status { margin-top: 6px; font-size: 12px; color: #9aa4b5; }
.trade-status.ok { color: #6fe0a0; }
.trade-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* Habilidades (árbol) */
#skills-window { width: 560px; }
.skill-tier { margin: 8px 0 2px; font-size: 12px; color: #9aa4b5; }
.skill-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 4px 6px; border: 1px solid #2d3340; border-radius: 3px; margin-bottom: 4px; }
.skill-row.locked { opacity: .5; }
.skill-row .skill-desc { font-size: 12px; color: #9aa4b5; }
.skill-row .skill-rank { font-weight: bold; margin-right: 8px; }

/* Profesiones */
#professions-window { width: 720px; }
.prof-body { display: flex; gap: 10px; }
.prof-side { width: 170px; flex: none; display: flex; flex-direction: column; gap: 4px; }
.prof-item { padding: 3px 6px; border: 1px solid #2d3340; border-radius: 3px; cursor: pointer; }
.prof-item.selected { background: #232a38; border-color: #5a6a8c; }
.prof-item .bar { height: 6px; margin-top: 2px; }
.prof-name { font-weight: 600; }
.prof-skill { font-size: 11px; color: #7b8496; }
.prof-main { flex: 1; min-width: 0; }
.prof-qty { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.prof-qty input { width: 56px; }
.alch-level.grey { color: #9aa0aa; }
.hint.warn { color: #ffb35c; }
.alch-list { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; }
.alch-row { display: flex; align-items: center; gap: 8px; padding: 4px; border-bottom: 1px solid #2d3340; }
.alch-row.locked { opacity: 0.55; }
.alch-row .shop-icon { width: 38px; flex: none; }
.alch-info { flex: 1; min-width: 0; }
.alch-name { font-weight: 600; }
.alch-level { font-size: 11px; color: #7b8496; }
.alch-ing { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11.5px; }
.alch-ing .ok { color: #6fe0a0; }
.alch-ing .miss { color: #ff9a9a; }
.alch-btns { display: flex; gap: 4px; flex: none; }

.overlay-soft { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; background: rgba(90, 0, 0, 0.45); z-index: 15; pointer-events: none; }
.overlay-soft h2 { font-size: 34px; color: #ff6060; text-shadow: 0 0 8px #000; }

/* Fantasma (F3): bruma ~10% y barra de revivir */
#rain-layer { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 13; pointer-events: none; }
#ghost-sepia { position: absolute; inset: 0; background: rgba(120, 78, 30, 0.28); backdrop-filter: sepia(0.9) saturate(0.8); mix-blend-mode: multiply; z-index: 14; pointer-events: none; }
#ghost-bar { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: rgba(20, 24, 34, 0.9); border: 1px solid #7b8496; border-radius: 4px; padding: 6px 10px; z-index: 16; font-size: 13px; }

/* Wiki */
.wiki-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(5, 6, 10, 0.78); display: flex; align-items: center; justify-content: center; }
.wiki-panel { width: min(1040px, 96vw); height: min(680px, 92vh); background: #1c2029; border: 2px solid #4a546c; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7); }
.wiki-body { flex: 1; min-height: 0; display: flex; gap: 10px; }
.wiki-nav { width: 170px; flex: none; display: flex; flex-direction: column; gap: 6px; }
.wiki-search { background: #12141a; border: 1px solid #3b4358; color: #fff; padding: 6px; border-radius: 4px; user-select: text; }
.wiki-nav-list { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.wiki-nav-btn { text-align: left; background: #232938; color: #e6e6e6; border: 1px solid #343b4c; border-radius: 4px; padding: 6px 8px; cursor: pointer; font: inherit; }
.wiki-nav-btn:hover { background: #2d3548; }
.wiki-nav-btn.active { background: #3c6cd3; border-color: #5584ea; }
.wiki-content { flex: 1; min-width: 0; overflow-y: auto; padding: 0 8px 12px 4px; user-select: text; }
.wiki-title { font-size: 20px; text-transform: none; letter-spacing: 0; color: #f2c94c; margin: 4px 0 8px; }
.wiki-h { margin: 14px 0 4px; font-size: 14px; color: #8fb4ff; }
.wiki-p { margin: 6px 0; line-height: 1.5; }
.wiki-list { margin: 6px 0; padding-left: 20px; }
.wiki-list li { margin: 2px 0; }
.wiki-table-wrap { overflow-x: auto; margin: 8px 0; }
.wiki-table { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.wiki-table th, .wiki-table td { border: 1px solid #343b4c; padding: 3px 7px; text-align: left; vertical-align: top; }
.wiki-table th { background: #232938; color: #9aa4b5; position: sticky; top: 0; }
.wiki-table tr:nth-child(even) td { background: rgba(255, 255, 255, 0.025); }
.wiki-cards { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.wiki-card { margin: 0; width: 160px; text-align: center; font-size: 11px; color: #9aa4b5; }
.wiki-card canvas { display: block; width: 160px; height: auto; border-radius: 8px; }
.wiki-sprite { margin: 6px 12px 6px 0; display: inline-block; text-align: center; font-size: 11px; color: #9aa4b5; vertical-align: top; }
.wiki-sprite canvas { display: block; background: #12141a; border: 1px solid #343b4c; border-radius: 6px; }

/* Tooltip y menu contextual */
#tooltip { position: fixed; z-index: 300; max-width: 250px; background: #0d0f14; border: 1px solid #5584ea; border-radius: 4px; padding: 6px 8px; pointer-events: none; font-size: 12px; }
#tooltip .tt-title { font-weight: 600; font-size: 13px; }
#tooltip .tt-dim { color: #7b8496; }
#tooltip .tt-bonus { color: #6fe0a0; }
#tooltip .tt-warn { color: #ff7b7b; }
#tooltip .tt-gold { color: #f2c94c; }
#tooltip .tt-image { margin: 4px 0; text-align: center; }
#tooltip .tt-image canvas { border-radius: 8px; }
#context-menu { position: fixed; z-index: 310; min-width: 160px; background: #1c2029; border: 1px solid #5584ea; border-radius: 4px; padding: 3px; }
#context-menu .menu-title { padding: 3px 8px; color: #7b8496; font-size: 11.5px; }
#context-menu .menu-item { padding: 5px 8px; cursor: pointer; border-radius: 3px; }
#context-menu .menu-item:hover { background: #343c52; }

/* Diálogos, mapa y eventos del mundo (iteración 6) */
#dialogue-window { width: 400px; max-height: 420px; }
.dialogue-text { margin: 4px 0 10px; line-height: 1.4; font-style: italic; color: #e6dcc0; }
.dialogue-buttons { display: flex; flex-direction: column; gap: 5px; }
.dialogue-buttons .btn { text-align: left; }
#map-window { width: 556px; }
.map-tabs { display: flex; gap: 4px; }
.map-tabs .btn.active { border-color: #f2c94c; color: #f2c94c; }
#map-canvas { display: block; width: 520px; max-width: 100%; background: #07080c; border: 1px solid #2d3340; }
.map-info-line { margin-top: 6px; font-size: 12.5px; color: #b8c0d2; }
.world-event { margin: 4px 0; }
.world-event-item { padding: 4px 6px; border: 1px solid #8a7440; border-radius: 4px; background: rgba(60, 48, 20, 0.45); margin-bottom: 3px; cursor: help; }
.world-event-head { display: flex; justify-content: space-between; font-weight: 600; color: #e8cf9a; }
.world-event-time { font-variant-numeric: tabular-nums; }
.world-event-maps { font-size: 11px; color: #9aa3b8; }
.world-event-bonus { font-size: 11.5px; color: #8fe0a0; }

/* Rareza de ítems (LORE.md §19.1): .rarity-* colorea texto (nombres); .rb-* colorea el borde de casillas */
.rarity-common { color: #e8e8e8; }
.rarity-uncommon { color: #4fd16a; }
.rarity-rare { color: #4a9eff; }
.rarity-epic { color: #b266ff; }
.rarity-legendary { color: #f2b134; }
.rarity-timeless { background: linear-gradient(90deg, #ff7eb6, #ffd36e, #7fe9e0, #8fa8ff, #ff7eb6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.inv-slot.filled.rb-common, .equip-slot.filled.rb-common, .shop-icon.rb-common { border-color: #e8e8e8; }
.inv-slot.filled.rb-uncommon, .equip-slot.filled.rb-uncommon, .shop-icon.rb-uncommon { border-color: #4fd16a; }
.inv-slot.filled.rb-rare, .equip-slot.filled.rb-rare, .shop-icon.rb-rare { border-color: #4a9eff; }
.inv-slot.filled.rb-epic, .equip-slot.filled.rb-epic, .shop-icon.rb-epic { border-color: #b266ff; }
.inv-slot.filled.rb-legendary, .equip-slot.filled.rb-legendary, .shop-icon.rb-legendary { border-color: #f2b134; }
.inv-slot.filled.rb-timeless, .equip-slot.filled.rb-timeless, .shop-icon.rb-timeless { border-color: #7fe9e0; box-shadow: 0 0 4px #ff7eb6, inset 0 0 3px #8fa8ff; }

/* Diálogo NPC estilo papiro / Chrono Trigger (F1) */
#dialogue-window { width: 460px; background: #e8d9b0; background-image: linear-gradient(#efe1ba, #dcc994); border: 3px double #6b4a22; color: #3a2610; font-family: Georgia, 'Palatino Linotype', serif; box-shadow: 0 4px 18px rgba(0,0,0,.6); }
#dialogue-window .dialogue-text { font-size: 15.5px; line-height: 1.55; font-style: normal; color: #3a2610; }
#dialogue-window .btn { background: #cdb57c; color: #3a2610; border: 1px solid #6b4a22; font-family: inherit; }
#dialogue-window .btn:hover { background: #f0dca0; }

/* Paneles movibles (F11) */
.dockable { position: absolute; }
.dock-tools { position: absolute; top: -18px; right: 0; display: flex; gap: 2px; align-items: center; opacity: 0.35; transition: opacity 0.15s; pointer-events: auto; z-index: 20; }
.dockable:hover > .dock-tools, .dock-tools:hover { opacity: 1; }
.dock-grip { cursor: grab; padding: 0 5px; background: rgba(20, 24, 34, 0.9); border: 1px solid #4a546c; border-radius: 3px; font-size: 12px; line-height: 16px; touch-action: none; user-select: none; }
.dock-btn { background: rgba(20, 24, 34, 0.9); color: #e6e6e6; border: 1px solid #4a546c; border-radius: 3px; font-size: 11px; line-height: 14px; padding: 0 5px; cursor: pointer; }
.dock-btn:hover { border-color: #f2c94c; }
.ui-menu-btn { position: absolute; left: 50%; top: 4px; transform: translateX(-50%); z-index: 17; opacity: 0.55; }
.ui-menu-btn:hover { opacity: 1; }
.ui-menu { position: absolute; left: 50%; top: 30px; transform: translateX(-50%); z-index: 17; background: rgba(20, 24, 34, 0.95); border: 1px solid #4a546c; border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.ui-menu[hidden] { display: none; }
#chat.dockable { width: 44%; }

/* Ventana de viaje (F9) */
.travel-window { width: 420px; max-height: 520px; overflow-y: auto; border-color: #8a7ab8; }
.travel-window .gold { color: #f2c94c; margin-bottom: 4px; }
.travel-window .hint { color: #9aa3b8; font-size: 12px; margin: 4px 0 8px; }
.travel-cast {
  position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%);
  width: 240px; padding: 4px 6px; background: rgba(20, 16, 28, 0.85);
  border: 1px solid #8a7ab8; border-radius: 4px; color: #eee; font-size: 12px;
  text-align: center; z-index: 20; pointer-events: none;
}

/* Ventana de opciones (tecla O) */
#options-window { width: 420px; }
.opt-section { margin-bottom: 12px; }
.opt-section h4 { margin: 0 0 6px; font-size: 13px; color: #aab4cf; }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.opt-row select, .opt-row input[type="range"] { flex: 0 0 55%; }
.style-select select { background: #272d3c; color: #e6e9f2; border: 1px solid #4a546c; border-radius: 4px; padding: 2px 4px; }
.opt-reload { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding: 6px; border: 1px solid #8a6a2f; border-radius: 4px; font-size: 12px; color: #e6c27a; }
.audio-options { margin-left: 4px; font-size: 11px; padding: 2px 6px; }

/* Diario (tecla J) */
#journal-window { width: 460px; max-height: 80%; }
.journal-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.journal-tabs .btn.active { background: #4a546c; }
.journal-section h4 { margin: 8px 0 4px; color: #d8c890; }
.journal-entry { margin-bottom: 6px; padding: 4px 6px; border: 1px solid #343b4e; border-radius: 4px; font-size: 12px; }
.journal-entry.unknown { opacity: 0.5; }
.journal-entry.done { border-color: #8a7d5a; }
.journal-name { font-weight: 600; font-size: 13px; }
.journal-text { color: #b8bfd0; }
.journal-reward { color: #e6c27a; margin-top: 2px; }

/* Inclinaciones (Diario) — prefijo .incl- */
.incl-panel { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.incl-row { display: flex; align-items: center; gap: 8px; }
.incl-label { flex: 0 0 90px; color: #cfd5e6; }
.incl-bar { flex: 1; height: 8px; background: #272d3c; border: 1px solid #4a546c; border-radius: 4px; overflow: hidden; }
.incl-fill { height: 100%; background: #8aa0d0; }
.incl-fill.incl-time { background: #d6b25a; }
.incl-fill.incl-destruction { background: #c0524a; }
.incl-fill.incl-nature { background: #5fae6a; }
.incl-fill.incl-neutral { background: #8a93a8; }
.incl-text { margin: 0 0 4px; font-style: italic; color: #e6c27a; }
