/* Theme Variables & Font Declarations */
:root {
    --bg-dark: #0f0913;
    --bg-panel: rgba(22, 13, 31, 0.7);
    --bg-glass: rgba(30, 20, 42, 0.4);
    --border-color: rgba(147, 51, 234, 0.3);
    --border-hover: rgba(147, 51, 234, 0.7);

    --color-text: #e2e8f0;
    --color-muted: #94a3b8;

    --color-primary: #a855f7;
    --color-primary-glow: rgba(168, 85, 247, 0.4);
    --color-accent: #f43f5e;
    /* Neon Crimson */
    --color-energy: #d946ef;
    /* Purple-magenta */
    --color-health: #10b981;
    /* Emerald Green */
    --color-block: #06b6d4;
    /* Cyan */
    --color-gold: #f59e0b;
    /* Gold */
    --color-upgrade: #14b8a6;
    /* Teal */

    --shadow-glow: 0 0 15px var(--color-primary-glow);
    --shadow-neon-red: 0 0 15px rgba(244, 63, 94, 0.4);
    --shadow-neon-cyan: 0 0 15px rgba(6, 182, 212, 0.4);
    --shadow-gold: 0 0 15px rgba(245, 158, 11, 0.4);

    --font-sans: 'Outfit', sans-serif;
    --font-serif: 'Cinzel', serif;

    --card-width: 155px;
    --card-height: 230px;
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-drag: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--color-text);
    font-family: var(--font-sans);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Background Atmosphere */
.bg-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, #2e1065 0%, #09050d 100%);
    z-index: -2;
    pointer-events: none;
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.15;
    background-image: radial-gradient(circle, #a855f7 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Main Container: Maintains 16:9 ratio and scales */
#game-container {
    width: 1280px;
    height: 800px;
    background: rgba(10, 5, 15, 0.85);
    border: 1px solid var(--border-color);
    border-top: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Game Screens */
.game-screen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    flex-direction: column;
    z-index: 1;
}

.game-screen.active {
    display: flex;
}

/* Headers */
.screen-header {
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 7, 23, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 10;
}

.player-summary {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 600;
}

.hp-stat {
    color: var(--color-health);
}

.gold-stat {
    color: var(--color-gold);
}

.header-title {
    font-family: var(--font-serif);
    letter-spacing: 2px;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #f3e8ff 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.relics-list {
    display: flex;
    gap: 10px;
    flex-grow: 1;
    margin-left: 30px;
}

.relic-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    transition: all 0.2s ease;
}

.relic-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
    transform: scale(1.1);
}

/* Buttons */
.game-btn,
.menu-btn,
.deck-btn {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    outline: none;
    letter-spacing: 0.5px;
}

.game-btn:hover:not(:disabled),
.deck-btn:hover,
.menu-btn:hover:not(:disabled) {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.game-btn:active:not(:disabled) {
    transform: translateY(0);
}

.game-btn:disabled,
.menu-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.game-btn.primary {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    border-color: #c084fc;
}

.game-btn.primary:hover {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.6);
}

.game-btn.danger-btn {
    border-color: rgba(244, 63, 94, 0.5);
    background: rgba(244, 63, 94, 0.1);
}

.game-btn.danger-btn:hover {
    background: rgba(244, 63, 94, 0.3);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-neon-red);
}

/* --- SCREEN: START MENU --- */
#screen-menu {
    justify-content: center;
    align-items: center;
    background: linear-gradient(to top, rgba(15, 7, 23, 0.95), rgba(15, 7, 23, 0.8)),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" stroke="%239333ea" stroke-width="0.5" fill="none" opacity="0.1"/></svg>');
    background-size: cover;
}

.menu-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-title {
    font-family: var(--font-serif);
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: 8px;
    background: linear-gradient(to bottom, #ffffff 30%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.5));
    margin-bottom: 5px;
    animation: titleGlow 4s ease-in-out infinite alternate;
}

.subtitle {
    font-size: 1.25rem;
    letter-spacing: 4px;
    color: var(--color-muted);
    margin-bottom: 50px;
    text-transform: uppercase;
}

.menu-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 250px;
}

.menu-btn {
    padding: 12px 24px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-footer {
    position: absolute;
    bottom: 20px;
    font-size: 0.85rem;
    color: var(--color-muted);
    letter-spacing: 1px;
}

/* --- SCREEN: MAP --- */
.map-scroll-container {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 40px 0;
    display: flex;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at center, #1b0e27 0%, #0d0614 100%);
}

.map-viewport {
    width: 600px;
    position: relative;
    min-height: 1000px;
    /* Expands with node counts */
}

.map-connections-svg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#map-connections-svg {
    width: 100%;
    height: 100%;
}

.map-nodes-grid {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column-reverse;
    /* Generates boss at the top, start at the bottom */
    justify-content: space-between;
    padding: 50px 0;
    z-index: 2;
}

.map-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 70px;
}

