/* Enhanced Succubus Dungeon - Following Original Gameplay */
:root {
    --bg: #1a0f1b;
    --panel: #2a1830;
    --panel-2: #1d1222;
    --accent: #ff86d0;
    --accent-2: #ffa3e0;

    --good: #4ecdc4;
    --warn: #f7b731;
    --bad: #ff5722;

    --text-light: #f8f8f2;
    --text-mid: #a0a0a0;
    --text-dark: #666;

    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    --glow: 0 0 20px rgba(255, 134, 208, 0.3);
    --border: 1px solid rgba(255, 134, 208, 0.3);
    --radius: 12px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Crimson Text', serif;
    background: var(--bg);
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.3;
    z-index: -1;
}

.play {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--panel), var(--panel-2));
    border: var(--border);
    border-radius: var(--radius);
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lore-modal-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    color: var(--bg);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(255, 134, 208, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lore-modal-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 134, 208, 0.5);
}

.modal-icon {
    line-height: 1;
}

.title-section h1 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 5px;
}

.seed-info {
    font-size: 0.9rem;
    color: var(--text-mid);
    font-style: italic;
}

.stats-section {
    display: flex;
    gap: 30px;
}

.stat-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-mid);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Game Area */
.game-area {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 30px;
    align-items: start;
    margin-bottom: 30px;
}

/* Cards */
.card-container {
    display: flex;
    justify-content: center;
    position: relative;
    /* Enable positioning for pills overlay */
}

/* Pills overlay - positioned outside card to avoid overflow clipping */
.card-pills-overlay {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    /* High z-index to appear above everything */
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
    pointer-events: none;
    /* Allow clicks to pass through to card */
    white-space: nowrap;
    /* Prevent any text wrapping */
}

/* Re-enable pointer events on the pills themselves */
.card-pills-overlay .quick-health,
.card-pills-overlay .quick-armor,
.card-pills-overlay .quick-damage {
    pointer-events: auto;
}

.card {
    width: 300px;
    height: 450px;
    /* Fixed height to make art the main body */
    background: transparent;
    /* Remove background - let art show through */
    border: 3px solid var(--accent);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), var(--glow);
    border-color: var(--accent-2);
}

.card-art {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    /* Art fills the entire card */
    background-size: cover;
    background-position: center;
    z-index: 1;
    /* Behind overlays */
}

.card-art::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 25%;
    /* Reduced since we only need space for the name */
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.3));
    z-index: 2;
}

/* Subtle frame effect around the entire card */
.card-art::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid rgba(255, 134, 208, 0.2);
    border-radius: 8px;
    pointer-events: none;
    z-index: 5;
}

/* OLD CARD-INFO STYLES - REPLACED WITH PILL SYSTEM
.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(
        transparent, 
        rgba(0, 0, 0, 0.8) 40%, 
        rgba(26, 15, 27, 0.9) 100%
    );
    z-index: 3;
}
*/

.card-name {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    text-align: center;
    margin-bottom: 12px;
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.9),
        0 0 10px rgba(0, 0, 0, 0.8);
    /* Strong text shadow for readability */
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    z-index: 4;
}

/* Add a subtle background to the name for extra readability */
.card-name::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -8px;
    right: -8px;
    bottom: -4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    z-index: -1;
    backdrop-filter: blur(2px);
}

.card-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 4;
}

/* OLD - Top overlay for quick reference stats (replaced with card-pills-overlay)
.card-top-overlay {
    position: absolute;
    top: -10px;
    left: 12px;
    right: 12px;
    z-index: 5;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
*/

/* Base pill styling for all stat displays */
.quick-health,
.quick-armor,
.quick-damage {
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid var(--good);
    padding: 4px 10px;
    border-radius: 18px;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--good);
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    /* Inner highlight for depth */
    transition: var(--transition);
    min-width: 60px;
    justify-content: center;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Add subtle glow effect */
