/* Shared theme controls and alternate visual systems. The original stylesheet
   remains the source of truth for the Original theme. */
:root {
    --theme-bg: #f7f2e7;
    --theme-surface: #fffdf8;
    --theme-surface-raised: #fffefb;
    --theme-primary: #bc2c1a;
    --theme-accent: #c5a059;
    --theme-text: #1f1b18;
    --theme-muted: #5c554e;
    --theme-border: rgba(188, 44, 26, 0.35);
    --theme-focus: rgba(188, 44, 26, 0.32);
}

.theme-switcher {
    position: fixed;
    z-index: 1040;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    color: var(--tor-ink, var(--theme-text));
    font: 500 0.82rem/1.35 'Inter', sans-serif;
}

.theme-switcher summary {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 42px;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--tor-red-border, var(--theme-border));
    border-radius: 999px;
    background: var(--tor-paper-card, var(--theme-surface));
    box-shadow: 0 6px 18px rgba(20, 22, 18, 0.12);
    color: var(--tor-red-dark, var(--theme-primary));
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.theme-switcher summary::-webkit-details-marker { display: none; }
.theme-switcher summary::marker { content: ''; }
.theme-switcher summary:hover { border-color: var(--tor-red, var(--theme-primary)); }
.theme-switcher summary:focus-visible,
.theme-switcher select:focus-visible {
    outline: 3px solid var(--theme-focus);
    outline-offset: 3px;
}

.theme-switcher-panel {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    display: grid;
    gap: 0.45rem;
    width: min(270px, calc(100vw - 24px));
    padding: 0.9rem;
    border: 1px solid var(--tor-red-border, var(--theme-border));
    border-radius: 12px;
    background: var(--tor-paper-card, var(--theme-surface));
    box-shadow: 0 14px 38px rgba(20, 22, 18, 0.2);
}

.theme-switcher-panel label { color: var(--tor-ink, var(--theme-text)); font-weight: 700; }
.theme-switcher-panel small { color: var(--tor-ink-muted, var(--theme-muted)); }

html[data-theme="arcane"] {
    color-scheme: dark;
    --theme-bg: #0b0d14;
    --theme-surface: #201827;
    --theme-surface-raised: #2a2032;
    --theme-primary: #c8a66a;
    --theme-accent: #8a3e50;
    --theme-text: #f1e6d0;
    --theme-muted: #c4b8a7;
    --theme-border: rgba(200, 166, 106, 0.48);
    --theme-focus: rgba(200, 166, 106, 0.62);

    --tor-red: var(--theme-primary);
    --tor-red-dark: #e6ce9f;
    --tor-red-light: #dfbd78;
    --tor-red-border: rgba(200, 166, 106, 0.62);
    --tor-red-bg: rgba(200, 166, 106, 0.1);
    --tor-gold: var(--theme-primary);
    --tor-gold-dark: #a9874f;
    --tor-gold-light: #3b3040;
    --tor-ink: var(--theme-text);
    --tor-ink-muted: var(--theme-muted);
    --tor-ink-subtle: #a79b8a;
    --tor-paper: var(--theme-bg);
    --tor-paper-card: var(--theme-surface);
    --tor-paper-border: var(--theme-border);
    --accent: var(--theme-primary);
    --accent-dark: #a9874f;
    --text-main: var(--theme-text);
    --text-muted: var(--theme-muted);
    --bg-paper: var(--theme-bg);

    --bs-body-bg: var(--theme-bg);
    --bs-body-color: var(--theme-text);
    --bs-secondary-color: var(--theme-muted);
    --bs-border-color: rgba(200, 166, 106, 0.28);
    --bs-link-color: #e1c487;
    --bs-link-hover-color: #f0d8a6;
}

