/* ==========================================
   White Mage Sanctuary Design Tokens (Normal Mode)
   ========================================== */
:root {
    /* Fonts - Classic High Fantasy & RPG Serifs */
    --font-heading: 'Cinzel', 'Georgia', serif;
    --font-body: 'Lora', 'Georgia', serif;

    /* Theme: Lodestone Warm Eorzean Parchment */
    --bg-app: #eae3d2; /* Eorzean Warm Parchment Map Background */
    
    /* Document elements - rich cream scroll cards */
    --bg-window-top: #fcf9f2;
    --bg-window-bottom: #fcf9f2;
    --bg-surface: #fcf9f2; /* Clean light parchment */
    --bg-surface-hover: #f5eedf; /* Soft golden hover */
    
    /* White Mage Quest Accent */
    --bg-tldr: linear-gradient(135deg, #fdf5e8 0%, #faecd7 100%);
    
    /* Authentic Gold & Crimson Trims */
    --gold-primary: #be9648; /* Antique Gold */
    --gold-secondary: #997227; /* Deep Gold */
    --gold-light: #e5c483; /* Radiant Gold highlight */
    --crimson-primary: #be123c; /* White Mage Crimson */
    --crimson-hover: #9f1239; /* Deep Burgundy */
    
    --border-color: #d8cfc0; /* Warm clay border */
    --border-gold: #be9648; /* Gold border for accents */
    
    --text-primary: #2b201a; /* Sharp, extremely legible dark espresso */
    --text-secondary: #4c3b31; /* Warm mahogany brown for body text */
    --text-muted: #7c685c; /* Soft charcoal-brown for notes */
    
    /* Spell & Buff Colors (Subtle, clean, high-contrast on light background) */
    --color-cure1: #dc2626; /* Crimson for Cure I */
    --color-cure2: #16a34a; /* Emerald for Cure II */
    --color-lucid: #7c3aed; /* Mana Violet */
    --color-damage: #2563eb; /* Glare sky-blue */

    /* Shadows & Borders */
    --box-shadow-game: 0 6px 20px rgba(43, 32, 26, 0.08), 0 1px 3px rgba(43, 32, 26, 0.02);
    --transition-click: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   Bizarro Mode (NES / SNES Final Fantasy Dialogue Box)
   ========================================== */
.reverse-mode {
    /* Classic Retro Monospaced Font */
    --font-heading: 'Press Start 2P', monospace;
    --font-body: 'Press Start 2P', monospace;

    /* NES Royal Blue Background & Thick White Borders */
    --bg-app: #000000;
    --bg-window-top: #000088;
    --bg-window-bottom: #0000a8;
    --bg-surface: linear-gradient(to bottom, var(--bg-window-top) 0%, var(--bg-window-bottom) 100%);
    --bg-surface-hover: #0000d8;
    --bg-tldr: #000088;
    
    --gold-primary: #ffffff;
    --gold-secondary: #ffffff;
    --gold-light: #ffffff;
    
    --border-color: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-muted: #aaaaaa;
    
    --color-cure1: #00ff00; /* Cure I is green/good! */
    --color-cure2: #ff0000; /* Cure II is red/bad! */
    --color-lucid: #ff00ff;
    --color-damage: #00ffff;
}

/* ==========================================
   Reset & Base Styles
   ========================================== */
html {
    scroll-behavior: smooth;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    background-image: radial-gradient(circle at 50% 0%, rgba(190, 18, 60, 0.04) 0%, rgba(234, 227, 210, 0) 70%);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    transition: background var(--transition-smooth);
}

.glow-bg {
    display: none;
}

/* ==========================================
   Layout Containers
   ========================================== */
.app-container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 50px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ==========================================
   Typography & Decorative Ornaments
   ========================================== */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--crimson-primary);
}

a {
    color: var(--crimson-primary);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dotted var(--crimson-primary);
    transition: all var(--transition-click);
}

a:hover {
    color: var(--crimson-hover);
    border-bottom-color: var(--crimson-hover);
}

/* FFXIV Diamond Divider Ornament */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px 0;
    color: var(--gold-primary);
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider::before { margin-right: 15px; }
.divider::after { margin-left: 15px; }

.divider-icon {
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--gold-primary);
}

/* ==========================================
   WHM Panel Styling
   ========================================== */
.glass-panel {
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    border-top: 3px solid var(--gold-primary);
    border-radius: 4px; /* Hard classic corners */
    box-shadow: var(--box-shadow-game);
    position: relative;
    transition: border var(--transition-smooth);
}

