﻿/* ==========================================================================
   THREE CARD DRAW MODAL STYLES (player + GM sheet)
   ========================================================================== */

#three-card-draw-modal.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    backdrop-filter: blur(6px);
}

#three-card-draw-modal.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.tarot-modal-overlay.modal-overlay {
    backdrop-filter: blur(6px);
}

#three-card-draw-modal .modal-content,
#three-card-draw-modal .tarot-modal-content,
.tarot-modal--ritual .tarot-modal-content {
    padding: 2rem;
    width: 92%;
    border-radius: 1.5rem;
    position: relative;
    max-width: 980px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid rgba(212, 175, 90, 0.55);
    background:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(139, 92, 246, 0.22), transparent 55%),
        radial-gradient(ellipse 90% 60% at 80% 100%, rgba(251, 191, 36, 0.12), transparent 50%),
        linear-gradient(165deg, #1a1428 0%, #120e1c 45%, #0d0a14 100%);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.65),
        0 0 48px rgba(139, 92, 246, 0.15),
        inset 0 1px 0 rgba(255, 235, 190, 0.12);
    color: #f0e8d8;
}

#three-card-draw-modal .modal-body.is-scrollable {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.65rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 90, 0.55) rgba(8, 6, 14, 0.85);
}

#three-card-draw-modal .modal-body.is-scrollable::-webkit-scrollbar {
    width: 8px;
}

#three-card-draw-modal .modal-body.is-scrollable::-webkit-scrollbar-track {
    background: rgba(8, 6, 14, 0.85);
    border-radius: 999px;
    margin: 4px 0;
}

#three-card-draw-modal .modal-body.is-scrollable::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(212, 175, 90, 0.8), rgba(139, 92, 246, 0.5));
    border-radius: 999px;
    border: 2px solid rgba(14, 10, 22, 0.65);
}

#three-card-draw-modal .modal-body.is-scrollable::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.9), rgba(167, 139, 250, 0.6));
}

.tarot-modal-close {
    z-index: 2;
}

#three-card-draw-modal .modal-close,
#three-card-draw-modal .tarot-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #d4af5a;
    z-index: 2;
}

#three-card-draw-modal .tarot-modal-close:hover {
    color: #fde68a;
}

.tarot-modal--ritual .tarot-modal-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(212, 175, 90, 0.25);
}

.tarot-modal--ritual .tarot-modal-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.68rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #c4b5fd;
    font-weight: 700;
}

.tarot-modal--ritual .tarot-modal-title {
    margin: 0;
    font-family: 'Cinzel Decorative', serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: #fff8e8;
    text-shadow: 0 0 24px rgba(251, 191, 36, 0.35);
}

.tarot-modal-toolbar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
    flex-wrap: wrap;
}

.tarot-toolbar-btn {
    border: 1px solid rgba(212, 175, 90, 0.45);
    background: rgba(255, 255, 255, 0.06);
    color: #f5e6c8;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.tarot-toolbar-btn:hover {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.65);
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.25);
}

.tarot-modal--ritual .tarot-reference-hint {
    color: #c8b8a0;
    font-size: 0.82rem;
    text-align: left;
    margin: 0;
    flex: 1 1 12rem;
}

.tarot-reference-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

.tarot-reference-toolbar {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.tarot-mechanics-trigger-btn {
    flex: 0 0 auto;
}

.tarot-reference-grid-wrap {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    margin-right: -0.35rem;
    padding-right: 0.35rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 90, 0.55) rgba(8, 6, 14, 0.85);
}

.tarot-reference-grid-wrap::-webkit-scrollbar {
    width: 8px;
}

.tarot-reference-grid-wrap::-webkit-scrollbar-track {
    background: rgba(8, 6, 14, 0.85);
    border-radius: 999px;
    margin: 4px 0;
}

.tarot-reference-grid-wrap::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(212, 175, 90, 0.8), rgba(139, 92, 246, 0.5));
    border-radius: 999px;
    border: 2px solid rgba(14, 10, 22, 0.65);
}

.tarot-reference-grid-wrap::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.9), rgba(167, 139, 250, 0.6));
}

.tarot-reference-grid-wrap .tarot-grid-container {
    padding-bottom: 1rem;
}

#three-card-draw-modal.tarot-modal--ritual .modal-body.is-scrollable {
    display: flex;
    flex-direction: column;
}

#three-card-draw-modal.tarot-modal--ritual .tarot-panels-slot {
    position: relative;
    flex: 0 0 auto;
}

/* Reading panel defines natural height; reference overlays without expanding the slot */
#three-card-draw-modal.tarot-modal--ritual #tarot-perform-panel {
    position: relative;
    z-index: 1;
}

#three-card-draw-modal.tarot-modal--ritual #tarot-perform-panel.hidden {
    display: block !important;
    visibility: hidden;
    pointer-events: none;
}

#three-card-draw-modal.tarot-modal--ritual .tarot-modal-panel[data-tarot-panel="reference"] {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    visibility: visible;
}

#three-card-draw-modal.tarot-modal--ritual .tarot-modal-panel[data-tarot-panel="reference"].hidden {
    display: flex !important;
    visibility: hidden;
    pointer-events: none;
    z-index: 0;
}

#three-card-draw-modal.tarot-modal--reference-mode .modal-body.is-scrollable {
    overflow-y: hidden;
}

/* Opened directly to Arcana Reference (TCD already used this Long Rest) */
#three-card-draw-modal.tarot-modal--reference-only .modal-body.is-scrollable {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#three-card-draw-modal.tarot-modal--reference-only .tarot-panels-slot {
    flex: 1 1 auto;
    min-height: min(52vh, 480px);
    display: flex;
    flex-direction: column;
}

#three-card-draw-modal.tarot-modal--reference-only #tarot-perform-panel.hidden {
    display: none !important;
    visibility: hidden;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

#three-card-draw-modal.tarot-modal--reference-only .tarot-modal-panel[data-tarot-panel="reference"] {
    position: relative;
    inset: auto;
    flex: 1 1 auto;
    min-height: min(48vh, 440px);
}

#three-card-draw-modal.tarot-modal--reference-only .tarot-reference-grid-wrap {
    flex: 1 1 auto;
    min-height: min(40vh, 380px);
}

.tarot-mechanics-overlay {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.25rem 1rem 1.5rem;
    overflow-y: auto;
    background: rgba(8, 6, 14, 0.78);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 90, 0.55) rgba(8, 6, 14, 0.85);
}

.tarot-mechanics-overlay::-webkit-scrollbar {
    width: 8px;
}

.tarot-mechanics-overlay::-webkit-scrollbar-track {
    background: rgba(8, 6, 14, 0.85);
    border-radius: 999px;
}

.tarot-mechanics-overlay::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(212, 175, 90, 0.8), rgba(139, 92, 246, 0.5));
    border-radius: 999px;
    border: 2px solid rgba(14, 10, 22, 0.65);
}

.tarot-mechanics-overlay.hidden {
    display: none;
}

.tarot-mechanics-popover {
    position: relative;
    width: min(100%, 34rem);
    flex-shrink: 0;
    margin: 0 auto;
    overflow-y: visible;
    border-radius: 1rem;
    padding: 1.35rem 1.4rem 1.25rem;
    background:
        radial-gradient(ellipse 90% 55% at 50% 0%, rgba(139, 92, 246, 0.2), transparent 65%),
        linear-gradient(180deg, rgba(30, 24, 48, 0.98), rgba(14, 10, 24, 0.99));
    border: 1px solid rgba(212, 175, 90, 0.55);
    box-shadow:
        0 20px 48px rgba(0, 0, 0, 0.55),
        0 0 32px rgba(139, 92, 246, 0.18);
}