.map-node {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #12071d;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: not-allowed;
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.map-node.playable {
    cursor: pointer;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

.map-node.playable:hover {
    transform: scale(1.25);
    background: var(--color-primary);
    border-color: #d8b4fe;
}

.map-node.active {
    border-color: var(--color-health);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    background: #064e3b;
}

.map-node.visited {
    border-color: var(--color-muted);
    opacity: 0.6;
}

.map-node svg {
    width: 22px;
    height: 22px;
    fill: var(--color-text);
}

.map-node.visited svg {
    fill: var(--color-muted);
}

/* Node tooltips */
.map-node::after {
    content: attr(data-type-label);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: var(--bg-dark);
    color: var(--color-text);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 10;
}

.map-node:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- CARDS DESIGN --- */
.card-wrapper {
    width: var(--card-width);
    height: var(--card-height);
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 8px;
    cursor: grab;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.card-wrapper:hover {
    transform: translateY(-15px) scale(1.08);
    border-color: var(--color-primary);
    box-shadow: 0 10px 20px rgba(168, 85, 247, 0.4), var(--shadow-glow);
    z-index: 20;
}

.card-wrapper.upgraded {
    border-color: var(--color-upgrade);
}

.card-wrapper.upgraded:hover {
    box-shadow: 0 10px 20px rgba(20, 184, 166, 0.4), 0 0 15px rgba(20, 184, 166, 0.4);
}

.card-rarity-common {
    border-color: rgba(148, 163, 184, 0.4);
}

.card-rarity-uncommon {
    border-color: rgba(59, 130, 246, 0.5);
}

.card-rarity-rare {
    border-color: rgba(245, 158, 11, 0.6);
}

.card-cost {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-energy);
    border: 1px solid #ff77ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
    color: white;
    z-index: 2;
    text-shadow: 0 1px 2px black;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.card-name {
    text-align: center;
    font-size: 0.7rem;
    margin-bottom: 6px;
    /* Avoid overlapping cost circle */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: #9f00ff85;
}

.card-wrapper.upgraded .card-name {
    color: var(--color-upgrade);
}

.card-art-frame {
    height: 80px;
    border: 1px solid rgba(147, 51, 234, 0.2);
    border-radius: 6px;
    background: rgba(10, 5, 15, 0.6);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    position: relative;
}

.card-art-svg {
    width: 100%;
    height: 100%;
    padding: 8px;
}

.card-type-badge {
    position: absolute;
    top: 65px;
    right: 5px;
    font-size: 0.6rem;
    text-transform: uppercase;
    background: rgba(15, 7, 23, 0.9);
    padding: 2px 5px;
    border-radius: 3px;
    border: 0.5px solid var(--border-color);
}

.card-desc {
    font-size: 0.65rem;
    color: var(--color-muted);
    text-align: center;
    line-height: 1.2;
    flex-grow: 1;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    word-break: break-word;
}

.card-desc strong {
    color: var(--color-text);
}

.card-wrapper.selected {
    border-color: var(--color-health);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.7);
}

/* Dragging visual */
.card-wrapper.dragging {
    opacity: 0.5;
    transform: scale(0.9);
    cursor: grabbing;
}

/* --- SCREEN: COMBAT --- */
#screen-combat {
    background: linear-gradient(to top, rgba(16, 8, 26, 0.98), rgba(8, 4, 13, 0.92)),
        radial-gradient(ellipse at bottom, rgba(76, 29, 149, 0.2) 0%, transparent 70%);
}

.combat-main-layout {
    flex-grow: 1;
    display: flex;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
}

.combat-grid-container {
    width: 75%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 5px 15px;
    padding: 15px 30px;
    align-items: center;
    justify-items: center;
    box-sizing: border-box;
}

.grid-cell {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.combat-log-panel {
    width: 25%;
    height: 100%;
    background: rgba(10, 5, 20, 0.85);
    border-left: 2px solid rgba(168, 85, 247, 0.25);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 15px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
}

.log-header {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-upgrade);
    border-bottom: 1.5px solid rgba(168, 85, 247, 0.4);
    padding-bottom: 8px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(168, 85, 247, 0.5);
}

.log-entries {
    flex-grow: 1;
    overflow-y: auto;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: var(--color-muted);
}

.log-entry {
    margin-bottom: 2px;
    line-height: 1.4;
    border-bottom: 1px dashed rgba(168, 85, 247, 0.1);
    padding-bottom: 2px;
    animation: fadeIn 0.2s ease-out;
}

.log-entry:last-child {
    border-bottom: none;
    color: var(--color-text);
    font-weight: 600;
}

/* Actors */
.combat-actor {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 135px;
    position: relative;
}

.actor-visual {
    height: 95px;
    width: 95px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 6px;
}

.player-sprite-container {
    width: 100%;
    height: 100%;
}

.player-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid #7c3aed;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}

.enemy-sprite-container {
    width: 100%;
    height: 100%;
}

.actor-info {
    width: 100%;
    text-align: center;
}

.actor-name {
    font-family: var(--font-serif);
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 1px;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.hp-bar-container {
    width: 100%;
    height: 1.2em;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    position: relative;
    overflow: visible;
}

.hp-bar {
    height: 100%;
    background: var(--color-health);
    width: 100%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.hp-text {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px black;
}

.block-badge {
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 30px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2306b6d4' stroke='%23e0f2fe' stroke-width='2'><path d='M12 2L20 5v7c0 5.5-3.5 10-8 10s-8-4.5-8-10V5l8-3z'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 2px;
    font-size: 0.75rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 1px 2px black;
    filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.6));
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.block-badge.has-block {
    opacity: 1;
}

/* Enemy Intent indicators */
.enemy-intent-bubble {
    position: absolute;
    top: -15px;
    background: rgba(15, 7, 23, 0.9);
    border: 1.5px solid var(--color-primary);
    border-radius: 6px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    align-self: start;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: var(--shadow-glow);
    z-index: 5;
    animation: bounceBubble 2s infinite alternate;
}

.intent-icon,
.enemy-intent-bubble .icon-svg,
.enemy-intent-bubble svg {
    width: 18px;
    height: 18px;
    fill: var(--color-text);
}

.intent-value {
    color: var(--color-accent);
}

/* Status Effects List */
.status-effects {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 10px;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    max-width: 130px;
    flex-wrap: wrap;
    justify-content: center;
}

.status-badge {
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-badge svg {
    width: 14px;
    height: 14px;
}

.status-value {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: black;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0 3px;
    border-radius: 4px;
    border: 0.5px solid var(--border-color);
}

/* Enemies panel */
.enemies-container {
    display: flex;
    gap: 40px;
    justify-content: center;
    /* Centered in the empty arena */
    flex-grow: 1;
}

/* Combat Controls */
.combat-controls {
    height: 200px;
    border-top: 1px solid var(--border-color);
    background: rgba(10, 5, 15, 0.95);
    display: grid;
    grid-template-columns: 200px 1fr 180px;
    align-items: center;
    padding: 0 30px;
    position: relative;
}

.combat-info-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    grid-column: 1 / 4;
    position: absolute;
    width: calc(100% - 60px);
    top: -30px;
    left: 30px;
    pointer-events: none;
    z-index: 10;
}

.pile-container {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    transition: all 0.2s ease;
}

.pile-container:hover {
    border-color: var(--color-primary);
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.pile-icon {
    width: 18px;
    height: 18px;
}

.pile-count {
    font-size: 0.8rem;
    font-weight: 800;
}

.energy-orb-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.energy-orb {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: radial-gradient(circle, #e879f9 0%, #a21caf 100%);
    border: 3px solid #ffbafb;
    box-shadow: 0 0 20px rgba(217, 70, 239, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    animation: orbPulse 2s infinite alternate;
}

/* Hand of cards */
.hand-container {
    grid-column: 2;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    height: 100%;
    padding-bottom: 10px;
    gap: -15px;
    /* Cards overlap slightly */
}

/* Make cards fan out or scale properly in hand */
.hand-container .card-wrapper {
    margin: 0 -12px;
    transform-origin: bottom center;
    transform: scale(0.85);
    /* Slightly scaled down to fit 200px footer */
}

.hand-container .card-wrapper:hover {
    margin: 0 5px;
    /* Translate upward to overlap battlefield and scale back to prominent size */
    transform: translateY(-65px) scale(1.2) rotate(0deg) !important;
}

.combat-actions {
    grid-column: 3;
    display: flex;
    justify-content: flex-end;
}

.end-turn-btn {
    padding: 12px 24px;
    font-size: 1rem;
    text-transform: uppercase;
    border-color: var(--color-accent);
    background: rgba(244, 63, 94, 0.1);
}

.end-turn-btn:hover {
    background: rgba(244, 63, 94, 0.3) !important;
    border-color: var(--color-accent) !important;
    box-shadow: var(--shadow-neon-red) !important;
}

/* --- SCREEN: SHOP --- */
#screen-shop {
    background: linear-gradient(to top, rgba(12, 6, 17, 0.98), rgba(24, 12, 33, 0.95));
}

.shop-content {
    flex-grow: 1;
    display: flex;
    padding: 20px 40px;
    gap: 40px;
}

.merchant-area {
    width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(147, 51, 234, 0.15);
    padding-right: 30px;
}

.merchant-visual {
    width: 140px;
    height: 140px;
    margin-bottom: 20px;
}

.merchant-bubble {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: center;
    position: relative;
}

.merchant-bubble::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: var(--border-color);
}

.shop-shelves {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.shelf-row h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--color-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 5px;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.shelf-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.shop-item-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.shop-price-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    color: var(--color-gold);
    font-size: 0.95rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 8px;
    border-radius: 12px;
    border: 0.5px solid rgba(245, 158, 11, 0.3);
}

.shop-price-tag svg {
    width: 14px;
    height: 14px;
    fill: var(--color-gold);
}

.shop-item-container.bought {
    opacity: 0.3;
    pointer-events: none;
}

.shop-relic-item {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-relic-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.shop-service-item {
    width: var(--card-width);
    height: 110px;
    border-radius: 10px;
    border: 1px dashed var(--color-accent);
    background: rgba(244, 63, 94, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-service-item:hover {
    background: rgba(244, 63, 94, 0.15);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-neon-red);
    transform: translateY(-3px);
}

.shop-service-item h4 {
    font-family: var(--font-serif);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.shop-service-item p {
    font-size: 0.65rem;
    color: var(--color-muted);
}

.screen-footer-actions {
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 7, 23, 0.8);
}

/* --- SCREEN: EVENT --- */
#screen-event {
    background: linear-gradient(to top, rgba(12, 6, 17, 0.98), rgba(20, 10, 28, 0.95));
}

.event-container {
    flex-grow: 1;
    display: flex;
    padding: 40px;
    gap: 40px;
    align-items: center;
}

.event-image-container {
    width: 380px;
    height: 380px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: rgba(10, 5, 15, 0.6);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.event-image-container svg {
    width: 100%;
    height: 100%;
    padding: 40px;
}

.event-dialogue-panel {
    flex-grow: 1;
    height: 380px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    padding: 30px;
}

.event-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--color-primary);
    letter-spacing: 1px;
}

.event-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 25px;
}

.event-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.choice-btn {
    text-align: left;
    width: 100%;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-sans);
    color: var(--color-text);
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.choice-btn:hover:not(:disabled) {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--color-primary);
    padding-left: 25px;
}

.choice-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.choice-effect {
    color: var(--color-muted);
    font-size: 0.8rem;
    margin-left: 10px;
}

/* --- SCREEN: CAMPFIRE / REST --- */
#screen-rest {
    background: linear-gradient(to top, rgba(12, 6, 17, 0.98), rgba(26, 10, 10, 0.95));
    /* subtle reddish background */
    align-items: center;
    justify-content: center;
}

