/* ==========================================================================
   ASSASSIN'S CREED: BROTHERHOOD OF VENICE - INTERACTIVE COMPANION STYLESHEET
   Aesthetics: Venetian Renaissance & Animus HR-8.5 Interface
   ========================================================================== */

:root {
    --bg-primary: #0a0d14;
    --bg-secondary: #121824;
    --bg-card: rgba(22, 30, 46, 0.85);
    --bg-card-hover: rgba(30, 41, 64, 0.95);
    --border-color: rgba(212, 175, 55, 0.25);
    --border-glow: rgba(0, 210, 255, 0.35);

    --gold-primary: #d4af37;
    --gold-light: #f3e5ab;
    --gold-dark: #997a15;

    --assassin-red: #c0392b;
    --assassin-red-glow: rgba(192, 57, 43, 0.6);

    --animus-cyan: #00d2ff;
    --animus-cyan-glow: rgba(0, 210, 255, 0.5);

    --stealth-green: #2ecc71;
    --stealth-green-glow: rgba(46, 204, 113, 0.4);

    --text-main: #f0f4f8;
    --text-muted: #a0aec0;
    --text-gold: #f1c40f;

    --font-heading: 'Cinzel', serif;
    --font-body: 'Montserrat', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 10px;
    --box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 15% 20%, rgba(0, 210, 255, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(192, 57, 43, 0.05) 0%, transparent 40%),
        linear-gradient(180deg, #090c12 0%, #0e1420 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   APP HEADER & GLOBAL STATUS
   ========================================================================== */
.app-header {
    background: rgba(10, 13, 20, 0.95);
    border-bottom: 2px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

.animus-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.animus-symbol {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 8px var(--animus-cyan));
    animation: eagleGlow 3s infinite alternate;
}

@keyframes eagleGlow {
    0% { filter: drop-shadow(0 0 4px var(--animus-cyan)); }
    100% { filter: drop-shadow(0 0 12px var(--gold-primary)); }
}

.animus-sub {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 2px;
    color: var(--animus-cyan);
    display: block;
}

.animus-title h1 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    letter-spacing: 1px;
    color: var(--gold-light);
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.global-status-badges {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.status-badge:hover {
    transform: translateY(-2px);
    border-color: var(--gold-primary);
}

.status-badge.stealth-mode {
    border-color: var(--stealth-green);
    color: var(--stealth-green);
    background: rgba(46, 204, 113, 0.1);
}

.status-badge.alert-mode {
    border-color: var(--assassin-red);
    color: #ff7675;
    background: rgba(192, 57, 43, 0.2);
    animation: pulseAlert 1.5s infinite;
}

@keyframes pulseAlert {
    0% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(192, 57, 43, 0); }
    100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}

.status-badge.xp-badge {
    border-color: var(--gold-primary);
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.1);
}

.audio-controls {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-icon:hover {
    border-color: var(--animus-cyan);
    background: rgba(0, 210, 255, 0.15);
}

/* ==========================================================================
   NAVIGATION TABS
   ========================================================================== */
.main-nav {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    overflow-x: auto;
    scrollbar-width: thin;
    padding: 0 16px;
}

.nav-tab {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    padding: 14px 20px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--gold-light);
    background: rgba(255, 255, 255, 0.03);
}

.nav-tab.active {
    color: var(--gold-primary);
    border-bottom-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.08);
}

/* ==========================================================================
   MAIN APP CONTENT & TABS
   ========================================================================== */
.app-main {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary), #b38600);
    color: #000;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #f1c40f, var(--gold-primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    border-color: var(--gold-primary);
    color: var(--gold-light);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--animus-cyan);
    color: var(--animus-cyan);
}

.btn-tts {
    background: rgba(0, 210, 255, 0.15);
    border: 1px solid var(--animus-cyan);
    color: var(--animus-cyan);
}

.btn-tts:hover {
    background: var(--animus-cyan);
    color: #000;
}

.btn-danger {
    background: rgba(192, 57, 43, 0.2);
    border: 1px solid var(--assassin-red);
    color: #ff7675;
}

.btn-danger:hover {
    background: var(--assassin-red);
    color: #fff;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* ==========================================================================
   TAB 1: LIVE TURN ASSISTANT
   ========================================================================== */
.turn-assistant-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Stepper */
.phase-stepper {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 20px;
    gap: 12px;
    box-shadow: var(--box-shadow);
}

.phase-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
}

.phase-step:hover {
    background: rgba(255, 255, 255, 0.05);
}

.phase-step.active {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold-primary);
}

.phase-step.completed .step-num {
    background: var(--stealth-green);
    color: #000;
}

.step-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
}

.phase-step.active .step-num {
    background: var(--gold-primary);
    color: #000;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.6);
}

.step-info {
    display: flex;
    flex-direction: column;
}

.step-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gold-light);
}

.step-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.phase-divider {
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
}

/* Phase Card & Side Panel Layout */
.phase-card-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.phase-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.phase-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 18px;
    margin-bottom: 20px;
}

.phase-card-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.phase-icon {
    font-size: 2.2rem;
}