.tarot-mechanics-close {
    position: absolute;
    top: 0.55rem;
    right: 0.65rem;
    border: none;
    background: transparent;
    color: #d4af5a;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    border-radius: 0.35rem;
    transition: color 0.15s, background 0.15s;
}

.tarot-mechanics-close:hover {
    color: #fde68a;
    background: rgba(255, 255, 255, 0.06);
}

.tarot-modal--ritual .tarot-mechanics-popover .tarot-mechanics-panel,
.tarot-modal--ritual .tarot-mechanics-popover #tarot-mechanics-explanation {
    margin-top: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.35rem 0.25rem 0;
    color: #f0e8d8;
}

.tarot-modal--ritual .tarot-mechanics-popover .parchment-subheader {
    color: #ffe9a8;
    border-bottom-color: rgba(212, 175, 90, 0.45);
}

.tarot-modal--ritual .tarot-mechanics-popover .parchment-list,
.tarot-modal--ritual .tarot-mechanics-popover .parchment-list li {
    color: #f0e8d8;
    line-height: 1.55;
}

.tarot-modal--ritual .tarot-mechanics-popover .parchment-list strong {
    color: #fde68a;
}

.tarot-modal--ritual .tarot-mechanics-popover em {
    color: #e9d5ff;
    font-style: italic;
}

.tarot-modal--ritual .tarot-card-name {
    color: #f0e8d8;
}

.tarot-modal--ritual .tarot-card-meaning {
    color: #c8b8a8;
}

.tarot-modal--ritual .tarot-mechanics-panel,
.tarot-modal--ritual #tarot-mechanics-explanation {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(212, 175, 90, 0.35);
    color: #e8dcc8;
}

.tarot-modal--ritual #tarot-mechanics-explanation .parchment-subheader {
    color: #ffe9a8;
}

.tarot-modal--ritual .tarot-premonition-footer {
    border-top-color: rgba(212, 175, 90, 0.25);
}

.tarot-grid-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.1rem 1rem;
    padding: 0.5rem 0 1rem;
}

@media (max-width: 860px) {
    .tarot-grid-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.tarot-card-display {
    cursor: pointer;
    text-align: center;
    border-radius: 12px;
    padding: 0.35rem;
    transition: transform 0.25s ease;
    animation: tarot-card-deal 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    animation-delay: var(--card-delay, 0ms);
}

.modal-overlay.show .tarot-card-display,
#three-card-draw-modal.modal-overlay.show .tarot-card-display {
    animation-name: tarot-card-deal;
}

@keyframes tarot-card-deal {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.9) rotate(-2deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0);
    }
}

.tarot-card-display:hover {
    transform: translateY(-6px);
}

.tarot-card-scene {
    perspective: 1100px;
}

.tarot-card-flipper {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0.15, 0.2, 1);
    will-change: transform;
}

.tarot-card-flipper.is-flipped {
    transform: rotateY(180deg);
}

.tarot-card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.tarot-card-face-back {
    transform: rotateY(180deg);
}

.tarot-card-frame {
    height: 100%;
    border-radius: 10px;
    padding: 5px;
    background:
        linear-gradient(145deg, rgba(255, 236, 179, 0.35), rgba(90, 74, 58, 0.15)),
        linear-gradient(180deg, #4a3b28, #2f2418);
    border: 2px solid #a8894d;
    box-shadow:
        0 10px 22px rgba(0, 0, 0, 0.35),
        inset 0 0 0 1px rgba(255, 240, 200, 0.25);
}

.tarot-card-frame-reversed {
    border-color: #8b5cf6;
    box-shadow:
        0 10px 22px rgba(76, 29, 149, 0.35),
        inset 0 0 0 1px rgba(196, 181, 253, 0.35);
}

.tarot-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.tarot-card-meta {
    margin-top: 0.65rem;
    padding: 0.45rem 0.35rem 0.2rem;
}

.tarot-orientation-pill {
    display: inline-block;
    margin-bottom: 0.35rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f8f1df;
    background: linear-gradient(135deg, #6a5638, #4a3b28);
    border: 1px solid rgba(255, 235, 190, 0.35);
}

.tarot-card-display.is-reversed .tarot-orientation-pill {
    color: #f3e8ff;
    background: linear-gradient(135deg, #6d28d9, #4c1d95);
    border-color: rgba(216, 180, 254, 0.45);
}

.tarot-card-name {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.92rem;
    color: #3a2e20;
    margin: 0.15rem 0 0.35rem;
}

.tarot-card-meaning {
    font-size: 0.78rem;
    line-height: 1.35;
    color: #4a2f26;
    min-height: 3.6em;
    margin: 0;
}

.tarot-card-display.has-glow .tarot-card-scene {
    filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.55));
}

.tarot-card-display.has-glow .tarot-card-meta {
    background: rgba(139, 92, 246, 0.08);
    border-radius: 8px;
}

.tarot-mechanics-panel,
#tarot-mechanics-explanation {
    background:
        linear-gradient(180deg, rgba(58, 46, 32, 0.08), rgba(58, 46, 32, 0.14));
    border: 1px solid #948954;
    border-radius: 0.75rem;
    padding: 1rem 1.1rem;
    margin-top: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

#tarot-mechanics-explanation .parchment-subheader {
    margin-top: 0;
    font-family: 'Cinzel Decorative', serif;
    color: #3a2e20;
}

#tarot-mechanics-explanation .parchment-list {
    margin-bottom: 0;
}
/* --- NEW: Apply Cinzel font to Trackable Ability Labels --- */
.abilities-pane-themed .consumable-tracker-item .tracker-label {
    font-family: 'Cinzel', serif; /* Apply the same font as h4.ability-title */
    font-weight: 700;           /* Ensure it's bold */
    font-size: 1.2rem;          /* Match the passive ability title size */
    color: #3a2e20;             /* Ensure dark brown text */
}

/* Optional: Adjust spacing if needed */
.abilities-pane-themed .consumable-tracker-item .ability-title-row {
    align-items: baseline; /* Align text baselines better */
}
/* --- NEW: Tarot Card Reversed Glow --- */
.tarot-card-display.has-glow {
    box-shadow: none;
    border-color: transparent;
}
/* --- FIX: Add Border to Trackable Ability Items --- */
.abilities-pane-themed .consumable-tracker-item.item-ability {
    /* Keep existing styles: background, border, etc. */
    background-color: rgba(58, 46, 32, 0.1);
    border: 1px solid #948954;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem; /* Use margin for spacing */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    /* display: flex; <-- Keep flex if you want items side-by-side */
    /* justify-content: space-between; <-- Remove or adjust as needed */
    align-items: start; /* Align items to top */

    /* --- NEW --- */
    position: relative; /* Make this the positioning context for the checkbox */
    padding-right: 3rem; /* Add padding on the right to make space for the checkbox */
}

/* --- Item Sizing & Styling within Flexbox (REVISED) --- */
.abilities-pane-themed .ability-card.item-ability,
.abilities-pane-themed .consumable-tracker-item.item-ability {
    /* Keep internal flex/column layout and height */
    display: flex;
    flex-direction: column;
    height: min-content;

    /* Styling */
    background-color: rgba(58, 46, 32, 0.1); /* */
    border: 1px solid #948954; /* */
    border-radius: 0.5rem; /* */
    padding: 0.75rem 1rem; /* */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* */

    /* Critical for Multi-column: Prevent items from breaking mid-card */
    break-inside: avoid;
    /* Add margin-bottom for spacing *within* a column */
    margin-bottom: 0.75rem;

    /* Removed flex-basis, flex-grow, min-width specific to flexbox wrap */
    /* Ensure box-sizing if padding/border issues arise */
    box-sizing: border-box;
}