/* ==========================================
   Header Component
   ========================================== */
header {
    text-align: center;
    padding: 35px 20px;
    border-radius: 4px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    border-top: 4px solid var(--crimson-primary);
    box-shadow: var(--box-shadow-game);
    position: relative;
}

header::after {
    content: '❖';
    position: absolute;
    bottom: -10px;
    left: calc(50% - 8px);
    background: var(--bg-app);
    color: var(--gold-primary);
    font-size: 0.8rem;
    padding: 0 6px;
}

.header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    font-size: 2.1rem;
    font-weight: 700;
    flex-wrap: nowrap;
    line-height: 1.3;
    color: var(--text-primary);
    white-space: nowrap;
}

.header-title img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px;
    background: rgba(43, 32, 26, 0.04);
    flex-shrink: 0;
}

.cure1-header {
    color: var(--color-cure1);
    background: #ffebeb;
    border: 1px solid #ffc1c1;
    padding: 2px 10px;
    border-radius: 4px;
    font-family: var(--font-heading);
    white-space: nowrap;
}

.cure2 {
    color: var(--color-cure2);
    background: #ebfcf0;
    border: 1px solid #c2f5d3;
    padding: 2px 10px;
    border-radius: 4px;
    font-family: var(--font-heading);
    white-space: nowrap;
}

/* ==========================================
   TL;DR Panel (Duty/Quest Card Style)
   ========================================== */
.tldr-box {
    background: var(--bg-tldr);
    border: 1.5px solid var(--border-color);
    border-left: 6px solid var(--crimson-primary);
    padding: 30px;
    border-radius: 4px;
    box-shadow: var(--box-shadow-game);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tldr-box h2 {
    font-size: 1.5rem;
    color: var(--crimson-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.tldr-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
}

.tldr-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.tldr-badge {
    display: inline-block;
    padding: 4px 10px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    border-radius: 4px;
    text-align: center;
    min-width: 70px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(43, 32, 26, 0.05);
}

.badge-stop {
    background: rgba(190, 18, 60, 0.08);
    border: 1.5px solid var(--crimson-primary);
    color: var(--crimson-primary);
}

.badge-use {
    background: rgba(22, 163, 74, 0.08);
    border: 1.5px solid var(--color-cure2);
    color: var(--color-cure2);
}

.badge-avoid {
    background: rgba(217, 119, 6, 0.08);
    border: 1.5px solid #d97706;
    color: #d97706;
}

.tldr-text {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.tldr-text img {
    height: 22px;
    width: 22px;
    vertical-align: middle;
    margin: 0 4px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: rgba(43, 32, 26, 0.04);
}

.potency-highlight {
    color: var(--crimson-primary);
    font-weight: 700;
}

/* ==========================================
   Tabs Component (Elegant Guidebook Tabs)
   ========================================== */
.tab {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: rgba(43, 32, 26, 0.05);
    border-radius: 4px 4px 0 0;
    padding: 6px 6px 0 6px;
    gap: 4px;
    border-bottom: 1.5px solid var(--border-color);
}

.tab::-webkit-scrollbar {
    display: none;
}

.tab button {
    flex-shrink: 0;
    background: rgba(43, 32, 26, 0.03);
    border: 1px solid var(--border-color);
    border-bottom: none;
    outline: none;
    cursor: pointer;
    padding: 12px 20px;
    transition: all var(--transition-click);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    border-radius: 3px 3px 0 0;
    position: relative;
    margin-bottom: -1.5px;
}

.tab button:hover {
    color: var(--crimson-primary);
    background: var(--bg-surface-hover);
}

.tab button.active {
    color: var(--crimson-primary);
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    border-bottom: 2px solid var(--bg-surface); /* Overlaps bottom border perfectly */
    border-top: 3px solid var(--crimson-primary);
    font-weight: 700;
    box-shadow: none;
}

.tabcontent-container {
    padding: 35px;
}

.tabcontent {
    display: none;
}

.tabcontent h2 {
    font-size: 1.75rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    color: var(--crimson-primary);
    position: relative;
}

/* Small square ornament under headers */
.tabcontent h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--gold-primary);
    transform: rotate(45deg);
}

.tabcontent h3 {
    font-size: 1.25rem;
    margin: 28px 0 14px 0;
    color: var(--crimson-primary);
    border-left: 3px solid var(--crimson-primary);
    padding-left: 10px;
}

.tabcontent p {
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.tabcontent strong {
    color: var(--text-primary);
}

/* Bullet list modernization */
.tabcontent ul {
    list-style: none;
    margin-bottom: 24px;
    padding-left: 4px;
}

.tabcontent li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 1.02rem;
}

.tabcontent li::before {
    content: '❖';
    position: absolute;
    left: 4px;
    top: 2px;
    color: var(--crimson-primary);
    font-size: 0.75rem;
}

/* Nested lists */
.tabcontent ul ul {
    margin-top: 10px;
    margin-bottom: 10px;
    padding-left: 12px;
}

.tabcontent ul ul li::before {
    content: '✦';
    color: var(--text-muted);
}

/* Return to top link */
.tabcontent p a[href="#tabbed-content"] {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px dashed var(--text-muted);
    transition: color var(--transition-click);
    margin-top: 20px;
}

.tabcontent p a[href="#tabbed-content"]:hover {
    color: var(--crimson-primary);
    border-bottom-color: var(--crimson-primary);
}

/* Custom Highlight Spans */
.damage-spell {
    color: var(--color-damage);
    font-weight: 700;
}

.lucid-dreaming {
    color: var(--color-lucid);
    font-weight: 700;
}

.tabcontent img:not(.sim-slot-icon) {
    height: 22px;
    width: 22px;
    vertical-align: middle;
    margin: 0 4px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: rgba(43, 32, 26, 0.04);
}

/* ==========================================
   RPG Comparison Grid & Cards
   ========================================== */
.math-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 24px 0;
}