.phase-card-title-group h2 {
    font-family: var(--font-heading);
    color: var(--gold-primary);
    font-size: 1.4rem;
}

.phase-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.phase-card-body {
    flex-grow: 1;
    margin-bottom: 24px;
}

.phase-steps-checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.phase-step-item {
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid var(--gold-primary);
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    font-size: 0.92rem;
}

.phase-step-item strong {
    color: var(--gold-light);
}

.phase-protip-box {
    margin-top: 18px;
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid var(--animus-cyan-glow);
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #e0f7fa;
}

.phase-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    padding-top: 18px;
}

.turn-controls-inline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.turn-indicator {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--gold-light);
}

/* Tactical Side Panel */
.tactical-side-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tactical-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 18px;
    box-shadow: var(--box-shadow);
}

.tactical-box h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--gold-light);
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    padding-bottom: 6px;
}

.box-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.alert-toggle-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-stealth {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid var(--stealth-green);
    color: #2ecc71;
}

.btn-stealth.active {
    background: var(--stealth-green);
    color: #000;
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.5);
}

.btn-alert {
    background: rgba(192, 57, 43, 0.15);
    border: 1px solid var(--assassin-red);
    color: #ff7675;
}

.btn-alert.active {
    background: var(--assassin-red);
    color: #fff;
    box-shadow: 0 0 15px rgba(192, 57, 43, 0.7);
    animation: pulseAlert 1.5s infinite;
}

.alert-warning-banner {
    background: rgba(192, 57, 43, 0.25);
    border: 1px solid var(--assassin-red);
    padding: 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    color: #ffcccc;
    line-height: 1.4;
}

.alert-warning-banner.hidden {
    display: none;
}

.quick-actions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: var(--transition);
}

.quick-action-item:hover {
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.1);
    transform: translateX(4px);
}

.qa-icon {
    font-size: 1.1rem;
}

.qa-name {
    font-size: 0.85rem;
    font-weight: 500;
    flex-grow: 1;
    margin-left: 10px;
}

.qa-cost {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
}

.table-tools-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ==========================================================================
   TAB 2: CAMPAIGN BOOK & MEMORIES
   ========================================================================== */
.campaign-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.campaign-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.campaign-header h2 {
    font-family: var(--font-heading);
    color: var(--gold-primary);
    font-size: 1.3rem;
}

.campaign-header p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.sequence-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.seq-filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: var(--transition);
}

.seq-filter-btn:hover {
    border-color: var(--gold-primary);
    color: var(--gold-light);
}

.seq-filter-btn.active {
    background: var(--gold-primary);
    color: #000;
    font-weight: 700;
}

.memories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.memory-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 18px;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.memory-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-primary);
    background: var(--bg-card-hover);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
}

.memory-card.completed {
    border-color: var(--stealth-green);
}

.memory-card.completed::before {
    content: "✓ COMPLETADA";
    position: absolute;
    top: 10px;
    right: -30px;
    background: var(--stealth-green);
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 30px;
    transform: rotate(45deg);
    font-family: var(--font-heading);
}

.memory-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.memory-id-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-light);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.memory-xp-badge {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    color: var(--gold-primary);
}

.memory-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--gold-light);
    margin-bottom: 4px;
}

.memory-title-en {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 10px;
}

.memory-synopsis {
    font-size: 0.82rem;
    color: #cbd5e0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px;
}

.memory-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   TAB 3: HEADQUARTERS (HQ) & DIARY OF MEMORIES
   ========================================================================== */
.hq-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hq-banner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--box-shadow);
    flex-wrap: wrap;
    gap: 20px;
}

.hq-banner-info {
    max-width: 650px;
}

.hq-banner-info h2 {
    font-family: var(--font-heading);
    color: var(--gold-primary);
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.hq-banner-info p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.hq-banner-stats {
    display: flex;
    gap: 16px;
}

.hq-stat-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 160px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--gold-primary);
    font-weight: 700;
    margin: 4px 0;
}

.stat-meta {
    font-size: 0.72rem;
    color: var(--animus-cyan);
}

.hq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.hq-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hq-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.hq-card-header {
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding: 14px 20px;
}

.hq-card-header h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--gold-light);
}

.hq-card-body {
    padding: 20px;
}

.guild-choice-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 12px;
}

.guild-option {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.guild-option:hover {
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.08);
}

.guild-option.selected {
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.18);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.guild-icon {
    font-size: 1.8rem;
}

.guild-info h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--gold-light);
    margin-bottom: 4px;
}

.guild-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.upgrade-checklist {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.checkbox-item input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--gold-primary);
    width: 16px;
    height: 16px;
}

.save-controls-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Assassin Sheets */
.assassins-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.assassin-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 4px;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: var(--transition);
}

.assassin-tab-btn:hover {
    color: var(--gold-light);
}

.assassin-tab-btn.active {
    background: var(--gold-primary);
    color: #000;
    font-weight: 700;
}

.assassin-profile-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 18px;
}

.assassin-portrait-box {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--gold-primary);
    height: 180px;
    background: #000;
}