/* Target the main text content area of the TRACKABLE card */
.abilities-pane-themed .consumable-tracker-item.item-ability .tracker-info {
    flex-grow: 0; /* */
    padding-bottom: 0.5rem; /* */
}
.abilities-pane-themed .ability-card.item-ability .ability-description {
     flex-grow: 0; /* */
     margin-bottom: 0; /* */
}
/* --- MODIFIED: Position Checkbox Absolutely --- */
.abilities-pane-themed .consumable-tracker-item.item-ability .tracker-controls {
    position: absolute; /* Position relative to the card */
    top: 0.75rem;       /* Same as card's top padding */
    right: 0.75rem;      /* Same as card's right padding */
    margin-top: 0;       /* Remove any auto margins */
    padding-top: 0;      /* Remove any padding */
    /* You might need slight adjustments to top/right values */
}
.abilities-pane-themed .consumable-tracker-item.item-ability .tracker-info {
    flex-grow: 1; /* Allow info to take up available width */
    padding-bottom: 0; /* Remove extra padding if needed */
    /* Make sure it's not flexing vertically if not intended */
    display: block; /* Or keep flex column if needed */
}
.ability-title-controls-wrapper {
    display: flex;              /* Arrange title row and controls horizontally */
    justify-content: space-between; /* Push title left, controls right */
    align-items: flex-start;    /* Align items to the top */
    gap: 0.5rem;                /* Space between title area and controls */
    margin-bottom: 0.25rem;     /* Space below this row */
}

/* Ensure the inner title row doesn't cause issues */
.ability-title-controls-wrapper .ability-title-row {
    margin-bottom: 0; /* Remove bottom margin if it exists */
    flex-grow: 1; /* Allow title area to take available space */
}

/* Ensure controls don't shrink and align checkbox nicely */
.ability-title-controls-wrapper .tracker-controls {
    flex-shrink: 0;   /* Prevent controls from shrinking */
    margin-top: 0;    /* Remove any top margin */
    padding-top: 0;   /* Remove any top padding */
    /* Optional: Add slight top margin to align checkbox baseline better if needed */
    /* margin-top: 0.125rem; */
}

/* --- Optional Cleanup: Remove conflicting styles --- */
/* You might not need justify-content on the main item anymore */
.abilities-pane-themed .consumable-tracker-item.item-ability {
    /* justify-content: space-between; <-- Can likely remove this */
    /* align-items: start; <-- Keep this or remove if default works */
}
.rest-tag {
    display: inline-block;
    vertical-align: middle;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    text-transform: uppercase;
    line-height: 1.2;
    margin-left: 4px; /* Small space from action tag */
}

.rest-tag-short {
    background-color: #ca8a04; /* yellow-600 */
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.rest-tag-long {
    background-color: #be185d; /* pink-700 */
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}
/* --- NEW: Inner Ability Tab Styles --- */

/* Style for the inner tab navigation bar */
.inner-ability-tabs {
    border-bottom-color: #948954; /* Match parchment theme border */
    margin-bottom: 1rem; /* Space below the tabs */
}

/* Style for individual inner tab buttons */
.inner-ability-tab-btn {
    font-family: 'Cinzel', serif; /* Use a less decorative font */
    font-size: 0.9em; /* Make them slightly smaller */
    font-weight: 600;
    padding: 0.4rem 0.8rem; /* Adjust padding */
    color: #5d4935; /* Dark parchment text */
    border: 2px solid #948954; /* Parchment border */
    border-bottom: none; /* Remove bottom border as it connects */
    border-radius: 0.5rem 0.5rem 0 0; /* Slightly less rounded */
    opacity: 0.8;
    margin-bottom: -2px; /* Pulls button over the nav border */
    background-color: rgba(58, 46, 32, 0.1); /* Default light background directly on button */
    position: relative; /* Keep for z-index */
    z-index: 1; /* Keep */
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out, opacity 0.2s ease-in-out; /* Added transitions */
}

/* Hover state for inactive inner tabs */
.inner-ability-tab-btn:not(.active):hover {
    color: #3a2e20; /* Darker text on hover */
    border-color: #6a5e3c; /* Darker border on hover */
    opacity: 1;
    background-color: rgba(58, 46, 32, 0.2); /* Slightly darker bg on hover */
}

/* --- ADJUSTED: Active state for inner tabs --- */
.inner-ability-tab-btn.active {
    color: #3a2e20; /* Dark brown text for active tab */
    border-color: #948954; /* Keep parchment border */
    opacity: 1;
    font-weight: 700; /* Make active tab text bolder */
    background-color: #C1B395; /* Use a noticeably darker parchment/tan background directly */
    z-index: 2; /* Ensure active tab border overlaps inactive ones */
}
/* Container for inner tab panes */
.inner-ability-panes {
    padding-top: 1rem; /* Add padding back here */
    /* Add a subtle top border to connect visually if needed, matching the nav's bottom border */
    /* border-top: 2px solid #948954; */
}

/* Ensure ability grid within panes has no extra top margin */
.inner-ability-panes .ability-grid {
    margin-top: 0;
}
/* ==========================================================================
   CHARACTER SELECTION MODAL
   ========================================================================== */

#character-select-modal .modal-content {
    max-height: 80vh;
}

#character-select-grid {
    min-height: 200px; /* Ensures modal has height even when empty */
}

.char-select-card {
    background-color: rgba(0, 0, 0, 0.1);
    border: 2px solid #948954;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.char-select-card:hover {
    background-color: rgba(58, 46, 32, 0.2);
    border-color: #f0e6d2;
    transform: scale(1.05);
}

.char-select-portrait-wrapper {
    width: 100%;
    height: 150px;
    border-radius: 0.375rem;
    border: 2px solid #5a4a3a;
    background-color: rgba(0, 0, 0, 0.2);
    margin-bottom: 0.75rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.char-select-portrait-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.char-select-portrait-wrapper.create-new {
    color: #5a4a3a;
    background-color: rgba(255, 255, 255, 0.2);
}

.char-select-card:hover .char-select-portrait-wrapper.create-new {
    color: #f0e6d2;
    background-color: rgba(58, 46, 32, 0.4);
}

.char-select-name {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #3a2e20;
    /* For long names */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.session-indicator {
    position: relative; /* Anchor for the dropdown */
    display: inline-flex;
    align-items: center;
    margin-left: 1rem; /* Space from title */
    vertical-align: middle; /* Aligns icon with the giant text */
    cursor: pointer;
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none;     /* IE 10+ and Edge */
    user-select: none;         /* Standard syntax */
}

/* --- REPLACE THIS RULE --- */
.session-icon {
    font-size: 0.5em; /* Scales relative to the 3.5em h1 size */
    line-height: 1;
    color: #FFFFFF; /* --- ADD THIS LINE to make the emoji white --- */
    animation: glow-animation 2s infinite ease-in-out;
    transition: transform 0.2s ease-in-out;
    /* This filter creates the glow */
    filter: drop-shadow(0 0 5px rgba(255, 165, 0, 0.7)); /* --- CHANGED to orange glow --- */
}
/* --- REPLACE THIS RULE --- */
.session-indicator:hover .session-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(255, 165, 0, 1)); /* --- CHANGED to brighter orange glow --- */
}