.quick-health::before,
.quick-armor::before,
.quick-damage::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, currentColor, transparent, currentColor);
    border-radius: 18px;
    opacity: 0.3;
    z-index: -1;
}

/* Armor pill styling */
.quick-armor {
    border-color: var(--accent);
    color: var(--accent);
}

/* Damage pill styling */
.quick-damage {
    border-color: var(--warn);
    color: var(--warn);
}

/* Enemy variants */
.quick-health.enemy {
    border-color: var(--bad);
    color: var(--bad);
}

.quick-damage.enemy {
    border-color: var(--bad);
    color: var(--bad);
}

/* Hover effects for all pills */
.quick-health:hover,
.quick-armor:hover,
.quick-damage:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Low health warning states */
.quick-health.critical {
    border-color: var(--bad);
    color: var(--bad);
    animation: pulse-critical 1.5s ease-in-out infinite;
}

.quick-health.damaged {
    border-color: var(--warn);
    color: var(--warn);
}

@keyframes pulse-critical {

    0%,
    100% {
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.6),
            0 0 0 0 rgba(255, 87, 34, 0.8),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow:
            0 6px 16px rgba(0, 0, 0, 0.8),
            0 0 0 6px rgba(255, 87, 34, 0),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
}

/* Bottom overlay for character name only */
.card-name-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 16px;
    background: linear-gradient(transparent,
            rgba(0, 0, 0, 0.6) 30%,
            rgba(26, 15, 27, 0.9) 100%);
    z-index: 3;
    text-align: center;
}

.card-name {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0;
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.9),
        0 0 10px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    position: relative;
    z-index: 4;
}

/* Enhanced name background for better readability */
.card-name::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -12px;
    right: -12px;
    bottom: -6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    z-index: -1;
    backdrop-filter: blur(3px);
}

.quick-stat {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.5px;
    text-align: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.6);
    /* More transparent but still readable */
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 134, 208, 0.4);
    backdrop-filter: blur(4px);
    /* Subtle blur effect for modern glass look */
    text-shadow:
        1px 1px 2px rgba(0, 0, 0, 0.9),
        0 0 8px rgba(0, 0, 0, 0.7);
    /* Strong text shadow for readability over art */
    transition: var(--transition);
}

.stat-item:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: var(--accent);
    transform: translateX(2px);
}

.stat-icon {
    font-size: 1.1rem;
    width: 18px;
    text-align: center;
}

.stat-item.health .stat-icon {
    color: var(--bad);
}

.stat-item.armor .stat-icon {
    color: var(--warn);
}

.stat-item.damage .stat-icon {
    color: var(--accent);
}

.stat-text {
    color: var(--text-light);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

/* Enhanced Card Visual Effects */
.card.damaged .card-art::before {
    border-color: rgba(255, 165, 0, 0.6);
    /* Orange border for damaged state */
    box-shadow: inset 0 0 20px rgba(255, 165, 0, 0.2);
}

.card.critical .card-art::before {
    border-color: rgba(255, 0, 0, 0.8);
    /* Red border for critical state */
    box-shadow: inset 0 0 25px rgba(255, 0, 0, 0.3);
    animation: critical-pulse 1.5s ease-in-out infinite;
}

.card.defeated .card-art {
    filter: grayscale(50%) brightness(0.7) blur(0px);
    transform: scale(0.95);
    transition: all 1.2s ease-out;
    animation: defeat-fade 2s ease-out;
}

.card.defeated {
    border-color: rgba(255, 0, 0, 0.8);
    box-shadow:
        0 0 40px rgba(255, 0, 0, 0.6),
        inset 0 0 30px rgba(0, 0, 0, 0.7);
    animation: defeat-glow 2s ease-out;
}

.card.taking-damage {
    animation: damage-flash 0.5s ease-out;
}

@keyframes critical-pulse {

    0%,
    100% {
        border-color: rgba(255, 0, 0, 0.8);
        box-shadow: inset 0 0 25px rgba(255, 0, 0, 0.3);
    }

    50% {
        border-color: rgba(255, 0, 0, 1);
        box-shadow: inset 0 0 35px rgba(255, 0, 0, 0.5);
    }
}

@keyframes damage-flash {
    0% {
        filter: brightness(1);
    }

    25% {
        filter: brightness(1.8) saturate(1.5);
    }

    100% {
        filter: brightness(1);
    }
}

@keyframes defeat-fade {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(0.98);
    }

    100% {
        opacity: 0.8;
        transform: scale(0.95);
    }
}