@media (max-width: 768px) {
    .math-grid {
        grid-template-columns: 1fr;
    }
    .header-title {
        flex-wrap: wrap;
        font-size: 1.4rem;
        white-space: normal;
        gap: 10px;
    }
    .header-title img {
        width: 32px;
        height: 32px;
    }
}

.math-card {
    background: rgba(43, 32, 26, 0.02);
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    padding: 22px;
    transition: all var(--transition-smooth);
}

.math-card:hover {
    border-color: var(--gold-primary);
    background: var(--bg-surface-hover);
    box-shadow: var(--box-shadow-game);
}

.math-card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.math-card-cure1 {
    border-top: 4px solid var(--color-cure1);
}

.math-card-cure2 {
    border-top: 4px solid var(--color-cure2);
}

.math-card p {
    font-size: 0.98rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* ==========================================
   Resources Component
   ========================================== */
.resource-card {
    padding: 35px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: flex-start;
    border-top: 3px solid var(--crimson-primary);
}

.resource-card h2 {
    font-size: 1.6rem;
    border-bottom: none;
}

.resource-card p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.resource-link-wrapper {
    width: 100%;
}

/* Crimson Primary Action Button */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(to bottom, var(--crimson-primary) 0%, var(--crimson-hover) 100%);
    border: 1.5px solid var(--crimson-primary);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 15px 32px;
    border-radius: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(190, 18, 60, 0.15);
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--crimson-hover);
    box-shadow: 0 6px 20px rgba(190, 18, 60, 0.25);
    transform: translateY(-1px);
}

.btn-primary svg {
    transition: transform var(--transition-click);
}

.btn-primary:hover svg {
    transform: translate(3px, -3px);
}

.guide-intent-container {
    margin-top: 14px;
    width: 100%;
}

.guide-intent-link {
    font-size: 0.9rem;
    font-family: var(--font-heading);
    color: var(--text-muted);
    border-bottom: 1.5px dashed var(--border-color);
    transition: color var(--transition-click);
}

.guide-intent-link:hover {
    color: var(--crimson-primary);
    border-bottom-color: var(--crimson-primary);
}

.reverse-mode .guide-intent-container {
    margin-top: 20px !important;
}

.reverse-mode .guide-intent-link {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.55rem !important;
    color: #ffffff !important;
    border-bottom: 3px dashed #ffffff !important;
}

/* ==========================================
   Footer Component
   ========================================== */
footer {
    border-top: 1.5px solid var(--border-color);
    padding: 35px 20px;
    margin-top: 20px;
    background: var(--bg-surface);
    border-radius: 4px;
    box-shadow: var(--box-shadow-game);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

.vanilla-badge-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.vanilla-link img {
    height: 22px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 1px;
    background: rgba(43, 32, 26, 0.04);
}

.speed-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: 4px;
    background: rgba(43, 32, 26, 0.03);
    border: 1.5px solid var(--border-color);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.speed-icon {
    color: var(--gold-primary);
}

#load-time {
    color: var(--crimson-primary);
    font-weight: 700;
}