.assassin-portrait-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.assassin-info-box h4 {
    font-family: var(--font-heading);
    color: var(--gold-primary);
    font-size: 1.2rem;
}

.assassin-role-tag {
    font-size: 0.8rem;
    color: var(--animus-cyan);
    font-family: var(--font-mono);
    margin-bottom: 8px;
}

.assassin-trait {
    font-size: 0.85rem;
    color: #e2e8f0;
    margin-bottom: 12px;
    line-height: 1.4;
}

.assassin-stats-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-pill {
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--gold-light);
}

/* ==========================================================================
   TAB 4: RULES COMPENDIUM & SEARCH
   ========================================================================== */
.rules-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rules-search-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 18px;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    gap: 10px;
}

.search-icon {
    font-size: 1.1rem;
    color: var(--gold-primary);
}

.search-input-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    width: 100%;
}

.btn-clear-search {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
}

.quick-tag-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tag-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition);
}

.tag-btn:hover {
    border-color: var(--gold-primary);
    color: var(--gold-light);
}

.rules-sections-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rules-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.rules-card-header {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding: 16px 20px;
}

.rules-card-header h3 {
    font-family: var(--font-heading);
    color: var(--gold-primary);
    font-size: 1.15rem;
}

.rules-card-body {
    padding: 20px;
}

.faq-item {
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid var(--animus-cyan);
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 12px;
}

.faq-question {
    font-weight: 700;
    color: var(--gold-light);
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.faq-answer {
    font-size: 0.85rem;
    color: #cbd5e0;
}

/* ==========================================================================
   TAB 5: SIMULATORS & CALCULATORS
   ========================================================================== */
.simulators-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.simulators-nav {
    display: flex;
    gap: 12px;
}

.sim-nav-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 12px 20px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
}

.sim-nav-btn:hover {
    color: var(--gold-light);
    border-color: var(--gold-primary);
}

.sim-nav-btn.active {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold-primary);
    color: var(--gold-primary);
}

.sim-panel {
    display: none;
}

.sim-panel.active {
    display: block;
}

.sim-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--box-shadow);
}

.sim-header {
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.sim-header h3 {
    font-family: var(--font-heading);
    color: var(--gold-primary);
    font-size: 1.3rem;
}

.sim-header p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.sim-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold-light);
}

.counter-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.counter-input button {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--gold-light);
    width: 40px;
    height: 40px;
    border-radius: 6px;
    font-size: 1.2rem;
    cursor: pointer;
}

.counter-input input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    height: 40px;
    width: 80px;
    text-align: center;
    font-size: 1.1rem;
    font-family: var(--font-mono);
    border-radius: 6px;
}

.control-group select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
}

.sim-action-center {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.sim-result-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    min-height: 120px;
}

.result-placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    margin-top: 25px;
}

.dice-result-grid {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 16px 0;
    flex-wrap: wrap;
}

.dice-cube {
    width: 50px;
    height: 50px;
    background: #f0f4f8;
    color: #000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    animation: rollDice 0.4s ease;
}

.dice-cube.black-dice {
    background: #111;
    color: #ff7675;
    border: 1px solid var(--assassin-red);
}

@keyframes rollDice {
    0% { transform: rotate(0deg) scale(0.5); opacity: 0; }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

.ia-node {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.ia-node h4 {
    font-family: var(--font-heading);
    color: var(--gold-light);
    font-size: 1.05rem;
    margin-bottom: 14px;
}

.ia-buttons {
    display: flex;
    gap: 12px;
}

.ia-alert-box {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.alert-red {
    background: rgba(192, 57, 43, 0.25);
    border: 1px solid var(--assassin-red);
    color: #ffcccc;
}

.alert-blue {
    background: rgba(0, 210, 255, 0.15);
    border: 1px solid var(--animus-cyan);
    color: #e0f7fa;
}

/* ==========================================================================
   TAB 6: ORIGINAL BOOK GALLERY
   ========================================================================== */
.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gallery-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--box-shadow);
    flex-wrap: wrap;
    gap: 16px;
}

.gallery-header h2 {
    font-family: var(--font-heading);
    color: var(--gold-primary);
    font-size: 1.3rem;
}

.gallery-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.gallery-book-toggle {
    display: flex;
    gap: 10px;
}

.gallery-viewer-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.viewer-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.gallery-page-indicator {
    font-family: var(--font-heading);
    color: var(--gold-light);
    font-size: 1.1rem;
}

.viewer-canvas {
    max-width: 1000px;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
}

.viewer-canvas img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    background: #111722;
    border: 2px solid var(--gold-primary);
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
}

.modal-card.small-modal {
    max-width: 500px;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 18px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close-btn:hover {
    color: var(--assassin-red);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .phase-card-wrapper {
        grid-template-columns: 1fr;
    }
    .hq-grid {
        grid-template-columns: 1fr;
    }
    .sim-controls-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    .phase-stepper {
        flex-direction: column;
        align-items: stretch;
    }
    .phase-divider {
        display: none;
    }
    .guild-choice-container {
        grid-template-columns: 1fr;
    }
}