@keyframes defeat-glow {
    0% {
        box-shadow:
            0 0 20px rgba(255, 0, 0, 0.3),
            inset 0 0 15px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow:
            0 0 50px rgba(255, 0, 0, 0.8),
            inset 0 0 40px rgba(0, 0, 0, 0.8);
    }

    100% {
        box-shadow:
            0 0 40px rgba(255, 0, 0, 0.6),
            inset 0 0 30px rgba(0, 0, 0, 0.7);
    }
}

/* Image quality enhancements */
.card-art {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    background-attachment: local;
}

/* Combat Section */
.combat-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
}

.dice-area {
    text-align: center;
}

.dice-area h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.dice-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.die {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #f8f8f8, #e0e0e0);
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.die:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.die.sel {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--accent), #ff6bc7);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 15px rgba(255, 134, 208, 0.6);
}

.die.used {
    background: #666;
    border-color: #444;
    color: #999;
    cursor: not-allowed;
    opacity: 0.5;
}

.die.rolling {
    animation: diceRoll 1s ease-out;
}

.die.rolling-fast {
    animation: diceRollFast 0.6s ease-out;
}

@keyframes diceRoll {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    25% {
        transform: translateY(-15px) scale(1.1);
    }

    50% {
        transform: translateY(-8px) scale(1.05);
    }

    75% {
        transform: translateY(-3px) scale(1.02);
    }
}

@keyframes diceRollFast {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

/* Action Buttons */
.action-area {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--panel), var(--panel-2));
    border: var(--border);
    border-radius: var(--radius);
    padding: 20px 25px;
    color: var(--text-light);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    min-width: 120px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), var(--glow);
}

.action-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.5rem;
}

.btn-text {
    font-weight: 700;
}

.btn-desc {
    font-size: 0.85rem;
    color: var(--text-mid);
}

.btn-bonus {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--good);
    background: rgba(78, 205, 196, 0.15);
    border: 1px solid rgba(78, 205, 196, 0.3);
    border-radius: 8px;
    padding: 2px 6px;
    min-height: 20px;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
}

/* Status Area */
.status-area {
    background: linear-gradient(135deg, var(--panel), var(--panel-2));
    border: var(--border);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.status-area h4 {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
    font-family: 'Cinzel', serif;
}

.status-effects {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    min-height: 30px;
    align-items: center;
}

.status-effect {
    background: linear-gradient(135deg, rgba(255, 134, 208, 0.15), rgba(255, 163, 224, 0.1));
    border: 1px solid rgba(255, 134, 208, 0.3);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(255, 134, 208, 0.2);
}

.status-effect .effect-icon {
    font-size: 0.8rem;
}

.status-effects:empty::after {
    content: "No active bonuses";
    color: var(--text-mid);
    font-size: 0.8rem;
    font-style: italic;
}

.drain-btn:hover {
    border-color: var(--bad);
}

.shield-btn:hover {
    border-color: var(--warn);
}

.restore-btn:hover {
    border-color: var(--good);
}

.end-turn-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    border-radius: var(--radius);
    padding: 15px 30px;
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.end-turn-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), var(--glow);
}