.rest-choices {
    display: flex;
    gap: 40px;
    margin-top: 50px;
}

.rest-option-btn {
    width: 200px;
    height: 250px;
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rest-option-btn:hover:not(:disabled) {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-10px);
}

.rest-option-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.option-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.option-details {
    text-align: center;
}

.option-details h4 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.option-details p {
    font-size: 0.8rem;
    color: var(--color-muted);
    line-height: 1.4;
}

/* --- SCREEN: MODS --- */
#screen-mods {
    background: linear-gradient(to top, rgba(12, 6, 17, 0.98), rgba(20, 10, 35, 0.95));
}

.mods-container {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 30px;
    gap: 30px;
    overflow: hidden;
}

.mods-actions-panel,
.mods-list-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mods-container h3 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
    margin-bottom: 20px;
    color: var(--color-primary);
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-grow: 1;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--color-primary);
    background: rgba(168, 85, 247, 0.05);
}

.upload-zone p {
    font-size: 0.9rem;
    color: var(--color-muted);
    line-height: 1.5;
}

.mod-creator-link {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.link-btn {
    text-decoration: underline;
    background: transparent;
    border: none;
    color: var(--color-muted);
    font-size: 0.85rem;
    padding: 5px 0;
    text-align: left;
    cursor: pointer;
}

.link-btn:hover {
    color: var(--color-primary);
    background: transparent;
    box-shadow: none;
    transform: none;
}

.mods-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.no-mods-msg {
    font-size: 0.85rem;
    color: var(--color-muted);
    line-height: 1.6;
    text-align: center;
    margin-top: 40px;
}

.mod-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mod-info h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.mod-info p {
    font-size: 0.75rem;
    color: var(--color-muted);
}

.mod-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--color-primary);
}