@keyframes glow-animation {
    0% { filter: drop-shadow(0 0 5px rgba(34, 197, 94, 0.6)); } /* Brighter start */
    50% { filter: drop-shadow(0 0 12px rgba(34, 197, 94, 1.0)); } /* Much stronger peak */
    100% { filter: drop-shadow(0 0 5px rgba(34, 197, 94, 0.6)); } /* Return to start */
}

.session-dropdown {
    position: absolute;
    top: 100%; /* Position below the icon */
    left: 50%;
    transform: translateX(-50%); /* Center dropdown under icon */
    background-color: var(--card-bg-color, #ffffff);
    border: 1px solid var(--card-border-color, #e2e8f0);
    border-radius: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1700; /* Above nav bar */
    width: 220px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    
    /* === THIS IS THE CRITICAL FIX === */
    font-size: 1rem; /* Resets font size from the h1 */
    /* === END FIX === */
    
    /* Hidden by default, shown on hover/click */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    pointer-events: none; /* Cant be clicked when hidden */
}

/* Show dropdown on hover (for mouse) OR when .expanded class is added (for touch) */
.session-indicator:hover .session-dropdown,
.session-indicator.expanded .session-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto; /* Can be clicked when visible */
}

.session-dropdown strong {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
}

#session-indicator-id {
    font-family: 'Fjalla One', sans-serif;
    font-size: 1.25rem;
    color: var(--highlight-color);
    background-color: rgba(0,0,0,0.1);
    padding: 0.25rem;
    border-radius: 0.25rem;
}

#session-indicator-leave-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #b91c1c; /* red-700 */
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: background-color 0.2s, color 0.2s;
}

#session-indicator-leave-btn:hover {
    background-color: #fecaca; /* red-200 */
    color: #991b1b; /* red-800 */
}

/* --- NEW: Session Party Bar --- */
.session-party-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* 24px */
    background-color: #1a1a1a;
    border: 2px solid var(--card-border-color, #e2e8f0);
    border-radius: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 1rem;
    margin: 0 auto 1rem;
    max-width: 56rem; /* Matches the width of the title card */
    overflow-x: auto; /* Allows horizontal scrolling if many players */
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.party-member-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    position: relative;
    padding-right: 1.5rem; /* Space for the divider */
}

.party-member-card--target .party-member-img {
    box-shadow: 0 0 0 3px #FFC107, 0 0 14px rgba(255, 193, 7, 0.55);
    border-radius: 50%;
}

.party-member-card--target .party-member-name {
    color: #FFC107;
    font-weight: 700;
}

/* Add the divider line */
.party-member-card:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 80%;
    background: linear-gradient(to bottom, #ff0000, #ffa500);
    opacity: 0.5;
}

.party-member-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    object-fit: cover;
}

.party-member-name {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #F0F0F0;
    white-space: nowrap;
}
/* --- END Session Party Bar --- */
/* ==========================================================================
   TOME READER MODAL (v6 - HIGH SPECIFICITY FINAL)
   ========================================================================== */

/* 1. Main Modal Content */
#tome-modal-content {
    background-image: url('/assets/icons/tomes/opentome.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent; 
    padding: 0;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    width: 90vw;
    max-width: 950px;
    aspect-ratio: 1.55 / 1; 
    display: flex;
    flex-direction: column;
}

/* 2. Modal Header */
#tome-modal-content .details-modal-header {
    position: relative; 
    z-index: 10;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6% 7% 0; 
}

/* 3. Modal Title */
#tome-modal-title {
    font-family: 'Cinzel Decorative', serif;
    color: #3a2e20;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
    margin-bottom: 0;
    flex-grow: 1;
}

/* 4. Close Button */
#tome-modal-close-btn {
    color: #3a2e20;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
    opacity: 0.7;
    transition: all 0.2s ease;
    position: static; 
    flex-shrink: 0;
}
#tome-modal-close-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* 5. Modal Body */
#tome-modal-content .modal-body {
    display: flex;
    gap: 0;
    padding: 0;
    min-height: 0;
    flex-grow: 1;
    margin: 1% 7% 10%; 
}

/* 6. Left Page (Chapter List) */
#tome-chapter-list {
    flex: 1;
    border-right: none;
    overflow-y: auto;
    padding-right: 6%; 
    scrollbar-width: thin;
    scrollbar-color: #948954 rgba(0,0,0,0.1);
}
#tome-chapter-list::-webkit-scrollbar { width: 8px; }
#tome-chapter-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 4px; }
#tome-chapter-list::-webkit-scrollbar-thumb { background-color: #948954; border-radius: 4px; }

/* 7. Right Page (Content Display) */
#tome-content-display {
    flex: 1;
    overflow-y: auto;
    color: #3a2e20;
    padding-left: 6%;
    scrollbar-width: thin;
    scrollbar-color: #948954 rgba(0,0,0,0.1);
}
#tome-content-display::-webkit-scrollbar { width: 8px; }
#tome-content-display::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 4px; }
#tome-content-display::-webkit-scrollbar-thumb { background-color: #948954; border-radius: 4px; }


/* 8. Chapter Button Styles */
.tome-chapter-btn {
    display: block; width: 100%;
    padding: 0.5rem 0.75rem; margin-bottom: 0.25rem;
    text-align: left; font-family: 'Cinzel', serif;
    font-weight: 600; color: #5d4935;
    background-color: transparent; border: 1px solid transparent;
    border-radius: 4px; cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.tome-chapter-btn:hover {
    background-color: rgba(58, 46, 32, 0.1);
    border-color: #948954;
}
.tome-chapter-btn.active {
    background-color: #6a5e3c; color: #f0e6d2;
    border-color: #3a2e20;
}

/* 9. Locked Chapter Button (Stacked & Blurred) */
.tome-chapter-btn.locked {
    color: #8c7b53; 
    opacity: 0.9; 
    cursor: not-allowed;
    background-color: transparent;
    display: block; 
    line-height: 1.3;
}
.tome-chapter-btn.locked:hover {
    background-color: transparent; border-color: transparent;
}
.tome-chapter-btn.locked .tome-chapter-number {
    color: #8c7b53;
    font-weight: 600;
    display: block;
}
.tome-chapter-btn.locked .tome-chapter-locked-title {
    filter: blur(3px);
    opacity: 0.6;
    margin-left: 0;
    color: #948954;
    display: block;
    font-size: 0.9em;
    padding-left: 0.5rem;
}

/* 10. Content Text Styles (HIGH SPECIFICITY FIX) */

/* This rule applies to the title on the right page */
#tome-modal-content #tome-chapter-title {
    color: #3a2e20;
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* This is our base styling for the text content */
#tome-modal-content .tome-prose-content {
    color: #3a2e20;
    font-size: 1rem;
    line-height: 1.6;
}

/* This selector is now very specific and will force the paragraph margin */
#tome-modal-content .tome-prose-content p {
    color: #3a2e20;
    margin-bottom: 1.25rem;
}

/* This selector will style the <strong> tags */
#tome-modal-content .tome-prose-content strong {
     color: #3a2e20;
     font-weight: 700;
}

/* This selector will style the <em> tags */
#tome-modal-content .tome-prose-content em {
    font-family: 'Lora', serif;
    color: #5d4935; /* The different, slightly faded brown */
    font-weight: 500;
    font-style: italic;
}
.bullet-line::before {
    content: "â€¢ ";
    font-weight: bold;
    margin-right: 4px;
}