.timing-details {
    margin-top: 20px;
    padding: 20px;
    background: rgba(43, 32, 26, 0.03);
    border-radius: 4px;
    border: 1.5px dashed var(--border-color);
    font-size: 0.92rem;
    color: var(--text-secondary);
    width: 100%;
}

.timing-details a {
    color: var(--crimson-primary);
    font-weight: 700;
    border-bottom: 1px dotted var(--crimson-primary);
}

.timing-details a:hover {
    color: var(--crimson-hover);
}

/* ==========================================
   NES Theme Details (Only applied when .reverse-mode)
   ========================================== */
.reverse-mode body {
    background: #000000 !important;
    background-image: none !important;
}

.reverse-mode .app-container {
    gap: 36px;
}

.reverse-mode header,
.reverse-mode .tldr-box,
.reverse-mode .glass-panel,
.reverse-mode .math-card,
.reverse-mode .timing-details,
.reverse-mode footer {
    background: #000088 !important;
    border: 4px solid #ffffff !important;
    box-shadow: 0 0 0 4px #000000, 10px 10px 0px rgba(0,0,0,0.5) !important;
    border-radius: 0px !important;
    color: #ffffff !important;
    text-shadow: none !important;
}

.reverse-mode h1, 
.reverse-mode h2, 
.reverse-mode h3, 
.reverse-mode h4,
.reverse-mode a,
.reverse-mode span {
    color: #ffffff !important;
    font-family: 'Press Start 2P', monospace !important;
    text-shadow: none !important;
}

.reverse-mode header::after,
.reverse-mode .tabcontent h2::after {
    display: none !important;
}

.reverse-mode .header-title {
    font-size: 1.1rem !important;
    gap: 12px !important;
    line-height: 1.8 !important;
}

.reverse-mode .header-title img {
    width: 32px !important;
    height: 32px !important;
    border: 3px solid #ffffff !important;
    border-radius: 0px !important;
}

.reverse-mode .tab {
    background: #000000 !important;
    border-bottom: 4px solid #ffffff !important;
    padding: 8px 8px 0 8px !important;
    gap: 8px !important;
    border-radius: 0px !important;
}

.reverse-mode .tab button {
    background: #000044 !important;
    border: 3px solid #ffffff !important;
    border-bottom: none !important;
    color: #ffffff !important;
    font-size: 0.6rem !important;
    padding: 10px 12px !important;
    border-radius: 0px !important;
    margin-bottom: -4px !important;
}

.reverse-mode .tab button:hover {
    background: #0000aa !important;
}

.reverse-mode .tab button.active {
    background: #000088 !important;
    border: 4px solid #ffffff !important;
    border-bottom: none !important;
    color: #00ff00 !important;
}

.reverse-mode .tabcontent-container {
    padding: 24px !important;
}

.reverse-mode .tabcontent h2 {
    font-size: 0.75rem !important;
    border-bottom: 4px solid #ffffff !important;
    padding-bottom: 12px !important;
}

.reverse-mode .tabcontent h3 {
    font-size: 0.65rem !important;
    border-left: none !important;
    padding-left: 0 !important;
    margin: 24px 0 12px 0 !important;
    text-decoration: underline !important;
}

.reverse-mode .tabcontent p,
.reverse-mode .tabcontent li {
    font-size: 0.6rem !important;
    line-height: 2.0 !important;
    color: #ffffff !important;
}

.reverse-mode .tabcontent li::before {
    content: '▶' !important;
    color: #ffffff !important;
    font-size: 0.55rem !important;
}