/* Log Section */
.log-section {
    background: rgba(0, 0, 0, 0.6);
    border: var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.log-section h3 {
    font-family: 'Cinzel', serif;
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.log-content {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 134, 208, 0.2);
    border-radius: 8px;
    padding: 15px;
    height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    color: var(--text-mid);
}

/* Restart Section */
.restart-section {
    text-align: center;
}

.restart-btn {
    background: linear-gradient(135deg, var(--panel), var(--panel-2));
    border: var(--border);
    border-radius: var(--radius);
    padding: 15px 30px;
    color: var(--text-light);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), var(--glow);
    border-color: var(--accent);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.shop-container,
.event-container {
    background: linear-gradient(135deg, var(--panel), var(--panel-2));
    border: var(--border);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow), var(--glow);
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .shop-container,
.modal-overlay.active .event-container,
.modal-overlay.active .lore-modal-container,
.modal-overlay.active .defeat-modal-container {
    transform: scale(1);
}

/* Lore Modal Styles */
.lore-modal-container {
    background: linear-gradient(135deg, var(--panel), var(--panel-2));
    border: var(--border);
    border-radius: var(--radius);
    padding: 0;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    transform: scale(0.8);
    transition: var(--transition);
    position: relative;
}

.lore-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 134, 208, 0.2);
    background: linear-gradient(135deg, rgba(255, 134, 208, 0.1), rgba(255, 163, 224, 0.05));
}

.lore-modal-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.8);
    border: none;
    color: white;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close-btn:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

.lore-modal-content {
    padding: 30px;
    display: grid;
    gap: 30px;
}

/* Shop Styles */
.shop-header {
    text-align: center;
    margin-bottom: 30px;
}

.shop-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.shop-subtitle {
    font-size: 1.1rem;
    color: var(--text-mid);
    font-style: italic;
    margin-bottom: 15px;
}

.lust-display {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent);
}

.lust-amount {
    color: var(--accent-2);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.shop-item {
    background: linear-gradient(135deg, var(--panel-2), var(--bg));
    border: var(--border);
    border-radius: var(--radius);
    padding: 25px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.shop-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow), var(--glow);
    border-color: var(--accent);
}

.shop-item.affordable {
    border-color: var(--good);
}

.shop-item.expensive {
    opacity: 0.6;
    cursor: not-allowed;
}

.shop-item-name {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
}

.shop-item-desc {
    color: var(--text-mid);
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 15px;
}

.shop-item-cost {
    color: var(--accent-2);
    font-weight: 600;
    font-size: 1.1rem;
}

.shop-footer {
    text-align: center;
}

.shop-close-btn {
    background: transparent;
    border: var(--border);
    border-radius: var(--radius);
    padding: 12px 24px;
    color: var(--text-mid);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.shop-close-btn:hover {
    background: var(--panel);
    color: var(--text-light);
}

/* Event Styles */
.event-header {
    text-align: center;
    margin-bottom: 30px;
}

.event-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.event-description {
    font-size: 1.2rem;
    color: var(--text-light);
    font-style: italic;
    line-height: 1.5;
}

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

.event-choice {
    background: linear-gradient(135deg, var(--panel-2), var(--bg));
    border: var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.event-choice:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow), var(--glow);
    border-color: var(--accent);
}

.event-choice-text {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 600;
}

/* Particle Canvas */
.fx-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* Pop Text Animation */
.pop {
    position: absolute;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 200;
    animation: popUp 0.7s ease-out forwards;
}

@keyframes popUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-40px) scale(1.2);
        opacity: 0;
    }
}

/* Game Area Overlay */
.game-area-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(10, 5, 16, 0.95),
            rgba(26, 15, 27, 0.95),
            rgba(42, 24, 48, 0.95));
    backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    border: var(--border);
    box-shadow:
        inset 0 0 50px rgba(255, 134, 208, 0.1),
        0 0 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.game-area-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 134, 208, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 163, 224, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.game-area-overlay.hidden {
    display: none;
}