/* ==========================================================================
   PREMONITIONS & THREE CARD DRAW USE FLOW
   ========================================================================== */

.tarot-premonition-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(106, 86, 56, 0.3);
}

.tarot-modal--ritual .premonition-status-empty {
    color: #a8a090;
}

/* --- Three Card Draw ritual wizard --- */

.tcd-ritual-stage {
    position: relative;
    border: 1px solid rgba(212, 175, 90, 0.35);
    border-radius: 1rem;
    padding: 1.35rem 1.25rem 1.15rem;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(139, 92, 246, 0.18), transparent 70%),
        linear-gradient(180deg, rgba(30, 24, 48, 0.85), rgba(14, 10, 24, 0.95));
    box-shadow: inset 0 0 48px rgba(120, 90, 200, 0.1);
    overflow: hidden;
}

.tcd-ritual-mist {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(196, 181, 253, 0.08), transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(251, 191, 36, 0.06), transparent 45%);
    pointer-events: none;
    animation: tcd-mist-drift 8s ease-in-out infinite alternate;
}

@keyframes tcd-mist-drift {
    from { opacity: 0.6; transform: translateX(-2%); }
    to { opacity: 1; transform: translateX(2%); }
}

.tcd-stage-enter {
    animation: tcd-stage-in 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes tcd-stage-in {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.tcd-ritual-header {
    position: relative;
    text-align: center;
    margin-bottom: 1.15rem;
}

.tcd-ritual-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.68rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #c4b5fd;
    font-weight: 700;
}

.tcd-ritual-title {
    margin: 0 0 0.6rem;
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.45rem;
    color: #fff8e8;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.tcd-ritual-lead {
    margin: 0 auto;
    line-height: 1.55;
    color: #d8d0c4;
    font-size: 0.92rem;
    max-width: 42rem;
}

.tcd-points-remaining {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1.1rem;
}

.tcd-points-remaining-label {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #a8a090;
    font-weight: 700;
}

.tcd-points-orb-row {
    display: flex;
    gap: 0.55rem;
}

.tcd-point-orb {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 90, 0.35);
    background: rgba(0, 0, 0, 0.35);
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}

.tcd-point-orb--available {
    background: radial-gradient(circle at 35% 30%, #fff8c8, #fbbf24 55%, #b45309);
    border-color: #fde68a;
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.65);
    animation: tcd-orb-pulse 2s ease-in-out infinite;
}

.tcd-point-orb--spent {
    opacity: 0.25;
    transform: scale(0.85);
}

@keyframes tcd-orb-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.45); }
    50% { box-shadow: 0 0 18px rgba(251, 191, 36, 0.8); }
}

.tcd-points-remaining-count {
    font-family: 'Cinzel', serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: #fde68a;
    line-height: 1;
}

/* --- Three Card Draw: card pile split --- */

.tcd-split-stage {
    overflow: visible;
}

.tcd-split-stage--intro-active .tcd-split-hint,
.tcd-split-stage--intro-active .tcd-ritual-actions,
.tcd-split-stage--intro-active .tcd-split-reveal-after-intro {
    pointer-events: none;
}

.tcd-split-reveal-after-intro {
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
}

.tcd-split-playfield {
    position: relative;
    margin-bottom: 0.75rem;
}

.tcd-split-playfield .tcd-split-intro {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0;
    padding-top: 0.35rem;
    pointer-events: none;
}

.tcd-split-stage--intro-active .tcd-split-reveal-after-intro {
    visibility: hidden;
}

.tcd-split-pile--deck,
.tcd-split-piles-row,
.tcd-split-hint,
.tcd-ritual-actions {
    transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Shuffle intro theater */

.tcd-split-intro {
    text-align: center;
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.tcd-split-intro--exit {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    pointer-events: none;
    /* Stay out of document flow until removed â€” prevents modal height jump */
    position: absolute;
    inset: 0;
    z-index: 6;
}

.tcd-shuffle-caption {
    margin: 0 0 0.65rem;
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #c4b5fd;
    min-height: 1.2em;
    animation: tcd-shuffle-caption-pulse 2s ease-in-out infinite;
}

@keyframes tcd-shuffle-caption-pulse {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 1; }
}

.tcd-shuffle-theater {
    position: relative;
    height: 11.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tcd-shuffle-deal-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 12;
}

.tcd-shuffle-deck {
    position: relative;
    width: 4.75rem;
    height: 7.1rem;
    opacity: 0;
    transform: translateY(1.25rem) scale(0.88);
    transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.tcd-shuffle-deck--present {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tcd-shuffle-deck--shuffling {
    animation: tcd-shuffle-deck-wiggle 0.32s ease-in-out 6;
}

.tcd-shuffle-deck--diminished {
    opacity: 0.35;
    transform: scale(0.92);
    filter: blur(0.5px);
    transition: opacity 0.35s, transform 0.35s, filter 0.35s;
}

.tcd-shuffle-card {
    position: absolute;
    inset: 0;
    border-radius: 0.45rem;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    transform:
        translateY(calc(var(--stack-index) * -1.25px))
        translateX(calc(var(--stack-index) * 0.35px))
        rotate(calc(var(--stack-index) * 0.15deg));
}

.tcd-shuffle-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tcd-shuffle-deck--shuffling .tcd-shuffle-card:nth-child(odd) {
    animation: tcd-shuffle-riffle-odd 0.32s ease-in-out 6;
}

.tcd-shuffle-deck--shuffling .tcd-shuffle-card:nth-child(even) {
    animation: tcd-shuffle-riffle-even 0.32s ease-in-out 6;
}

@keyframes tcd-shuffle-deck-wiggle {
    0%, 100% { transform: rotate(0deg) translateX(0); }
    20% { transform: rotate(-4deg) translateX(-6px); }
    40% { transform: rotate(3deg) translateX(5px); }
    60% { transform: rotate(-2deg) translateX(-3px); }
    80% { transform: rotate(2deg) translateX(4px); }
}

@keyframes tcd-shuffle-riffle-odd {
    0%, 100% { transform: translateY(calc(var(--stack-index) * -1.25px)) translateX(calc(var(--stack-index) * 0.35px)) rotate(calc(var(--stack-index) * 0.15deg)); }
    50% { transform: translateY(calc(var(--stack-index) * -1.25px - 3px)) translateX(calc(var(--stack-index) * 0.35px - 9px)) rotate(-6deg); }
}

@keyframes tcd-shuffle-riffle-even {
    0%, 100% { transform: translateY(calc(var(--stack-index) * -1.25px)) translateX(calc(var(--stack-index) * 0.35px)) rotate(calc(var(--stack-index) * 0.15deg)); }
    50% { transform: translateY(calc(var(--stack-index) * -1.25px - 2px)) translateX(calc(var(--stack-index) * 0.35px + 9px)) rotate(6deg); }
}

.tcd-shuffle-fly-card {
    position: absolute;
    left: 50%;
    top: 46%;
    width: 4.6rem;
    aspect-ratio: 2 / 3;
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0;
    z-index: 20;
    transition:
        transform 0.58s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.42s ease;
    transition-delay: var(--fly-delay, 0ms);
}

.tcd-shuffle-fly-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0.45rem;
    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.55),
        0 0 20px rgba(251, 191, 36, 0.25);
}

.tcd-shuffle-fly-card--launch {
    opacity: 1;
    transform:
        translate(calc(-50% + var(--fly-x, 0px)), calc(-50% + 7.25rem))
        rotate(var(--fly-rotate, 0deg))
        scale(1);
}

.tcd-split-board {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0;
}

.tcd-split-piles-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

@media (max-width: 640px) {
    .tcd-split-piles-row { grid-template-columns: 1fr; }
}

.tcd-split-pile {
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: 0.85rem;
    padding: 0.75rem 0.65rem 0.85rem;
    background: rgba(0, 0, 0, 0.22);
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    min-height: 11.5rem;
}

.tcd-split-pile--deck {
    text-align: center;
    border-style: solid;
    border-color: rgba(212, 175, 90, 0.28);
    background: rgba(0, 0, 0, 0.18);
    min-height: 10.5rem;
}

.tcd-split-pile--info.tcd-split-pile--active,
.tcd-split-pile--info.tcd-split-pile--drop-hover {
    border-color: rgba(196, 181, 253, 0.65);
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.22);
    background: rgba(76, 29, 149, 0.12);
}

