
  /* ===== ROOT VARIABLES ===== */
  :root {
    --void: #080604;
    --ash-deep: #0F0B08;
    --ash-mid: #1C1410;
    --ash-panel: #221812;
    --ash-raised: #2A1E16;
    --border-rust: #5C2E14;
    --border-gold: #7A5520;
    --border-bright: #C4860A;
    --text-parchment: #D4C49A;
    --text-dim: #8A7A5E;
    --text-ghost: #4A3E2E;
    --accent-gold: #C4860A;
    --accent-bright-gold: #E8C06A;
    --accent-crimson: #8B1A1A;
    --accent-blood: #A82020;
    --accent-telvanni: #2E7D6B;
    --accent-telvanni-bright: #4BA899;
    --accent-tribunal: #6B5B2A;
    --scrollbar-track: #120D09;
    --scrollbar-thumb: #5C2E14;
  }


  /* ===== RESET & BASE ===== */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }


  html { scroll-behavior: smooth; }


  body {
    background: var(--void);
    color: var(--text-parchment);
    font-family: 'Courier Prime', monospace;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
      radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139,26,26,0.08) 0%, transparent 60%),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23080604'/%3E%3Crect x='0' y='0' width='1' height='1' fill='%230D0907' opacity='0.6'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%230D0907' opacity='0.4'/%3E%3C/svg%3E");
  }


  /* ===== SCROLLBAR ===== */
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: var(--scrollbar-track); border-left: 1px solid var(--border-rust); }
  ::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border: 1px solid var(--border-gold); }
  ::-webkit-scrollbar-thumb:hover { background: var(--border-gold); }


  /* ===== TYPOGRAPHY ===== */
  h1, h2, h3 { font-family: 'Cinzel Decorative', serif; letter-spacing: 0.05em; }
  h4, h5, h6 { font-family: 'Cinzel', serif; letter-spacing: 0.04em; }
  .vt { font-family: 'VT323', monospace; }


  /* ===== DECORATIVE DIVIDERS ===== */
  .divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-rust), var(--accent-gold), var(--border-rust), transparent);
    margin: 8px 0;
    position: relative;
  }
  .divider::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 3px;
    background: var(--accent-gold);
  }
  .divider-thick {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-crimson), var(--accent-gold), var(--accent-crimson), transparent);
    margin: 12px 0;
  }


  /* ===== PANEL COMPONENT ===== */
  .panel {
    background: var(--ash-panel);
    border: 1px solid var(--border-rust);
    position: relative;
  }
  .panel::before {
    content: '';
    position: absolute;
    top: 2px; left: 2px; right: 2px; bottom: 2px;
    border: 1px solid rgba(92,46,20,0.3);
    pointer-events: none;
  }
  .panel-inset {
    background: var(--ash-deep);
    border: 1px solid var(--border-rust);
    box-shadow: inset 0 1px 8px rgba(0,0,0,0.6), inset 0 0 2px var(--border-rust);
  }
  .panel-raised {
    background: var(--ash-raised);
    border: 1px solid var(--border-gold);
    box-shadow: 0 2px 12px rgba(0,0,0,0.5), 0 0 4px rgba(196,134,10,0.1);
  }


  .panel-header {
    background: linear-gradient(90deg, var(--ash-deep), var(--ash-raised), var(--ash-deep));
    border-bottom: 1px solid var(--border-rust);
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .panel-header h4, .panel-header h5 {
    color: var(--accent-gold);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .panel-corner {
    width: 8px; height: 8px;
    background: var(--accent-gold);
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    flex-shrink: 0;
  }


  /* ===== NAVBAR ===== */
  #navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(180deg, #0A0806 0%, var(--ash-mid) 100%);
    border-bottom: 2px solid var(--border-rust);
    box-shadow: 0 2px 20px rgba(0,0,0,0.8), 0 1px 0 rgba(196,134,10,0.2);
  }
  .navbar-inner {
    display: flex;
    align-items: stretch;
    height: 44px;
    max-width: 1400px;
    margin: 0 auto;
  }
  .nav-logo {
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-right: 1px solid var(--border-rust);
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
  }
  .nav-logo .logo-sigil {
    width: 22px;
    height: 22px;
    background: var(--accent-gold);
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    position: relative;
    flex-shrink: 0;
  }
  .nav-logo .logo-sigil::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 8px; height: 8px;
    background: var(--ash-deep);
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  }
  .nav-logo span {
    font-family: 'Cinzel Decorative', serif;
    font-size: 13px;
    color: var(--accent-gold);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .nav-links {
    display: flex;
    align-items: stretch;
    list-style: none;
    flex: 1;
  }
  .nav-links li a {
    display: flex;
    align-items: center;
    padding: 0 14px;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    border-right: 1px solid rgba(92,46,20,0.4);
    transition: all 0.15s ease;
    position: relative;
  }
  .nav-links li a:hover, .nav-links li a.active {
    color: var(--accent-bright-gold);
    background: rgba(196,134,10,0.06);
  }
  .nav-links li a.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent-gold);
  }
  .nav-right {
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 16px;
    border-left: 1px solid var(--border-rust);
    margin-left: auto;
  }
  .nav-status {
    font-family: 'VT323', monospace;
    font-size: 13px;
    color: var(--accent-telvanni);
    letter-spacing: 0.05em;
  }
  .nav-status .blink {
    animation: blink 1.4s step-end infinite;
  }
  @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }


  /* ===== THREE.JS HERO ===== */
  #hero {
    position: relative;
    height: 280px;
    overflow: hidden;
    border-bottom: 2px solid var(--border-rust);
  }
  #hero-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
  }
  .hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
      linear-gradient(180deg, rgba(8,6,4,0.3) 0%, rgba(8,6,4,0.0) 40%, rgba(8,6,4,0.8) 100%),
      linear-gradient(90deg, rgba(8,6,4,0.7) 0%, transparent 30%, transparent 70%, rgba(8,6,4,0.7) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 24px;
    text-align: center;
  }
  .hero-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(22px, 4vw, 46px);
    font-weight: 900;
    color: var(--accent-bright-gold);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-shadow: 0 0 30px rgba(196,134,10,0.6), 0 2px 4px rgba(0,0,0,0.9);
    line-height: 1.1;
  }
  .hero-subtitle {
    font-family: 'Cinzel', serif;
    font-size: clamp(10px, 1.5vw, 14px);
    color: var(--text-dim);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 6px;
  }
  .hero-marquee {
    position: absolute;
    top: 8px;
    width: 100%;
    font-family: 'VT323', monospace;
    font-size: 15px;
    color: var(--accent-telvanni);
    letter-spacing: 0.1em;
    opacity: 0.7;
  }
  .hero-marquee marquee { display: block; }


  /* ===== MAIN LAYOUT ===== */
  #main-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: auto;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 324px);
  }


  /* ===== SIDEBAR ===== */
  #sidebar {
    border-right: 1px solid var(--border-rust);
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(180deg, var(--ash-deep) 0%, #0A0704 100%);
  }


  .sidebar-widget {
    padding: 0;
    overflow: hidden;
  }
  .sidebar-widget .panel-header {
    padding: 4px 8px;
  }
  .sidebar-widget .widget-body {
    padding: 8px;
    font-size: 12px;
  }


  /* stat bars */
  .stat-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
  }
  .stat-label {
    font-family: 'Cinzel', serif;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    width: 52px;
    flex-shrink: 0;
  }
  .stat-bar {
    flex: 1;
    height: 10px;
    background: var(--ash-deep);
    border: 1px solid var(--border-rust);
    position: relative;
    overflow: hidden;
  }
  .stat-bar-fill {
    height: 100%;
    position: relative;
  }
  .stat-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(255,255,255,0.15);
  }
  .stat-health .stat-bar-fill { background: linear-gradient(90deg, #6B0000, #C41C1C); width: 73%; }
  .stat-magicka .stat-bar-fill { background: linear-gradient(90deg, #003B6B, #1C7AC4); width: 88%; }
  .stat-fatigue .stat-bar-fill { background: linear-gradient(90deg, #2A5500, #5CA41C); width: 54%; }
  .stat-value {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: var(--text-parchment);
    width: 36px;
    text-align: right;
    flex-shrink: 0;
  }


  /* attribute mini-grid */
  .attr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 8px;
  }
  .attr-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    border-bottom: 1px solid rgba(92,46,20,0.2);
  }
  .attr-name {
    font-family: 'Cinzel', serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
  }
  .attr-val {
    font-family: 'VT323', monospace;
    font-size: 15px;
    color: var(--accent-gold);
  }


  /* weather widget */
  .weather-display {
    background: var(--ash-deep);
    border: 1px solid var(--border-rust);
    padding: 8px;
    margin: 6px 0;
    position: relative;
    overflow: hidden;
  }
  .weather-display::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(139,26,26,0.03) 3px,
      rgba(139,26,26,0.03) 4px
    );
    pointer-events: none;
  }
  .weather-type {
    font-family: 'Cinzel Decorative', serif;
    font-size: 12px;
    color: var(--accent-crimson);
    text-align: center;
    letter-spacing: 0.08em;
  }
  .weather-particles {
    height: 28px;
    position: relative;
    overflow: hidden;
    margin: 4px 0;
  }
  .ash-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--text-dim);
    border-radius: 50%;
    animation: ashfall linear infinite;
    opacity: 0.6;
  }
  @keyframes ashfall {
    0% { transform: translate(0, -10px); opacity: 0; }
    20% { opacity: 0.6; }
    100% { transform: translate(-20px, 30px); opacity: 0; }
  }
  .weather-detail {
    font-family: 'VT323', monospace;
    font-size: 13px;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
  }


  /* quick nav */
  .quick-nav-list {
    list-style: none;
  }
  .quick-nav-list li a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    border-bottom: 1px solid rgba(92,46,20,0.2);
    transition: all 0.1s;
  }
  .quick-nav-list li a:hover {
    color: var(--accent-bright-gold);
    background: rgba(196,134,10,0.05);
    padding-left: 10px;
  }
  .quick-nav-list li a::before {
    content: '>';
    color: var(--border-rust);
    font-family: 'VT323', monospace;
    font-size: 14px;
  }
  .quick-nav-list li a:hover::before { color: var(--accent-gold); }


  /* prophecy widget */
  .prophecy-scroll {
    background: var(--ash-deep);
    border: 1px solid var(--border-rust);
    padding: 6px 8px;
    font-style: italic;
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.7;
    position: relative;
  }
  .prophecy-scroll::before {
    content: '"';
    font-family: 'Cinzel Decorative', serif;
    font-size: 28px;
    color: rgba(196,134,10,0.2);
    position: absolute;
    top: -4px;
    left: 4px;
    line-height: 1;
  }


  /* hit counter */
  .counter-display {
    background: var(--void);
    border: 1px solid var(--border-rust);
    font-family: 'VT323', monospace;
    font-size: 20px;
    color: var(--accent-telvanni);
    text-align: center;
    letter-spacing: 0.2em;
    padding: 4px 0;
    text-shadow: 0 0 8px rgba(46,125,107,0.5);
  }
  .counter-label {
    font-family: 'Cinzel', serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-ghost);
    text-align: center;
    margin-top: 3px;
  }


  /* faction badge */
  .faction-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .faction-badge {
    font-family: 'Cinzel', serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 6px;
    border: 1px solid;
    cursor: default;
    transition: all 0.15s;
  }
  .faction-badge:hover { filter: brightness(1.4); transform: translateY(-1px); }
  .badge-telvanni { color: var(--accent-telvanni); border-color: var(--accent-telvanni); }
  .badge-hlaalu { color: #C4A01A; border-color: #C4A01A; }
  .badge-redoran { color: #C45A1A; border-color: #C45A1A; }
  .badge-indoril { color: #8B5EA8; border-color: #8B5EA8; }
  .badge-tribunal { color: var(--accent-bright-gold); border-color: var(--accent-bright-gold); }
  .badge-dagoth { color: var(--accent-blood); border-color: var(--accent-blood); }


  /* ===== MAIN CONTENT ===== */
  #main-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }


  /* ===== TAB SYSTEM ===== */
  .tab-container { }
  .tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border-rust);
    background: var(--ash-deep);
    flex-wrap: wrap;
  }
  .tab-btn {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-ghost);
    background: transparent;
    border: none;
    border-right: 1px solid rgba(92,46,20,0.4);
    border-bottom: 2px solid transparent;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: -1px;
    position: relative;
  }
  .tab-btn:hover { color: var(--text-dim); background: rgba(196,134,10,0.04); }
  .tab-btn.active {
    color: var(--accent-bright-gold);
    background: var(--ash-panel);
    border-bottom-color: var(--accent-gold);
  }
  .tab-pane { display: none; padding: 14px 0 0 0; }
  .tab-pane.active { display: block; }


  /* ===== CONTENT GRID LAYOUTS ===== */
  .content-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .content-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  .content-sidebar-main { display: grid; grid-template-columns: 220px 1fr; gap: 12px; }


  /* ===== SCROLLBOX ===== */
  .scrollbox {
    background: var(--ash-deep);
    border: 1px solid var(--border-rust);
    box-shadow: inset 0 1px 10px rgba(0,0,0,0.5);
    overflow-y: auto;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-parchment);
  }
  .scrollbox::-webkit-scrollbar { width: 6px; }
  .scrollbox p + p { margin-top: 8px; }
  .scrollbox .lore-highlight {
    color: var(--accent-bright-gold);
    font-family: 'Cinzel', serif;
    font-size: 12px;
    letter-spacing: 0.04em;
  }
  .scrollbox em { color: var(--accent-telvanni-bright); font-style: italic; }
  .scrollbox strong { color: var(--accent-gold); font-weight: 700; }


  /* ===== LOCATION CARDS ===== */
  .location-card {
    background: var(--ash-panel);
    border: 1px solid var(--border-rust);
    overflow: hidden;
    transition: border-color 0.2s;
    cursor: default;
  }
  .location-card:hover {
    border-color: var(--border-gold);
    box-shadow: 0 0 12px rgba(196,134,10,0.1);
  }
  .location-card-header {
    background: linear-gradient(90deg, var(--ash-deep), var(--ash-raised));
    border-bottom: 1px solid var(--border-rust);
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .location-card-header h5 {
    font-size: 11px;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }
  .location-type {
    font-family: 'VT323', monospace;
    font-size: 13px;
    color: var(--text-ghost);
    letter-spacing: 0.05em;
  }
  .location-card-body { padding: 8px 10px; font-size: 12px; color: var(--text-dim); }
  .location-card-body .coord {
    font-family: 'VT323', monospace;
    font-size: 13px;
    color: var(--accent-telvanni);
    margin-top: 4px;
    display: block;
  }
  .location-danger {
    display: inline-block;
    margin-top: 4px;
    font-family: 'VT323', monospace;
    font-size: 13px;
    padding: 0 5px;
    border: 1px solid;
  }
  .danger-1 { color: #5CA41C; border-color: #5CA41C; }
  .danger-2 { color: #C4A01A; border-color: #C4A01A; }
  .danger-3 { color: #C45A1A; border-color: #C45A1A; }
  .danger-4 { color: #C41C1C; border-color: #C41C1C; }


  /* ===== BESTIARY ENTRIES ===== */
  .bestiary-entry {
    background: var(--ash-panel);
    border: 1px solid var(--border-rust);
    padding: 0;
    overflow: hidden;
    display: flex;
    gap: 0;
    margin-bottom: 8px;
    transition: all 0.15s;
  }
  .bestiary-entry:hover { border-color: var(--accent-crimson); }
  .creature-art {
    width: 80px;
    flex-shrink: 0;
    background: var(--ash-deep);
    border-right: 1px solid var(--border-rust);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'VT323', monospace;
    font-size: 36px;
    color: var(--text-ghost);
    position: relative;
    overflow: hidden;
  }
  .creature-art::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
      45deg,
      transparent,
      transparent 6px,
      rgba(92,46,20,0.05) 6px,
      rgba(92,46,20,0.05) 7px
    );
  }
  .creature-art svg { width: 44px; height: 44px; opacity: 0.5; }
  .bestiary-info { padding: 8px 10px; flex: 1; }
  .bestiary-name {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .bestiary-class {
    font-family: 'VT323', monospace;
    font-size: 13px;
    color: var(--accent-blood);
    letter-spacing: 0.05em;
  }
  .bestiary-desc { font-size: 11px; color: var(--text-dim); margin-top: 4px; line-height: 1.5; }
  .bestiary-stats {
    display: flex;
    gap: 8px;
    margin-top: 5px;
    flex-wrap: wrap;
  }
  .b-stat {
    font-family: 'VT323', monospace;
    font-size: 12px;
    color: var(--text-ghost);
    border: 1px solid rgba(92,46,20,0.3);
    padding: 1px 5px;
  }
  .b-stat span { color: var(--text-parchment); }


  /* ===== SPELL LIST ===== */
  .spell-list { list-style: none; }
  .spell-item {
    display: grid;
    grid-template-columns: 160px 80px 80px 1fr;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(92,46,20,0.2);
    transition: background 0.1s;
  }
  .spell-item:hover { background: rgba(196,134,10,0.04); }
  .spell-item:nth-child(even) { background: rgba(0,0,0,0.2); }
  .spell-item:nth-child(even):hover { background: rgba(196,134,10,0.06); }
  .spell-name {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    color: var(--text-parchment);
    letter-spacing: 0.04em;
  }
  .spell-school {
    font-family: 'VT323', monospace;
    font-size: 13px;
  }
  .school-destruction { color: #C41C1C; }
  .school-illusion { color: #8B5EA8; }
  .school-alteration { color: #1C7AC4; }
  .school-conjuration { color: #C4860A; }
  .school-mysticism { color: #2E7D6B; }
  .school-restoration { color: #5CA41C; }
  .spell-cost {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: #1C7AC4;
  }
  .spell-effect { font-size: 11px; color: var(--text-dim); }
  .spell-header-row {
    display: grid;
    grid-template-columns: 160px 80px 80px 1fr;
    gap: 8px;
    padding: 4px 8px;
    background: var(--ash-deep);
    border-bottom: 1px solid var(--border-rust);
  }
  .spell-header-row span {
    font-family: 'Cinzel', serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-ghost);
  }


  /* ===== NPC CARDS ===== */
  .npc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
  .npc-card {
    background: var(--ash-panel);
    border: 1px solid var(--border-rust);
    overflow: hidden;
    transition: all 0.2s;
    cursor: default;
  }
  .npc-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  }
  .npc-portrait {
    height: 80px;
    background: linear-gradient(135deg, var(--ash-deep), var(--ash-raised));
    border-bottom: 1px solid var(--border-rust);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
  }
  .npc-portrait::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
      -45deg, transparent, transparent 4px,
      rgba(92,46,20,0.06) 4px, rgba(92,46,20,0.06) 5px
    );
  }
  .npc-portrait-glyph {
    font-family: 'Cinzel Decorative', serif;
    font-size: 32px;
    color: rgba(196,134,10,0.3);
    text-transform: uppercase;
  }
  .npc-info { padding: 8px; }
  .npc-name {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .npc-title {
    font-family: 'VT323', monospace;
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 1px;
  }
  .npc-faction { margin-top: 4px; }
  .npc-race {
    font-size: 10px;
    color: var(--text-ghost);
    font-family: 'Cinzel', serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .npc-desc {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 5px;
    line-height: 1.4;
    border-top: 1px solid rgba(92,46,20,0.3);
    padding-top: 5px;
  }


  /* ===== INFO BOXES ===== */
  .info-box {
    background: var(--ash-deep);
    border-left: 3px solid var(--accent-gold);
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.7;
    margin: 8px 0;
  }
  .info-box.crimson { border-left-color: var(--accent-blood); }
  .info-box.telvanni { border-left-color: var(--accent-telvanni); }
  .info-box-title {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-gold);
    margin-bottom: 4px;
  }
  .info-box.crimson .info-box-title { color: var(--accent-blood); }
  .info-box.telvanni .info-box-title { color: var(--accent-telvanni-bright); }


  /* ===== TABLE ===== */
  .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }
  .data-table thead th {
    background: var(--ash-deep);
    border: 1px solid var(--border-rust);
    padding: 5px 8px;
    font-family: 'Cinzel', serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    text-align: left;
  }
  .data-table tbody td {
    border: 1px solid rgba(92,46,20,0.3);
    padding: 5px 8px;
    color: var(--text-dim);
  }
  .data-table tbody tr:hover td { background: rgba(196,134,10,0.04); color: var(--text-parchment); }
  .data-table tbody tr:nth-child(even) td { background: rgba(0,0,0,0.15); }
  .td-highlight { color: var(--accent-gold) !important; font-family: 'Cinzel', serif; }
  .td-telvanni { color: var(--accent-telvanni-bright) !important; }


  /* ===== QUOTE BLOCK ===== */
  .lore-quote {
    border: 1px solid rgba(92,46,20,0.4);
    background: linear-gradient(135deg, var(--ash-deep), rgba(28,20,16,0.5));
    padding: 12px 16px;
    position: relative;
    margin: 10px 0;
  }
  .lore-quote::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(180deg, var(--accent-gold), var(--accent-crimson));
  }
  .lore-quote p {
    font-style: italic;
    font-size: 13px;
    color: var(--text-parchment);
    line-height: 1.8;
  }
  .lore-quote .attribution {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-top: 8px;
    text-align: right;
  }


  /* ===== NESTED CONTAINER ===== */
  .nested-container {
    border: 1px solid rgba(92,46,20,0.3);
    padding: 8px;
    background: rgba(0,0,0,0.2);
    margin: 6px 0;
  }
  .nested-title {
    font-family: 'Cinzel', serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    border-bottom: 1px solid rgba(92,46,20,0.3);
    padding-bottom: 4px;
    margin-bottom: 6px;
  }


  /* ===== MAP GRID ===== */
  .map-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: var(--border-rust);
    border: 1px solid var(--border-rust);
    font-family: 'VT323', monospace;
    font-size: 11px;
  }
  .map-cell {
    background: var(--ash-deep);
    padding: 4px;
    text-align: center;
    color: var(--text-ghost);
    cursor: default;
    transition: all 0.1s;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    position: relative;
  }
  .map-cell:hover { background: rgba(196,134,10,0.08); color: var(--accent-gold); z-index: 2; }
  .map-cell.notable { background: rgba(139,26,26,0.2); color: var(--accent-crimson); }
  .map-cell.settlement { background: rgba(196,134,10,0.12); color: var(--accent-gold); }
  .map-cell.telvanni-cell { background: rgba(46,125,107,0.1); color: var(--accent-telvanni); }
  .map-legend {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    flex-wrap: wrap;
  }
  .legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Cinzel', serif;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-ghost);
  }
  .legend-dot {
    width: 8px; height: 8px;
    border: 1px solid;
  }


  /* ===== FOOTER ===== */
  #footer {
    border-top: 2px solid var(--border-rust);
    background: var(--ash-deep);
    padding: 0;
  }
  .footer-marquee-bar {
    background: var(--void);
    border-bottom: 1px solid rgba(92,46,20,0.4);
    padding: 4px 0;
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: var(--accent-telvanni);
    letter-spacing: 0.05em;
  }
  .footer-inner {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    padding: 14px;
    gap: 14px;
    max-width: 1400px;
    margin: 0 auto;
  }
  .footer-section h5 {
    font-size: 10px;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(92,46,20,0.4);
    padding-bottom: 4px;
  }
  .footer-links { list-style: none; }
  .footer-links li a {
    font-size: 11px;
    color: var(--text-ghost);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: block;
    padding: 2px 0;
    transition: color 0.1s;
  }
  .footer-links li a:hover { color: var(--text-dim); }
  .footer-bottom {
    border-top: 1px solid rgba(92,46,20,0.4);
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
  }
  .footer-bottom-text {
    font-family: 'VT323', monospace;
    font-size: 13px;
    color: var(--text-ghost);
    letter-spacing: 0.05em;
  }


  /* ===== ANIMATIONS ===== */
  @keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 4px rgba(196,134,10,0.2); }
    50% { box-shadow: 0 0 12px rgba(196,134,10,0.4); }
  }
  @keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
  }
  .scanline-overlay {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(196,134,10,0.06), transparent);
    pointer-events: none;
    animation: scanline 8s linear infinite;
    z-index: 9999;
  }
  @keyframes float-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .tab-pane.active { animation: float-in 0.25s ease; }


  /* ===== TOOLTIP ===== */
  [data-tooltip] { position: relative; cursor: help; }
  [data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--ash-raised);
    border: 1px solid var(--border-gold);
    color: var(--text-parchment);
    font-family: 'Courier Prime', monospace;
    font-size: 11px;
    padding: 4px 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 100;
  }
  [data-tooltip]:hover::after { opacity: 1; }


  /* ===== RESPONSIVE ===== */
  @media (max-width: 900px) {
    #main-layout { grid-template-columns: 1fr; }
    #sidebar { border-right: none; border-bottom: 1px solid var(--border-rust); flex-direction: row; flex-wrap: wrap; }
    .sidebar-widget { min-width: 200px; flex: 1; }
    .content-2col { grid-template-columns: 1fr; }
    .content-3col { grid-template-columns: 1fr 1fr; }
    .spell-item { grid-template-columns: 1fr 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
  }
  @media (max-width: 600px) {
    .nav-links li:nth-child(n+4) { display: none; }
    .content-3col { grid-template-columns: 1fr; }
    .npc-grid { grid-template-columns: 1fr 1fr; }
    .hero-title { font-size: 20px; }
  }