input:checked+.slider:before {
    transform: translateX(18px);
}

.mod-item-delete-btn {
    background: transparent;
    border: none;
    color: var(--color-accent);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
}

/* --- OVERLAYS --- */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 5, 15, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
}

.game-overlay.active {
    display: flex;
}

.overlay-box {
    width: 900px;
    max-height: 580px;
    background: rgba(20, 10, 30, 0.95);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.overlay-box.narrow {
    width: 450px;
}

.overlay-box.centered-box {
    width: 500px;
    align-items: center;
    text-align: center;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.overlay-header h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--color-primary);
    letter-spacing: 1px;
}

.close-overlay-btn {
    background: transparent;
    border: none;
    color: var(--color-muted);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-overlay-btn:hover {
    color: var(--color-accent);
}

.overlay-instruction {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 20px;
}

.cards-grid {
    flex-grow: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding: 10px;
}

/* Options body */
.options-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.option-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-row label {
    font-size: 0.9rem;
    color: var(--color-muted);
}

.option-row input[type="range"] {
    accent-color: var(--color-primary);
    cursor: pointer;
}

.option-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary);
    cursor: pointer;
    align-self: flex-start;
}

.danger-row {
    border-top: 1px solid rgba(244, 63, 94, 0.15);
    padding-top: 20px;
    margin-top: 10px;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
}