.tcd-split-pile--prem.tcd-split-pile--active,
.tcd-split-pile--prem.tcd-split-pile--drop-hover {
    border-color: rgba(251, 191, 36, 0.65);
    box-shadow: 0 0 24px rgba(251, 191, 36, 0.18);
    background: rgba(120, 83, 14, 0.12);
}

.tcd-split-pile-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.tcd-split-pile-title {
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff8e8;
}

.tcd-split-pile-icon {
    font-size: 1rem;
    line-height: 1;
}

.tcd-split-pile--info .tcd-split-pile-icon { color: #c4b5fd; }
.tcd-split-pile--prem .tcd-split-pile-icon { color: #fde68a; }

.tcd-split-pile-count {
    min-width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.72rem;
    font-weight: 800;
    color: #fde68a;
}

.tcd-split-pile-desc {
    margin: 0 0 0.55rem;
    font-size: 0.72rem;
    line-height: 1.4;
    color: #a8a090;
    text-align: center;
    min-height: 2.6em;
}

.tcd-split-pile-cards {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    min-height: 7.5rem;
    padding-top: 0.35rem;
}

.tcd-split-pile-cards--deck {
    min-height: 8.5rem;
}

.tcd-split-card {
    position: relative;
    width: 4.6rem;
    aspect-ratio: 2 / 3;
    border: none;
    padding: 0;
    background: transparent;
    cursor: grab;
    perspective: 900px;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), filter 0.25s, box-shadow 0.25s;
    z-index: 1;
}

.tcd-split-card:active { cursor: grabbing; }

.tcd-split-card-flipper {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 0.15, 0.2, 1);
}

.tcd-split-card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 0.45rem;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.tcd-split-card-face--back {
    transform: rotateY(0deg);
}

.tcd-split-card-face--assigned {
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotateY(180deg);
    background: linear-gradient(145deg, #2a2040, #120e1c);
    border: 1px solid rgba(212, 175, 90, 0.45);
}

.tcd-split-card--in-info .tcd-split-card-flipper,
.tcd-split-card--in-prem .tcd-split-card-flipper {
    transform: rotateY(180deg);
}

.tcd-split-card--in-info .tcd-split-card-face--assigned {
    background: linear-gradient(145deg, #3b2a62, #1a1230);
    border-color: rgba(196, 181, 253, 0.55);
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.35);
}

.tcd-split-card--in-prem .tcd-split-card-face--assigned {
    background: linear-gradient(145deg, #3d2e14, #1a1408);
    border-color: rgba(251, 191, 36, 0.55);
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.3);
}

.tcd-split-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tcd-split-card-sigil {
    font-size: 1.45rem;
    color: #fde68a;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.55);
}

.tcd-split-card--in-info .tcd-split-card-sigil { color: #c4b5fd; text-shadow: 0 0 12px rgba(139, 92, 246, 0.55); }

.tcd-split-pile-cards--deck .tcd-split-card:nth-child(1) {
    transform: rotate(-10deg) translateX(1.1rem);
    z-index: 1;
}
.tcd-split-pile-cards--deck .tcd-split-card:nth-child(2) {
    transform: rotate(0deg);
    z-index: 3;
}
.tcd-split-pile-cards--deck .tcd-split-card:nth-child(3) {
    transform: rotate(10deg) translateX(-1.1rem);
    z-index: 2;
}

.tcd-split-pile-cards:not(.tcd-split-pile-cards--deck) .tcd-split-card {
    margin-left: -2.2rem;
}
.tcd-split-pile-cards:not(.tcd-split-pile-cards--deck) .tcd-split-card:first-child {
    margin-left: 0;
}
.tcd-split-pile-cards:not(.tcd-split-pile-cards--deck) .tcd-split-card:nth-child(1) { transform: rotate(-4deg); z-index: 1; }
.tcd-split-pile-cards:not(.tcd-split-pile-cards--deck) .tcd-split-card:nth-child(2) { transform: rotate(0deg) translateY(-0.35rem); z-index: 2; }
.tcd-split-pile-cards:not(.tcd-split-pile-cards--deck) .tcd-split-card:nth-child(3) { transform: rotate(4deg); z-index: 3; }

.tcd-split-card--selected {
    transform: translateY(-0.65rem) scale(1.04) !important;
    z-index: 5 !important;
    filter: drop-shadow(0 0 14px rgba(251, 191, 36, 0.55));
}

.tcd-split-card--deal-in {
    animation: tcd-split-deal-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    animation-delay: var(--deal-delay, 0ms);
}

@keyframes tcd-split-deal-in {
    from {
        opacity: 0;
        transform: translateY(2rem) rotate(8deg) scale(0.82);
    }
    to {
        opacity: 1;
        transform: rotate(var(--deal-rotate, 0deg));
    }
}

.tcd-split-card--moving {
    z-index: 6 !important;
}

.tcd-split-card--flip .tcd-split-card-flipper {
    animation: tcd-split-card-flip 0.55s ease-in-out;
}

.tcd-split-card--return .tcd-split-card-flipper {
    animation: tcd-split-card-return 0.45s ease-in-out;
}

@keyframes tcd-split-card-flip {
    0% { transform: rotateY(0deg) scale(1); }
    45% { transform: rotateY(90deg) scale(1.06); }
    100% { transform: rotateY(180deg) scale(1); }
}

@keyframes tcd-split-card-return {
    0% { transform: rotateY(180deg); }
    100% { transform: rotateY(0deg); }
}

.tcd-split-card--dragging {
    opacity: 0.72;
    transform: scale(1.06) rotate(2deg) !important;
}

.tcd-split-hint {
    margin: 0 0 0.85rem;
    text-align: center;
    font-size: 0.72rem;
    color: #908878;
    font-style: italic;
}

.tcd-pool-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 1.15rem;
}

@media (max-width: 640px) {
    .tcd-pool-grid { grid-template-columns: 1fr; }
}

.tcd-pool {
    position: relative;
    padding: 1rem 0.85rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.28);
    text-align: center;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.tcd-pool--active {
    transform: translateY(-2px);
}

.tcd-pool--info.tcd-pool--active {
    border-color: rgba(196, 181, 253, 0.55);
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.25);
}

.tcd-pool--prem.tcd-pool--active {
    border-color: rgba(251, 191, 36, 0.55);
    box-shadow: 0 0 24px rgba(251, 191, 36, 0.2);
}

.tcd-pool-icon-wrap {
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
    opacity: 0.85;
}