html[data-theme="woodland"] {
    color-scheme: light;
    --theme-bg: #f5f1e7;
    --theme-surface: #e3e6d4;
    --theme-surface-raised: #fbfaf4;
    --theme-primary: #476650;
    --theme-accent: #987a57;
    --theme-text: #292f27;
    --theme-muted: #535c50;
    --theme-border: rgba(71, 102, 80, 0.32);
    --theme-focus: rgba(71, 102, 80, 0.48);

    --tor-red: var(--theme-primary);
    --tor-red-dark: #354e3d;
    --tor-red-light: #66836e;
    --tor-red-border: rgba(71, 102, 80, 0.44);
    --tor-red-bg: rgba(71, 102, 80, 0.08);
    --tor-gold: var(--theme-accent);
    --tor-gold-dark: #765f43;
    --tor-gold-light: #f0e6d5;
    --tor-ink: var(--theme-text);
    --tor-ink-muted: var(--theme-muted);
    --tor-ink-subtle: #6d7569;
    --tor-paper: var(--theme-bg);
    --tor-paper-card: var(--theme-surface-raised);
    --tor-paper-border: var(--theme-border);
    --accent: var(--theme-primary);
    --accent-dark: #354e3d;
    --text-main: var(--theme-text);
    --text-muted: var(--theme-muted);
    --bg-paper: var(--theme-bg);

    --bs-body-bg: var(--theme-bg);
    --bs-body-color: var(--theme-text);
    --bs-secondary-color: var(--theme-muted);
    --bs-border-color: rgba(71, 102, 80, 0.25);
    --bs-link-color: #365b40;
    --bs-link-hover-color: #294a33;
}

/* Arcane Edition — a quiet, gilded instrument with its own geometric field. */
html[data-theme="arcane"] body {
    color: var(--theme-text);
    background-color: var(--theme-bg);
    background-image:
        radial-gradient(circle at 12% 5%, rgba(138, 62, 80, 0.26), transparent 28rem),
        radial-gradient(circle at 88% 72%, rgba(200, 166, 106, 0.11), transparent 30rem),
        repeating-linear-gradient(45deg, rgba(200, 166, 106, 0.025) 0 1px, transparent 1px 72px),
        repeating-linear-gradient(135deg, rgba(200, 166, 106, 0.018) 0 1px, transparent 1px 72px);
    font-family: 'Inter', Arial, sans-serif;
}

html[data-theme="arcane"] :is(h1, h2, h3, h4, h5, h6, .logo-text, .section-title, .zone-title, .tor-label, .tor-mini-header, .sheet-kicker) {
    color: var(--theme-primary);
    font-family: 'Cinzel', Georgia, serif;
    letter-spacing: 0.055em;
}

html[data-theme="arcane"] :is(.tor-book-panel, .glass-panel, .card, .modal-content, .dice-selector-card, .roll-card, .user-config-card, .adventurer-card, .adventure-header, .adventure-panel, .sheet-panel) {
    color: var(--theme-text);
    background-color: var(--theme-surface);
    border-color: var(--theme-border) !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28), inset 0 1px rgba(241, 230, 208, 0.035) !important;
}

html[data-theme="arcane"] :is(.tor-book-panel, .glass-panel, .adventure-panel, .sheet-panel) {
    border-radius: 10px !important;
}

html[data-theme="arcane"] .tor-book-panel {
    position: relative;
    outline: 1px solid rgba(200, 166, 106, 0.13);
    outline-offset: -6px;
}

html[data-theme="arcane"] .tor-corner-tl,
html[data-theme="arcane"] .tor-corner-tr,
html[data-theme="arcane"] .tor-corner-bl,
html[data-theme="arcane"] .tor-corner-br { width: 15px; height: 15px; border-color: var(--theme-primary); }

html[data-theme="arcane"] :is(.navbar, .modal-header, .modal-footer, .sheet-header, .sheet-footer) {
    color: var(--theme-text);
    border-color: var(--theme-border) !important;
}