.overlay-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 60px 40px;
    max-width: 600px;
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    border: 2px solid rgba(255, 134, 208, 0.3);
    backdrop-filter: blur(10px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.overlay-content h2 {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ff86d0, #ffa3e0, #ffb8e6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(255, 134, 208, 0.5);
    letter-spacing: 3px;
    line-height: 1.2;
}

.overlay-content p {
    font-size: 1.4rem;
    color: #ffa3e0;
    font-style: italic;
    margin-bottom: 40px;
    opacity: 0.9;
    font-weight: 300;
    line-height: 1.4;
}

.begin-trial-btn-large {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 600;
    padding: 18px 45px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #ff86d0, #ffa3e0, #ff86d0);
    background-size: 200% 100%;
    color: #1a0f1b;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow:
        0 10px 30px rgba(255, 134, 208, 0.6),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 2px;
    min-width: 250px;
    animation: buttonPulse 3s ease-in-out infinite;
}

@keyframes buttonPulse {

    0%,
    100% {
        box-shadow:
            0 10px 30px rgba(255, 134, 208, 0.6),
            inset 0 2px 0 rgba(255, 255, 255, 0.3),
            inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    }

    50% {
        box-shadow:
            0 15px 40px rgba(255, 134, 208, 0.8),
            inset 0 2px 0 rgba(255, 255, 255, 0.4),
            inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    }
}

.begin-trial-btn-large:hover {
    transform: translateY(-4px) scale(1.08);
    background-position: 100% 0;
    box-shadow:
        0 20px 50px rgba(255, 134, 208, 0.9),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    animation: none;
}

.begin-trial-btn-large:active {
    transform: translateY(-2px) scale(1.06);
    transition: all 0.1s ease;
}

.begin-trial-btn-large .btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.8s ease;
}

.begin-trial-btn-large:hover .btn-glow {
    left: 100%;
}

.begin-trial-btn-large .btn-text {
    position: relative;
    z-index: 2;
}

/* Game area positioning for overlay */
.play {
    position: relative;
}

.game-area {
    position: relative;
}

/* Responsive Design */
@media (max-width: 1000px) {
    .game-area {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .combat-section {
        order: 1;
    }

    .card-container:first-child {
        order: 2;
    }

    .card-container:last-child {
        order: 3;
    }
}

@media (max-width: 768px) {
    .play {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }

    .stats-section {
        gap: 20px;
    }

    .action-area {
        gap: 10px;
    }

    .action-btn {
        min-width: 100px;
        padding: 15px 20px;
    }

    .card {
        width: 100%;
        max-width: 300px;
    }

    .shop-container,
    .event-container {
        padding: 20px;
        width: 95%;
    }

    /* Responsive overlay styles */
    .overlay-content {
        padding: 30px 20px;
        margin: 10px;
    }

    .overlay-content h2 {
        font-size: 2rem;
    }

    .overlay-content p {
        font-size: 1.1rem;
        margin-bottom: 25px;
    }

    .begin-trial-btn-large {
        padding: 18px 40px;
        font-size: 1.2rem;
    }
}

/* ===========================
   Lore Section Styling
=========================== */

/* Compact Header with Toggle */
.lore-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--panel), var(--panel-2));
    border: var(--border);
    border-radius: var(--radius);
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.lore-title-section h2 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lore-title-section .lore-subtitle {
    font-size: 1rem;
    color: var(--text-mid);
    font-style: italic;
    opacity: 0.9;
    margin: 0;
}

.lore-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    color: var(--bg);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(255, 134, 208, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lore-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 134, 208, 0.5);
}

.toggle-icon {
    line-height: 1;
}

/* Trial Start Section */
.trial-start-section {
    text-align: center;
    margin-bottom: 20px;
}

