/* ================================================
   BREATH OF THE BLADE — Dark Anime Theme
   ================================================ */

/* Page-level dark override */
.botb-page {
    background: #0f0f1a;
    min-height: 100vh;
}

.botb-container {
    max-width: 700px;
    margin: 2rem auto;
    padding: 2rem;
    background: #1a1a2e;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #2a2a4a;
}

/* ---- Game Header ---- */
.botb-container .game-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.botb-container .game-header h1 {
    font-size: 1.8rem;
    color: #e2e8f0;
    margin-bottom: 0.25rem;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.botb-container .game-header p {
    color: #94a3b8;
    font-size: 0.95rem;
}

/* ---- Screens ---- */
.screen { transition: opacity 0.3s ease; }
.screen.hidden { display: none; }

/* ---- Character Select Grid ---- */
.char-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.char-card {
    background: #16162b;
    border: 2px solid #2a2a4a;
    border-radius: 12px;
    padding: 1.2rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.char-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.char-card.selected {
    border-color: var(--char-color, #8b5cf6);
    box-shadow: 0 0 20px color-mix(in srgb, var(--char-color, #8b5cf6) 40%, transparent);
}

.char-portrait {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    position: relative;
}

/* Character-specific portraits */
.portrait-tanjiro { background: linear-gradient(135deg, #1e3a5f, #3b82f6); }
.portrait-zenitsu { background: linear-gradient(135deg, #78650a, #eab308); }
.portrait-inosuke { background: linear-gradient(135deg, #7c3a0d, #f97316); }
.portrait-kanao   { background: linear-gradient(135deg, #831843, #ec4899); }

.char-card-name {
    color: #e2e8f0;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.char-card-style {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Character detail panel */
.char-detail {
    background: #16162b;
    border: 1px solid #2a2a4a;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.char-detail-name {
    color: #e2e8f0;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.char-detail-style {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.char-detail-passive {
    color: #a78bfa;
    font-size: 0.85rem;
    font-style: italic;
}

/* ---- Difficulty Selector ---- */
.botb-container .difficulty-selector {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.botb-container .difficulty-btn {
    padding: 0.6rem 1.25rem;
    border: 2px solid #2a2a4a;
    background: #16162b;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: #94a3b8;
    transition: all 0.3s;
}

.botb-container .difficulty-btn:hover {
    border-color: #8b5cf6;
    color: #e2e8f0;
}

.botb-container .difficulty-btn.active {
    background: #8b5cf6;
    color: white;
    border-color: #8b5cf6;
}

/* ---- Game Stats Bar ---- */
.botb-container .game-stats {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem;
    background: #16162b;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    border: 1px solid #2a2a4a;
}

.botb-container .stat {
    text-align: center;
}

.botb-container .stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #e2e8f0;
}

.botb-container .stat-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---- Arena ---- */
.arena {
    background:
        /* Moon disc */
        radial-gradient(circle at 82% 12%, rgba(200, 190, 255, 0.08) 0%, rgba(200, 190, 255, 0.03) 4%, transparent 8%),
        /* Moon halo */
        radial-gradient(circle at 82% 12%, rgba(139, 92, 246, 0.04) 0%, transparent 15%),
        /* Stars */
        radial-gradient(circle at 10% 18%, rgba(255, 255, 255, 0.3) 0.5px, transparent 0.5px),
        radial-gradient(circle at 25% 8%, rgba(255, 255, 255, 0.2) 0.5px, transparent 0.5px),
        radial-gradient(circle at 45% 5%, rgba(255, 255, 255, 0.25) 0.5px, transparent 0.5px),
        radial-gradient(circle at 65% 22%, rgba(255, 255, 255, 0.15) 0.5px, transparent 0.5px),
        radial-gradient(circle at 92% 28%, rgba(255, 255, 255, 0.2) 0.5px, transparent 0.5px),
        radial-gradient(circle at 15% 35%, rgba(255, 255, 255, 0.12) 0.5px, transparent 0.5px),
        radial-gradient(circle at 55% 15%, rgba(255, 255, 255, 0.18) 0.5px, transparent 0.5px),
        radial-gradient(circle at 78% 32%, rgba(255, 255, 255, 0.1) 0.5px, transparent 0.5px),
        radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.08) 0.5px, transparent 0.5px),
        radial-gradient(circle at 88% 6%, rgba(255, 255, 255, 0.22) 0.5px, transparent 0.5px),
        /* Base gradient */
        linear-gradient(180deg, #08081a 0%, #0c0c1e 40%, #100e22 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
    min-height: 280px;
    border: 1px solid #1e1e3a;
}

/* Demon Zone */
.demon-zone {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.demon {
    text-align: center;
    transition: all 0.3s ease;
}

.demon-name {
    color: #ff4444;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.demon-body {
    font-size: 4rem;
    line-height: 1;
    color: #ff2d2d;
    text-shadow: 0 0 30px rgba(255, 45, 45, 0.6), 0 0 60px rgba(255, 45, 45, 0.3);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    animation: demonIdle 2s ease-in-out infinite;
}

.demon-body.boss {
    font-size: 3rem;
    text-shadow: 0 0 40px rgba(255, 45, 45, 0.8), 0 0 80px rgba(255, 45, 45, 0.4);
    animation: demonIdle 1.5s ease-in-out infinite;
}

.demon-weakness {
    font-size: 1.4rem;
    margin-bottom: 0.6rem;
    transition: opacity 0.3s;
}

.demon-hp-bar {
    width: 160px;
    height: 8px;
    background: #2a2a4a;
    border-radius: 4px;
    margin: 0 auto;
    overflow: hidden;
}

.demon-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff6b6b);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 100%;
}

/* ---- Slash Overlay ---- */
.slash-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    border-radius: 12px;
}

.slash-overlay.slash-water   { animation: waterSlash 0.6s ease-out forwards; }
.slash-overlay.slash-flame   { animation: flameSlash 0.6s ease-out forwards; }
.slash-overlay.slash-thunder { animation: thunderSlash 0.4s ease-out forwards; }
.slash-overlay.slash-beast   { animation: beastSlash 0.5s ease-out forwards; }
.slash-overlay.slash-flower  { animation: flowerSlash 0.7s ease-out forwards; }
.slash-overlay.slash-wind    { animation: windSlash 0.6s ease-out forwards; }

/* ---- Form Announcement ---- */
.form-announce {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 0 20px currentColor;
    animation: formAnnounce 1.5s ease-out forwards;
}

/* ---- Sequence Display ---- */
.sequence-zone {
    text-align: center;
    margin-bottom: 1rem;
}

.sequence-label {
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sequence-arrows {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    align-items: center;
}

.seq-arrow {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a4a;
    border-radius: 8px;
    font-size: 1.3rem;
    color: #e2e8f0;
    animation: sequenceFlash 0.5s ease-in-out;
    transition: all 0.3s;
}

.seq-arrow.revealed {
    background: #4a3a6a;
    border: 1px solid #8b5cf6;
}

/* ---- Input Progress ---- */
.input-progress {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.progress-dot {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a4a;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #64748b;
    transition: all 0.2s;
}

.progress-dot.correct {
    background: #166534;
    color: #4ade80;
}

.progress-dot.wrong {
    background: #7f1d1d;
    color: #f87171;
}

.progress-dot.current {
    border: 2px solid #8b5cf6;
    background: #2a2a4a;
}

/* ---- Attack Timer ---- */
.attack-timer-bar {
    width: 100%;
    height: 4px;
    background: #2a2a4a;
    border-radius: 2px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.attack-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #fbbf24);
    border-radius: 2px;
    width: 100%;
    transition: width 0.1s linear;
}

/* ---- Breathing Style Selector ---- */
.style-selector {
    margin-bottom: 1rem;
}

.style-label {
    text-align: center;
    color: #64748b;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.style-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.style-btn {
    padding: 0.6rem 0.4rem;
    border: 2px solid #2a2a4a;
    background: #16162b;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    transition: all 0.3s;
    text-align: center;
}

.style-btn:hover {
    border-color: var(--style-color);
    color: #e2e8f0;
}

.style-btn.selected {
    border-color: var(--style-color);
    background: color-mix(in srgb, var(--style-color) 15%, #16162b);
    color: #e2e8f0;
    box-shadow: 0 0 12px color-mix(in srgb, var(--style-color) 30%, transparent);
}

.style-btn.primary-style::after {
    content: ' \u2605';
    color: var(--style-color);
}

/* ---- Arrow Input (D-pad) ---- */
.arrow-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 1rem;
}

.arrow-row {
    display: flex;
    gap: 4px;
}

.arrow-btn {
    width: 56px;
    height: 56px;
    border: 2px solid #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 10px;
    font-size: 1.5rem;
    color: #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: all 0.15s;
}

.arrow-btn:active {
    background: rgba(139, 92, 246, 0.35);
    transform: scale(0.95);
}

.arrow-btn.spacer {
    visibility: hidden;
    border: none;
    background: none;
}

/* ---- Game Controls ---- */
.botb-container .game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.25rem;
}

.btn-glow {
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.botb-container .btn-primary {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.botb-container .btn-primary:hover {
    background: #7c3aed;
}

.botb-container .btn-secondary {
    background: #2a2a4a;
    border-color: #2a2a4a;
    color: #94a3b8;
}

.botb-container .btn-secondary:hover {
    background: #3a3a5a;
    color: #e2e8f0;
}

.botb-container .controls-hint {
    text-align: center;
    margin-top: 0.75rem;
    color: #4a5568;
    font-size: 0.8rem;
}

/* ---- Game Over Screen ---- */
.game-over-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.go-stat {
    text-align: center;
    background: #16162b;
    border-radius: 8px;
    padding: 1rem 0.5rem;
    border: 1px solid #2a2a4a;
}

.go-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 0.25rem;
}

.go-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---- Rules Section (dark themed) ---- */
.botb-container .rules-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #16162b;
    border-radius: 8px;
    border-left: 4px solid #8b5cf6;
}

.botb-container .rules-section h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #e2e8f0;
}

.botb-container .rules-section h3 {
    font-size: 1rem;
    margin: 1.25rem 0 0.5rem;
    color: #cbd5e1;
}

.botb-container .rules-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.botb-container .rules-section li {
    position: relative;
    padding: 0.3rem 0 0.3rem 1.4rem;
    font-size: 0.93rem;
    color: #94a3b8;
    line-height: 1.5;
}

.botb-container .rules-section li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8b5cf6;
}

.botb-container .rules-section .key {
    display: inline-block;
    padding: 1px 7px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background: #2a2a4a;
    border: 1px solid #3a3a5a;
    border-radius: 4px;
    color: #e2e8f0;
}

/* ================================================
   ARENA ATMOSPHERE — Wisteria, Mist, Petals
   ================================================ */

/* Wisteria tree silhouettes on arena edges */
.arena::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.12;
    background:
        /* Left wisteria trunk */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 200'%3E%3Cpath d='M30 200 L30 80 Q20 60 10 50 M30 80 Q22 55 8 40' stroke='%238b5cf6' stroke-width='2' fill='none'/%3E%3Cpath d='M30 100 Q38 85 42 70' stroke='%238b5cf6' stroke-width='1.5' fill='none'/%3E%3Ccircle cx='8' cy='48' r='5' fill='%238b5cf6' opacity='.6'/%3E%3Ccircle cx='5' cy='58' r='4' fill='%23a78bfa' opacity='.5'/%3E%3Ccircle cx='9' cy='67' r='4.5' fill='%238b5cf6' opacity='.5'/%3E%3Ccircle cx='6' cy='76' r='3.5' fill='%23a78bfa' opacity='.4'/%3E%3Ccircle cx='10' cy='84' r='3' fill='%23c4b5fd' opacity='.3'/%3E%3Ccircle cx='42' cy='68' r='4' fill='%238b5cf6' opacity='.5'/%3E%3Ccircle cx='44' cy='78' r='3.5' fill='%23a78bfa' opacity='.4'/%3E%3Ccircle cx='41' cy='86' r='3' fill='%23c4b5fd' opacity='.3'/%3E%3C/svg%3E") no-repeat left bottom / 50px auto,
        /* Right wisteria trunk */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 200'%3E%3Cpath d='M30 200 L30 80 Q40 60 50 50 M30 80 Q38 55 52 40' stroke='%238b5cf6' stroke-width='2' fill='none'/%3E%3Cpath d='M30 100 Q22 85 18 70' stroke='%238b5cf6' stroke-width='1.5' fill='none'/%3E%3Ccircle cx='52' cy='48' r='5' fill='%238b5cf6' opacity='.6'/%3E%3Ccircle cx='55' cy='58' r='4' fill='%23a78bfa' opacity='.5'/%3E%3Ccircle cx='51' cy='67' r='4.5' fill='%238b5cf6' opacity='.5'/%3E%3Ccircle cx='54' cy='76' r='3.5' fill='%23a78bfa' opacity='.4'/%3E%3Ccircle cx='50' cy='84' r='3' fill='%23c4b5fd' opacity='.3'/%3E%3Ccircle cx='18' cy='68' r='4' fill='%238b5cf6' opacity='.5'/%3E%3Ccircle cx='16' cy='78' r='3.5' fill='%23a78bfa' opacity='.4'/%3E%3Ccircle cx='19' cy='86' r='3' fill='%23c4b5fd' opacity='.3'/%3E%3C/svg%3E") no-repeat right bottom / 50px auto;
}

/* Ground mist */
.arena::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 45%;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(to top,
        rgba(139, 92, 246, 0.04) 0%,
        rgba(139, 92, 246, 0.02) 30%,
        transparent 100%);
}

/* Ensure arena content sits above atmosphere */
.demon-zone,
.sequence-zone,
.input-progress,
.attack-timer-bar {
    position: relative;
    z-index: 1;
}

/* ---- Floating Wisteria Petals ---- */
.arena-petals {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.petal {
    position: absolute;
    width: 5px;
    height: 3px;
    border-radius: 50% 0 50% 0;
    background: rgba(167, 139, 250, 0.35);
    top: -8px;
    animation: petalFall var(--petal-duration, 8s) var(--petal-delay, 0s) linear infinite;
    left: var(--petal-x, 50%);
}

.petal:nth-child(even) {
    background: rgba(236, 72, 153, 0.25);
    width: 4px;
    height: 2.5px;
}

.petal:nth-child(3n) {
    background: rgba(196, 181, 253, 0.3);
    width: 3.5px;
    height: 2px;
}

@keyframes petalFall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    8% {
        opacity: 0.6;
    }
    50% {
        transform: translateY(140px) translateX(25px) rotate(180deg);
        opacity: 0.4;
    }
    100% {
        transform: translateY(300px) translateX(-10px) rotate(400deg);
        opacity: 0;
    }
}

/* ================================================
   ENHANCED TITLE & HEADER
   ================================================ */

.botb-container .game-header h1 {
    font-size: 1.8rem;
    color: #e2e8f0;
    margin-bottom: 0.25rem;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, #e2e8f0 0%, #c4b5fd 40%, #e2e8f0 60%, #f9a8d4 80%, #e2e8f0 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleShimmer 6s linear infinite;
    position: relative;
}

/* Decorative blade line under title */
.botb-container .game-header h1::after {
    content: '';
    display: block;
    width: 60%;
    height: 1px;
    margin: 0.4rem auto 0;
    background: linear-gradient(90deg, transparent, #8b5cf6, #ec4899, #8b5cf6, transparent);
    opacity: 0.5;
    /* Reset clip to show the line */
    -webkit-text-fill-color: initial;
    -webkit-background-clip: initial;
    background-clip: initial;
}

@keyframes titleShimmer {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* ================================================
   CHARACTER PORTRAIT SVG STYLING
   ================================================ */

.char-portrait {
    width: 64px;
    height: 64px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    position: relative;
    overflow: hidden;
}

.char-portrait svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Character card hover glow enhancement */
.char-card:hover .char-portrait {
    filter: brightness(1.15);
}

.char-card.selected .char-portrait {
    filter: brightness(1.2) drop-shadow(0 0 6px var(--char-color, #8b5cf6));
}

/* ================================================
   DEMON BODY SVG STYLING
   ================================================ */

.demon-body svg {
    width: 80px;
    height: 96px;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 12px rgba(255, 45, 45, 0.4)) drop-shadow(0 0 30px rgba(255, 45, 45, 0.15));
}

.demon-body.boss svg {
    width: 100px;
    height: 120px;
    filter: drop-shadow(0 0 16px rgba(255, 45, 45, 0.5)) drop-shadow(0 0 40px rgba(255, 45, 45, 0.2));
}

/* ================================================
   ENHANCED SLASH EFFECTS
   ================================================ */

/* Water Slash - flowing wave lines */
.slash-overlay.slash-water {
    animation: waterSlashEnhanced 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Flame Slash - fire burst */
.slash-overlay.slash-flame {
    animation: flameSlashEnhanced 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Thunder Slash - electric flash */
.slash-overlay.slash-thunder {
    animation: thunderSlashEnhanced 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Beast Slash - triple claw marks */
.slash-overlay.slash-beast {
    animation: beastSlashEnhanced 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Flower Slash - petal burst */
.slash-overlay.slash-flower {
    animation: flowerSlashEnhanced 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Wind Slash - spiral vortex */
.slash-overlay.slash-wind {
    animation: windSlashEnhanced 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ================================================
   SLASH OVERLAY SVG SIZING
   ================================================ */

.slash-overlay svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ================================================
   CHARACTER IDLE ANIMATION
   ================================================ */

.char-card .char-portrait {
    animation: portraitBreathing 3.5s ease-in-out infinite;
}

.char-card:hover .char-portrait {
    animation: portraitBreathing 2s ease-in-out infinite;
}

@keyframes portraitBreathing {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

/* Style button selection pulse */
.style-btn.selected {
    animation: stylePulse 1.5s ease-in-out infinite;
}

@keyframes stylePulse {
    0%, 100% { box-shadow: 0 0 12px color-mix(in srgb, var(--style-color) 30%, transparent); }
    50% { box-shadow: 0 0 20px color-mix(in srgb, var(--style-color) 50%, transparent); }
}

/* ================================================
   DAMAGE VIGNETTE EFFECT
   ================================================ */

.arena.damage-flash {
    animation: damageVignette 0.5s ease-out;
}

@keyframes damageVignette {
    0% { box-shadow: inset 0 0 60px rgba(255, 0, 0, 0.5), inset 0 0 120px rgba(255, 0, 0, 0.2); }
    30% { box-shadow: inset 0 0 40px rgba(255, 0, 0, 0.3), inset 0 0 80px rgba(255, 0, 0, 0.1); }
    100% { box-shadow: inset 0 0 0 rgba(255, 0, 0, 0); }
}

/* ================================================
   BOSS ENTRANCE ANIMATION
   ================================================ */

.demon.boss-appear {
    animation: bossAppear 0.9s ease-out;
}

@keyframes bossAppear {
    0% { opacity: 0; transform: scale(0.15); filter: brightness(3) saturate(2); }
    25% { opacity: 1; transform: scale(1.35); filter: brightness(2) saturate(1.5); }
    45% { transform: scale(0.85); filter: brightness(1.3); }
    65% { transform: scale(1.15); filter: brightness(1.15); }
    80% { transform: scale(0.95); }
    100% { transform: scale(1); filter: brightness(1) saturate(1); }
}

/* ================================================
   ENHANCED FORM ANNOUNCEMENT
   ================================================ */

.form-announce {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    font-size: 1.2rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 0 20px currentColor, 0 0 40px currentColor, 0 0 60px currentColor;
    animation: formAnnounceEnhanced 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    letter-spacing: 0.08em;
    padding: 0.4em 1.2em;
    border-radius: 4px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.08) 0%, transparent 70%);
}

/* Flash glow behind form text */
.form-announce::before {
    content: '';
    position: absolute;
    inset: -20px -40px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, currentColor, transparent 70%);
    opacity: 0;
    z-index: -1;
    animation: formGlowFlash 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: none;
}

@keyframes formGlowFlash {
    0% { opacity: 0; transform: scale(0.5); }
    8% { opacity: 0.25; transform: scale(1.2); }
    20% { opacity: 0.12; transform: scale(1); }
    50% { opacity: 0.06; }
    100% { opacity: 0; transform: scale(1.3); }
}

@keyframes formAnnounceEnhanced {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); filter: blur(8px); }
    8% { opacity: 1; transform: translate(-50%, -50%) scale(1.35); filter: blur(0); }
    14% { transform: translate(-50%, -50%) scale(0.95); filter: blur(0); }
    20% { transform: translate(-50%, -50%) scale(1.08); }
    28% { transform: translate(-50%, -50%) scale(1); }
    60% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) translateY(-30px) scale(0.9); filter: blur(2px); }
}

/* ================================================
   GAME OVER SCREEN ENHANCEMENT
   ================================================ */

#gameOverScreen .game-header h1 {
    color: #ff4444;
    text-shadow: 0 0 30px rgba(255, 45, 45, 0.5), 0 0 60px rgba(255, 45, 45, 0.2);
    background: linear-gradient(135deg, #ff4444 0%, #ff8888 50%, #ff4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#gameOverScreen .game-header h1::after {
    background: linear-gradient(90deg, transparent, #ff4444, #ff6b6b, #ff4444, transparent);
}

/* Game over stat card glow on hover */
.go-stat {
    transition: all 0.3s ease;
}

.go-stat:hover {
    border-color: #3a3a5a;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.15);
}

/* ================================================
   ANIMATIONS
   ================================================ */

@keyframes demonIdle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes demonAppear {
    0% { opacity: 0; transform: scale(0.3); }
    60% { opacity: 1; transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes demonDefeat {
    0% { opacity: 1; transform: scale(1); filter: brightness(1); }
    30% { transform: scale(1.15); filter: brightness(2); }
    100% { opacity: 0; transform: scale(0); filter: brightness(3); }
}

@keyframes demonHit {
    0%, 100% { transform: translateX(0); filter: brightness(1); }
    20% { transform: translateX(-8px); filter: brightness(1.5); }
    40% { transform: translateX(8px); filter: brightness(1.5); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

@keyframes sequenceFlash {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes formAnnounce {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    30% { transform: translate(-50%, -50%) scale(1); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) translateY(-20px); }
}

@keyframes waterSlash {
    0% { background: radial-gradient(ellipse at center, rgba(59,130,246,0.4) 0%, transparent 70%); }
    50% { background: radial-gradient(ellipse at center, rgba(59,130,246,0.6) 0%, transparent 80%); }
    100% { background: transparent; }
}

@keyframes flameSlash {
    0% { background: radial-gradient(ellipse at center, rgba(239,68,68,0.5) 0%, rgba(249,115,22,0.2) 50%, transparent 70%); }
    50% { background: radial-gradient(ellipse at center, rgba(239,68,68,0.7) 0%, rgba(249,115,22,0.3) 60%, transparent 80%); }
    100% { background: transparent; }
}

@keyframes thunderSlash {
    0% { background: rgba(234,179,8,0.5); }
    20% { background: rgba(234,179,8,0.05); }
    40% { background: rgba(234,179,8,0.4); }
    60% { background: rgba(234,179,8,0.02); }
    100% { background: transparent; }
}

@keyframes beastSlash {
    0% { background: linear-gradient(45deg, rgba(249,115,22,0.4) 0%, transparent 30%, rgba(249,115,22,0.4) 40%, transparent 60%, rgba(249,115,22,0.4) 70%, transparent 100%); }
    100% { background: transparent; }
}

@keyframes flowerSlash {
    0% { background: radial-gradient(circle at center, rgba(236,72,153,0.5) 0%, transparent 50%); }
    50% { background: radial-gradient(circle at 30% 30%, rgba(236,72,153,0.3) 0%, transparent 30%), radial-gradient(circle at 70% 60%, rgba(236,72,153,0.3) 0%, transparent 30%), radial-gradient(circle at 50% 80%, rgba(236,72,153,0.3) 0%, transparent 30%); }
    100% { background: transparent; }
}

@keyframes windSlash {
    0% { background: radial-gradient(ellipse at center, rgba(34,197,94,0.4) 0%, transparent 60%); transform: rotate(0deg); }
    50% { background: radial-gradient(ellipse at center, rgba(34,197,94,0.5) 0%, transparent 70%); }
    100% { background: transparent; }
}

/* ---- Enhanced Slash Keyframes ---- */

@keyframes waterSlashEnhanced {
    0% {
        background:
            linear-gradient(30deg, transparent 40%, rgba(59,130,246,0.6) 45%, transparent 50%),
            linear-gradient(35deg, transparent 50%, rgba(59,130,246,0.4) 55%, transparent 60%),
            radial-gradient(ellipse at center, rgba(59,130,246,0.3) 0%, transparent 60%);
        transform: scale(0.9);
        filter: brightness(1.3);
    }
    15% {
        transform: scale(1.08);
        filter: brightness(1.5);
    }
    35% {
        background:
            linear-gradient(30deg, transparent 15%, rgba(59,130,246,0.7) 20%, transparent 25%),
            linear-gradient(35deg, transparent 25%, rgba(59,130,246,0.5) 30%, transparent 35%),
            linear-gradient(25deg, transparent 40%, rgba(96,165,250,0.4) 45%, transparent 50%),
            radial-gradient(ellipse at center, rgba(59,130,246,0.35) 0%, transparent 70%);
        transform: scale(1.02);
        filter: brightness(1.15);
    }
    70% {
        background:
            linear-gradient(30deg, transparent 20%, rgba(59,130,246,0.15) 25%, transparent 30%),
            radial-gradient(ellipse at center, rgba(59,130,246,0.1) 0%, transparent 60%);
        transform: scale(1);
    }
    100% {
        background: transparent;
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes flameSlashEnhanced {
    0% {
        background:
            radial-gradient(ellipse at 50% 40%, rgba(255,200,50,0.8) 0%, rgba(239,68,68,0.5) 20%, rgba(249,115,22,0.3) 40%, transparent 60%);
        transform: scale(0.85);
        filter: brightness(1.6);
    }
    12% {
        transform: scale(1.12);
        filter: brightness(1.8);
    }
    25% {
        background:
            radial-gradient(ellipse at 50% 40%, rgba(239,68,68,0.8) 0%, rgba(249,115,22,0.5) 20%, transparent 55%),
            radial-gradient(circle at 30% 25%, rgba(251,191,36,0.45) 0%, transparent 22%),
            radial-gradient(circle at 70% 50%, rgba(251,191,36,0.4) 0%, transparent 22%),
            radial-gradient(circle at 45% 65%, rgba(249,115,22,0.3) 0%, transparent 18%);
        transform: scale(1.04);
        filter: brightness(1.3);
    }
    55% {
        background:
            radial-gradient(circle at 25% 20%, rgba(239,68,68,0.2) 0%, transparent 20%),
            radial-gradient(circle at 65% 40%, rgba(249,115,22,0.18) 0%, transparent 20%),
            radial-gradient(circle at 50% 70%, rgba(251,191,36,0.12) 0%, transparent 15%);
        transform: scale(1);
    }
    100% {
        background: transparent;
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes thunderSlashEnhanced {
    0% {
        background: rgba(255,240,100,0.9);
        filter: brightness(2.2);
        transform: scale(1.06);
    }
    10% {
        background: rgba(234,179,8,0.03);
        filter: brightness(1);
        transform: scale(1);
    }
    22% {
        background:
            linear-gradient(170deg, transparent 43%, rgba(255,230,50,0.8) 46%, rgba(234,179,8,0.6) 48%, transparent 50%),
            rgba(234,179,8,0.35);
        filter: brightness(1.6);
        transform: scale(1.04);
    }
    40% {
        background:
            linear-gradient(170deg, transparent 44%, rgba(234,179,8,0.3) 47%, transparent 49%),
            rgba(234,179,8,0.05);
        filter: brightness(1.1);
        transform: scale(1);
    }
    60% {
        background: rgba(234,179,8,0.08);
    }
    100% {
        background: transparent;
        filter: brightness(1);
        transform: scale(1);
    }
}

@keyframes beastSlashEnhanced {
    0% {
        background:
            linear-gradient(40deg, rgba(249,115,22,0.7) 0%, transparent 12%,
                           rgba(249,115,22,0.7) 18%, transparent 30%,
                           rgba(249,115,22,0.7) 36%, transparent 50%);
        transform: scale(0.9) rotate(-2deg);
        filter: brightness(1.4);
    }
    18% {
        background:
            linear-gradient(40deg, rgba(249,115,22,0.8) 0%, transparent 14%,
                           rgba(249,115,22,0.8) 20%, transparent 34%,
                           rgba(249,115,22,0.8) 38%, transparent 52%);
        transform: scale(1.1) rotate(1deg);
        filter: brightness(1.6);
    }
    45% {
        background:
            linear-gradient(40deg, rgba(249,115,22,0.35) 3%, transparent 18%,
                           rgba(249,115,22,0.35) 23%, transparent 38%,
                           rgba(249,115,22,0.35) 43%, transparent 58%);
        transform: scale(1.02) rotate(0deg);
        filter: brightness(1.1);
    }
    100% {
        background: transparent;
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
}

@keyframes flowerSlashEnhanced {
    0% {
        background: radial-gradient(circle at center, rgba(255,180,220,0.7) 0%, rgba(236,72,153,0.4) 20%, transparent 45%);
        transform: scale(0.85);
        filter: brightness(1.4);
    }
    15% {
        background: radial-gradient(circle at center, rgba(236,72,153,0.6) 0%, transparent 50%);
        transform: scale(1.1);
        filter: brightness(1.5);
    }
    30% {
        background:
            radial-gradient(circle at 28% 22%, rgba(236,72,153,0.45) 0%, transparent 20%),
            radial-gradient(circle at 72% 28%, rgba(236,72,153,0.4) 0%, transparent 17%),
            radial-gradient(circle at 50% 58%, rgba(236,72,153,0.38) 0%, transparent 20%),
            radial-gradient(circle at 22% 55%, rgba(168,85,247,0.3) 0%, transparent 14%),
            radial-gradient(circle at 78% 62%, rgba(168,85,247,0.28) 0%, transparent 14%),
            radial-gradient(circle at center, rgba(236,72,153,0.15) 0%, transparent 55%);
        transform: scale(1.03);
        filter: brightness(1.2);
    }
    60% {
        background:
            radial-gradient(circle at 18% 12%, rgba(236,72,153,0.2) 0%, transparent 14%),
            radial-gradient(circle at 82% 18%, rgba(236,72,153,0.16) 0%, transparent 12%),
            radial-gradient(circle at 38% 78%, rgba(236,72,153,0.16) 0%, transparent 14%),
            radial-gradient(circle at 68% 82%, rgba(168,85,247,0.12) 0%, transparent 12%);
        transform: scale(1);
    }
    100% {
        background: transparent;
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes windSlashEnhanced {
    0% {
        background: radial-gradient(ellipse at center, rgba(100,255,150,0.5) 0%, rgba(34,197,94,0.3) 30%, transparent 55%);
        transform: scale(0.88) rotate(-3deg);
        filter: brightness(1.3);
    }
    15% {
        transform: scale(1.08) rotate(2deg);
        filter: brightness(1.5);
    }
    30% {
        background:
            conic-gradient(from 0deg at 50% 50%, transparent, rgba(34,197,94,0.4), transparent, rgba(34,197,94,0.3), transparent);
        transform: scale(1.03) rotate(0deg);
        filter: brightness(1.2);
    }
    55% {
        background:
            conic-gradient(from 140deg at 50% 50%, transparent, rgba(34,197,94,0.15), transparent, rgba(34,197,94,0.1), transparent);
        transform: scale(1) rotate(0deg);
    }
    100% {
        background: transparent;
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }
}

@keyframes damageShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-10px); }
    20% { transform: translateX(10px); }
    30% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    50% { transform: translateX(-5px); }
    60% { transform: translateX(5px); }
    70% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.arena.shake {
    animation: damageShake 0.5s ease-out;
}

.demon.hit {
    animation: demonHit 0.4s ease-out;
}

.demon.appear {
    animation: demonAppear 0.5s ease-out;
}

.demon.defeat {
    animation: demonDefeat 0.6s ease-out forwards;
}

/* ================================================
   SLASH SCREEN-SHAKE — brief impact shake on attack
   ================================================ */

.arena.slash-shake {
    animation: slashImpactShake 0.35s ease-out;
}

@keyframes slashImpactShake {
    0% { transform: translate(0, 0); }
    15% { transform: translate(-4px, 2px); }
    30% { transform: translate(5px, -2px); }
    45% { transform: translate(-3px, 1px); }
    60% { transform: translate(3px, -1px); }
    75% { transform: translate(-1px, 1px); }
    100% { transform: translate(0, 0); }
}

/* ================================================
   BREATHING RHYTHM PULSE — visual cue during combat
   ================================================ */

.breath-pulse {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(139, 92, 246, 0.4);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.breath-pulse.active {
    opacity: 1;
    animation: breathPulseRhythm 4s ease-in-out infinite;
}

.breath-pulse.rhythm-medium.active { animation-duration: 3.4s; }
.breath-pulse.rhythm-hard.active { animation-duration: 2.8s; }

.breath-pulse.rhythm-medium::before,
.breath-pulse.rhythm-medium::after { animation-duration: 3.4s; }

.breath-pulse.rhythm-hard::before,
.breath-pulse.rhythm-hard::after { animation-duration: 2.8s; }

.breath-pulse::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.25);
    animation: breathPulseInner 4s ease-in-out infinite;
    animation-delay: 0.15s;
}

.breath-pulse::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.15);
    animation: breathPulseOuter 4s ease-in-out infinite;
    animation-delay: -0.15s;
}

@keyframes breathPulseRhythm {
    0%, 100% { transform: scale(0.8); opacity: 0.4; border-color: rgba(139, 92, 246, 0.3); }
    25% { transform: scale(1.15); opacity: 0.9; border-color: rgba(139, 92, 246, 0.7); }
    50% { transform: scale(0.85); opacity: 0.5; border-color: rgba(139, 92, 246, 0.35); }
    75% { transform: scale(1.1); opacity: 0.85; border-color: rgba(139, 92, 246, 0.65); }
}

@keyframes breathPulseInner {
    0%, 100% { transform: scale(0.85); opacity: 0.3; }
    25% { transform: scale(1.2); opacity: 0.8; }
    50% { transform: scale(0.9); opacity: 0.35; }
    75% { transform: scale(1.15); opacity: 0.75; }
}

@keyframes breathPulseOuter {
    0%, 100% { transform: scale(1.1); opacity: 0.2; }
    25% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 0.25; }
    75% { transform: scale(0.92); opacity: 0.45; }
}

/* Style-specific pulse colors */
.breath-pulse.pulse-water { border-color: rgba(59, 130, 246, 0.5); }
.breath-pulse.pulse-water::before { border-color: rgba(59, 130, 246, 0.3); }
.breath-pulse.pulse-water::after { border-color: rgba(59, 130, 246, 0.15); }

.breath-pulse.pulse-flame { border-color: rgba(239, 68, 68, 0.5); }
.breath-pulse.pulse-flame::before { border-color: rgba(239, 68, 68, 0.3); }
.breath-pulse.pulse-flame::after { border-color: rgba(239, 68, 68, 0.15); }

.breath-pulse.pulse-thunder { border-color: rgba(234, 179, 8, 0.5); }
.breath-pulse.pulse-thunder::before { border-color: rgba(234, 179, 8, 0.3); }
.breath-pulse.pulse-thunder::after { border-color: rgba(234, 179, 8, 0.15); }

.breath-pulse.pulse-beast { border-color: rgba(249, 115, 22, 0.5); }
.breath-pulse.pulse-beast::before { border-color: rgba(249, 115, 22, 0.3); }
.breath-pulse.pulse-beast::after { border-color: rgba(249, 115, 22, 0.15); }

.breath-pulse.pulse-flower { border-color: rgba(236, 72, 153, 0.5); }
.breath-pulse.pulse-flower::before { border-color: rgba(236, 72, 153, 0.3); }
.breath-pulse.pulse-flower::after { border-color: rgba(236, 72, 153, 0.15); }

.breath-pulse.pulse-wind { border-color: rgba(34, 197, 94, 0.5); }
.breath-pulse.pulse-wind::before { border-color: rgba(34, 197, 94, 0.3); }
.breath-pulse.pulse-wind::after { border-color: rgba(34, 197, 94, 0.15); }

.breath-guide {
    position: absolute;
    bottom: 10px;
    left: 12px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(8, 8, 26, 0.55);
    color: #cbd5e1;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.breath-guide.active {
    opacity: 1;
    transform: translateY(0);
}

.breath-guide.inhale {
    color: #93c5fd;
    border-color: rgba(147, 197, 253, 0.45);
}

.breath-guide.exhale {
    color: #f9a8d4;
    border-color: rgba(249, 168, 212, 0.45);
}

/* ================================================
   BREATHING STYLE IDLE EFFECTS — persistent arena aura
   ================================================ */

.style-idle-fx {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.6s ease;
    overflow: hidden;
}

.style-idle-fx.active {
    opacity: 1;
}

/* Water — gentle ripple rings from bottom */
.style-idle-fx.fx-water {
    background:
        radial-gradient(ellipse at 50% 95%, rgba(59,130,246,0.06) 0%, transparent 35%),
        radial-gradient(ellipse at 30% 90%, rgba(96,165,250,0.04) 0%, transparent 25%),
        radial-gradient(ellipse at 70% 92%, rgba(59,130,246,0.04) 0%, transparent 25%);
    animation: waterIdleRipple 5s ease-in-out infinite;
}

@keyframes waterIdleRipple {
    0%, 100% {
        background-size: 100% 100%, 80% 80%, 80% 80%;
        background-position: center bottom, 30% bottom, 70% bottom;
    }
    33% {
        background-size: 110% 110%, 90% 90%, 75% 75%;
        background-position: center bottom, 25% bottom, 72% bottom;
    }
    66% {
        background-size: 95% 95%, 75% 75%, 90% 90%;
        background-position: center bottom, 32% bottom, 68% bottom;
    }
}

/* Flame — flickering ember glow from edges */
.style-idle-fx.fx-flame {
    animation: flameIdleEmber 3s ease-in-out infinite;
}

@keyframes flameIdleEmber {
    0%, 100% {
        box-shadow:
            inset 0 -20px 40px -20px rgba(239,68,68,0.06),
            inset 0 -10px 20px -10px rgba(249,115,22,0.04);
    }
    25% {
        box-shadow:
            inset 0 -25px 45px -18px rgba(239,68,68,0.09),
            inset -10px -15px 25px -10px rgba(251,191,36,0.05),
            inset 10px -12px 20px -10px rgba(249,115,22,0.04);
    }
    50% {
        box-shadow:
            inset 0 -18px 35px -18px rgba(239,68,68,0.05),
            inset 8px -10px 20px -10px rgba(249,115,22,0.04);
    }
    75% {
        box-shadow:
            inset 0 -22px 42px -20px rgba(239,68,68,0.08),
            inset 12px -18px 30px -12px rgba(251,191,36,0.04),
            inset -8px -14px 22px -10px rgba(249,115,22,0.05);
    }
}

/* Thunder — intermittent faint flicker */
.style-idle-fx.fx-thunder {
    animation: thunderIdleFlicker 4s ease-in-out infinite;
}

@keyframes thunderIdleFlicker {
    0%, 100% { background: transparent; }
    18% { background: transparent; }
    19% { background: rgba(234,179,8,0.04); }
    21% { background: transparent; }
    47% { background: transparent; }
    48% { background: rgba(234,179,8,0.03); }
    49% { background: transparent; }
    50% { background: rgba(234,179,8,0.05); }
    51% { background: transparent; }
    78% { background: transparent; }
    79% { background: rgba(234,179,8,0.03); }
    80% { background: transparent; }
}

/* Beast — faint claw-like scratches, feral energy */
.style-idle-fx.fx-beast {
    animation: beastIdleFeral 3.5s ease-in-out infinite;
}

@keyframes beastIdleFeral {
    0%, 100% {
        background:
            linear-gradient(42deg, transparent 48%, rgba(249,115,22,0.03) 49%, transparent 50%),
            linear-gradient(38deg, transparent 52%, rgba(249,115,22,0.02) 53%, transparent 54%);
    }
    50% {
        background:
            linear-gradient(42deg, transparent 46%, rgba(249,115,22,0.05) 47.5%, transparent 49%),
            linear-gradient(38deg, transparent 50%, rgba(249,115,22,0.04) 51.5%, transparent 53%),
            linear-gradient(44deg, transparent 54%, rgba(249,115,22,0.03) 55%, transparent 56%);
    }
}

/* Flower — drifting petal-like color shifts */
.style-idle-fx.fx-flower {
    animation: flowerIdlePetals 6s ease-in-out infinite;
}

@keyframes flowerIdlePetals {
    0%, 100% {
        background:
            radial-gradient(circle at 20% 30%, rgba(236,72,153,0.04) 0%, transparent 20%),
            radial-gradient(circle at 80% 70%, rgba(168,85,247,0.03) 0%, transparent 18%);
    }
    33% {
        background:
            radial-gradient(circle at 25% 60%, rgba(236,72,153,0.05) 0%, transparent 22%),
            radial-gradient(circle at 75% 35%, rgba(168,85,247,0.04) 0%, transparent 20%),
            radial-gradient(circle at 50% 80%, rgba(236,72,153,0.03) 0%, transparent 15%);
    }
    66% {
        background:
            radial-gradient(circle at 70% 25%, rgba(236,72,153,0.04) 0%, transparent 20%),
            radial-gradient(circle at 30% 75%, rgba(168,85,247,0.05) 0%, transparent 22%);
    }
}

/* Wind — gentle swirling currents */
.style-idle-fx.fx-wind {
    animation: windIdleCurrents 5s ease-in-out infinite;
}

@keyframes windIdleCurrents {
    0%, 100% {
        background:
            linear-gradient(120deg, transparent 30%, rgba(34,197,94,0.03) 50%, transparent 70%);
    }
    33% {
        background:
            linear-gradient(140deg, transparent 25%, rgba(34,197,94,0.05) 45%, transparent 65%);
    }
    66% {
        background:
            linear-gradient(100deg, transparent 35%, rgba(34,197,94,0.04) 55%, transparent 75%);
    }
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media screen and (max-width: 768px) {
    .char-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .game-over-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 480px) {
    .botb-container {
        padding: 1rem;
        margin: 1rem auto;
    }

    .botb-container .game-header h1 {
        font-size: 1.4rem;
    }

    .char-portrait {
        width: 52px;
        height: 52px;
        font-size: 1.4rem;
    }

    .arena {
        padding: 1rem;
        min-height: 240px;
    }

    .breath-pulse {
        width: 24px;
        height: 24px;
        bottom: 8px;
        right: 8px;
    }

    .demon-body {
        font-size: 3rem;
    }

    .demon-body svg {
        width: 64px;
        height: 80px;
    }

    .demon-body.boss svg {
        width: 80px;
        height: 100px;
    }

    /* Reduce petal count visually on mobile */
    .petal:nth-child(n+9) {
        display: none;
    }

    .style-buttons {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.35rem;
    }

    .style-btn {
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
    }

    .arrow-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .seq-arrow {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .game-over-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .go-stat { padding: 0.75rem 0.25rem; }
    .go-value { font-size: 1.2rem; }
}

@media screen and (max-width: 360px) {
    .botb-container {
        padding: 0.75rem;
    }

    .char-grid {
        gap: 0.5rem;
    }

    .demon-body {
        font-size: 2.5rem;
    }

    .demon-body svg {
        width: 56px;
        height: 72px;
    }

    .demon-body.boss svg {
        width: 72px;
        height: 88px;
    }

    /* Hide wisteria trees on very small screens */
    .arena::before {
        display: none;
    }

    .arrow-btn {
        width: 44px;
        height: 44px;
    }
}
