@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700;900&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;0,700;1,400&display=swap');

:root {
    --bg-darker: #080808;
    --bg-dark: #121212;
    --bg-card: #1c1c1c;
    --bg-card-hover: #262626;
    --primary-red: #990000;
    --primary-red-hover: #b30000;
    --blood-glow: rgba(153, 0, 0, 0.4);
    --gold: #c5a059;
    --gold-dim: #8c703d;
    --gold-glow: rgba(197, 160, 89, 0.3);
    --text-primary: #e6e0d2;
    --text-muted: #a0998c;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Crimson Pro', serif;
    --border-color: #2e2a24;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    background-color: var(--bg-darker);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.65rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 1rem;
    box-sizing: border-box;
}

/* Header / Status Bar */
.game-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(180deg, #181512 0%, #100d0b 100%);
    border: 1px solid var(--border-color);
    border-bottom: 2px solid var(--primary-red);
    border-radius: 0 0 6px 6px;
    padding: 0.65rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    box-sizing: border-box;
    transition: padding 0.3s ease, margin-bottom 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.game-header.is-sticky {
    padding: 0.4rem 1.5rem;
    background: rgba(16, 13, 11, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 15px rgba(153, 0, 0, 0.2);
    margin-bottom: 1.25rem;
}

.header-tabs {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.header-tabs .btn-db-secondary {
    padding: 0.45rem 1.25rem;
    font-size: 1.35rem;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.space-toggle-container {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.toggle-label {
    font-size: 1.275rem;
    color: var(--text-muted);
    user-select: none;
    white-space: nowrap;
}

.round-indicator {
    font-family: var(--font-heading);
    color: var(--gold);
    font-weight: bold;
    font-size: 1.425rem;
    white-space: nowrap;
}

.btn-header-action {
    padding: 0.4rem 1rem;
    font-size: 1.35rem;
    white-space: nowrap;
}

.phase-badge {
    background-color: var(--primary-red);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    letter-spacing: 0.1em;
    box-shadow: 0 0 8px var(--blood-glow);
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.resource-item {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.resource-item:hover {
    border-color: var(--gold-dim);
    background: rgba(197, 160, 89, 0.05);
}

.resource-label {
    font-size: 1.35rem;
    color: var(--text-muted);
}

.resource-value {
    font-weight: bold;
    font-size: 1.8rem;
    color: var(--text-primary);
}

.resource-value.blood { color: #ff3b30; text-shadow: 0 0 5px rgba(255,59,48,0.3); }
.resource-value.silver { color: #e5c158; text-shadow: 0 0 5px rgba(229,193,88,0.3); }

/* Main Gameplay Area */
.game-main {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    flex-grow: 1;
}

@media (max-width: 1024px) {
    .game-main {
        grid-template-columns: 1fr;
    }
}

/* Sidebar / Left Column */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.25rem;
    box-shadow: 0 6px 15px rgba(0,0,0,0.5);
}

.panel-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    color: var(--gold);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Disabled token group styling for Solo mode */
.token-group.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}





/* Unholy Favor Track */
.favor-track {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.favor-step {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s;
}

.favor-step.active-player {
    border-color: var(--primary-red);
    background: rgba(153, 0, 0, 0.1);
    box-shadow: inset 0 0 10px rgba(153, 0, 0, 0.2);
}

.favor-step.active-enemy {
    border-color: #4a5568;
    background: rgba(74, 85, 104, 0.1);
}

.favor-number {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--gold-dim);
    margin-right: 1rem;
    width: 20px;
    text-align: center;
}

.favor-owner {
    font-weight: 600;
}

.favor-owner.player {
    color: #ff3b30;
}

.favor-owner.enemy {
    color: #a0aec0;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    align-content: start;
}

@media (max-width: 1200px) {
    .board-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .board-grid {
        grid-template-columns: 1fr;
    }
}

.location-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.location-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 8px 25px var(--gold-glow);
}

.location-card.defiled {
    background: linear-gradient(135deg, #121010 0%, #080808 100%);
    border-color: var(--primary-red);
    opacity: 0.85;
}

.location-card.defiled::after {
    content: "DEFILED";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-family: var(--font-heading);
    font-size: 3.3rem;
    color: rgba(153, 0, 0, 0.65);
    border: 3px double rgba(153, 0, 0, 0.65);
    padding: 0.25rem 1rem;
    pointer-events: none;
    letter-spacing: 0.1em;
    font-weight: bold;
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.location-name {
    margin: 0;
    font-size: 1.95rem;
    color: var(--text-primary);
}

.location-priority {
    background: #181512;
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.location-stats {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
    font-size: 1.425rem;
}

.location-stat-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}

.location-stat-val {
    color: var(--text-primary);
    font-weight: 600;
}

.location-hexes {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.hex-badge {
    background: #231f1a;
    border: 1px solid var(--gold-dim);
    font-size: 1.2rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    color: var(--text-primary);
}

/* Modals & Popups */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-card);
    border: 2px solid var(--gold);
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px var(--gold-glow);
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-title {
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    color: var(--gold);
    font-size: 2.25rem;
}

/* Faction Card Selection */
.faction-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.faction-card {
    background: #181512;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.faction-card:hover {
    border-color: var(--gold-dim);
    background: #1e1a16;
}

.faction-card.selected {
    border-color: var(--primary-red);
    background: rgba(153, 0, 0, 0.15);
    box-shadow: 0 0 10px var(--blood-glow);
}

.faction-name {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.faction-desc {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Buttons */
.btn-db {
    background: linear-gradient(180deg, #990000 0%, #730000 100%);
    border: 1px solid #b30000;
    color: white;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-db:hover:not(:disabled) {
    background: linear-gradient(180deg, #b30000 0%, #8c0000 100%);
    box-shadow: 0 0 10px var(--blood-glow);
}

.btn-db:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #333;
    border-color: #444;
}

.btn-db-secondary {
    background: linear-gradient(180deg, #2e2a24 0%, #1c1a17 100%);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-db-secondary:hover:not(:disabled) {
    border-color: var(--gold-dim);
    background: #3a352d;
}

.btn-db-gold {
    background: linear-gradient(180deg, #c5a059 0%, #a6813b 100%);
    border: 1px solid #d9b873;
    color: #121212;
    font-weight: bold;
}

.btn-db-gold:hover:not(:disabled) {
    background: linear-gradient(180deg, #d9b873 0%, #b8924a 100%);
    box-shadow: 0 0 10px var(--gold-glow);
}

/* Input Styles */
.input-db {
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    font-family: monospace;
    font-size: 1.8rem;
    text-align: center;
}

.input-db:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 5px var(--blood-glow);
}

/* Close/Action layouts */
.button-row {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Tree of Damned & Ritual panel tweaks */
.ritual-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0;
}

.ritual-row:last-child {
    border-bottom: none;
}

.ritual-cost {
    font-size: 1.275rem;
    color: var(--text-muted);
}

/* --- New Board Representations & Premium Elements --- */

/* Tokens Board Panel */
.tokens-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.token-group {
    background: rgba(16, 13, 11, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.token-group-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--gold);
    margin-top: 0;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
    text-align: center;
}

.token-slots-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.board-token-visual {
    background: linear-gradient(135deg, #2a2520 0%, #1a1614 100%);
    border: 1px solid var(--gold-dim);
    border-radius: 4px;
    width: 50px;
    height: 65px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: all 0.2s;
}

.board-token-visual.claimed {
    opacity: 0.25;
    border-color: #333;
    background: #0d0d0d;
}

.board-token-visual.claimed::after {
    content: "CLAIMED";
    position: absolute;
    font-family: var(--font-heading);
    font-size: 0.825rem;
    color: var(--primary-red);
    transform: rotate(-30deg);
    font-weight: bold;
}

.board-token-visual .token-val {
    font-size: 1.65rem;
    font-weight: bold;
    color: var(--gold);
}

.board-token-visual .token-lbl {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* Unholy Favor Action Slots & Badges */
.favor-token-badge {
    background: rgba(197, 160, 89, 0.15);
    border: 1px solid var(--gold);
    color: var(--gold);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 1.125rem;
    font-family: var(--font-heading);
    margin-left: auto;
}

.favor-action-area {
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.favor-action-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.favor-action-slots {
    display: flex;
    gap: 0.5rem;
}

.favor-slot-button {
    flex: 1;
    background: rgba(153, 0, 0, 0.1);
    border: 1px dashed var(--primary-red);
    border-radius: 4px;
    padding: 0.4rem;
    color: var(--text-primary);
    font-size: 1.125rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.favor-slot-button:hover:not(:disabled) {
    background: rgba(153, 0, 0, 0.25);
    border-style: solid;
}

.favor-slot-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--border-color);
    background: rgba(0,0,0,0.1);
}

/* Location Card Details (Hex Trays & Stacked Under-Hexes) */
.location-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.location-number-circle {
    background: linear-gradient(135deg, #c5a059 0%, #8c703d 100%);
    color: #080808;
    font-weight: 900;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-family: var(--font-heading);
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    border: 1px solid #d9b873;
}

.location-resource-production {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 1.2rem;
    color: var(--gold-dim);
}

.location-defile-token-slot {
    border: 1px dashed var(--gold-dim);
    border-radius: 4px;
    padding: 0.35rem;
    margin-bottom: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.2rem;
}

.defile-token-visual {
    background: #1b1613;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: var(--font-heading);
    font-weight: bold;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 1.125rem;
}

.location-under-hexes-tray {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.under-hex-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #551111;
    border: 1px solid var(--primary-red);
    display: inline-block;
    box-shadow: 0 0 4px var(--blood-glow);
}

.under-hex-dot.cult-enemy {
    background: #334155;
    border-color: #64748b;
}

/* Visual Hex Tray & Discs */
.hex-tray-label {
    font-size: 1.125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.hex-tray-visuals {
    display: flex;
    gap: 0.5rem;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    min-height: 48px;
    align-items: center;
}

.hex-disc-visual {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    position: relative;
    user-select: none;
    border: 2px solid #111;
}

.hex-disc-visual.numbered {
    background: linear-gradient(135deg, #c5a059 0%, #8c703d 100%);
    color: #121212;
    border-color: #d9b873;
}

.hex-disc-visual.peasant {
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    color: white;
    border-color: #4ade80;
}

.hex-disc-visual.cult-player {
    background: linear-gradient(135deg, #990000 0%, #550000 100%);
    color: white;
    border-color: #ff3b30;
    box-shadow: 0 0 6px var(--blood-glow);
}

.hex-disc-visual.cult-enemy {
    background: linear-gradient(135deg, #475569 0%, #1e293b 100%);
    color: #cbd5e1;
    border-color: #94a3b8;
}

.hex-disc-visual.shield {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-color: #60a5fa;
}

.zone-tag {
    background-color: #0c0b0a;
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: bold;
    font-family: monospace;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    border: 1px solid var(--gold-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-right: 0.35rem;
    vertical-align: middle;
    box-shadow: 0 0 5px rgba(0,0,0,0.8);
}

/* Sections Layout */
.screen-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-top: 1rem;
}

@media (min-width: 1400px) {
    .screen-layout {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.game-board-section, .ritual-book-section {
    background: linear-gradient(180deg, #120f0d 0%, #080706 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
    position: relative;
}

.game-board-section {
    border-color: var(--primary-red);
    box-shadow: 0 0 15px rgba(153, 0, 0, 0.15);
}

.ritual-book-section {
    border-color: var(--gold-dim);
    box-shadow: 0 0 15px rgba(197, 160, 89, 0.1);
}

.section-header-title {
    font-family: var(--font-heading);
    font-size: 2.7rem;
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px double var(--border-color);
    padding-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-board-section .section-header-title {
    text-shadow: 0 0 10px var(--blood-glow);
    color: #ff4d4d;
}

.ritual-book-section .section-header-title {
    text-shadow: 0 0 10px var(--gold-glow);
    color: var(--gold);
}

/* Ritual Book Grid Layout */
.ritual-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.ritual-book-card {
    background: rgba(16, 13, 11, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.25rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.ritual-book-card:hover {
    border-color: var(--gold-dim);
    box-shadow: 0 6px 20px var(--gold-glow);
    transform: translateY(-2px);
}

.ritual-book-card-title {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    color: var(--gold);
    margin-top: 0;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.35rem;
    display: flex;
    align-items: center;
}

.ritual-book-card-content {
    font-size: 1.425rem;
    color: var(--text-primary);
    flex-grow: 1;
}

/* Specific Location styles */
.pouch-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pouch-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pouch-stat .val {
    font-weight: bold;
    font-size: 1.875rem;
}

.pouch-stat .blood-val {
    color: #ff3b30;
    text-shadow: 0 0 5px rgba(255, 59, 48, 0.4);
}

.pouch-stat .points-val {
    color: var(--gold);
    text-shadow: 0 0 5px rgba(197, 160, 89, 0.4);
}

.sigils-coffin {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.4);
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-height: 40px;
}

.sigil-token-item {
    background: radial-gradient(circle, #ff4d4d 0%, #990000 100%);
    border: 1px solid #ff3b30;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 0 5px var(--blood-glow);
}

.silver-crate {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.4);
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-height: 40px;
}

.silver-coin-item {
    background: radial-gradient(circle, #fcd34d 0%, #b45309 100%);
    border: 1px solid #fbbf24;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.4);
}

.cultists-pool {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.4);
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-height: 40px;
}

.cultist-token-item {
    background: radial-gradient(circle, #cbd5e1 0%, #475569 100%);
    border: 1px solid #94a3b8;
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.cultist-token-item.inactive {
    background: radial-gradient(circle, #64748b 0%, #0f172a 100%);
    border-color: #334155;
    opacity: 0.6;
}


/* Guide Book Styles */
.guide-book-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 1rem;
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 1200px) {
    .guide-book-container {
        grid-template-columns: 1.2fr 1fr;
    }
}

.guide-card, .rules-card {
    padding: 1.5rem;
    background: linear-gradient(180deg, #120f0d 0%, #080706 100%);
}

.guide-scrollable-content {
    max-height: calc(85vh - 120px);
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Custom Scrollbar for Guide Modal */
.guide-scrollable-content::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 6px;
}
.guide-scrollable-content::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
.guide-scrollable-content::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
    border-radius: 3px;
}

.guide-sub-header {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: 1.725rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.35rem;
}

.guide-lore-text {
    font-style: italic;
    color: var(--text-muted);
    border-left: 3px solid var(--primary-red);
    padding-left: 0.75rem;
    line-height: 1.6;
}

.guide-strategy-item {
    background: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--gold);
    padding: 0.75rem;
    border-radius: 4px;
    line-height: 1.5;
}

.guide-strategy-label {
    display: block;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 0.25rem;
}

.guide-strategy-desc {
    color: var(--text-primary);
}

.iconography-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.icon-item {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.35rem;
    transition: all 0.2s;
}

.icon-item:hover {
    border-color: var(--gold-dim);
    background: rgba(197, 160, 89, 0.05);
}

.icon-item strong {
    color: var(--gold);
}

.resource-conversion-box {
    background: rgba(197, 160, 89, 0.03);
    border: 1px dashed var(--gold-dim);
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.4);
}

.phases-flow {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.phase-flow-item {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.phase-flow-item:hover {
    border-color: var(--primary-red);
    box-shadow: 0 0 8px rgba(153, 0, 0, 0.1);
}

.phase-flow-title {
    color: var(--gold);
    margin-top: 0;
    margin-bottom: 0.35rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
}

.phase-flow-desc {
    margin: 0;
    font-size: 1.35rem;
    color: var(--text-muted);
    line-height: 1.5;
}


.ritual-action-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.ritual-action-item {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.ritual-action-item:hover {
    background: rgba(197, 160, 89, 0.05);
}

.upgrade-triangle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.upgrade-triangle-card {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    text-align: center;
}

.upgrade-triangle-title {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.upgrade-triangle-cost {
    font-size: 1.125rem;
    color: var(--gold-dim);
    margin-bottom: 0.5rem;
}

.passive-rituals-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.passive-ritual-item {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    background: rgba(0,0,0,0.2);
}

.passive-ritual-item.unlocked {
    border-color: var(--gold-dim);
    background: rgba(197, 160, 89, 0.05);
}

.passive-ritual-item.locked {
    opacity: 0.5;
    background: rgba(0,0,0,0.5);
    cursor: not-allowed;
}

.passive-ritual-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}

.passive-ritual-desc {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Upkeep Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-border {
    0% { border-color: var(--primary-red); box-shadow: 0 0 5px rgba(153, 0, 0, 0.3); }
    100% { border-color: #ff3b30; box-shadow: 0 0 15px rgba(255, 59, 48, 0.6); }
}

.pulse-priority {
    animation: pulse-priority-kf 1s infinite alternate;
}
@keyframes pulse-priority-kf {
    0% { transform: scale(1); box-shadow: 0 0 0px var(--gold-glow); border-color: var(--gold-dim); }
    100% { transform: scale(1.25); box-shadow: 0 0 15px var(--gold); border-color: var(--gold); }
}

.bounce-hex {
    animation: bounce-hex-kf 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
@keyframes bounce-hex-kf {
    0% { transform: scale(0) translateY(-20px); opacity: 0; }
    70% { transform: scale(1.15) translateY(2px); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.flash-resolve {
    animation: flash-resolve-kf 0.8s ease-in-out infinite alternate;
    border-radius: 3px;
    padding: 0 0.2rem;
}
@keyframes flash-resolve-kf {
    0% { background-color: transparent; text-shadow: none; }
    100% { background-color: rgba(153, 0, 0, 0.4); color: #ff4d4d; text-shadow: 0 0 8px #ff4d4d; }
}

.pulse-peasant {
    animation: pulse-peasant-kf 0.8s ease-in-out infinite alternate;
    border-radius: 3px;
    padding: 0 0.2rem;
}
@keyframes pulse-peasant-kf {
    0% { background-color: transparent; }
    100% { background-color: rgba(34, 197, 94, 0.3); color: #4ade80; text-shadow: 0 0 8px #4ade80; }
}

/* Upkeep Specific Location Highlights & Flares */
.upkeep-active-highlight {
    position: relative;
    border-color: var(--gold) !important;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4) !important;
    transform: translateY(-4px) scale(1.02);
    transition: all 0.4s ease;
    z-index: 10;
}

.priority-reveal-flare {
    animation: priority-reveal-kf 0.6s ease-out;
}
@keyframes priority-reveal-kf {
    0% { box-shadow: 0 0 0px transparent; border-color: var(--gold-dim); }
    50% { box-shadow: 0 0 25px var(--gold); border-color: var(--gold); background-color: rgba(212, 175, 55, 0.3); }
    100% { box-shadow: 0 0 0px transparent; }
}

.hex-placed-flare {
    animation: hex-placed-kf 0.8s ease-out;
}
@keyframes hex-placed-kf {
    0% { box-shadow: 0 0 0px transparent; }
    30% { box-shadow: 0 0 30px var(--primary-red); background-color: rgba(153, 0, 0, 0.2); }
    100% { box-shadow: 0 0 0px transparent; }
}

.peasant-placed-flare {
    animation: peasant-placed-kf 0.8s ease-out;
}
@keyframes peasant-placed-kf {
    0% { box-shadow: 0 0 0px transparent; }
    30% { box-shadow: 0 0 25px #22c55e; background-color: rgba(34, 197, 94, 0.2); }
    100% { box-shadow: 0 0 0px transparent; }
}

.flow-alert-flare {
    animation: flow-alert-kf 1s ease-in-out;
}
@keyframes flow-alert-kf {
    0% { transform: scale(1); border-color: var(--primary-red); }
    50% { transform: scale(1.04); border-color: #ff3b30; box-shadow: 0 0 20px #ff3b30; }
    100% { transform: scale(1); }
}

/* Cultist Slots Styles */
.cultist-slots-container {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.5rem;
    justify-content: center;
    align-items: center;
}

.cultist-slot {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1.5px dashed var(--border-color);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    transition: all 0.2s ease;
    cursor: default;
    user-select: none;
}

.cultist-slot.player {
    border: 1.5px solid var(--gold);
    background: var(--gold-dim);
    color: #000;
    box-shadow: 0 0 5px var(--gold-glow);
}

.cultist-slot.enemy {
    border: 1.5px solid var(--primary-red);
    background: rgba(153, 0, 0, 0.4);
    color: var(--text-primary);
    box-shadow: 0 0 5px rgba(153, 0, 0, 0.5);
}

.cultist-slot.empty {
    opacity: 0.6;
}

.cultist-slot.reclaimable {
    cursor: pointer;
}
.cultist-slot.reclaimable:hover {
    transform: scale(1.15);
    background: rgba(255, 59, 48, 0.2);
    border-color: #ff3b30;
    color: #ff3b30;
    box-shadow: 0 0 8px #ff3b30;
}

.cultist-slot.placeable {
    cursor: pointer;
}
.cultist-slot.placeable:hover {
    transform: scale(1.15);
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold);
    box-shadow: 0 0 8px var(--gold);
}

/* Iconography & Tooltip Styles */
.db-icon-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    vertical-align: middle;
    border-radius: 4px;
    padding: 2px 4px;
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.05);
}

.db-icon-container:hover {
    transform: scale(1.08);
    background-color: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
}

.db-icon-container.active {
    background-color: rgba(197, 160, 89, 0.15);
    border: 1px solid var(--gold);
    box-shadow: 0 0 8px var(--gold-glow);
}

.db-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.7));
}

.db-icon-label {
    margin-left: 0.35rem;
    font-size: 1.275rem;
    color: var(--text-primary);
}

.db-icon-tooltip {
    position: absolute;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%);
    background: #181512;
    border: 1px solid var(--gold);
    border-radius: 6px;
    padding: 0.65rem;
    width: 200px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.9), 0 0 10px var(--gold-glow);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 1.2rem;
    text-align: left;
    line-height: 1.3;
    color: var(--text-primary);
    pointer-events: none;
    animation: tooltip-fade-in 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.db-icon-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--gold) transparent transparent transparent;
}

@keyframes tooltip-fade-in {
    from { opacity: 0; transform: translate(-50%, 6px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.db-tooltip-title {
    color: var(--gold);
    font-family: var(--font-heading);
    font-size: 1.275rem;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.2rem;
}

.db-tooltip-desc {
    color: var(--text-muted);
}

/* Iconography Section */
.iconography-panel {
    background: linear-gradient(180deg, #120f0d 0%, #080706 100%);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
    margin-top: 2rem;
}

.iconography-title {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    color: var(--gold);
    margin-top: 0;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.iconography-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.iconography-card {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: default;
}

.iconography-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold-dim);
    background: rgba(197, 160, 89, 0.03);
    box-shadow: 0 4px 15px rgba(197, 160, 89, 0.08);
}

.iconography-img-wrapper {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid var(--gold-dim);
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: all 0.2s;
}

.iconography-card:hover .iconography-img-wrapper {
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--gold-glow);
    transform: scale(1.05);
}

.iconography-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.7));
}

.iconography-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.iconography-name {
    color: var(--gold);
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.03em;
}

.iconography-desc {
    color: var(--text-muted);
    margin: 0;
    font-size: 1.275rem;
    line-height: 1.35;
}

/* ==========================================================================
   Mobile Phone Simulator Layout & Bottom Navigation
   ========================================================================== */

.phone-simulator-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-darker);
    background-image: radial-gradient(circle at center, #1a0f0d 0%, #080808 100%);
    padding: 2rem;
    box-sizing: border-box;
    overflow: hidden;
}

.phone-viewport {
    width: 390px;
    height: 844px;
    max-width: 100%;
    max-height: 100%;
    border: 12px solid #1c1a17;
    border-radius: 40px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 30px rgba(153, 0, 0, 0.3);
    background-color: var(--bg-dark);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

/* Phone screen content area with scroll */
.phone-screen-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1.25rem 0.625rem;
    padding-bottom: 74px; /* Space for the bottom tabs */
    box-sizing: border-box;
    scrollbar-width: none; /* Hide scrollbar for standard look */
}

.phone-screen-content::-webkit-scrollbar {
    display: none;
}

/* Bottom navigation bar */
.phone-bottom-tabs {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: linear-gradient(180deg, #181512 0%, #100d0b 100%);
    border-top: 2px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 10;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 15px rgba(0,0,0,0.6);
}

/* Tab button formatting with 54px min tap area */
.phone-tab-btn {
    flex: 1;
    height: 100%;
    min-height: 54px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.phone-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.phone-tab-btn:focus {
    outline: none;
}

.phone-tab-btn.active {
    color: var(--gold);
    text-shadow: 0 0 5px var(--gold-glow);
    background: rgba(197, 160, 89, 0.05);
}

.phone-tab-btn .tab-icon {
    font-size: 2.025rem;
    transition: transform 0.2s ease;
}

.phone-tab-btn.active .tab-icon {
    transform: scale(1.1);
}

/* Mobile Prototype Placeholders style */
.mobile-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60vh;
    padding: 2rem 1.5rem;
    box-sizing: border-box;
}

.mobile-placeholder .placeholder-icon {
    font-size: 6rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 12px rgba(197, 160, 89, 0.25));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.mobile-placeholder h2 {
    font-size: 2.4rem;
    color: var(--gold);
    margin-top: 0;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px var(--gold-glow);
}

.mobile-placeholder p {
    font-size: 1.575rem;
    line-height: 1.5;
    color: var(--text-primary);
    max-width: 280px;
    margin-bottom: 1.75rem;
}

.mobile-placeholder .placeholder-tag {
    background: rgba(153, 0, 0, 0.2);
    border: 1px solid var(--primary-red);
    color: #ff4d4d;
    font-family: var(--font-heading);
    font-size: 1.275rem;
    letter-spacing: 0.1em;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 0 10px var(--blood-glow);
}

/* Responsive adjustment for actual mobile screens */
@media (max-width: 480px) {
    .phone-simulator-wrapper {
        padding: 0;
        background: var(--bg-darker);
    }
    
    .phone-viewport {
        width: 100vw;
        height: 100vh;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
}

/* ==========================================================================
   Mobile Campaign Board & Ritual Book Styles
   ========================================================================== */

:root {
    --silver: #9ca3af;
    --silver-glow: rgba(126, 139, 145, 0.3);
    --red: #a83232;
    --red-glow: rgba(168, 50, 50, 0.5);
    --purple: #a855f7;
    --purple-glow: rgba(168, 85, 247, 0.4);
    --crimson: #b91c1c;
    --crimson-glow: rgba(185, 28, 28, 0.45);
    --slot-bg: rgba(18, 11, 9, 0.96);
    --slot-hover: rgba(209, 176, 106, 0.2);
    --channel-glow: #8a3333;
    --piece-fill: #2d201d;
    --piece-hover: #402f2a;
}

.section-header {
    font-family: 'Cinzel', serif;
    font-size: 19.5px;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 2px double var(--border-color);
    padding-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 0 5px var(--gold-glow);
}

.section-header:first-of-type {
    margin-top: 0;
}

/* Core tracks */
.core-tracks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.track-tile {
    background: #181512;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.track-tile:hover {
    border-color: var(--gold-dim);
    background: #201a15;
}

.tile-value {
    font-size: 22.5px;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 0 0 4px var(--gold-glow);
}

.tile-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #8c8275;
    letter-spacing: 0.5px;
}

.num-badge {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    background: #2a221d;
    border: 1px solid var(--gold);
    color: #fff;
    font-size: 12px;
    padding: 1px 4px;
    border-radius: 8px;
    font-weight: bold;
    pointer-events: none;
    z-index: 5;
}

/* Defile & Shield Grid */
.defile-shields-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 15px;
    width: 100%;
}

.token-row {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

.token-node {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color);
    background: #141211;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.25s;
}

.token-node:hover {
    transform: scale(1.08);
    border-color: var(--gold-dim);
}

.token-node.defiled-token {
    border-radius: 6px;
    width: 58px;
    height: 46px;
    background: radial-gradient(circle, rgba(168, 50, 50, 0.1) 0%, rgba(20, 10, 10, 0.95) 100%);
    color: #ff4d4d;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.token-node.defiled-token:not(.claimed) {
    border-color: #ff3b30;
}

.token-node.defiled-token.claimed {
    opacity: 0.15;
    border-color: #333;
    background: #080808;
    box-shadow: none;
    animation: none;
}

.token-node.defiled-token.claimed::after {
    content: "✘";
    position: absolute;
    font-size: 24px;
    color: var(--red);
}

@keyframes active-defiled-pulse {
    0% {
        border-color: #ff1a0d;
        box-shadow: 0 0 6px rgba(255, 26, 13, 0.5), inset 0 0 3px rgba(255, 26, 13, 0.2);
    }
    100% {
        border-color: #ff665c;
        box-shadow: 0 0 14px rgba(255, 102, 92, 0.8), inset 0 0 6px rgba(255, 102, 92, 0.4);
    }
}

.token-node.two-peasant-hex-token {
    border-color: var(--silver);
    background: radial-gradient(circle, rgba(126, 139, 145, 0.1) 0%, rgba(15, 15, 15, 0.95) 100%);
    color: var(--silver);
    font-size: 14px;
    font-weight: bold;
    width: 54px;
    height: 54px;
}

.token-node.two-peasant-hex-token.claimed {
    opacity: 0.2;
    border-color: #333;
    background: #080808;
}


.defiled-taint-number {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 14.25px;
    font-weight: bold;
    color: #ff4d4d;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.cultists-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
    max-width: 38px;
    padding: 2px;
}

.cultist-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6), inset 0 1px 3px rgba(255, 255, 255, 0.2);
    transition: transform 0.2s;
}

.cultist-dot:hover {
    transform: scale(1.25);
    z-index: 2;
}

/* Hanging Tree Complex */
.tree-complex-card {
    background: rgba(18, 15, 13, 0.85);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.tree-interactive-box {
    width: 160px;
    height: 160px;
    border: 1px dashed #3a322b;
    border-radius: 50%;
    position: relative;
    background: radial-gradient(circle at center, #1b1512 0%, #0a0909 100%);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin-left: 8px;
}

.tree-title-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    color: var(--red);
    font-weight: bold;
}

.rope-container {
    display: flex;
    gap: 12px;
    position: absolute;
    bottom: 8px;
    width: 100%;
    justify-content: center;
}

.gallows-rope {
    width: 2px;
    height: 44px;
    background: #4a3c31;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    cursor: pointer;
    pointer-events: auto;
    transform-origin: top center;
    animation: wind-sway 5s ease-in-out infinite alternate;
    opacity: 0;
    transition: opacity 0.2s;
}

.gallows-rope.occupied {
    opacity: 1;
}

.gallows-rope:hover {
    opacity: 0.4;
}

.rope-1 { animation-delay: 0.2s; }
.rope-2 { animation-delay: 0.8s; }
.rope-3 { animation-delay: 0.4s; }
.rope-4 { animation-delay: 1.2s; }
.rope-5 { animation-delay: 0.6s; }

.gallows-rope::before {
    content: '';
    position: absolute;
    top: -2px;
    width: 4px;
    height: 4px;
    background: #2a1f18;
    border-radius: 50%;
}

.hanging-peasant-node {
    width: 14px;
    height: 22px;
    opacity: 0.2;
    transition: all 0.2s;
    transform: translateY(0);
}

.gallows-rope.occupied .hanging-peasant-node {
    opacity: 1;
    transform: translateY(0) scale(1.15);
}

@keyframes wind-sway {
    0% { transform: rotate(-2deg); }
    100% { transform: rotate(2deg); }
}

.stack-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
    margin-left: 6px;
}

.favor-stack-node {
    background: #1a1614;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    transition: background 0.2s;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    flex-shrink: 0;
}

.favor-stack-node:hover {
    background: #221d1a;
    border-color: var(--gold-dim);
}

.favor-stack-node.active {
    border-color: var(--gold);
    background: rgba(197, 160, 89, 0.08);
}

.favor-stack-lbl {
    font-size: 11px;
    color: #a0998c;
    text-transform: uppercase;
}

.favor-stack-val {
    font-size: 13px;
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-weight: bold;
}

.arc-system-container {
    position: relative;
    width: 160px;
    height: 220px;
    flex-shrink: 0;
    margin-left: -30px;
    pointer-events: none;
}

.arc-row {
    position: absolute;
    top: 50%;
    left: -18px;                
    width: 184px;               
    height: 52px;               
    margin-top: -26px;          
    transform-origin: left center;
    display: flex;
    align-items: center;
}

.arc-row.pos-0 { transform: rotate(-36deg); }
.arc-row.pos-1 { transform: rotate(-12deg); }
.arc-row.pos-2 { transform: rotate(12deg); }
.arc-row.pos-3 { transform: rotate(36deg); }

.ladder-step {
    position: relative;
    width: 49px;
    height: 52px;
    margin-left: 63px;
    background-color: #3a332d;
    clip-path: polygon(0% 28%, 100% 10%, 100% 90%, 0% 72%);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    display: block; /* box model reset */
    pointer-events: auto;
}

.ladder-step:hover {
    background-color: var(--gold-dim);
}

.ladder-step-inner {
    position: absolute;
    inset: 2px 1.5px;
    background-color: #181512;
    clip-path: polygon(0% 28%, 100% 10%, 100% 90%, 0% 72%);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.ladder-step:hover .ladder-step-inner {
    background-color: #201a15;
}

.ladder-step-val {
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: bold;
    color: var(--gold);
}

.ladder-step-desc {
    font-size: 10px;
    color: #8c8275;
    text-transform: uppercase;
}

.favor-token-node {
    width: 49px;
    height: 49px;
    margin-left: 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    background: radial-gradient(circle, rgba(197, 160, 89, 0.1) 0%, rgba(20, 16, 12, 0.95) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Responsive adjustments to fit container width on mobile */
@media (max-width: 360px) {
    .tree-complex-card {
        transform: scale(0.85);
        transform-origin: center top;
        margin-top: -15px;
        margin-bottom: -40px;
        width: 117.6% !important;
        margin-left: -8.8% !important;
    }
}
@media (max-width: 310px) {
    .tree-complex-card {
        transform: scale(0.72);
        transform-origin: center top;
        margin-top: -25px;
        margin-bottom: -60px;
        width: 138.8% !important;
        margin-left: -19.4% !important;
    }
}

/* 5 Sites Location Panels */
.location-panel {
    background: rgba(18, 15, 13, 0.95);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    position: relative;
}

.location-panel.priority-i { border-color: var(--primary-red); }
.location-panel.priority-ii { border-color: var(--silver); }
.location-panel.priority-iii { border-color: #059669; }
.location-panel.priority-iv { border-color: #4b5563; }
.location-panel.priority-v { border-color: var(--gold-dim); }

.location-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 6px;
}

.location-panel-title {
    font-family: 'Cinzel', serif;
    font-size: 21px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.location-panel-priority {
    background: #2a221d;
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
}

.location-panel-body {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.location-circle-container {
    width: 110px;
    height: 110px;
    position: relative;
    border-radius: 50%;
    border: 2px dashed #443c34;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.board-cultist-slot {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px dashed rgba(197, 160, 89, 0.45);
    background: rgba(0,0,0,0.45);
    transform: translate(-50%, -50%);
    transition: all 0.2s;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
}

.board-cultist-slot.occupied {
    border: none;
    background: none;
}

.location-card-container {
    flex: 1;
    height: 110px;
    perspective: 600px;
    margin-right: 8px;
}

.physical-card {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: default;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: absolute;
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
    background: radial-gradient(circle at 50% 10%, #201a16 0%, #0c0a09 100%);
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.6), inset 0 0 10px rgba(0,0,0,0.5);
    padding: 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.physical-card:hover .card-inner {
    border-color: var(--gold-dim);
    box-shadow: 0 8px 16px rgba(197, 160, 89, 0.15);
}

.card-title {
    font-family: 'Cinzel', serif;
    font-size: 13.5px;
    color: var(--gold);
    font-weight: bold;
    border-bottom: 1px solid rgba(197,160,89,0.2);
    padding-bottom: 2px;
    text-align: center;
    text-transform: uppercase;
}

.card-body {
    font-size: 12px;
    color: #beb8ab;
    line-height: 1.3;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.25px;
    color: #8c8275;
    border-top: 1px dashed rgba(255,255,255,0.1);
    padding-top: 2px;
}

.location-panel-resources {
    display: flex;
    gap: 12px;
    justify-content: space-around;
    border-top: 1px dashed #3a322b;
    padding-top: 8px;
}

.resource-node {
    background: #181512;
    border: 1.5px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.resource-node:hover {
    transform: scale(1.08);
    border-color: var(--gold-dim);
}

.placed-token {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 3px 6px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 12;
    cursor: pointer;
    animation: spawn-token 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes spawn-token {
    from { transform: scale(0) rotate(-45deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

.placed-token.player-cultist {
    background: radial-gradient(circle at 35% 35%, #ebdcb9 0%, #a88d55 70%, #5c4722 100%);
    border: 1.5px solid #fff;
}

.placed-token.enemy-cultist {
    background: radial-gradient(circle at 35% 35%, #ff8888 0%, #b91c1c 70%, #540505 100%);
    border: 1.5px solid #ff9999;
}

.db-svg-icon {
    width: 70%;
    height: 70%;
    fill: currentColor;
    display: block;
    pointer-events: none;
}

.token-flying {
    position: absolute;
    z-index: 999;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes resource-float {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-30px) scale(0.6); opacity: 0; }
}

.gathering-indicator {
    position: absolute;
    color: var(--gold);
    font-size: 16.5px;
    font-weight: bold;
    animation: resource-float 0.8s ease-out forwards;
    pointer-events: none;
    z-index: 1000;
}

/* Grimoire / Ritual Book Canvas scaling and components styling */
.ritual-book-scaler {
    width: 100%;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding-bottom: 2rem;
}

.page-scaler {
    width: 100%;
    height: 440px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    overflow: visible;
}

.scaled-page {
    width: 506px;
    height: 600px;
    transform: scale(0.72);
    transform-origin: center center;
    flex-shrink: 0;
    position: relative;
    background: linear-gradient(135deg, #1f0b08 0%, #0d0605 50%, #080303 100%);
    border: 4px double #5a463d;
    border-radius: 8px;
    box-shadow: 0 20px 45px rgba(0,0,0,0.95);
    box-sizing: border-box;
    overflow: hidden;
}

.slot {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--slot-bg);
    border: 2px solid var(--border-color);
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 3;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8), 0 4px 10px rgba(0,0,0,0.5);
}

.slot:hover {
    background: var(--slot-hover);
    border-color: var(--gold);
    box-shadow: inset 0 0 12px rgba(209, 176, 106, 0.15), 0 6px 15px rgba(0,0,0,0.6);
}

.circle { border-radius: 50%; }
.gold-core { border-color: var(--gold); background: rgba(36, 26, 22, 0.95); }
.gold-core:hover { background: rgba(56, 40, 34, 0.95); }

.num {
    position: absolute;
    top: 3px;
    font-size: 13.5px;
    color: rgba(235, 220, 213, 0.6);
    z-index: 5;
    font-weight: bold;
}

.lbl {
    font-size: 13.5px;
    color: var(--gold);
    margin-top: 2px;
    text-transform: uppercase;
    z-index: 5;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.coffin-box {
    clip-path: polygon(25% 0%, 75% 0%, 100% 20%, 85% 100%, 15% 100%, 0% 20%);
}

.crate-box {
    border-radius: 6px;
    background: linear-gradient(135deg, #1c1310 0%, #0d0806 100%);
    border: 3px solid #5a463d;
}

.drawstring-pouch {
    border-color: var(--crimson);
    background: radial-gradient(circle at center, #3d0c0c 0%, #170303 100%);
    box-shadow: inset 0 0 12px rgba(185, 28, 28, 0.3), 0 4px 10px rgba(0,0,0,0.6);
}

/* Apocrypha Coordinates */
#s1 { left: 45px; top: 50px; width: 80px; height: 140px; transform: rotate(-15deg); }
#s2 { left: 210px; top: 40px; width: 70px; height: 70px; }
#s3 { left: 350px; top: 50px; width: 90px; height: 130px; transform: rotate(15deg); }
#s4 { left: 195px; top: 215px; width: 100px; height: 100px; }

/* 8 Satellite Cultist Slots */
.sat8 { width: 44px; height: 44px; font-size: 16.5px; }
#s5  { left: 223px; top: 152px; }
#s6  { left: 282px; top: 177px; }
#s7  { left: 307px; top: 236px; }
#s8  { left: 282px; top: 295px; }
#s9  { left: 223px; top: 320px; }
#s10 { left: 164px; top: 295px; }
#s11 { left: 139px; top: 236px; }
#s12 { left: 164px; top: 177px; }

/* Inactive Cultists */
.inactive-slot { width: 44px; height: 44px; border-style: dashed; }
#s13 { left: 105px; top: 410px; }
#s14 { left: 185px; top: 432px; }
#s15 { left: 265px; top: 432px; }
#s16 { left: 345px; top: 410px; }

/* Active Ritual Slots forming Pentagram Points */
.rituals-layer {
    position: absolute;
    left: 0;
    top: 12px;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.rituals-layer .ritual-tile {
    pointer-events: auto;
}

.ritual-tile {
    width: 80px;
    height: 80px;
    perspective: 800px;
}

.ritual-tile-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.ritual-tile.upgraded .ritual-tile-inner {
    transform: rotateY(180deg);
}

.tile-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--slot-bg);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.tile-face.back {
    transform: rotateY(180deg);
    border-color: var(--gold);
    background: radial-gradient(circle at center, #2e2012 0%, #0f0a06 100%);
    box-shadow: inset 0 0 15px rgba(209, 176, 106, 0.3), 0 0 8px var(--gold-glow);
}

#s17 { left: 213px; top: 40px; }
#s18 { left: 95px;  top: 135px; }
#s19 { left: 331px; top: 135px; }
#s20 { left: 132px; top: 265px; }
#s21 { left: 294px; top: 265px; }

/* Cultists Performing slots */
.perform-dot {
    width: 34px;
    height: 34px;
    border-style: dotted;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
}
#s22 { left: 108px; top: 85px; }
#s23 { left: 163px; top: 42px; }
#s24 { left: 305px; top: 42px; }
#s25 { left: 360px; top: 85px; }
#s26 { left: 35px;  top: 205px; }
#s27 { left: 45px;  top: 265px; }
#s28 { left: 435px; top: 205px; }
#s29 { left: 425px; top: 265px; }

/* SVG Pentagram Overlay */
.pentagram-container-svg {
    position: absolute;
    left: 23px;
    top: 28px;
    width: 460px;
    height: 422px;
    z-index: 1;
    pointer-events: none;
}

.star-piece {
    fill: var(--piece-fill);
    stroke: var(--channel-glow);
    stroke-width: 5;
    stroke-linejoin: round;
    cursor: pointer;
    transition: fill 0.2s, stroke 0.2s;
    pointer-events: auto;
}

.star-piece:hover {
    fill: var(--piece-hover);
    stroke: #b33b3b;
}

.star-piece.upgraded {
    fill: rgba(209, 176, 106, 0.15);
    stroke: var(--gold);
    filter: drop-shadow(0 0 5px var(--gold-glow));
}

.icon-glyph {
    fill: var(--gold);
    font-size: 30px;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    opacity: 0.85;
}

.label-text {
    fill: #ffffff;
    font-size: 18px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    text-shadow: 1px 1px 2px #000;
}

/* Passive Seals */
.passive-seal-slot {
    width: 76px;
    height: 76px;
    top: 510px;
    perspective: 600px;
    border-radius: 50%;
}

.passive-seal-slot .node-tooltip {
    max-width: none;
    width: 456px;
    transform: none;
    font-size: 15px;
    padding: 6px 12px;
    box-sizing: border-box;
}

.passive-seal-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.passive-seal-slot.unlocked .passive-seal-inner {
    transform: rotateY(180deg);
}

.seal-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8), 0 4px 8px rgba(0,0,0,0.4);
}

.seal-face.front {
    border: 3px solid #735e52;
    background: radial-gradient(circle at center, #594539 0%, #291e17 100%);
    color: #d1b06a;
    font-family: 'Cinzel', serif;
    font-weight: bold;
}

.seal-face.front::after {
    content: ''; position: absolute; width: 85%; height: 85%;
    border: 1px dashed rgba(209,176,106,0.3); border-radius: 50%;
}

.seal-face.back {
    transform: rotateY(180deg);
    border: 3px solid #735e52;
    background: radial-gradient(circle at center, #594539 0%, #291e17 100%);
    color: #d1b06a;
    font-family: 'Cinzel', serif;
    font-weight: bold;
}

.seal-face.back::after {
    content: ''; position: absolute; width: 85%; height: 85%;
    border: 1px dashed rgba(209,176,106,0.3); border-radius: 50%;
}

#s36 { left: 25px; }
#s37 { left: 120px; }
#s38 { left: 215px; }
#s39 { left: 310px; }
#s40 { left: 405px; }

/* Monstrosity Miniature */
.monstrosity-miniature {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #ff6b6b 0%, #b91c1c 60%, #3f0000 100%);
    border: 3px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.8), 0 0 12px rgba(185, 28, 28, 0.4);
    animation: spawn-summon-mon 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 36px;
    position: absolute;
    z-index: 20;
    cursor: pointer;
}

@keyframes spawn-summon-mon {
    0% { transform: scale(0) rotate(-180deg); filter: brightness(3) blur(5px); }
    50% { transform: scale(1.2) rotate(10deg); filter: brightness(2); }
    100% { transform: scale(1) rotate(0); filter: brightness(1); }
}

/* Resource Storage Pile visual grids */
.resource-pile-grid {
    position: absolute;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 80px;
    height: 80px;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 5;
}

.coffin-overlay {
    position: absolute;
    left: 0; top: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #241915 0%, #0d0806 100%);
    clip-path: polygon(25% 0%, 75% 0%, 100% 20%, 85% 100%, 15% 100%, 0% 20%);
    border: 2px solid var(--border-color);
    z-index: 1;
}

/* Tooltip details overlay */
.node-tooltip {
    position: absolute;
    background: rgba(18, 12, 11, 0.99);
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 16.5px;
    color: #ebdcd5;
    box-shadow: 0 10px 20px rgba(0,0,0,0.9);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
    max-width: 180px;
    line-height: 1.4;
    transform: scale(1.39);
    transform-origin: top left;
}

.slot:hover .node-tooltip {
    opacity: 1;
}

.tooltip-title {
    font-family: 'Cinzel', serif;
    font-size: 16.5px;
    color: var(--gold);
    margin-bottom: 4px;
    font-weight: bold;
    border-bottom: 1px solid rgba(209, 176, 106, 0.25);
    padding-bottom: 2px;
    text-transform: uppercase;
}

.tokens-overlay-sub {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

/* Grimoire Tokens Style (Active/Inactive Cultists & Sigil Skulls) */
.token {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    z-index: 15;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    cursor: pointer;
    animation: spawn-token 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.token.active-cultist {
    background: radial-gradient(circle at 35% 35%, #ebdcb9 0%, #a88d55 70%, #5c4722 100%);
    border: 1.5px solid #fff;
    color: #3d2f1d;
}
.token.active-cultist::after {
    content: '👤';
    font-size: 15px;
}

.token.inactive-cultist {
    background: radial-gradient(circle at 35% 35%, #948a73 0%, #5e513a 70%, #2b2315 100%);
    border: 1.5px solid #b0a794;
    opacity: 0.65;
}
.token.inactive-cultist::after {
    content: '💤';
    font-size: 12px;
}

.token.sigil-skull {
    background: radial-gradient(circle at 45% 45%, #ffffff 0%, #cbc2b5 60%, #7d7366 100%);
    border: 1.5px solid #fff;
    width: 24px;
    height: 24px;
    border-radius: 4px;
}
.token.sigil-skull::after {
    content: '💀';
    font-size: 15px;
}

/* Interactive and glowing location cards */
.location-card-container.interactive-card {
    cursor: pointer !important;
}

.location-card-container.interactive-card .physical-card {
    cursor: pointer !important;
}

.location-card-container.interactive-card .card-inner {
    border-color: var(--cult-glow-color, var(--gold)) !important;
    box-shadow: 0 0 10px var(--cult-glow-color, rgba(197, 160, 89, 0.4)), inset 0 0 10px rgba(0, 0, 0, 0.5) !important;
    animation: card-glow-pulse 1.8s infinite alternate ease-in-out;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.location-card-container.interactive-card:hover .card-inner {
    transform: scale(1.04);
    box-shadow: 0 0 20px var(--cult-glow-color, rgba(197, 160, 89, 0.8)), inset 0 0 10px rgba(0, 0, 0, 0.5) !important;
}

@keyframes card-glow-pulse {
    0% {
        box-shadow: 0 0 6px var(--cult-glow-color-dim, rgba(197, 160, 89, 0.3)), inset 0 0 10px rgba(0, 0, 0, 0.5) !important;
    }
    100% {
        box-shadow: 0 0 16px var(--cult-glow-color, rgba(197, 160, 89, 0.7)), inset 0 0 10px rgba(0, 0, 0, 0.5) !important;
    }
}

/* Dynamic Cult Interactable Glows */
.interactable-glow {
    cursor: pointer !important;
    border-color: var(--player-cult-border, var(--primary-red)) !important;
    box-shadow: 0 0 8px var(--player-cult-border, rgba(153, 0, 0, 0.6)), inset 0 0 6px rgba(0, 0, 0, 0.4) !important;
    animation: interactable-glow-pulse 1.6s infinite alternate ease-in-out !important;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease !important;
}

.interactable-glow:hover {
    transform: scale(1.03);
    box-shadow: 0 0 16px var(--player-cult-border, rgba(153, 0, 0, 0.9)), inset 0 0 6px rgba(0, 0, 0, 0.4) !important;
}

/* For SVG polygons (like Pentagram upgrade star slots) */
polygon.interactable-glow {
    cursor: pointer !important;
    stroke: var(--player-cult-border, var(--primary-red)) !important;
    stroke-width: 2.5px !important;
    filter: drop-shadow(0 0 5px var(--player-cult-border, var(--primary-red))) !important;
    animation: interactable-svg-glow-pulse 1.6s infinite alternate ease-in-out !important;
    transition: filter 0.25s ease, stroke 0.25s ease !important;
}

polygon.interactable-glow:hover {
    transform: none !important;
    filter: drop-shadow(0 0 10px var(--player-cult-border, var(--primary-red))) !important;
}

polygon.cancel-active {
    fill: rgba(153, 0, 0, 0.4) !important;
    stroke: var(--primary-red) !important;
    animation: interactable-svg-glow-pulse 1.6s infinite alternate ease-in-out !important;
}

polygon.cancel-active:hover {
    fill: rgba(185, 28, 28, 0.6) !important;
    filter: drop-shadow(0 0 10px var(--primary-red)) !important;
}

@keyframes interactable-glow-pulse {
    0% {
        box-shadow: 0 0 4px var(--player-cult-border, rgba(153, 0, 0, 0.4)), inset 0 0 6px rgba(0, 0, 0, 0.4) !important;
    }
    100% {
        box-shadow: 0 0 12px var(--player-cult-border, rgba(153, 0, 0, 0.8)), inset 0 0 6px rgba(0, 0, 0, 0.4) !important;
    }
}

@keyframes interactable-svg-glow-pulse {
    0% {
        filter: drop-shadow(0 0 3px var(--player-cult-border, rgba(153, 0, 0, 0.4))) !important;
    }
    100% {
        filter: drop-shadow(0 0 8px var(--player-cult-border, rgba(153, 0, 0, 0.8))) !important;
    }
}

.gallows-rope:hover {
    opacity: 0.75 !important;
    background: var(--player-cult-border, var(--primary-red)) !important;
    box-shadow: 0 0 6px var(--player-cult-border, var(--primary-red)) !important;
}

#blazor-error-ui {
    color-scheme: dark only;
    background: #2a0000;
    color: #ffcccc;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem calc(0.75rem + env(safe-area-inset-bottom)) 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
    border-top: 2px solid #ff4444;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.9rem;
}

#blazor-error-ui a.reload {
    color: #ff8888;
    text-decoration: underline;
    margin-left: 0.5rem;
    font-weight: bold;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1.25rem;
    top: 0.75rem;
    color: #ffaaaa;
    font-size: 1.1rem;
}