.reverse-mode .cure1,
.reverse-mode .cure1-header,
.reverse-mode .cure2 {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.reverse-mode .cure1, 
.reverse-mode .cure1-header {
    color: #00ff00 !important; /* Green is good in bizarro! */
}

.reverse-mode .cure2 {
    color: #ff0000 !important; /* Red is bad in bizarro! */
}

.reverse-mode .damage-spell {
    color: #00ffff !important;
}

.reverse-mode .lucid-dreaming {
    color: #ff00ff !important;
}

/* Bizarro/NES Mode Override for TL;DR objectives */
.reverse-mode .tldr-list {
    gap: 18px;
}

.reverse-mode .tldr-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.reverse-mode .tldr-badge {
    border-radius: 0px !important;
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.7rem !important;
    letter-spacing: 0px !important;
    padding: 6px 12px !important;
    min-width: 80px !important;
    text-align: center !important;
    box-shadow: none !important;
}

.reverse-mode .badge-stop {
    background: #ff0000 !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
}

.reverse-mode .badge-use {
    background: #00aa00 !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
}

.reverse-mode .badge-avoid {
    background: #ffaa00 !important;
    border: 2px solid #ffffff !important;
    color: #000000 !important;
}

.reverse-mode .tldr-text {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.8rem !important;
    line-height: 1.8 !important;
    color: #ffffff !important;
}

.reverse-mode .tldr-text img {
    border: 2px solid #ffffff !important;
    border-radius: 0px !important;
    background: transparent !important;
}

.reverse-mode .potency-highlight {
    color: #ffff00 !important; /* Retro bright yellow */
}

.reverse-mode .btn-primary {
    background: #000044 !important;
    border: 4px solid #ffffff !important;
    border-radius: 0px !important;
    color: #ffffff !important;
    font-size: 0.6rem !important;
    padding: 12px 20px !important;
    box-shadow: none !important;
}

.reverse-mode .btn-primary:hover {
    background: #0000d8 !important;
    color: #00ff00 !important;
}

.reverse-mode .speed-badge {
    border: 3px solid #ffffff !important;
    border-radius: 0px !important;
    background: #000044 !important;
    font-size: 0.5rem !important;
}

.reverse-mode #load-time {
    color: #00ff00 !important;
}

.reverse-mode .timing-details a {
    color: #00ffff !important;
}

/* Potency Calculation Box comparison grid */
.potency-calc-box {
    display: flex;
    gap: 20px;
    margin: 24px 0;
}

.potency-calc-col {
    flex: 1;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 16px 20px;
}

.potency-calc-col h4 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--crimson-primary);
    font-family: var(--font-heading);
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.potency-calc-col ul {
    margin: 0;
    padding-left: 20px;
}

.potency-calc-col li {
    margin-bottom: 6px;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .potency-calc-box {
        flex-direction: column;
    }
}

/* Bizarro overrides */
.reverse-mode .potency-calc-col {
    background: #000055 !important;
    border: 3px solid #ffffff !important;
    border-radius: 0px !important;
}

.reverse-mode .potency-calc-col h4 {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.5rem !important;
    color: #ffffff !important;
    border-bottom: 3px solid #ffffff !important;
}

.reverse-mode .potency-calc-col li {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.4rem !important;
    line-height: 1.6 !important;
    color: #ffffff !important;
}

/* ==========================================
   FFXIV Cast Bar & GCD Timeline Simulator
   ========================================== */
.simulator-wrapper {
    background: var(--bg-surface-hover);
    border: 1.5px solid var(--border-color);
    border-top: 3.5px solid var(--gold-primary);
    border-radius: 4px;
    padding: 30px;
    margin: 32px 0 16px 0;
    box-shadow: var(--box-shadow-game);
}

.sim-header {
    text-align: center;
    margin-bottom: 24px;
}

.sim-header h4 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--crimson-primary);
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.sim-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0 !important;
}

.sim-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
}

.btn-sim {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-click);
    outline: none;
}