.begin-trial-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    border-radius: 25px;
    padding: 15px 40px;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--bg);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow:
        0 6px 20px rgba(255, 134, 208, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.begin-trial-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 10px 30px rgba(255, 134, 208, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.begin-trial-btn:hover .btn-glow {
    left: 100%;
}

.btn-text {
    position: relative;
    z-index: 2;
}

/* Collapsible Lore Section */
.lore-section {
    background: linear-gradient(135deg, var(--panel), var(--panel-2));
    border: var(--border);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.lore-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 134, 208, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255, 163, 224, 0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: 1;
}

.lore-container {
    position: relative;
    z-index: 2;
}

.lore-content {
    display: grid;
    gap: 40px;
}

.lore-story {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 134, 208, 0.2);
    border-radius: var(--radius);
    padding: 25px;
    backdrop-filter: blur(5px);
}

.lore-story h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    color: var(--accent);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lore-story p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 15px;
}

.lore-story p:last-child {
    margin-bottom: 0;
    font-style: italic;
    color: var(--accent-2);
}

.lore-story strong {
    color: var(--accent);
    font-weight: 600;
}

.rules-section h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    color: var(--accent);
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.rule-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 134, 208, 0.3);
    border-radius: var(--radius);
    padding: 20px;
    backdrop-filter: blur(5px);
    transition: var(--transition);
}

.rule-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.rule-card h4 {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: var(--accent-2);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rule-card ul {
    list-style: none;
    padding: 0;
}

.rule-card li {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
}

.rule-card li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* Responsive adjustments for lore section */
@media (max-width: 768px) {
    .lore-header h2 {
        font-size: 2.2rem;
    }

    .rules-grid {
        grid-template-columns: 1fr;
    }

    .lore-section {
        padding: 20px;
    }
}

/* Defeat Modal Styles */
.defeat-modal-container {
    background: linear-gradient(135deg, var(--panel), var(--panel-2));
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 0;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), var(--glow);
    backdrop-filter: blur(10px);
    position: relative;
}

.defeat-slide-nav {
    display: flex;
    background: linear-gradient(135deg, var(--bg), var(--panel));
    border-bottom: 2px solid var(--accent);
}

.defeat-tab {
    flex: 1;
    padding: 15px 25px;
    background: transparent;
    border: none;
    color: var(--text-light);
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.defeat-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

.defeat-tab.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--bg);
    font-weight: 600;
}

.defeat-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

.defeat-modal-content {
    position: relative;
    height: 100%;
}

.defeat-slide {
    display: none;
    padding: 30px;
    animation: slideIn 0.3s ease-out;
}

.defeat-slide.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.defeat-header {
    text-align: center;
    margin-bottom: 25px;
}

.defeat-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.defeat-image-container {
    text-align: center;
    margin: 15px 0 20px 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 3px solid var(--accent);
    box-shadow: var(--shadow), 0 0 20px rgba(255, 134, 208, 0.3);
}

.defeat-image {
    width: 100%;
    max-width: 750px;
    height: 450px;
    object-fit: cover;
    border-radius: var(--radius);
    transition: var(--transition);
}

.defeat-image:hover {
    transform: scale(1.01);
}

.defeat-lore-text {
    background: linear-gradient(135deg, var(--panel-2), var(--bg));
    border: var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 15px 0 20px 0;
    text-align: center;
}

.defeat-lore-text p {
    font-family: 'Crimson Text', serif;
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--text);
    margin: 0;
    font-style: italic;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.stat-card {
    background: linear-gradient(135deg, var(--panel-2), var(--bg));
    border: var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.stat-card .stat-value {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.stat-card .stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.defeat-actions {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid var(--accent);
    margin-top: 25px;
}

.defeat-btn {
    padding: 15px 40px;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 600;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.defeat-btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--bg);
}

.defeat-btn.primary:hover {
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), var(--glow);
}

/* Responsive defeat modal */
@media (max-width: 768px) {
    .defeat-modal-container {
        max-width: 95%;
        margin: 10px;
    }

    .defeat-slide {
        padding: 20px;
    }

    .defeat-header h2 {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
    }

    .defeat-image {
        height: 300px;
    }

    .defeat-lore-text p {
        font-size: 1.1rem;
    }
}