.danger-row span {
    font-size: 0.85rem;
    color: var(--color-muted);
}

/* Game over styles */
.cinzel-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.gameover-banner {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-accent);
    letter-spacing: 2px;
    margin-bottom: 30px;
    text-shadow: var(--shadow-neon-red);
}

.gameover-stats {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px 40px;
    margin-bottom: 30px;
    text-align: left;
    width: 100%;
}

.gameover-stats p {
    font-size: 1rem;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
}

.gameover-stats span {
    font-weight: 700;
    color: var(--color-primary);
}

/* --- VIDEO EFFECT OVERLAY --- */
.video-overlay {
    background: rgba(0, 0, 0, 0.95);
    z-index: 200;
}

.video-wrapper {
    position: relative;
    width: 800px;
    height: 450px;
    background: black;
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.5);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skip-video-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
    color: var(--color-muted);
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.skip-video-btn:hover {
    color: white;
    border-color: var(--color-primary);
    background: rgba(168, 85, 247, 0.2);
}

#video-media-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#video-media-container video,
#video-media-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* --- FLOATING NUMBERS --- */
#combat-floating-numbers-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 150;
}

.floating-number {
    position: absolute;
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 900;
    text-shadow: 0 2px 4px black, 0 0 10px rgba(0, 0, 0, 0.8);
    animation: floatUpAndFade 1.2s cubic-bezier(0.25, 1, 0.50, 1) forwards;
}

.floating-number.dmg {
    color: var(--color-accent);
}

.floating-number.block {
    color: var(--color-block);
}

.floating-number.heal {
    color: var(--color-health);
}

.floating-number.status {
    color: var(--color-primary);
    font-size: 1.2rem;
}

/* Screen Shakes & Sprite Animations */
.actor-visual.hit {
    animation: shakeSprite 0.4s ease-in-out;
}

.actor-visual.heal-anim {
    animation: glowHeal 0.6s ease-in-out;
}

.actor-visual.attack-anim {
    animation: lungeAttack 0.4s ease-in-out;
}

/* Keyframes */
@keyframes titleGlow {
    from {
        filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.3));
    }

    to {
        filter: drop-shadow(0 0 25px rgba(168, 85, 247, 0.7));
    }
}

@keyframes floatUpAndFade {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.6);
    }

    20% {
        opacity: 1;
        transform: translateY(-10px) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translateY(-80px) scale(0.9);
    }
}

@keyframes bounceBubble {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-5px);
    }
}

@keyframes orbPulse {
    from {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(217, 70, 239, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.5);
    }

    to {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(217, 70, 239, 0.9), inset 0 0 15px rgba(255, 255, 255, 0.7);
    }
}

@keyframes shakeSprite {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-10px);
    }

    40%,
    80% {
        transform: translateX(10px);
    }
}

@keyframes glowHeal {

    0%,
    100% {
        filter: drop-shadow(0 0 0 transparent);
    }

    50% {
        filter: drop-shadow(0 0 20px var(--color-health));
    }
}

@keyframes lungeAttack {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(40px);
    }
}

.enemy-actor .actor-visual.attack-anim {
    animation: lungeAttackEnemy 0.4s ease-in-out;
}

@keyframes lungeAttackEnemy {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(-40px);
    }
}

/* Restructured Combat layout styles */
.combat-header-layout {
    height: 115px !important;
    padding: 10px 30px !important;
}

.player-combat-stats {
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
}

.combat-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.stamina-stat {
    color: var(--color-gold);
}

.header-center-area {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
    margin-left: 20px;
    justify-content: center;
}

.clothes-slots-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.relics-list-row {
    display: none !important;
    /* Hides relics row as requested */
}

.clothing-slot {
    position: relative;
    width: 66px;
    height: 66px;
    border: 1px dashed var(--border-color);
    background: rgba(0, 0, 0, 0.55);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: help;
    transition: all 0.2s ease;
    box-sizing: border-box;
    overflow: hidden;
}

.clothing-slot:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary-glow);
}

.clothing-slot.filled {
    border-style: solid;
    border-color: var(--color-upgrade);
}

.clothing-slot.secondary-filled {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.15);
    opacity: 0.7;
}

.slot-icon {
    font-size: 1.6rem;
    margin-bottom: 10px;
    opacity: 0.6;
    pointer-events: none;
}

.slot-label {
    font-size: 0.55rem;
    color: var(--color-muted);
    text-transform: uppercase;
    text-align: center;
    pointer-events: none;
    line-height: 1;
}