.btn-sim-play {
    background: linear-gradient(to bottom, #d9aa4e 0%, #be9648 100%);
    border: 1.5px solid #be9648;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(43, 32, 26, 0.4);
    box-shadow: 0 2px 6px rgba(190, 150, 72, 0.2);
}

.btn-sim-play:hover {
    background: #be9648;
    box-shadow: 0 4px 12px rgba(190, 150, 72, 0.35);
    transform: translateY(-1px);
}

.btn-sim-play.active {
    background: linear-gradient(to bottom, #ea580c 0%, #c2410c 100%);
    border-color: #c2410c;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-sim-reset {
    background: #eae3d2;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-sim-reset:hover {
    background: #dfd6c0;
    color: var(--text-primary);
}

.sim-lanes {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-bottom: 30px;
}

.sim-lane {
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    box-shadow: inset 0 1px 4px rgba(43, 32, 26, 0.03);
}

.sim-lane-header {
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sim-lane-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
}

/* Castbar styled like actual FFXIV castbar */
.sim-castbar-container {
    height: 30px;
    background: #1a1613;
    border: 1.5px solid #4a3e36;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8);
}

.sim-castbar-label {
    position: absolute;
    left: 12px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    color: #e2dcd6;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.sim-castbar-timer {
    position: absolute;
    right: 12px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    color: #ffd700;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.sim-castbar-fill {
    height: 100%;
    width: 0%;
    transition: width 0.05s linear;
}

/* Beautiful FFXIV Golden Gradient Cast fill */
.sim-castbar-fill.casting {
    background: linear-gradient(to right, #9a6d1e 0%, #be9648 40%, #ffd700 80%, #ffffff 100%);
    box-shadow: 0 0 12px #ffd700, inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

/* Slide Recast is empty or dark blue loading bar */
.sim-castbar-fill.recasting {
    background: rgba(190, 150, 72, 0.15);
    width: 0% !important;
}

/* OOM Error fill */
.sim-castbar-fill.oom-error {
    background: linear-gradient(45deg, #7f1d1d 25%, #b91c1c 25%, #b91c1c 50%, #7f1d1d 50%, #7f1d1d 75%, #b91c1c 75%, #b91c1c 100%);
    background-size: 20px 20px;
    animation: oom-hatch-slide 0.8s linear infinite;
    box-shadow: 0 0 8px rgba(185, 28, 28, 0.6);
}

@keyframes oom-hatch-slide {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.oom-warning {
    color: #ef4444 !important;
    font-weight: bold;
    animation: pulse-red 0.5s ease-in-out infinite alternate;
}

@keyframes pulse-red {
    0% { opacity: 0.7; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1.02); }
}

/* Timeline slots */
.sim-slots {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.sim-slot {
    background: rgba(43, 32, 26, 0.03);
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.sim-slot-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 0%;
    background: var(--gold-primary);
    transition: width 0.05s linear;
}

.sim-slot-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1px;
    background: rgba(43, 32, 26, 0.05);
    z-index: 2;
    transition: transform 0.2s ease;
}

/* Custom Glare CSS Icon */
.glare-icon-css {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: radial-gradient(circle, #a5f3fc 0%, #0284c7 100%);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: bold;
    font-size: 1.1rem;
    font-family: var(--font-heading);
    box-shadow: 0 0 8px rgba(14, 165, 233, 0.6);
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    z-index: 2;
}

.glare-letter {
    font-family: var(--font-heading) !important;
    font-weight: bold !important;
}

.sim-slot-badge {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    z-index: 2;
}

/* Active Casting slot state */
.sim-slot.active {
    border-color: var(--gold-primary);
    background: rgba(190, 150, 72, 0.05);
    box-shadow: 0 0 10px rgba(190, 150, 72, 0.2);
}

.sim-slot.active.casting {
    animation: slot-pulse 1s linear infinite alternate;
}

@keyframes slot-pulse {
    0% { border-color: var(--border-color); }
    100% { border-color: var(--gold-light); }
}

.sim-slot.active .sim-slot-icon {
    transform: scale(1.05);
}

/* Completed slot state */
.sim-slot.completed {
    border-color: var(--gold-primary);
    background: linear-gradient(135deg, rgba(253, 245, 232, 0.9) 0%, rgba(250, 236, 215, 0.9) 100%);
}

.sim-slot.completed::before {
    content: '❖';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.65rem;
    color: var(--gold-primary);
}

.sim-slot.completed .sim-slot-progress {
    background: var(--gold-primary);
    width: 100% !important;
}

/* Stuck OOM slot state */
.sim-slot.stuck-oom {
    border-color: #ef4444;
    background: linear-gradient(45deg, #fef2f2 25%, #fee2e2 25%, #fee2e2 50%, #fef2f2 50%, #fef2f2 75%, #fee2e2 75%, #fee2e2 100%);
    background-size: 14px 14px;
    animation: oom-hatch-slide 1.5s linear infinite;
}

.sim-slot.stuck-oom .sim-slot-icon,
.sim-slot.stuck-oom .glare-icon-css {
    filter: grayscale(1) opacity(0.4);
    border-color: #ef4444;
}

.sim-slot.stuck-oom .sim-slot-badge {
    color: #ef4444;
}

/* Dashboard styles */
.sim-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    border-top: 1.5px solid var(--border-color);
    padding-top: 24px;
}

.sim-dash-lane {
    background: rgba(43, 32, 26, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 16px;
}

.sim-dash-lane h5 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.sim-dash-metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sim-metric {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.metric-label {
    color: var(--text-secondary);
}

.metric-val {
    font-weight: 700;
    color: var(--text-primary);
}

/* Color codes for metrics */
.val-heal-a, .val-heal-b {
    color: var(--color-cure2);
}

.val-dps-a, .val-dps-b {
    color: var(--color-damage);
}

.val-mp-a, .val-mp-b {
    color: var(--color-lucid);
}

@media (max-width: 768px) {
    .sim-slots {
        gap: 6px;
    }
    .sim-slot {
        padding: 8px;
        font-size: 0.8rem;
    }
    .sim-slot-icon, .glare-icon-css {
        width: 32px;
        height: 32px;
    }
    .glare-icon-css {
        font-size: 0.9rem;
    }
    .sim-dashboard {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ==========================================
   Bizarro Mode Retro NES/SNES Simulator Styles
   ========================================== */
.reverse-mode .simulator-wrapper {
    background: #000088 !important;
    border: 4px solid #ffffff !important;
    box-shadow: 0 0 0 4px #000000, 10px 10px 0px rgba(0,0,0,0.5) !important;
    border-radius: 0px !important;
    padding: 20px !important;
}

.reverse-mode .sim-header h4 {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.65rem !important;
    color: #ffffff !important;
    line-height: 1.6 !important;
}

.reverse-mode .sim-subtitle {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.45rem !important;
    color: #aaaaaa !important;
    line-height: 1.6 !important;
}

.reverse-mode .btn-sim {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.5rem !important;
    border-radius: 0px !important;
    padding: 8px 16px !important;
}

.reverse-mode .btn-sim-play {
    background: #000044 !important;
    border: 3px solid #ffffff !important;
    color: #ffffff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.reverse-mode .btn-sim-play:hover {
    background: #0000aa !important;
    color: #00ff00 !important;
    transform: none !important;
}

.reverse-mode .btn-sim-play.active {
    background: #aa0000 !important;
    color: #ffffff !important;
}

.reverse-mode .btn-sim-reset {
    background: #000044 !important;
    border: 3px solid #ffffff !important;
    color: #ffffff !important;
}

.reverse-mode .btn-sim-reset:hover {
    background: #0000aa !important;
    color: #ffff00 !important;
}

.reverse-mode .sim-lane {
    background: #000055 !important;
    border: 3px solid #ffffff !important;
    border-radius: 0px !important;
}

.reverse-mode .sim-lane-title {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.5rem !important;
    color: #ffffff !important;
}

.reverse-mode .sim-castbar-container {
    height: 32px !important;
    border: 3px solid #ffffff !important;
    border-radius: 0px !important;
    background: #000000 !important;
    box-shadow: none !important;
}

.reverse-mode .sim-castbar-label {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.45rem !important;
    color: #ffffff !important;
    text-shadow: none !important;
}

.reverse-mode .sim-castbar-timer {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.45rem !important;
    color: #ffff00 !important;
    text-shadow: none !important;
}

.reverse-mode .sim-castbar-fill.casting {
    background: #ffff00 !important;
    box-shadow: none !important;
}

.reverse-mode .sim-castbar-fill.oom-error {
    background: linear-gradient(45deg, #aa0000 25%, #ff0000 25%, #ff0000 50%, #aa0000 50%, #aa0000 75%, #ff0000 75%, #ff0000 100%) !important;
    background-size: 16px 16px !important;
    box-shadow: none !important;
}

.reverse-mode .sim-slot {
    background: #000033 !important;
    border: 3px solid #ffffff !important;
    border-radius: 0px !important;
}

.reverse-mode .sim-slot-badge {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.45rem !important;
    color: #aaaaaa !important;
}

.reverse-mode .sim-slot-icon {
    border: 3px solid #ffffff !important;
    border-radius: 0px !important;
    background: #000000 !important;
    width: 36px !important;
    height: 36px !important;
}

.reverse-mode .sim-slot.active {
    border-color: #00ff00 !important;
    background: #0000aa !important;
    box-shadow: none !important;
}

.reverse-mode .sim-slot.active.casting {
    animation: none !important;
}

.reverse-mode .sim-slot.completed {
    border-color: #ffff00 !important;
    background: #000088 !important;
}

.reverse-mode .sim-slot.completed::before {
    content: '★' !important;
    color: #ffff00 !important;
    font-size: 0.55rem !important;
    top: 4px !important;
    right: 4px !important;
}

.reverse-mode .sim-slot.stuck-oom {
    border-color: #ff0000 !important;
    background: linear-gradient(45deg, #550000 25%, #ff0000 25%, #ff0000 50%, #550000 50%, #550000 75%, #ff0000 75%, #ff0000 100%) !important;
    background-size: 12px 12px !important;
}

.reverse-mode .sim-slot.stuck-oom .sim-slot-icon {
    border-color: #ff0000 !important;
}

.reverse-mode .sim-slot.stuck-oom .sim-slot-badge {
    color: #ff0000 !important;
}

.reverse-mode .sim-dash-lane {
    background: #000055 !important;
    border: 3px solid #ffffff !important;
    border-radius: 0px !important;
}

.reverse-mode .sim-dash-lane h5 {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.48rem !important;
    color: #ffffff !important;
    border-bottom: 3px solid #ffffff !important;
}

.reverse-mode .sim-dashboard {
    border-top: 3px solid #ffffff !important;
}

.reverse-mode .sim-metric {
    font-size: 0.42rem !important;
}

.reverse-mode .metric-label {
    color: #aaaaaa !important;
    font-family: 'Press Start 2P', monospace !important;
}

.reverse-mode .metric-val {
    font-family: 'Press Start 2P', monospace !important;
}

.reverse-mode .val-heal-a, 
.reverse-mode .val-heal-b {
    color: #00ff00 !important;
}

.reverse-mode .val-dps-a, 
.reverse-mode .val-dps-b {
    color: #00ffff !important;
}

.reverse-mode .val-mp-a, 
.reverse-mode .val-mp-b {
    color: #ff00ff !important;
}

.reverse-mode .oom-warning {
    color: #ff0000 !important;
    font-family: 'Press Start 2P', monospace !important;
    animation: none !important;
}

/* Interactive Simulators Upgrade - Styles */

/* Freecure Trap Simulator Specific Styles */
.freecure-slots {
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
}

.freecure-proc-badge {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
    border: 0.5px solid #fbbf24;
    white-space: nowrap;
    z-index: 10;
    animation: proc-pulse 1s infinite alternate;
    display: none;
}

@keyframes proc-pulse {
    0% { transform: translateX(-50%) scale(0.95); opacity: 0.9; }
    100% { transform: translateX(-50%) scale(1.05); opacity: 1; box-shadow: 0 0 10px rgba(245, 158, 11, 1); }
}

.sim-slot.freecure-free-glow {
    border-color: #fbbf24 !important;
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.9) 0%, rgba(253, 230, 138, 0.9) 100%) !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.sim-slot.freecure-free-glow::before {
    content: '★' !important;
    color: #d97706 !important;
}

/* MP Management Simulator Specific Styles */
.mp-slots {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.mp-bar-container {
    width: 100%;
    margin-bottom: 12px;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: rgba(43, 32, 26, 0.05);
    height: 24px;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.mp-bar-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.mp-bar-fill {
    height: 100%;
    width: 100%;
    transition: width 0.3s ease, background 0.3s ease;
}

.mp-healthy {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.2), 0 0 8px rgba(16, 185, 129, 0.4);
}

.mp-caution {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.2), 0 0 8px rgba(245, 158, 11, 0.4);
}

.mp-danger {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.2), 0 0 8px rgba(239, 68, 68, 0.4);
    animation: mp-danger-pulse 0.8s infinite alternate;
}

@keyframes mp-danger-pulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

.mp-bar-label {
    position: absolute;
    width: 100%;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dark);
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
    z-index: 10;
    pointer-events: none;
}

.mp-regen-flash {
    animation: regen-flash-anim 0.3s ease-out;
}

@keyframes regen-flash-anim {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.4); }
    100% { filter: brightness(1); }
}

.lucid-badge {
    display: none;
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    padding: 2px 6px;
    border-radius: 4px;
    border: 0.5px solid #60a5fa;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
    margin-left: auto;
}

/* Bizarro overrides for the new elements */
.reverse-mode .freecure-proc-badge {
    background: #00ff00 !important;
    color: #000000 !important;
    border: 1px solid #ffffff !important;
    box-shadow: 0 0 8px #00ff00 !important;
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.4rem !important;
}

.reverse-mode .sim-slot.freecure-free-glow {
    border-color: #00ff00 !important;
    background: #000055 !important;
    box-shadow: 0 0 12px #00ff00 !important;
}

.reverse-mode .sim-slot.freecure-free-glow::before {
    content: '★' !important;
    color: #00ff00 !important;
}

.reverse-mode .mp-bar-container {
    background: #000000 !important;
    border: 2px solid #ffffff !important;
    border-radius: 0px !important;
}

.reverse-mode .mp-bar-fill.mp-healthy {
    background: #00ff00 !important;
}

.reverse-mode .mp-bar-fill.mp-caution {
    background: #ffff00 !important;
}

.reverse-mode .mp-bar-fill.mp-danger {
    background: #ff0000 !important;
    animation: none !important;
}

.reverse-mode .mp-bar-label {
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.5rem !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px #000000 !important;
}

.reverse-mode .lucid-badge {
    background: #ff00ff !important;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
    box-shadow: 0 0 8px #ff00ff !important;
    font-family: 'Press Start 2P', monospace !important;
    font-size: 0.4rem !important;
}