html[data-theme="arcane"] .navbar {
    background: linear-gradient(100deg, rgba(32, 24, 39, 0.98), rgba(18, 17, 27, 0.97)) !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

html[data-theme="arcane"] :is(.private-room-panel, .guided-roll-panel, .stance-details-intro, .guided-intro, .occupation-trait-card, .adventure-scene-card, .adventure-roll-box, .adventure-completed-box, .adventure-sheet-summary) {
    color: var(--theme-text);
    background-color: rgba(200, 166, 106, 0.08);
    border-color: var(--theme-border);
}

html[data-theme="arcane"] :is(.dice-selector-card, .user-config-card, .adventurer-card, .adventure-card, .adventure-session-item, .adventure-choice-btn, .guided-mode-card, .guided-attribute-card, .attribute-choice, .guided-trait-choice, .guided-purchase-row, .adventure-sheet-stat, .adventure-sheet-skill, .adventure-sheet-equipment) {
    color: var(--theme-text);
    background: rgba(11, 13, 20, 0.5);
    border-color: rgba(200, 166, 106, 0.28);
}

html[data-theme="arcane"] :is(.dice-selector-card, .roll-card, .adventure-card, .adventure-session-item, .adventure-choice-btn, .guided-mode-card, .guided-attribute-card, .attribute-choice, .guided-trait-choice):is(:hover, :focus-visible, .active, .selected, .is-selected) {
    color: var(--theme-text);
    background: rgba(200, 166, 106, 0.12);
    border-color: var(--theme-primary);
}

html[data-theme="arcane"] :is(.tor-input, .tor-select, .form-control, .form-select, .sheet-panel input, .sheet-panel textarea, .admin-adventure-editor) {
    color: var(--theme-text) !important;
    background-color: #17131d !important;
    border-color: rgba(200, 166, 106, 0.48) !important;
    font-family: 'Inter', Arial, sans-serif !important;
}

html[data-theme="arcane"] :is(.tor-input, .tor-select, .form-control, .form-select, .sheet-panel input, .sheet-panel textarea):focus {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(200, 166, 106, 0.18) !important;
}

html[data-theme="arcane"] .form-select { background-color: #17131d !important; }
html[data-theme="arcane"] .form-select option { color: var(--theme-text); background: #201827; }
html[data-theme="arcane"] .btn-close { filter: invert(1) grayscale(1) brightness(1.8); }

html[data-theme="arcane"] :is(.btn-tor-primary, .btn-gold) {
    color: #17130d !important;
    background: linear-gradient(140deg, #ddc183, #b58f50) !important;
    border-color: #f1d9a3 !important;
    box-shadow: 0 5px 18px rgba(200, 166, 106, 0.2), inset 0 1px rgba(255, 255, 255, 0.35) !important;
}

html[data-theme="arcane"] :is(.btn-tor-primary, .btn-gold):hover {
    background: linear-gradient(140deg, #f0d8a6, #c8a66a) !important;
    box-shadow: 0 8px 24px rgba(200, 166, 106, 0.28) !important;
}

html[data-theme="arcane"] :is(.btn-outline-danger, .tor-leave-btn) {
    color: #edc2cb !important;
    border-color: #a55367 !important;
}

html[data-theme="arcane"] :is(.btn-outline-danger, .tor-leave-btn):hover {
    color: #fff4f5 !important;
    background: #713446 !important;
    border-color: #c06b7e !important;
}

html[data-theme="arcane"] :is(.btn-outline-secondary, .btn-outline-primary, .btn-outline-dark) {
    color: var(--theme-text);
    border-color: rgba(200, 166, 106, 0.48);
}

html[data-theme="arcane"] :is(.btn-outline-secondary, .btn-outline-primary, .btn-outline-dark):hover {
    color: #17130d;
    background: var(--theme-primary);
    border-color: var(--theme-primary);
}

html[data-theme="arcane"] .btn-dice-toggle,
html[data-theme="arcane"] .btn-d6-chip {
    color: var(--theme-text);
    background: #17131d;
    border-color: rgba(200, 166, 106, 0.42);
}

html[data-theme="arcane"] :is(.btn-dice-toggle, .btn-d6-chip):is(:hover, .active) {
    color: #17130d;
    background: var(--theme-primary);
    border-color: #edcf91;
}

html[data-theme="arcane"] .dice-d12 { color: #fff4df; background: linear-gradient(135deg, #844356, #4c2538); border-color: #b66379; }
html[data-theme="arcane"] .dice-d6 { color: var(--theme-text); background: #17131d; border-color: var(--theme-primary); }
html[data-theme="arcane"] .dice-badge.dice-tor-sauron { background: linear-gradient(135deg, #321d2c, #110e16); border-color: #a55367; color: #f08c9b; }
html[data-theme="arcane"] .roll-card { border-left-color: var(--theme-primary) !important; animation: arcane-roll-arrival 0.52s cubic-bezier(.2,.8,.2,1) both; }
html[data-theme="arcane"] .total-badge { background: #17131d; border-color: var(--theme-border); }
html[data-theme="arcane"] .total-val { color: var(--theme-primary); }
html[data-theme="arcane"] :is(.bg-gold, .battle-player-chip.is-you, .roll-mode-btn.active, .roll-mode-btn:hover) { color: #17130d !important; }
html[data-theme="arcane"] .bg-gold { background: var(--theme-primary) !important; }
html[data-theme="arcane"] .bg-purple { background: #59402f !important; color: #fff0d4 !important; }
html[data-theme="arcane"] :is(.stance-badge-vanguardia, .badge-tn-vanguardia) { color: #ffdbe0; background: rgba(138, 62, 80, 0.42); border-color: #a55367; }
html[data-theme="arcane"] :is(.stance-badge-abierta, .badge-tn-abierta) { color: #f1dba9; background: rgba(200, 166, 106, 0.12); border-color: #a9874f; }
html[data-theme="arcane"] :is(.stance-badge-defensiva, .badge-tn-defensiva) { color: #c6d9ff; background: rgba(55, 91, 153, 0.24); border-color: #6387c0; }
html[data-theme="arcane"] :is(.stance-badge-retaguardia, .badge-tn-retaguardia, .adventure-active-pill, .adventure-session-status.active) { color: #cce8c6; background: rgba(71, 102, 80, 0.28); border-color: #658c68; }
html[data-theme="arcane"] .adventure-session-status.completed { color: var(--theme-muted); background: rgba(200, 166, 106, 0.12); }
html[data-theme="arcane"] .adventure-roll-result.success { color: #d8efce; background: rgba(71, 102, 80, 0.28); }
html[data-theme="arcane"] .adventure-roll-result.failure { color: #ffd3d8; background: rgba(138, 62, 80, 0.3); }
html[data-theme="arcane"] :is(.text-success, .text-danger) { color: #edc2cb !important; }
html[data-theme="arcane"] .text-success { color: #cce8c6 !important; }
html[data-theme="arcane"] .form-control::placeholder { color: #a79b8a; opacity: 1; }

html[data-theme="arcane"] :is(.battle-stance-zone, .battle-player-chip, .tor-stance-box) {
    color: var(--theme-text);
    background: #211a29;
    border-color: rgba(200, 166, 106, 0.32);
}

html[data-theme="arcane"] :is(.stance-zone-vanguardia, .stance-zone-abierta, .stance-zone-defensiva, .stance-zone-retaguardia) {
    background: linear-gradient(145deg, rgba(42, 32, 50, 0.98), rgba(25, 20, 31, 0.98));
}

html[data-theme="arcane"] :is(.zone-summary, .zone-details-btn, .private-room-field, .sheet-footer, .adventure-lead, .adventure-card p, .adventure-card-meta, .adventure-empty-note, .adventure-field-note, .adventure-story-character, .adventure-choice-hint, .adventure-history-entry p, .adventure-character-sheet-subtitle, .text-muted) {
    color: var(--theme-muted) !important;
}

html[data-theme="arcane"] :is(.text-dark, .text-body, .adventure-panel-heading h2, .adventure-story-heading h2, .adventure-scene-card p, .adventure-roll-box h3, .adventure-choice-btn, .guided-roll-preview, .sheet-panel textarea) {
    color: var(--theme-text) !important;
}

html[data-theme="arcane"] :is(.logo-text, .section-title, .tor-label, .tor-mini-header, .tor-page-header, .zone-title, .zone-rule-highlight, .adventure-header h1, .adventure-card h3, .adventure-field-label, .adventure-scene-card h3, .adventure-session-item-body strong, .adventure-sheet-section-label, .sheet-header h1, .sheet-panel h2, .sheet-panel label, .sheet-kicker, .guided-field, .guided-mode-card strong, .admin-visibility-table th, .admin-adventures-table th) {
    color: var(--theme-primary) !important;
}

html[data-theme="arcane"] :is(.modal-body, .table, .table-responsive, .form-label) { color: var(--theme-text); }
html[data-theme="arcane"] .table { --bs-table-color: var(--theme-text); --bs-table-bg: transparent; --bs-table-hover-color: var(--theme-text); --bs-table-hover-bg: rgba(200, 166, 106, 0.08); --bs-table-border-color: rgba(200, 166, 106, 0.2); }
html[data-theme="arcane"] .table > :not(caption) > * > * { color: var(--theme-text); background-color: transparent; border-bottom-color: rgba(200, 166, 106, 0.2); }
html[data-theme="arcane"] :is(.adventure-screen, .adventurer-screen) { background: transparent; }
html[data-theme="arcane"] .adventurer-sheet { color: var(--theme-text); background: linear-gradient(150deg, #201827, #18131f); border-color: var(--theme-border); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4); }
html[data-theme="arcane"] .sheet-panel { box-shadow: inset 0 0 0 1px rgba(200, 166, 106, 0.08) !important; }
html[data-theme="arcane"] .sheet-panel input { border-bottom-color: rgba(200, 166, 106, 0.42) !important; }
html[data-theme="arcane"] .sheet-name { color: var(--theme-primary) !important; }
html[data-theme="arcane"] :is(.roll-mode-switch, .guided-points-total, .guided-roll-preview, .culture-summary, .culture-summary-header, .guided-summary-grid, .guided-purchase-btn) { color: var(--theme-text); background-color: #17131d; border-color: var(--theme-border); }
html[data-theme="arcane"] .guided-purchase-btn { color: var(--theme-primary); }
html[data-theme="arcane"] .admin-adventure-validation { color: #d9edc6; background: rgba(71, 102, 80, 0.28); }
html[data-theme="arcane"] .admin-adventure-validation.is-invalid { color: #ffd3d8; background: rgba(138, 62, 80, 0.28); }
html[data-theme="arcane"] .quick-suggestion-container,
html[data-theme="arcane"] #quick-suggestion-container > div { color: var(--theme-text) !important; background: rgba(200, 166, 106, 0.09) !important; border-color: var(--theme-border) !important; }

/* Woodland Edition — an airy field journal with rounded, natural surfaces. */
html[data-theme="woodland"] body {
    color: var(--theme-text);
    background-color: var(--theme-bg);
    background-image:
        radial-gradient(ellipse at 12% 0%, rgba(117, 145, 105, 0.17), transparent 30rem),
        radial-gradient(ellipse at 92% 28%, rgba(152, 122, 87, 0.11), transparent 26rem),
        repeating-linear-gradient(135deg, rgba(71, 102, 80, 0.025) 0 1px, transparent 1px 9px);
    font-family: 'Inter', Arial, sans-serif;
}

html[data-theme="woodland"] :is(h1, h2, h3, h4, h5, h6, .logo-text, .section-title, .zone-title, .tor-label, .tor-mini-header, .sheet-kicker) {
    color: var(--theme-primary);
    font-family: 'Fraunces', Georgia, serif;
    letter-spacing: 0.015em;
}

html[data-theme="woodland"] :is(.tor-book-panel, .glass-panel, .card, .modal-content, .dice-selector-card, .roll-card, .user-config-card, .adventurer-card, .adventure-header, .adventure-panel, .sheet-panel) {
    color: var(--theme-text);
    background-color: var(--theme-surface-raised);
    border-color: var(--theme-border) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 26px rgba(51, 66, 48, 0.09) !important;
}

html[data-theme="woodland"] :is(.tor-book-panel, .glass-panel, .adventure-panel, .sheet-panel) {
    border-radius: 20px 15px 19px 14px !important;
}

html[data-theme="woodland"] :is(.navbar, .modal-header, .modal-footer, .sheet-header, .sheet-footer) {
    color: var(--theme-text);
    border-color: var(--theme-border) !important;
}

html[data-theme="woodland"] .navbar {
    background: rgba(245, 241, 231, 0.96) !important;
    box-shadow: 0 7px 24px rgba(51, 66, 48, 0.08);
}

html[data-theme="woodland"] :is(.private-room-panel, .guided-roll-panel, .stance-details-intro, .guided-intro, .occupation-trait-card, .adventure-scene-card, .adventure-roll-box, .adventure-completed-box, .adventure-sheet-summary) {
    color: var(--theme-text);
    background-color: rgba(227, 230, 212, 0.7);
    border-color: var(--theme-border);
    border-radius: 14px;
}

html[data-theme="woodland"] :is(.dice-selector-card, .user-config-card, .adventurer-card, .adventure-card, .adventure-session-item, .adventure-choice-btn, .guided-mode-card, .guided-attribute-card, .attribute-choice, .guided-trait-choice, .guided-purchase-row, .adventure-sheet-stat, .adventure-sheet-skill, .adventure-sheet-equipment) {
    color: var(--theme-text);
    background: #fbfaf4;
    border-color: rgba(71, 102, 80, 0.24);
    border-radius: 13px;
}

html[data-theme="woodland"] :is(.dice-selector-card, .roll-card, .adventure-card, .adventure-session-item, .adventure-choice-btn, .guided-mode-card, .guided-attribute-card, .attribute-choice, .guided-trait-choice):is(:hover, :focus-visible, .active, .selected, .is-selected) {
    color: var(--theme-text);
    background: #eef1e6;
    border-color: var(--theme-primary);
}

html[data-theme="woodland"] :is(.tor-input, .tor-select, .form-control, .form-select, .sheet-panel input, .sheet-panel textarea, .admin-adventure-editor) {
    color: var(--theme-text) !important;
    background-color: #fffef9 !important;
    border-color: rgba(71, 102, 80, 0.35) !important;
    font-family: 'Inter', Arial, sans-serif !important;
    border-radius: 9px !important;
}

html[data-theme="woodland"] :is(.tor-input, .tor-select, .form-control, .form-select, .sheet-panel input, .sheet-panel textarea):focus {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(71, 102, 80, 0.13) !important;
}

html[data-theme="woodland"] :is(.btn-tor-primary, .btn-gold) {
    color: #f8f7ee !important;
    background: linear-gradient(145deg, #56775e, #3d5a45) !important;
    border-color: #36503d !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(71, 102, 80, 0.2) !important;
}

html[data-theme="woodland"] :is(.btn-tor-primary, .btn-gold):hover { background: #355740 !important; transform: translateY(-1px); }
html[data-theme="woodland"] :is(.btn-outline-danger, .tor-leave-btn) { color: #76583b !important; border-color: #987a57 !important; border-radius: 10px !important; }
html[data-theme="woodland"] :is(.btn-outline-danger, .tor-leave-btn):hover { color: #fffaf0 !important; background: #806546 !important; border-color: #806546 !important; }
html[data-theme="woodland"] :is(.btn-outline-secondary, .btn-outline-primary, .btn-outline-dark) { color: var(--theme-primary); border-color: rgba(71, 102, 80, 0.38); border-radius: 10px; }
html[data-theme="woodland"] :is(.btn-outline-secondary, .btn-outline-primary, .btn-outline-dark):hover { color: #fffaf0; background: var(--theme-primary); border-color: var(--theme-primary); }

html[data-theme="woodland"] .btn-dice-toggle,
html[data-theme="woodland"] .btn-d6-chip { color: var(--theme-text); background: #fbfaf4; border-color: rgba(71, 102, 80, 0.3); border-radius: 10px; }
html[data-theme="woodland"] :is(.btn-dice-toggle, .btn-d6-chip):is(:hover, .active) { color: #fffaf0; background: var(--theme-primary); border-color: var(--theme-primary); }
html[data-theme="woodland"] .dice-d12 { color: #fffaf0; background: linear-gradient(145deg, #607b5c, #3e5d46); border-color: #36503d; }
html[data-theme="woodland"] .dice-d6 { color: var(--theme-text); background: #fffef9; border-color: var(--theme-accent); }
html[data-theme="woodland"] .roll-card { border-left-color: var(--theme-primary) !important; border-radius: 12px !important; animation: woodland-roll-arrival 0.45s ease-out both; }
html[data-theme="woodland"] .total-badge { background: #eef1e6; border-color: var(--theme-border); border-radius: 12px; }
html[data-theme="woodland"] .total-val { color: var(--theme-primary); }
html[data-theme="woodland"] .bg-gold { color: #fffaf0 !important; background: #806546 !important; }
html[data-theme="woodland"] .bg-purple { color: #fffaf0 !important; background: #6f7156 !important; }
html[data-theme="woodland"] :is(.roll-mode-btn.active, .roll-mode-btn:hover) { color: #fffaf0; }
html[data-theme="woodland"] .battle-player-chip.is-you { color: #fffaf0; }
html[data-theme="woodland"] :is(.stance-badge-vanguardia, .badge-tn-vanguardia) { color: #7c342e; background: rgba(188, 44, 26, 0.1); border-color: rgba(188, 44, 26, 0.35); }
html[data-theme="woodland"] :is(.stance-badge-abierta, .badge-tn-abierta) { color: #6f5637; background: rgba(152, 122, 87, 0.15); border-color: #987a57; }
html[data-theme="woodland"] :is(.stance-badge-defensiva, .badge-tn-defensiva) { color: #234f83; background: rgba(37, 99, 235, 0.09); border-color: rgba(59, 130, 246, 0.55); }
html[data-theme="woodland"] :is(.stance-badge-retaguardia, .badge-tn-retaguardia, .adventure-active-pill, .adventure-session-status.active) { color: #315a3c; background: rgba(71, 102, 80, 0.12); border-color: rgba(71, 102, 80, 0.35); }
html[data-theme="woodland"] .adventure-session-status.completed { color: var(--theme-muted); background: rgba(83, 92, 80, 0.09); }
html[data-theme="woodland"] .adventure-roll-result.success { color: #315a3c; background: rgba(71, 102, 80, 0.12); }
html[data-theme="woodland"] .adventure-roll-result.failure { color: #7c342e; background: rgba(188, 44, 26, 0.1); }
html[data-theme="woodland"] .form-control::placeholder { color: #70776c; opacity: 1; }

html[data-theme="woodland"] :is(.battle-stance-zone, .battle-player-chip, .tor-stance-box) {
    color: var(--theme-text);
    background: #fbfaf4;
    border-color: rgba(71, 102, 80, 0.3);
    border-radius: 14px;
}

html[data-theme="woodland"] :is(.stance-zone-vanguardia, .stance-zone-abierta, .stance-zone-defensiva, .stance-zone-retaguardia) {
    background: linear-gradient(145deg, #f8f8ef, #e8ecdf);
}

html[data-theme="woodland"] :is(.zone-summary, .zone-details-btn, .private-room-field, .sheet-footer, .adventure-lead, .adventure-card p, .adventure-card-meta, .adventure-empty-note, .adventure-field-note, .adventure-story-character, .adventure-choice-hint, .adventure-history-entry p, .adventure-character-sheet-subtitle, .text-muted) {
    color: var(--theme-muted) !important;
}

html[data-theme="woodland"] :is(.text-dark, .text-body, .adventure-panel-heading h2, .adventure-story-heading h2, .adventure-scene-card p, .adventure-roll-box h3, .adventure-choice-btn, .guided-roll-preview, .sheet-panel textarea) {
    color: var(--theme-text) !important;
}

html[data-theme="woodland"] :is(.logo-text, .section-title, .tor-label, .tor-mini-header, .tor-page-header, .zone-title, .zone-rule-highlight, .adventure-header h1, .adventure-card h3, .adventure-field-label, .adventure-scene-card h3, .adventure-session-item-body strong, .adventure-sheet-section-label, .sheet-header h1, .sheet-panel h2, .sheet-panel label, .sheet-kicker, .guided-field, .guided-mode-card strong, .admin-visibility-table th, .admin-adventures-table th) {
    color: var(--theme-primary) !important;
}

html[data-theme="woodland"] :is(.modal-body, .table, .table-responsive, .form-label) { color: var(--theme-text); }
html[data-theme="woodland"] .table { --bs-table-color: var(--theme-text); --bs-table-bg: transparent; --bs-table-hover-color: var(--theme-text); --bs-table-hover-bg: rgba(71, 102, 80, 0.07); --bs-table-border-color: rgba(71, 102, 80, 0.18); }
html[data-theme="woodland"] .table > :not(caption) > * > * { color: var(--theme-text); background-color: transparent; border-bottom-color: rgba(71, 102, 80, 0.18); }
html[data-theme="woodland"] :is(.adventure-screen, .adventurer-screen) { background: transparent; }
html[data-theme="woodland"] .adventurer-sheet { color: var(--theme-text); background: #fbfaf4; border-color: var(--theme-border); border-radius: 20px 15px 20px 14px; box-shadow: 0 14px 35px rgba(51, 66, 48, 0.15); }
html[data-theme="woodland"] .sheet-panel { background: #f3f4eb; box-shadow: none !important; }
html[data-theme="woodland"] .sheet-panel input { border-bottom-color: rgba(71, 102, 80, 0.35) !important; }
html[data-theme="woodland"] .sheet-name { color: var(--theme-primary) !important; }
html[data-theme="woodland"] :is(.roll-mode-switch, .guided-points-total, .guided-roll-preview, .culture-summary, .culture-summary-header, .guided-summary-grid) { color: var(--theme-text); background-color: #eef1e6; border-color: var(--theme-border); border-radius: 12px; }
html[data-theme="woodland"] .guided-purchase-btn { color: var(--theme-primary); background: #fffef9; border-color: var(--theme-border); border-radius: 9px; }
html[data-theme="woodland"] .admin-adventure-validation { color: #365b40; background: rgba(104, 145, 54, 0.12); }
html[data-theme="woodland"] .admin-adventure-validation.is-invalid { color: #8a3e30; background: rgba(188, 44, 26, 0.1); }
html[data-theme="woodland"] #quick-suggestion-container > div { color: var(--theme-text) !important; background: rgba(227, 230, 212, 0.72) !important; border-color: var(--theme-accent) !important; }

@keyframes arcane-roll-arrival {
    from { opacity: 0; transform: translateY(10px) scale(0.985); box-shadow: 0 0 0 rgba(200, 166, 106, 0); }
    65% { opacity: 1; box-shadow: 0 0 24px rgba(200, 166, 106, 0.12); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes woodland-roll-arrival {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 575.98px) {
    .theme-switcher { top: max(0.6rem, env(safe-area-inset-top)); right: max(0.6rem, env(safe-area-inset-right)); }
    .theme-switcher summary { min-height: 40px; padding: 0.5rem 0.7rem; font-size: 0.76rem; }
    .theme-switcher-panel { width: min(250px, calc(100vw - 20px)); }
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme] *,
    html[data-theme] *::before,
    html[data-theme] *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