.slot-label-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 5, 20, 0.85);
    color: var(--color-text);
    font-size: 0.62rem;
    padding: 3px 1px;
    text-align: center;
    line-height: 1.1;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.slot-label-overlay.removed-label {
    background: rgba(244, 63, 94, 0.85);
    color: white;
    text-transform: uppercase;
    font-size: 0.58rem;
    border-top: none;
}

.slot-label-overlay.empty-label {
    background: rgba(10, 5, 20, 0.4);
    color: var(--color-muted);
    font-size: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.clothing-slot.removed {
    opacity: 0.55;
    filter: grayscale(80%);
    border-color: var(--color-accent);
}

.clothing-durability-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    z-index: 10;
}

/* Footer layout updates */
.combat-controls {
    display: grid !important;
    grid-template-columns: 200px 1fr 140px !important;
    height: 230px;
    padding: 0 10px !important;
    gap: 10px;
}

.special-cards-container {
    grid-column: 1;
    display: flex;
    flex-wrap: wrap !important;
    gap: 12px 4px !important;
    justify-content: center !important;
    align-content: center !important;
    align-items: center !important;
    height: 100% !important;
    padding: 10px 0 !important;
    box-sizing: border-box !important;
}

.special-cards-container .card-wrapper {
    width: 58px !important;
    height: 76px !important;
    border-radius: 4px !important;
    padding: 2px !important;
    cursor: pointer;
}

.special-cards-container .card-wrapper:hover {
    transform: translateY(-40px) scale(2.0) !important;
    z-index: 50 !important;
    box-shadow: 0 0 15px var(--color-primary-glow) !important;
}

.special-cards-container .card-wrapper .card-cost {
    display: none !important;
}

.special-cards-container .card-wrapper .card-name {
    font-size: 0.52rem !important;
    margin-bottom: 2px !important;
    padding-left: 0 !important;
    text-align: center !important;
    line-height: 1 !important;
    height: 12px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.special-cards-container .card-wrapper .card-art-frame {
    height: 56px !important;
    margin-bottom: 0 !important;
    border: none !important;
    background: transparent !important;
}

.special-cards-container .card-wrapper .card-art-frame svg {
    padding: 2px !important;
}

.special-cards-container .card-wrapper .card-desc {
    display: none !important;
}

.special-cards-container .card-wrapper .card-type-badge {
    display: none !important;
}

.combat-right-panel {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    justify-content: center;
    height: 100%;
}

.piles-row {
    display: flex;
    gap: 15px;
}

.combat-right-panel .energy-orb-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.combat-right-panel .energy-orb {
    width: 56px !important;
    height: 56px !important;
    font-size: 1.1rem !important;
}

.combat-right-panel .end-turn-btn {
    padding: 8px 10px !important;
    font-size: 0.8rem !important;
    width: 100%;
}

/* Enemy Stamina bars and image sprite support */
.stamina-bar-container {
    width: 100%;
    height: 1.2rem;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}

.stamina-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.stamina-blocked {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    background: repeating-linear-gradient(45deg,
            #4b5563,
            #4b5563 4px,
            #1f2937 4px,
            #1f2937 8px);
    opacity: 0.85;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.stamina-text {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px black;
    z-index: 3;
}

.enemy-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.enemy-attachments {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 6px;
}

.attachment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6rem;
    padding: 1px 4px;
    background: rgba(147, 51, 234, 0.8);
    border: 1.5px solid #d8b4fe;
    border-radius: 3px;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 0 1px 1px black;
    box-shadow: 0 0 5px rgba(168, 85, 247, 0.5);
    pointer-events: none;
}

.attachment-img {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
    border: 0.5px solid rgba(255, 255, 255, 0.4);
}

/* Card deactivated/attached style in special-cards-container */
.special-cards-container .card-wrapper.deactivated {
    opacity: 0.35 !important;
    filter: grayscale(80%) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

.special-cards-container .card-wrapper.deactivated * {
    pointer-events: none !important;
}

/* Detachable attachment badges */
.attachment-badge.can-detach {
    cursor: pointer !important;
    background: rgba(244, 63, 94, 0.25) !important;
    border: 1px solid var(--color-accent) !important;
    transition: all 0.2s ease !important;
    pointer-events: auto !important;
}

.attachment-badge.can-detach:hover {
    background: var(--color-accent) !important;
    color: white !important;
    box-shadow: var(--shadow-neon-red) !important;
    transform: scale(1.05) !important;
}

.attachment-badge .detach-btn {
    font-weight: bold;
    color: #ffd1d7;
    margin-left: 2px;
}

/* Stamina floating numbers styling */
.floating-number.stamina-dmg {
    color: var(--color-energy) !important;
    text-shadow: 0 2px 4px black, 0 0 10px rgba(217, 70, 239, 0.8) !important;
}

.floating-number.stamina-heal {
    color: #f472b6 !important;
    text-shadow: 0 2px 4px black, 0 0 10px rgba(244, 114, 182, 0.8) !important;
}

/* Micro-special-card styling adjustments */
.special-cards-container .card-wrapper .card-cost,
.special-cards-container .card-wrapper .card-type-badge,
.special-cards-container .card-wrapper .card-desc {
    display: none !important;
}

.special-cards-container .card-wrapper .card-name {
    font-size: 0.52rem !important;
    padding-left: 0 !important;
    margin-bottom: 2px !important;
    text-align: center !important;
    line-height: 1 !important;
    height: 12px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.special-cards-container .card-wrapper .card-art-frame {
    height: 56px !important;
    margin-bottom: 0 !important;
    border: none !important;
    background: transparent !important;
}

.special-cards-container .card-wrapper .card-art-frame svg {
    padding: 2px !important;
}

/* Permanent statuses container */
.permanent-statuses {
    display: inline-flex;
    gap: 6px;
    margin-left: 10px;
    vertical-align: middle;
}

/* Premium permanent status badge styling */
.permanent-status-badge {
    background: linear-gradient(135deg, #581c87 0%, #3b0764 100%);
    border: 1px solid #c084fc;
    color: #f3e8ff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 0 6px rgba(192, 132, 252, 0.4);
    letter-spacing: 0.05em;
    display: inline-block;
    line-height: 1.2;
}

.permanent-status-badge.org-badge {
    background: linear-gradient(135deg, #9d174d 0%, #4c0519 100%);
    border-color: #f472b6;
    color: #fce7f3;
    box-shadow: 0 0 8px rgba(244, 114, 182, 0.5);
}

/* Combat Left Panel & Player Profile Panel */
.combat-left-panel {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    justify-content: center !important;
    align-items: stretch;
    height: 100%;
    padding: 0 !important;
    box-sizing: border-box;
}

.player-profile-panel {
    display: flex;
    gap: 12px;
    background: rgba(15, 7, 25, 0.75);
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    height: 105px;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    position: relative;
}

/* Connect hit, heal, attack animations to the player profile box */
#combat-player-profile.hit {
    animation: shakeSprite 0.4s ease-in-out;
}

#combat-player-profile.heal-anim {
    animation: glowHeal 0.6s ease-in-out;
}

#combat-player-profile.attack-anim {
    animation: lungeAttack 0.4s ease-in-out;
}

.player-portrait-container {
    width: 68px;
    height: 68px;
    border-radius: 6px;
    border: 2px solid #7c3aed;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.6);
    overflow: visible !important;
    flex-shrink: 0;
    background: #000;
    transition: transform 0.2s ease;
    position: relative;
}

.player-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.player-profile-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    min-width: 0;
}

.player-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-muted);
    width: 48px;
    flex-shrink: 0;
    text-align: left;
    letter-spacing: 0.5px;
}