.tcd-pool--info .tcd-pool-icon-wrap { color: #c4b5fd; }
.tcd-pool--prem .tcd-pool-icon-wrap { color: #fde68a; }

.tcd-pool-title {
    margin: 0 0 0.45rem;
    font-family: 'Cinzel', serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff8e8;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tcd-pool-desc {
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #b8a898;
    min-height: 3.2em;
}

.tcd-pool-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
}

.tcd-pool-btn {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 90, 0.5);
    background: rgba(255, 255, 255, 0.08);
    color: #fff8e8;
    font-size: 1.15rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.tcd-pool-btn:hover {
    background: rgba(251, 191, 36, 0.2);
    transform: scale(1.05);
}

.tcd-pool-value {
    font-family: 'Cinzel', serif;
    font-size: 1.85rem;
    font-weight: 800;
    min-width: 1.5rem;
    color: #fde68a;
}

.tcd-ritual-actions {
    position: relative;
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.tcd-ritual-btn {
    border-radius: 999px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.5rem 1.15rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.tcd-ritual-btn--primary {
    background: linear-gradient(135deg, #d4a017, #b8860b);
    color: #1a1208;
    border-color: #fde68a;
    box-shadow: 0 4px 18px rgba(251, 191, 36, 0.35);
}

.tcd-ritual-btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(251, 191, 36, 0.5);
}

.tcd-ritual-btn--primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.tcd-ritual-btn--ghost {
    background: transparent;
    color: #c8b8a8;
    border-color: rgba(255, 255, 255, 0.2);
}

.tcd-ritual-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f0e8d8;
}

.tcd-ritual-btn--roll {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(109, 40, 217, 0.65));
    color: #f3e8ff;
    border-color: rgba(196, 181, 253, 0.5);
}

.tcd-assign-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.tcd-assign-grid--info {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 640px) {
    .tcd-assign-grid,
    .tcd-assign-grid--info { grid-template-columns: 1fr; }
}

.tcd-assign-chip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 0.5rem;
    border-radius: 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.tcd-assign-chip:has(input:checked) {
    transform: translateY(-2px);
    border-color: rgba(251, 191, 36, 0.65);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.25);
}

.tcd-assign-chip--self:has(input:checked) { border-color: #94a3b8; box-shadow: 0 0 18px rgba(148, 163, 184, 0.35); }
.tcd-assign-chip--control:has(input:checked) { border-color: #fbbf24; box-shadow: 0 0 18px rgba(251, 191, 36, 0.35); }
.tcd-assign-chip--action:has(input:checked) { border-color: #f8fafc; box-shadow: 0 0 18px rgba(248, 250, 252, 0.25); }
.tcd-assign-chip--info:has(input:checked) { border-color: #c4b5fd; box-shadow: 0 0 18px rgba(139, 92, 246, 0.3); }

.tcd-assign-chip input { position: absolute; opacity: 0; pointer-events: none; }
.tcd-assign-icon { width: 2rem; height: 2rem; }
.tcd-assign-chip-label {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.82rem;
    color: #fff8e8;
}
.tcd-assign-chip-hint {
    font-size: 0.68rem;
    line-height: 1.35;
    color: #a8a090;
}

.tcd-roll-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.tcd-roll-phase-label {
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #c4b5fd;
    font-weight: 700;
    margin-top: 0.35rem;
}

.tcd-roll-entry {
    padding: 0.85rem 0.9rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.28);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.tcd-roll-entry--self { border-color: rgba(148, 163, 184, 0.35); }
.tcd-roll-entry--control { border-color: rgba(251, 191, 36, 0.35); }
.tcd-roll-entry--action { border-color: rgba(248, 250, 252, 0.28); }
.tcd-roll-entry--info { border-color: rgba(196, 181, 253, 0.3); }

.tcd-roll-entry--rolling {
    animation: tcd-roll-shake 0.45s ease-in-out infinite alternate;
    border-color: rgba(196, 181, 253, 0.65);
    box-shadow: 0 0 28px rgba(139, 92, 246, 0.35);
}

@keyframes tcd-roll-shake {
    from { transform: translateX(-2px); }
    to { transform: translateX(2px); }
}

.tcd-roll-entry--revealed {
    animation: tcd-roll-reveal 0.5s ease-out;
}

@keyframes tcd-roll-reveal {
    from { opacity: 0.4; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.tcd-roll-entry-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.tcd-roll-entry-moon {
    width: 1.5rem;
    height: 1.5rem;
}

.tcd-roll-entry-label {
    font-weight: 700;
    color: #fff8e8;
    font-family: 'Cinzel', serif;
    font-size: 0.88rem;
}

.tcd-surge-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fde68a;
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.5);
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.tcd-roll-entry-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tcd-manual-roll {
    font-size: 0.78rem;
    color: #a8a090;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tcd-roll-total-input {
    width: 3.5rem;
    padding: 0.25rem 0.35rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.35);
    color: #fff8e8;
}

.tcd-roll-result {
    margin: 0;
    font-size: 0.95rem;
    color: #e8dcc8;
}

.tcd-roll-dice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    font-family: 'Cinzel', serif;
    font-weight: 800;
    color: #fde68a;
}

.tcd-roll-total {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    color: #fff8e8;
    margin: 0 0.25rem;
}

.tcd-success { color: #86efac; font-weight: 700; margin-left: 0.35rem; }
.tcd-fail { color: #fca5a5; font-weight: 700; margin-left: 0.35rem; }
.tcd-stored { color: #fde68a; font-weight: 700; margin-left: 0.35rem; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* Premonition status strip (modal footer + GM) */
.premonition-status-strip {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.premonition-status-strip--empty {
    justify-content: flex-start;
}

.premonition-status-empty {
    font-style: italic;
    font-size: 0.9rem;
}

.tarot-modal--ritual .premonition-status-empty {
    color: #a8a090;
}

#three-card-draw-modal.tarot-modal--ritual .premonition-status-empty {
    color: #a8a090;
}

.premonition-status-die {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-width: 4.5rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.65rem;
    border: 2px solid rgba(120, 120, 120, 0.35);
    background: rgba(40, 40, 48, 0.08);
}

.premonition-status-die--self.premonition-status-die--filled {
    border-color: rgba(148, 163, 184, 0.7);
    box-shadow: 0 0 14px rgba(148, 163, 184, 0.35);
}
.premonition-status-die--control.premonition-status-die--filled {
    border-color: rgba(251, 191, 36, 0.7);
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.35);
}
.premonition-status-die--action.premonition-status-die--filled {
    border-color: rgba(248, 250, 252, 0.55);
    box-shadow: 0 0 14px rgba(226, 232, 240, 0.35);
}

.premonition-status-die--used,
.premonition-status-die--empty {
    opacity: 0.45;
    filter: grayscale(0.85);
}

.premonition-status-die-icon { width: 2rem; height: 2rem; }
.premonition-status-die-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.premonition-status-die-value { font-size: 1.1rem; font-weight: 800; font-family: 'Cinzel', serif; }

/* --- Manual roll entry + faith assignment --- */

.tcd-discipline-pill {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background-color: #1E40AF;
    color: #DBEAFE;
    font-weight: 700;
    font-size: 0.88em;
    letter-spacing: 0.04em;
    vertical-align: baseline;
    box-shadow: 0 0 10px rgba(30, 64, 175, 0.35);
}

.tcd-enter-rolls-stage,
.tcd-assign-outcomes-stage {
    position: relative;
    overflow: hidden;
}

.tcd-tarot-decor-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.tcd-tarot-decor-layer--subtle .tcd-tarot-decor {
    opacity: 0.14;
}

.tcd-tarot-decor {
    position: absolute;
    width: 4.5rem;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 0.45rem;
    opacity: 0.22;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
    transform: rotate(var(--decor-rotate, 0deg));
}

.tcd-tarot-decor--0 { top: 8%; left: -0.5rem; --decor-rotate: -14deg; }
.tcd-tarot-decor--1 { top: 18%; right: -0.35rem; --decor-rotate: 11deg; width: 3.75rem; }
.tcd-tarot-decor--2 { bottom: 14%; left: 0.25rem; --decor-rotate: 8deg; width: 3.5rem; opacity: 0.16; }
.tcd-tarot-decor--3 { bottom: 10%; right: 0.5rem; --decor-rotate: -9deg; width: 4rem; opacity: 0.18; }

.tcd-enter-rolls-lead strong {
    color: #fff8e8;
}

.tcd-roll-entry-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .tcd-roll-entry-grid { grid-template-columns: 1fr; }
}

.tcd-roll-entry-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.75rem 0.65rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(212, 175, 90, 0.35);
    background: rgba(0, 0, 0, 0.28);
    text-align: center;
}

.tcd-roll-entry-field-label {
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c4b5fd;
}

.tcd-roll-entry-input {
    width: 100%;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 1.65rem;
    font-weight: 800;
    color: #fde68a;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(212, 175, 90, 0.4);
    border-radius: 0.55rem;
    padding: 0.45rem 0.35rem;
}

.tcd-roll-entry-input:focus {
    outline: none;
    border-color: rgba(251, 191, 36, 0.75);
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.2);
}

.tcd-roll-value-strip {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.tcd-roll-value-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 5.5rem;
    padding: 0.45rem 0.65rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(212, 175, 90, 0.4);
    background: rgba(0, 0, 0, 0.32);
    position: relative;
}

.tcd-roll-value-chip--draggable {
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.tcd-roll-value-chip--draggable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    border-color: rgba(251, 191, 36, 0.65);
}

.tcd-roll-value-chip--dragging {
    cursor: grabbing;
    opacity: 0.55;
    transform: scale(0.96);
}

.tcd-roll-value-chip--in-use {
    opacity: 0.42;
}

.tcd-roll-value-chip--placed {
    cursor: grab;
    width: 100%;
    min-width: 0;
    margin: 0;
}

.tcd-prem-drop-clear {
    position: absolute;
    top: 0.2rem;
    right: 0.25rem;
    width: 1.15rem;
    height: 1.15rem;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: #d8d0c0;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.tcd-prem-drop-clear:hover {
    background: rgba(127, 29, 29, 0.65);
    color: #fff;
}

.tcd-roll-value-chip-label {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a8a090;
}

.tcd-roll-value-chip-num {
    font-family: 'Cinzel', serif;
    font-size: 1.35rem;
    color: #fde68a;
}

.tcd-assign-section {
    position: relative;
    z-index: 1;
    margin-bottom: 1rem;
}

.tcd-assign-section-title {
    margin: 0 0 0.35rem;
    font-family: 'Cinzel', serif;
    font-size: 0.92rem;
    color: #fff8e8;
}

.tcd-assign-section-lead {
    margin: 0 0 0.65rem;
    font-size: 0.8rem;
    color: #c8b8a0;
}

.tcd-assign-faith-grid {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.tcd-assign-faith-row {
    display: grid;
    grid-template-columns: 1fr minmax(9rem, 11rem);
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.65rem;
    border-radius: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.22);
}

@media (max-width: 560px) {
    .tcd-assign-faith-row { grid-template-columns: 1fr; }
}

.tcd-assign-faith-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    min-width: 0;
}

.tcd-assign-faith-check input {
    flex-shrink: 0;
    accent-color: #d4af5a;
}

.tcd-assign-roll-select {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid rgba(212, 175, 90, 0.4);
    background: rgba(14, 10, 22, 0.92);
    color: #f0e8d8;
    font-size: 0.78rem;
    padding: 0.4rem 0.45rem;
}

.tcd-assign-roll-select:disabled {
    opacity: 0.45;
}

.tcd-assign-faith-row--self:has(input:checked) { border-color: rgba(148, 163, 184, 0.55); }
.tcd-assign-faith-row--control:has(input:checked) { border-color: rgba(251, 191, 36, 0.55); }
.tcd-assign-faith-row--action:has(input:checked) { border-color: rgba(248, 250, 252, 0.45); }
.tcd-assign-faith-row--info:has(input:checked) { border-color: rgba(196, 181, 253, 0.55); }

.tcd-assign-dm-note {
    position: relative;
    z-index: 1;
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(196, 181, 253, 0.35);
    background: rgba(76, 29, 149, 0.12);
    font-size: 0.78rem;
    line-height: 1.45;
    color: #d8d0e8;
    font-style: italic;
}

/* Premonition moon cards — Place Your Faith */
.tcd-assign-section--prem {
    margin-bottom: 1.25rem;
}

.tcd-prem-moon-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (max-width: 820px) {
    .tcd-prem-moon-grid { grid-template-columns: 1fr; }
}

.tcd-prem-moon-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem 0.8rem 0.75rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(165deg, rgba(18, 12, 30, 0.88), rgba(8, 6, 14, 0.72));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tcd-prem-moon-card--self.tcd-prem-moon-card--assigned {
    border-color: rgba(148, 163, 184, 0.55);
    box-shadow: 0 0 20px rgba(148, 163, 184, 0.12);
}

.tcd-prem-moon-card--control.tcd-prem-moon-card--assigned {
    border-color: rgba(251, 191, 36, 0.55);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.12);
}

.tcd-prem-moon-card--action.tcd-prem-moon-card--assigned {
    border-color: rgba(248, 250, 252, 0.4);
    box-shadow: 0 0 20px rgba(248, 250, 252, 0.08);
}

.tcd-prem-moon-card-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.tcd-prem-moon-icon {
    width: 3.25rem;
    height: 3.25rem;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.tcd-prem-moon-head-text {
    min-width: 0;
}

.tcd-prem-moon-title {
    margin: 0;
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff8e8;
}

.tcd-prem-moon-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #a8a090;
}

.tcd-prem-moon-flavor {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #d0c8b8;
}

.tcd-prem-moon-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.74rem;
    line-height: 1.4;
}

.tcd-prem-moon-table th,
.tcd-prem-moon-table td {
    padding: 0.4rem 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    vertical-align: top;
    text-align: left;
}

.tcd-prem-moon-table th {
    width: 38%;
    font-family: 'Cinzel', serif;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #c8b8a0;
    background: rgba(0, 0, 0, 0.28);
}

.tcd-prem-moon-table td {
    color: #e8e0d0;
    background: rgba(0, 0, 0, 0.18);
}

.tcd-prem-moon-drop {
    margin-top: auto;
    min-height: 4.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem;
    border-radius: 0.65rem;
    border: 2px dashed rgba(212, 175, 90, 0.35);
    background: rgba(0, 0, 0, 0.22);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.tcd-prem-moon-drop--filled {
    border-style: solid;
    border-color: rgba(212, 175, 90, 0.45);
    background: rgba(0, 0, 0, 0.32);
}

.tcd-prem-moon-drop--drop-hover {
    border-color: rgba(251, 191, 36, 0.85);
    background: rgba(76, 29, 149, 0.18);
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.15);
}

.tcd-prem-moon-drop-hint {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8a8070;
    text-align: center;
}