.player-profile-stats .hp-bar-container,
.player-profile-stats .stamina-bar-container {
    flex-grow: 1;
    height: 14px;
    margin-top: 0;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.player-profile-stats .hp-text,
.player-profile-stats .stamina-text {
    font-size: 0.65rem;
    font-weight: 700;
    text-shadow: 0 1px 2px black;
    z-index: 3;
}

.player-status-row {
    display: flex;
    align-items: center;
    min-height: 18px;
}

.player-status-row .status-effects {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 0;
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
}

.player-status-row .status-badge {
    width: 18px;
    height: 18px;
    padding: 1px;
}

.player-status-row .status-value {
    font-size: 0.55rem;
    bottom: -3px;
    right: -3px;
}

.player-org-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.orgasm-label {
    color: var(--color-muted);
    font-weight: 600;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.orgasm-value {
    color: #f472b6;
    font-weight: bold;
    font-size: 0.8rem;
    text-shadow: 0 0 5px rgba(244, 114, 182, 0.5);
}

/* Premium Player Profile styling when placed in the combat header */
.combat-header-layout .player-profile-panel {
    display: flex !important;
    gap: 8px !important;
    background: rgba(15, 7, 25, 0.75) !important;
    border: 1.5px solid rgba(168, 85, 247, 0.35) !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
    height: 95px !important;
    width: 275px !important;
    align-items: center !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-sizing: border-box !important;
    position: relative !important;
}

.combat-header-layout .player-portrait-container {
    width: 80px !important;
    height: 80px !important;
    border-width: 1.5px !important;
    border-radius: 6px !important;
    overflow: visible !important;
}

.combat-header-layout .player-portrait-container .player-portrait {
    border-radius: 4px !important;
}

.combat-header-layout .player-portrait-container .block-badge {
    position: absolute !important;
    bottom: -6px !important;
    right: -6px !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: 28px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
    z-index: 10 !important;
}

.combat-header-layout .player-profile-stats {
    gap: 2px !important;
    min-width: 0 !important;
    flex-grow: 1;
}

.combat-header-layout .player-stat-row {
    flex-direction: row !important;
    align-items: center !important;
    gap: 4px !important;
}

.combat-header-layout .player-stat-label {
    flex: 0 0 60px;
    font-size: 0.8rem !important;
    line-height: 1 !important;
    letter-spacing: 0.1px !important;
    margin-bottom: 0 !important;
}

.combat-header-layout .player-profile-stats .hp-bar-container,
.combat-header-layout .player-profile-stats .stamina-bar-container {
    height: .9em !important;
    border-radius: 2px !important;
}

.combat-header-layout .player-profile-stats .hp-text,
.combat-header-layout .player-profile-stats .stamina-text {
    font-size: 0.75rem !important;
}

/* Obsolete header block-badge rule removed */

.combat-header-layout .player-status-row {
    min-height: 1rem !important;
    display: flex !important;
    align-items: center !important;
}

.combat-header-layout .player-status-row .status-effects {
    gap: 3px !important;
}

.combat-header-layout .player-status-row .status-badge {
    width: 12px !important;
    height: 12px !important;
    padding: 0 !important;
    border-radius: 2px !important;
}

.combat-header-layout .player-status-row .status-badge svg {
    width: 10px !important;
    height: 10px !important;
}

.combat-header-layout .player-status-row .status-value {
    font-size: 0.45rem !important;
    bottom: -2px !important;
    right: -2px !important;
    padding: 0 1px !important;
}

.combat-header-layout .player-org-row {
    font-size: 0.55rem !important;
    gap: 4px !important;
    align-items: center !important;
    display: flex !important;
}

.combat-header-layout .orgasm-label {
    font-size: 0.55rem !important;
}

.combat-header-layout .orgasm-value {
    font-size: 0.65rem !important;
}

.combat-header-layout .permanent-status-badge {
    padding: 0 3px !important;
    font-size: 0.5rem !important;
    border-radius: 2px !important;
}

/* Specific styling for attachment container in special cards area */
.special-cards-container {
    height: 100% !important;
    align-items: center !important;
    padding-bottom: 0 !important;
}

/* Premium Toast Notification System */
.toast-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10000;
    pointer-events: none;
    width: 90%;
    max-width: 450px;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    border-width: 1.5px;
    border-style: solid;
    transition: all 0.2s ease;
    animation: slideDownFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-item:hover {
    transform: scale(1.02);
}

.toast-item.dismiss {
    animation: fadeOut 0.3s ease-in forwards;
}

.toast-success {
    background: rgba(6, 78, 59, 0.85);
    border-color: #10b981;
    color: #a7f3d0;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.toast-warning {
    background: rgba(120, 53, 4, 0.85);
    border-color: #f59e0b;
    color: #fef3c7;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.toast-error {
    background: rgba(153, 27, 27, 0.85);
    border-color: #ef4444;
    color: #fee2e2;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.toast-info {
    background: rgba(30, 58, 138, 0.85);
    border-color: #3b82f6;
    color: #dbeafe;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

@keyframes slideDownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

.status-badge.status-recovery {
    color: #f472b6 !important;
    /* Soft pink for recovery */
    filter: drop-shadow(0 0 3px rgba(244, 114, 182, 0.6));
}

/* Hybrid Enemy Card Overrides */
.enemy-actor {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-height: 155px;
    gap: 6px;
    background: rgba(22, 13, 31, 0.4);
    border: 1px solid rgba(147, 51, 234, 0.15);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.enemy-actor:hover {
    border-color: rgba(147, 51, 234, 0.6);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

.enemy-middle-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.enemy-actor .actor-visual {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.enemy-actor .actor-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.enemy-actor .hp-bar-container,
.enemy-actor .stamina-bar-container {
    width: 100%;
    margin-top: 1px;
}

.enemy-actor .actor-name {
    text-align: center;
    font-size: 0.8rem;
    margin-top: 2px;
    margin-bottom: 0;
    color: #f3e8ff;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.enemy-actor .status-effects {
    position: static;
    transform: none;
    max-width: 100%;
    padding: 0;
    background: none;
    border: none;
    justify-content: flex-start;
    margin-top: 2px;
    margin-bottom: 2px;
}

.enemy-actor .enemy-attachments {
    margin-top: 2px;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
}

/* Card Selector Split Decks styling */
.cards-split-container {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) rgba(0, 0, 0, 0.2);
}

.cards-split-container::-webkit-scrollbar {
    width: 6px;
}

.cards-split-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.cards-split-container::-webkit-scrollbar-thumb {
    background-color: var(--color-primary);
    border-radius: 3px;
}

.deck-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 0 8px currentColor;
}

/* Campfire Icons styling */
.heal-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2310b981"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

.smith-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2314b8a6"><path d="M9 3H15V5H18V7L16 9V13H21V15H3V13H8V9L6 7V5H9V3M5 17H19V20H5V17Z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 8px rgba(20, 184, 166, 0.4));
}

.repair-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f59e0b"><path d="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4));
}
