﻿@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;500;700&family=Noto+Sans+JP:wght@400;700&display=swap');

:root {
    --primary: #4facfe;
    --primary-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --bg-dark: #0b0c15;
    --bg-panel: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-sub: #a0a0b0;
    --danger: #ff6b6b;
    --success: #4ecdc4;
    --warning: #f5af19;
    --shadow-glow: 0 0 15px rgba(79, 172, 254, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    /* 繧ｷ繧ｹ繝・Β繝｡繝九Η繝ｼ繧偵げ繝ｭ繝ｼ繝舌Ν縺ｧ遖∵ｭ｢ */
}

img {
    -webkit-user-drag: none;
    /* 逕ｻ蜒上・繝峨Λ繝・げ繧堤ｦ∵ｭ｢ */
    -webkit-touch-callout: none;
    /* 逕ｻ蜒上・髟ｷ謚ｼ縺励Γ繝九Η繝ｼ繧堤ｦ∵ｭ｢ */
    user-select: none;
    -webkit-user-select: none;
}

body {
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* 繝ｭ繝ｼ繝・ぅ繝ｳ繧ｰ繧ｪ繝ｼ繝舌・繝ｬ繧､ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    text-align: center;
    color: var(--text-main);
}

.loading-content p {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-sub);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(79, 172, 254, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#game-container {
    max-width: 430px;
    margin: 0 auto;
    height: 100dvh;
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(11, 12, 21, 0.8);
    backdrop-filter: blur(20px);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.screen {
    display: none;
    padding: 24px;
    height: 100%;
    overflow: hidden;
    animation: fadeIn 0.4s ease-out;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Overlay to ensure text readability */
    z-index: 0;
}

.screen>* {
    position: relative;
    z-index: 1;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Custom Modal Styles (Enhanced) */
#modal-title {
    margin-bottom: 16px;
    font-size: 20px;
    color: var(--primary);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

#modal-body {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #eee;
    text-align: left;
    word-break: break-word;
}

/* Character Target Selection (Custom Modal) */
#target-select-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.target-char-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}

.target-char-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.target-char-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 8px;
    border: 2px solid #555;
    object-fit: cover;
}

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

.target-char-name {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 4px;
}

/* Item Modal Center Close */
#item-modal .btn-primary {
    margin: 16px auto 0;
    display: block !important;
    /* Force block to center */
    width: auto;
    min-width: 120px;
}

/* Enhance Screen Buttons */
.btn-plus,
.btn-minus {
    width: 40px;
    height: 30px;
    border-radius: 6px;
    border: none;
    font-weight: 900;
    cursor: pointer;
    margin: 0 2px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: 0.2s;
}

.btn-plus {
    background: #00f2fe !important;
    background: linear-gradient(to bottom, #4facfe, #00f2fe) !important;
    box-shadow: 0 2px 4px rgba(79, 172, 254, 0.4);
}

.btn-plus:active {
    transform: translateY(1px);
    box-shadow: none;
}

.btn-minus {
    background: #ff6b6b !important;
    background: linear-gradient(to bottom, #ff6b6b, #ee5253) !important;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.4);
}

.btn-minus:active {
    transform: translateY(1px);
    box-shadow: none;
}

.hidden {
    display: none !important;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Buttons */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    color: #fff;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 20px -5px rgba(79, 172, 254, 0.4);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Prevent text selection or cursor issues if needed */
}

/* Add spacing for H2 in Reward Screen */
#reward-screen h2 {
    margin-bottom: 8px;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: 0.3s;
}

.btn-primary:active {
    transform: scale(0.96);
}

.btn-primary:disabled {
    background: #333;
    box-shadow: none;
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5253 100%);
    border: none;
    color: #fff;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 20px -5px rgba(255, 107, 107, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(255, 107, 107, 0.6);
}

/* Title Screen */
#title-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    background-image: url('img/bg/bg_title.png');
}

#title-screen h1 {
    font-size: clamp(32px, 11vw, 48px);
    white-space: nowrap;
    /* Slightly larger */
    margin-bottom: 24px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    /* Restore gradient var if needed, or keeping similar */
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(79, 172, 254, 0.6)) drop-shadow(0 0 30px rgba(79, 172, 254, 0.4));
    animation: title-gradient 3s ease infinite;
}

@keyframes title-gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#title-screen .btn-primary,
#title-screen .btn-danger {
    width: 240px;
    /* Fixed width for consistency */
    display: block;
    /* Stack vertically */
    margin: 0 auto;
    /* Center */
}

#continue-btn {
    margin-top: 16px;
}

#title-screen .subtitle {
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* 髮｣譏灘ｺｦ驕ｸ謚・*/
.difficulty-selector {
    margin: 0 auto 30px auto;
    width: 280px;
    text-align: left;
}

.difficulty-selector label {
    display: block;
    font-size: 14px;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.difficulty-dropdown {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(79, 172, 254, 0.3);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.difficulty-dropdown:hover {
    border-color: rgba(79, 172, 254, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.difficulty-dropdown:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.4);
}

.difficulty-dropdown option {
    background: #1a1a2e;
    color: #fff;
}

.difficulty-description {
    margin-top: 12px;
    padding: 12px;
    font-size: 13px;
    color: #ddd;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border-left: 3px solid #4facfe;
    line-height: 1.6;
}

/* Party Screen */
#party-screen {
    padding-bottom: 30px;
    height: 100%;
}

.party-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.party-header h2 {
    text-align: center;
    font-size: 24px;
    margin: 0;
}

.back-btn {
    position: absolute;
    left: 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
}

.back-btn:active {
    transform: scale(0.95);
}

#party-screen h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 24px;
}

.description-text {
    text-align: center;
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 12px;
}

/* Filter Dropdown */
.filter-container {
    margin-bottom: 16px;
    padding: 0 8px;
    display: flex;
    gap: 12px;
    align-items: center;
}

#party-filter,
#party-sort {
    flex: 1;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    outline: none;
}

#character-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    overflow-y: auto;
    padding: 4px;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
    align-content: start;
}

#character-list::-webkit-scrollbar {
    display: none;
}

.character-card {
    background: #444;
    /* Solid gray */
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px 4px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
}

.character-card.selecting {
    background: #556;
    /* Slightly lighter solid for selection state */
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(79, 172, 254, 0.4);
    transform: scale(1.05);
}

.character-card.selected {
    background: #4a5a6a;
    /* Distinct solid color for in-party */
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.2);
}

.character-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    margin-bottom: 4px;
    background: #222;
}

.character-card.selected img {
    border-color: var(--primary);
}

.character-card .char-type-label {
    font-size: 8px;
    color: var(--primary);
    margin-bottom: 2px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.character-card .char-name {
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: visible;
    white-space: nowrap;
}

.character-card .char-type {
    font-size: 10px;
    color: var(--text-sub);
}

/* Party Divider */
.party-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px 0 12px;
    position: relative;
    width: 100%;
}

.party-divider::before,
.party-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.party-divider span {
    padding: 0 12px;
    font-size: 10px;
    color: var(--text-sub);
    letter-spacing: 0.1em;
    font-weight: 700;
}

#party-slots {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-shrink: 0;
    justify-content: center;
}

.slot-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.party-slot {
    width: 80px;
    height: 105px;
    background: linear-gradient(145deg, #2b3a4a, #222e3b);
    border: 1px dashed #556c80;
    border-radius: 12px;
    padding: 8px 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    transition: all 0.2s;
    flex: 0 0 auto;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.party-slot.available {
    border-color: var(--primary);
    background: linear-gradient(145deg, #3a4b5d, #2f3e4d);
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.25);
}

.party-slot.filled {
    border-style: solid;
    border-color: var(--primary);
    background: linear-gradient(145deg, #34495e, #2c3e50);
}

.slot-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.slot-role-label {
    font-size: 8px;
    color: var(--primary);
    margin-bottom: 2px;
    font-weight: 700;
}

.slot-char-name {
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: visible;
    white-space: nowrap;
    margin-top: auto;
    /* Push to bottom if needed, or just let flow */
    margin-bottom: 4px;
}

/* Position label is now outside, update margin */
.position-label {
    font-size: 10px;
    color: var(--text-sub);
    margin-bottom: 6px;
    text-transform: uppercase;
    font-weight: 700;
}

/* Note: Party screen shares generic bg or title bg if needed, or keeping transparent/dark */
#party-screen {
    background-image: url('img/bg/bg_title.png');
    /* Reuse title or generic */
}

/* Map Screen */
#map-screen {
    background-image: url('img/bg/bg_map.png');
}

#map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    margin-bottom: 16px;
    font-weight: 700;
}

#node-map {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* 繝弱・繝峨・繝・・・壼・蟯舌・繝・・縺ｮ繧ｳ繝ｳ繝・リ game.js縺ｧ逕滓・ */
    align-items: center;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 40px 20px;
    scroll-behavior: smooth;
}

/* Branching Map Container within #node-map */
.layers-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    /* 蛻・ｲ舌・繝・・繝ｬ繧､繝､繝ｼ繧ｳ繝ｳ繝・リ */
    width: 100%;
    z-index: 1;
    /* SVG驛｢・ｧ陋ｹ・ｻ繝ｻ鬘伜初繝ｻ・ｽ */
}

/* 蜷・Ξ繧､繝､繝ｼ縺ｮ陦・*/
.map-layer-row {
    display: flex;
    justify-content: center;
    /* 荳ｭ螟ｮ謠・∴ */
    align-items: center;
    width: 100%;
    position: relative;
    height: 60px;
    /* 鬮倥＆蝗ｺ螳・*/
}

.map-node {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: var(--bg-panel);
    border: 2px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: absolute;
    /* absolute驟咲ｽｮ縺ｮ繝弱・繝峨・蝓ｺ貅紋ｽ咲ｽｮ縲Ｈame.js縺ｮ險育ｮ励Ο繧ｸ繝・け縺ｧ縺ｯ div 閾ｪ菴薙・驟咲ｽｮ蠎ｧ讓吶ｒ謖・ｮ壹☆繧九′縲√％縺薙〒縺ｯ flexbox 縺ｧ謨ｴ蛻励＆縺帙ｋ縺溘ａ position: relative 縺ｨ縺励※縺・ｋ */
    /* game.js縺ｧ縺ｮ險育ｮ励Ο繧ｸ繝・け縺ｧ縺ｯ div 閾ｪ菴薙・驟咲ｽｮ蠎ｧ讓吶ｒ謖・ｮ壹☆繧九′縲√％縺薙〒縺ｯ flexbox 縺ｧ謨ｴ蛻励＆縺帙ｋ縺溘ａ position: relative 縺ｨ縺励※縺・ｋ */
    position: relative;
    margin: 0 15px;
    /* 繝弱・繝蛾俣縺ｮ蟾ｦ蜿ｳ繝槭・繧ｸ繝ｳ */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* 繝弱・繝峨ち繧､繝怜挨繧ｹ繧ｿ繧､繝ｫ */
.node-type-battle {
    background: radial-gradient(circle, #333, #111);
    border-color: #666;
}

.node-type-elite {
    background: radial-gradient(circle, #5a1a1a, #2a0a0a);
    border-color: #ff4444;
}

.node-type-rest {
    background: radial-gradient(circle, #5a4a1a, #2a1a0a);
    border-color: #ffaa44;
}

.node-type-event {
    background: radial-gradient(circle, #1a3a5a, #0a1a2a);
    border-color: #44aaff;
}

.node-type-treasure {
    background: radial-gradient(circle, #5a5a1a, #2a2a0a);
    border-color: #ffff44;
}

.node-type-shop {
    background: radial-gradient(circle, #4a4a2a, #2a2a0a);
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.node-type-boss {
    width: 80px !important;
    height: 80px !important;
    font-size: 40px !important;
    background: radial-gradient(circle, #4a0a4a, #2a0a2a);
    border-color: #ff44ff;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.4);
}

/* 騾ｲ陦悟庄閭ｽ繝弱・繝峨せ繧ｿ繧､繝ｫ */
.map-node.available {
    border-color: #ffd700;
    cursor: pointer;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    animation: pulseGold 1.5s infinite;
}

.map-node.available:hover {
    transform: scale(1.2);
}

.map-node.completed {
    filter: grayscale(100%);
    opacity: 0.6;
    border-style: dashed;
}

.map-node.locked {
    opacity: 0.4;
    filter: brightness(0.7);
}

@keyframes pulseGold {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

#party-status-bar {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    /* Vertical layout */
    gap: 8px;
    border-top: 1px solid var(--glass-border);
    position: relative;
}

.controls-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    /* Align items vertically */
    width: 100%;
}

#gold-display {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: auto;
    /* Push to left */
    font-weight: 700;
    color: var(--warning);
    font-size: 16px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(245, 175, 25, 0.3);
    white-space: nowrap;
}

#gold-display .gold-icon {
    font-size: 14px;
}

#gold-display .gold-amount {
    font-family: 'Outfit', sans-serif;
}

.members-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

/* 繧ｳ繝ｳ繝医Ο繝ｼ繝ｫ繝懊ち繝ｳ蜈ｱ騾壹せ繧ｿ繧､繝ｫ */
.control-btn {
    color: #fff;
    padding: 6px 8px;
    /* 繝代ョ繧｣繝ｳ繧ｰ繧堤ｸｮ蟆・*/
    border-radius: 8px;
    font-size: 11px;
    /* 繝輔か繝ｳ繝医し繧､繧ｺ繧貞ｰ代＠邵ｮ蟆・*/
    cursor: pointer;
    transition: 0.2s;
    min-width: 48px;
    /* 譛蟆丞ｹ・ｒ邵ｮ蟆・*/
    margin-left: 6px;
    /* 繝槭・繧ｸ繝ｳ繧堤ｸｮ蟆・*/
    white-space: nowrap;
    /* 謾ｹ陦檎ｦ∵ｭ｢ */
    flex-shrink: 0;
}

#home-btn {
    background: rgba(78, 205, 196, 0.2);
    border: 1px solid var(--success);
}

#home-btn:hover {
    background: rgba(78, 205, 196, 0.4);
}

#skill-btn {
    background: rgba(167, 139, 250, 0.2);
    border: 1px solid #a78bfa;
}

#skill-btn:hover {
    background: rgba(167, 139, 250, 0.4);
}

#item-btn {
    background: rgba(79, 172, 254, 0.2);
    border: 1px solid var(--primary);
}

#item-btn:hover {
    background: rgba(79, 172, 254, 0.4);
}


/* 謇謖・≡陦ｨ遉ｺ */
#gold-display {
    display: flex;
    align-items: center;
    gap: 2px;
    background: linear-gradient(135deg, rgba(245, 175, 25, 0.15) 0%, rgba(241, 39, 17, 0.1) 100%);
    border: 1px solid rgba(245, 175, 25, 0.4);
    border-radius: 8px;
    padding: 6px 12px;
    margin-right: auto;
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

#gold-display .gold-icon {
    color: var(--warning);
    font-size: 16px;
}

#gold-display .gold-amount {
    color: #fff;
    min-width: 40px;
}

.party-member-status {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: 0.2s;
}

.party-member-status:hover {
    background: rgba(255, 255, 255, 0.05);
}

.party-member-status img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    background: #222;
}

.party-member-status .hp-mp-text {
    font-size: 10px;
    color: var(--text-sub);
}

.party-member-status .name {
    font-size: 11px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Battle Screen */
#battle-screen {
    padding: 12px 16px 0 16px;
    /* 荳翫・遨ｺ逋ｽ繧貞ｰ代＠隧ｰ繧√∽ｸ九・繧ｳ繝槭Φ繝峨お繝ｪ繧｢縺ｫ莉ｻ縺帙ｋ */
    gap: 8px;
    /* 隕∫ｴ髢薙・髫咎俣繧貞ｰ代＠隧ｰ繧√ｋ */
    background-image: url('img/bg/bg_battle.png');
}

#battle-log {
    height: 56px;
    /* 3陦悟・縺ｫ蝗ｺ螳・*/
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 4px 8px;
    overflow-y: auto;
    font-size: 11px;
    /* 譁・ｭ励ｒ蟆代＠蟆上＆縺上＠縺ｦ3陦悟・蜈･繧翫ｄ縺吶￥縺吶ｋ */
    margin-bottom: 4px;
    scrollbar-width: thin;
    flex-shrink: 0;
    /* 繝ｭ繧ｰ縺梧ｽｰ縺輔ｌ縺ｪ縺・ｈ縺・↓菫晁ｭｷ */
}

#enemy-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    min-height: 130px;
}

/* VS Divider */
.vs-divider {
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 4px 0;
}

.vs-divider::before,
.vs-divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.vs-divider span {
    padding: 0 16px;
    font-size: 16px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    letter-spacing: 0.2em;
}

#ally-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    min-height: 115px;
}

.battle-unit {
    position: relative;
    transition: transform 0.2s;
    width: 100px;
    /* Wider for name */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;

    /* Card-like styling */
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Enemy/Ally Distinction */
.battle-unit[data-enemy-index] {
    background: linear-gradient(145deg, rgba(80, 20, 20, 0.7), rgba(40, 10, 10, 0.7));
    border-color: #ff6b6b;
}

.battle-unit[data-ally-index] {
    background: linear-gradient(145deg, rgba(20, 40, 80, 0.7), rgba(10, 20, 40, 0.7));
    border-color: #4facfe;
}

.battle-unit img {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);

    /* Rich Frame for Image */
    border: 2px solid #aaa;
}

/* エリート敵の画像背景（金色系） */
.battle-unit[data-rank="elite"] img {
    border: 3px solid #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, #4a3800, #3d2e00);
}

/* ボス敵の画像背景（紫系） */
.battle-unit[data-rank="boss"] img,
.battle-unit[data-rank="last_boss"] img {
    border: 3px solid #a855f7;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.7);
    background: linear-gradient(135deg, #3b0764, #2e1065);
}

.unit-name {
    font-size: 10px;
    /* Smaller text */
    margin-top: 4px;
    white-space: nowrap;
    /* Prevent wrapping if possible, or allow it but with smaller font */
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 2px #000;
}

.battle-unit.selected img {
    border-color: var(--warning);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(245, 175, 25, 0.3);
}

.battle-unit.target img {
    border-color: var(--danger);
    animation: shake 0.4s;
}

@keyframes shake {

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

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

.battle-unit.dead {
    opacity: 0.5;
    filter: grayscale(1);
    transform: scale(0.9);
}

/* Battle Effects */
.battle-impact-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    pointer-events: none;
    z-index: 100;
    animation: impactPulse 0.3s ease-out;
}

.battle-impact-effect img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes impactPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0;
    }
}

/* Flash Effects */
.flash-white {
    animation: flashWhite 0.3s ease-out;
}

.flash-yellow {
    animation: flashYellow 0.3s ease-out;
}

.flash-blue {
    animation: flashBlue 0.3s ease-out;
}

.flash-red {
    animation: flashRed 0.3s ease-out;
}

.flash-purple {
    animation: flashPurple 0.3s ease-out;
}

.flash-green {
    animation: flashGreen 0.3s ease-out;
}

.flash-gold {
    animation: flashGold 0.3s ease-out;
}

@keyframes flashWhite {

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

    50% {
        filter: brightness(3) drop-shadow(0 0 10px #fff);
    }
}

@keyframes flashYellow {

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

    50% {
        filter: brightness(2.5) drop-shadow(0 0 15px #ffd700);
    }
}

@keyframes flashBlue {

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

    50% {
        filter: brightness(2.5) drop-shadow(0 0 15px #4facfe);
    }
}

@keyframes flashRed {

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

    50% {
        filter: brightness(2.5) drop-shadow(0 0 15px #ff6b6b);
    }
}

@keyframes flashPurple {

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

    50% {
        filter: brightness(2.5) drop-shadow(0 0 15px #a29bfe);
    }
}

@keyframes flashGreen {

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

    50% {
        filter: brightness(2.5) drop-shadow(0 0 15px #4ecdc4);
    }
}

@keyframes flashGold {

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

    50% {
        filter: brightness(2.5) drop-shadow(0 0 20px #ffd700);
    }
}

/* Buff/Debuff Effect Icons */
.effect-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: 900;
    pointer-events: none;
    z-index: 100;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.effect-icon.buff-up {
    color: #ff6b6b;
    animation: buffUp 0.6s ease-out;
}

.effect-icon.debuff-down {
    color: #4facfe;
    animation: debuffDown 0.6s ease-out;
}

.effect-icon.heal {
    color: #4ecdc4;
    animation: healPulse 0.6s ease-out;
}

.effect-icon.revive {
    color: #ffd700;
    animation: reviveSpin 0.8s ease-out;
}

.effect-icon.shield {
    color: #c0c0c0;
    animation: shieldFade 0.5s ease-out;
}

.effect-icon.status {
    animation: statusBlink 0.6s ease-out;
}

@keyframes buffUp {
    0% {
        transform: translate(-50%, 20%);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -80%);
        opacity: 0;
    }
}

@keyframes debuffDown {
    0% {
        transform: translate(-50%, -80%);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 20%);
        opacity: 0;
    }
}

@keyframes healPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

@keyframes reviveSpin {
    0% {
        transform: translate(-50%, -50%) scale(0.5) rotate(0deg);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5) rotate(360deg);
        opacity: 0;
    }
}

@keyframes shieldFade {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

@keyframes statusBlink {

    0%,
    100% {
        opacity: 0;
    }

    25%,
    75% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Critical Effect */
.critical-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 64px;
    font-weight: 900;
    color: #ffd700;
    text-shadow:
        0 0 10px #000,
        0 0 20px #ffd700,
        0 0 30px #ffd700;
    pointer-events: none;
    z-index: 200;
    animation: criticalPop 0.6s ease-out;
}

@keyframes criticalPop {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    30% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Screen Flash for Critical */
.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 150;
    animation: screenFlash 0.4s ease-out;
}

.screen-flash.flash-critical {
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
}

@keyframes screenFlash {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

/* Bars */
.unit-hp-bar,
.unit-mp-bar,
.hp-bar,
.mp-bar {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.unit-hp-bar {
    height: 14px;
    /* Increased from 6px */
    margin-top: 6px;
    position: relative;
}

.unit-mp-bar {
    height: 12px;
    /* Increased from 4px */
    margin-top: 3px;
    position: relative;
}

.bar-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    line-height: 1;
    z-index: 2;
}

.hp-bar {
    height: 6px;
    margin: 3px 0;
}

.mp-bar {
    height: 4px;
}

.fill {
    height: 100%;
    transition: width 1.0s cubic-bezier(0.22, 1, 0.36, 1);
    /* 1遘偵°縺代※貊代ｉ縺九↓貂帛ｰ・*/
}

/* 迥ｶ諷狗焚蟶ｸ繝舌ャ繧ｸ縺ｮ驟崎牡險ｭ螳・*/
.status-ailment.poison {
    background: #a333c8;
    color: #fff;
}

.status-ailment.paralysis,
.status-ailment.stun {
    background: #fbbd08;
    color: #000;
}

.status-ailment.silence {
    background: #1b1c1d;
    color: #fff;
}

.status-ailment.burn {
    background: #db2828;
    color: #fff;
}

.status-ailment.taunt {
    background: #f5af19;
    color: #000;
}

.status-ailment.defending {
    background: #2185d0;
    color: #fff;
}

.status-ailment.regen {
    background: #21ba45;
    color: #fff;
}


.status-ailment.damageReduction {
    background: #2c3e50;
    color: #fff;
}

.status-ailment.curse {
    background: #800020;
    /* ワインレッド */
    color: #fff;
}

/* 髦ｲ蠕｡・壽ｴ礼ｷｴ縺輔ｌ縺溘す繝ｼ繝ｫ繝峨お繝輔ぉ繧ｯ繝・*/
.shield-aura {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 4px solid #4facfe;
    border-radius: 50%;
    background: rgba(79, 172, 254, 0.2);
    box-shadow: 0 0 20px #4facfe, inset 0 0 20px #4facfe;
    pointer-events: none;
    z-index: 100;
    animation: shield-expand-fade 0.8s ease-out forwards;
}

@keyframes shield-expand-fade {
    0% {
        transform: translate(-50%, -50%) scale(0.6);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0;
    }
}

/* 繝繝｡繝ｼ繧ｸ繝昴ャ繝励い繝・・縺ｮ繝舌ロ謖吝虚 */
.damage-popup {
    position: absolute;
    font-weight: 900;
    font-size: 28px;
    color: #ff6b6b;
    text-shadow: 0 2px 4px #000;
    animation: spring-up 1.0s forwards;
    z-index: 200;
}

.damage-popup.critical {
    color: #ffd700;
    font-size: 36px;
    text-shadow: 0 0 10px #ff0000, 0 2px 4px #000;
}

@keyframes spring-up {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }

    20% {
        transform: translateY(-30px) scale(1.2);
        opacity: 1;
    }

    40% {
        transform: translateY(-25px) scale(0.9);
    }

    60% {
        transform: translateY(-28px) scale(1.0);
    }

    100% {
        transform: translateY(-60px);
        opacity: 0;
    }
}

.unit-hp-bar .fill,
.hp-bar .fill {
    background: var(--secondary-gradient);
}

.unit-mp-bar .fill,
.mp-bar .fill {
    background: var(--primary-gradient);
}

/* 繝舌ヵ/繝・ヰ繝戊｡ｨ遉ｺ・医が繝ｼ繝舌・繝ｬ繧､・会ｼ壼屓驕ｿ蛻､螳壼､ｱ謨玲凾縺ｪ縺ｩ縺ｫ菴ｿ逕ｨ */
.buff-overlay {
    position: absolute;
    top: 4px;
    left: 4px;
    display: flex;
    flex-direction: column;
    gap: 0px;
    z-index: 10;
    pointer-events: none;
}

.buff-item,
.debuff-item {
    font-size: 8px;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

.buff-item {
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.5);
}

.debuff-item {
    color: #4facfe;
    border: 1px solid rgba(79, 172, 254, 0.5);
}

/* 迥ｶ諷狗焚蟶ｸ繧｢繧､繧ｳ繝ｳ陦ｨ遉ｺ繧ｨ繝ｪ繧｢・域立螳溯｣・ｺ呈鋤・・*/
.status-ailments {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-top: 4px;
    height: 20px;
}

.status-ailment {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(245, 175, 25, 0.9);
    color: #000;
}

/* Command Area */
#command-area {
    background: rgba(20, 20, 30, 0.9);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    border-radius: 20px 20px 0 0;
    padding: 8px 16px max(12px, env(safe-area-inset-bottom));
    /* 荳贋ｸ倶ｽ咏區繧堤｢ｺ菫昴＠縺､縺､繧ｻ繝ｼ繝輔お繝ｪ繧｢繧堤｢ｺ菫・*/
    margin: 0 -16px 0 -16px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
    flex-shrink: 0;
}

#character-commands {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    /* 髢馴囈繧堤ｭ牙・縺ｫ */
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    /* 邵ｦ繝代ョ繧｣繝ｳ繧ｰ繧堤｢ｺ菫・*/
    border-radius: 12px;
}

.char-command-slot {
    font-size: 11px;
    flex: 1;
    text-align: center;
    padding: 6px;
    border-radius: 8px;
    opacity: 0.5;
    transition: 0.3s;
}

.char-command-slot.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
    font-weight: 700;
}

#action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, auto);
    gap: 8px;
}

.action-btn {
    background: linear-gradient(145deg, rgba(50, 60, 80, 0.9), rgba(30, 35, 45, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 12px;
    /* 邵ｦ繧貞､ｧ蟷・↓邏ｰ縺上∵ｨｪ縺ｯ菴呵｣輔ｒ謖√◆縺帙ｋ */
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    /* 譁・ｭ励し繧､繧ｺ繧堤ｶｭ謖・*/
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.action-btn:hover {
    background: linear-gradient(145deg, rgba(70, 80, 100, 0.9), rgba(40, 45, 55, 0.9));
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.3);
    transform: translateY(-2px);
}

.action-btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(100%);
    box-shadow: none;
    pointer-events: none;
}


/* Turn Execution Controls */
#execute-turn-btn {
    background: linear-gradient(135deg, #FF512F 0%, #DD2476 100%);
    color: #fff;
    font-weight: bold;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    visibility: hidden;
    /* 莠育ｴ・せ繝壹・繧ｹ繧堤｢ｺ菫昴＠縺､縺､髫縺・*/
}

.btn-prominent {
    animation: pulse-glow 1s infinite alternate;
    box-shadow: 0 0 15px rgba(255, 81, 47, 0.8) !important;
    border: 1px solid #fff !important;
    /* Fixed width to prevent layout jump */
    /* transform: scale(1.05); Removed to prevent visual overlap or perceived shift */
}

@keyframes pulse-glow {
    from {
        box-shadow: 0 0 10px rgba(255, 81, 47, 0.6);
    }

    to {
        box-shadow: 0 0 25px rgba(255, 81, 47, 1);
    }
}

.faded-out {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(100%);
    transition: 0.3s;
}

/* Event & Reward Screen Layout Fixes */
#reward-screen,
#rest-screen,
#event-screen,
#treasure-screen,
#gameover-screen,
#clear-screen {
    display: none;
    /* Default hidden */
}

#reward-screen.active,
#rest-screen.active,
#event-screen.active,
#treasure-screen.active,
#gameover-screen.active,
#clear-screen.active {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    /* Center content vertically */
}

/* Modals & Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: #161824;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

#modal-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 20px;
}

#modal-actions button {
    flex: 1;
    min-width: 0;
    padding: 12px 2px !important;
    font-size: 14px !important;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Toast */
#toast-container {
    position: fixed;
    top: 40px;
    /* safe area consideration */
    right: 0;
    left: auto;
    transform: none;
    z-index: 2000;
    width: auto;
    max-width: 400px;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-right: 0;
}

.toast {
    background: rgba(22, 24, 36, 0.90);
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--success);
    /* Default to success/item color or use variable */
    color: #fff;
    padding: 12px 24px;
    margin-bottom: 10px;
    border-radius: 8px 0 0 8px;
    box-shadow: -5px 5px 20px rgba(0, 0, 0, 0.5);
    font-size: 14px;
    font-weight: 700;
    animation: slideInRight 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    position: relative;
    margin-right: -4px;
    /* Hide right border radius part slightly or aligns perfectly */
}

/* Specific styling for item toast if needed, but generic is fine */
.toast.success {
    border-color: var(--success);
}

.toast.info {
    border-color: var(--primary);
}

.toast.hiding {
    animation: slideOutRight 0.3s cubic-bezier(0.5, 0, 0.75, 0) forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(110%);
        opacity: 0;
    }
}

/* Reward & Event Screens */
#reward-screen.active {
    background-image: url('img/bg/bg_battle.png');
    justify-content: flex-start !important;
    padding: 16px 12px 5px 12px !important;
}

/* Rich Header Style */
#reward-character-name {
    width: 100%;
    text-align: center;
    padding: 8px 0;
    margin-top: 5px !important;
    margin-bottom: 5px !important;

    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.85), transparent);
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);

    color: #ffd700;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    position: relative;
    /* Ensure it doesn't shift */
    flex-shrink: 0;
}

#reward-sp-info {
    text-align: center;
    margin-bottom: 8px;
    color: var(--warning);
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 16px;
    border-radius: 12px;
    align-self: center;
    /* Center in flex column */
}

/* Opaque container for party icons */
#reward-party-status {
    background: rgba(20, 20, 25, 0.95);
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 10px;
    min-height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    /* Spck縺ｮ繝舌げ蟇ｾ遲厄ｼ壼享謇九↓謚倥ｊ霑斐＆縺ｪ縺・ｈ縺・宛蠕｡ */
}

/* 蝣ｱ驟ｬ逕ｻ髱｢蜀・・繧ｭ繝｣繝ｩ繧ｫ繝ｼ繝牙ｰら畑縺ｮ螳牙ｮ壼喧險ｭ螳・*/
#reward-party-status .party-member-status {
    flex: 0 0 95px;
    height: auto;
    overflow: visible;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0;
    padding: 4px;
}

#reward-party-status .party-member-status img {
    width: 42px;
    height: 42px;
    margin-bottom: 4px;
}

#reward-options {
    flex: 1;
    overflow-y: auto;
    min-height: auto;
    /* 驕ｸ謚櫁い縺ｮ譛蟆城ｫ倥＆繧堤｢ｺ菫昴＠縲∵焚縺梧ｸ帙▲縺ｦ繧ゆｸ企Κ縺悟虚縺九↑縺・ｈ縺・↓縺吶ｋ */
}

.reward-option,
.event-btn,
.treasure-btn,
.rest-btn {
    background: rgba(30, 30, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    text-align: left;
    margin-bottom: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.reward-option:hover,
.event-btn:hover,
.treasure-btn:hover,
.rest-btn:hover {
    border-color: var(--primary);
    background: rgba(40, 40, 50, 0.95);
    /* transform removed to prevent layout shift/clipping */
}

.reward-title {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.reward-desc,
.skill-desc {
    font-size: 12px;
    color: var(--text-sub);
}

/* Animations & Effects */
.damage-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 900;
    font-size: 32px;
    color: var(--danger);
    text-shadow: 0 2px 4px #000;
    animation: spring-pop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    z-index: 200;
    pointer-events: none;
    white-space: nowrap;
}

.damage-popup.heal {
    color: var(--success);
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

.damage-popup.mp-heal {
    color: #d000ff;
    text-shadow: 0 0 10px rgba(208, 0, 255, 0.5);
}

@keyframes spring-pop {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    40% {
        transform: translate(-50%, -100%) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -150%) scale(1.0);
        opacity: 0;
    }
}

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

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

/* Selection Panels (Target, Skill, Item) */
#target-selection,
#skill-selection,
#item-selection {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #11121d;
    padding: 20px;
    padding-bottom: 80px;
    z-index: 100;
    animation: fadeIn 0.2s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    -webkit-overflow-scrolling: touch;
}

/* Horizontal Target Selection Overrides */
#target-selection {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 8px;
}

/* 蟇ｾ雎｡驕ｸ謚樒判髱｢: 繧ｭ繝｣繝ｩ繧ｫ繝ｼ繝峨→謌ｻ繧九・繧ｿ繝ｳ縺ｮ髫咎俣繧定ｩｰ繧√ｋ */
#target-selection .btn-cancel {
    margin-top: 2px;
}

/* 繧ｹ繧ｭ繝ｫ驕ｸ謚樒判髱｢: 繧ｿ繧､繝医Ν繧剃ｸ翫↓蟇・○縲・囮髢薙ｒ隧ｰ繧√ｋ */
#skill-selection {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 8px;
}

#skill-selection .skill-btn {
    margin-bottom: 4px;
}

#skill-selection .btn-cancel {
    margin-top: 2px;
}

.target-container {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
    flex-shrink: 0;
}

.target-btn {
    width: 100px;
    /* Fixed width for cards */
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--glass-border);
    padding: 8px;
    margin-bottom: 0;
    /* Margin handled by gap */
    border-radius: 8px;
    color: #fff;
    text-align: center;
    /* Center text */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: 0.2s;
}

.target-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.3);
}

.target-btn img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #aaa;
}

.target-btn span {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px #000;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-btn,
.item-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 14px;
    margin-bottom: 10px;
    border-radius: 12px;
    color: #fff;
    text-align: left;
    cursor: pointer;
}

.target-btn:active,
.skill-btn:active,
.item-btn:active {
    background: rgba(79, 172, 254, 0.2);
}

.btn-cancel {
    background: transparent;
    border: 1px solid #555;
    color: #fff;
    padding: 12px;
    width: 100%;
    border-radius: 12px;
    margin-top: 10px;
}

/* 繧ｹ繧ｭ繝ｫ隧ｳ邏ｰ繝ｻ繝懊ち繝ｳ縺ｮ繝ｬ繧､繧｢繧ｦ繝郁ｪｿ謨ｴ */
.skill-btn {
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* 蜷咲ｧｰ縺ｨ隱ｬ譏弱・髢薙・髫咎俣繧定ｩｰ繧√ｋ */
    padding: 6px 12px;
    /* 繧ｹ繧ｭ繝ｫ繝懊ち繝ｳ繧らｸｦ繧貞､ｧ蟷・↓蝨ｧ邵ｮ */
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2px;
}

.skill-name {
    font-weight: 700;
    font-size: 13px;
    /* 繧上★縺九↓蟆上＆縺上＠縺ｦ荳陦後・蜿弱∪繧翫ｒ濶ｯ縺上☆繧・*/
    color: #fff;
}

.skill-cost {
    font-size: 12px;
    color: var(--primary);
    font-weight: 700;
    background: rgba(79, 172, 254, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.skill-body {
    width: 100%;
    text-align: left;
}

.skill-desc {
    font-size: 11px;
    color: var(--text-sub);
    white-space: normal;
    line-height: 1.4;
    display: block;
}

/* Character Detail Modal */
.character-detail {
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-sub);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.close-btn:hover {
    color: var(--text-main);
}

.detail-content {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.detail-image {
    flex-shrink: 0;
}

.detail-image img {
    width: 120px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--glass-border);
}

.detail-stats {
    flex: 1;
    font-size: 13px;
}

.detail-type {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-sub);
}

.stat-value {
    font-weight: 700;
}

.stat-change {
    color: var(--success);
}

.stat-change.down {
    color: var(--danger);
}

.detail-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}

.detail-section h4 {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 8px;
}

.skill-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
}

.skill-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.skill-item-name {
    font-weight: 700;
    font-size: 13px;
}

.skill-item-cost {
    font-size: 11px;
    color: var(--primary);
}

.skill-item-desc {
    font-size: 11px;
    color: var(--text-sub);
    line-height: 1.4;
}

.status-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.status-tag {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.5);
}

.status-tag.buff {
    color: var(--success);
    border: 1px solid var(--success);
}

.status-tag.debuff {
    color: var(--danger);
    border: 1px solid var(--danger);
}

.status-tag.ailment {
    color: var(--warning);
    border: 1px solid var(--warning);
}

/* Item Modal */
.item-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.item-entry:hover {
    background: rgba(79, 172, 254, 0.1);
    border-color: var(--primary);
}

.item-entry.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.item-entry.disabled:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 700;
    margin-bottom: 2px;
}

.item-desc {
    font-size: 11px;
    color: var(--text-sub);
}

.item-count {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

/* Event Screen Styles */
#event-screen {
    background-image: url('img/bg/bg_map.png');
    /* 閭梧勹逕ｻ蜒・*/
    background-size: cover;
    background-position: center;
    padding: 24px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    /* 繧ｳ繝ｳ繝・Φ繝・′髟ｷ縺・ｴ蜷医・繧ｹ繧ｯ繝ｭ繝ｼ繝ｫ */
}

#event-screen.active {
    display: flex;
}

/* Rest Screen Styles */
#rest-screen {
    background-image: url('img/bg/bg_map.png');
    background-size: cover;
    background-position: center;
    padding: 24px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#rest-screen.active {
    display: flex;
}

#rest-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
    width: 100%;
}

.rest-btn {
    padding: 20px;
    background: linear-gradient(145deg, rgba(80, 40, 40, 0.9), rgba(45, 25, 25, 0.9));
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #fff;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.rest-btn:hover {
    background: linear-gradient(145deg, rgba(100, 50, 50, 0.9), rgba(55, 30, 30, 0.9));
    border-color: var(--danger);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 107, 107, 0.2);
}

.event-content {
    background: rgba(11, 12, 18, 0.85);
    /* 隱ｭ縺ｿ繧・☆縺・ｈ縺・↓蜊企乗・縺ｮ閭梧勹 */
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

#event-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* 繝懊ち繝ｳ髢馴囈 */
    margin-top: 24px;
    width: 100%;
}

.event-btn {
    padding: 16px;
    text-align: left;
    line-height: 1.5;
    background: linear-gradient(145deg, rgba(50, 60, 80, 0.9), rgba(30, 35, 45, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.event-btn:hover {
    background: linear-gradient(145deg, rgba(70, 80, 100, 0.9), rgba(40, 45, 55, 0.9));
    border-color: var(--primary);
    transform: translateX(2px);
    box-shadow: 0 4px 8px rgba(79, 172, 254, 0.2);
}

/* Party Status Bar (Map & Rest) */
.party-status-bar,
#party-status-bar,
#rest-party-status {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    /* in case of many members on small screens */
}

/* Old wrapper - keep just in case but container flex handles layout */
.members-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.party-member-status {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    min-width: 85px;
    max-width: 110px;
    cursor: pointer;
}

.party-member-status img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 8px;
    border: 2px solid #fff;
}

.hp-mp-text {
    font-size: 10px;
    color: #eee;
    margin: 2px 0;
    width: 100%;
    text-align: left;
    white-space: nowrap;
    font-weight: 700;
}

/* 繧｢繧ｯ繝・ぅ繝悶Θ繝九ャ繝医・轤ｹ貊・｡ｨ遉ｺ */
.battle-unit.active-unit {
    border-color: var(--warning) !important;
    animation: unit-blink 1.5s infinite alternate ease-in-out;
    box-shadow: 0 0 15px rgba(245, 175, 25, 0.5);
}

@keyframes unit-blink {
    from {
        border-color: var(--primary);
    }

    to {
        border-color: var(--warning);
    }
}

/* 繝懊ち繝ｳ縺ｮ陦ｨ遉ｺ蛻ｶ蠕｡ */
#execute-turn-btn.visible {
    visibility: visible !important;
}

.char-command-slot svg {
    display: block;
    margin: 0 auto;
}

/* === 豎守畑繝舌ヨ繝ｫ繧ｨ繝輔ぉ繧ｯ繝・=== */

.vfx-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    pointer-events: none;
    z-index: 150;
    display: flex;
    justify-content: center;
    align-items: center;
    mix-blend-mode: plus-lighter;
    /* 蜷域・繝｢繝ｼ繝峨〒蜈峨ｒ蠑ｷ隱ｿ */
}

.vfx-container-fullscreen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 陦悟虚荳ｭ縺ｮ繝ｦ繝九ャ繝医・蠑ｷ隱ｿ繧｢繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ */
.battle-unit.acting {
    border-color: #ffd700 !important;
    box-shadow: 0 0 15px #ffd700, inset 0 0 10px #ffd700 !important;
    animation: acting-pulse 1s infinite alternate ease-in-out;
    z-index: 50;
}

@keyframes acting-pulse {
    from {
        filter: brightness(1) drop-shadow(0 0 5px #ffd700);
    }

    to {
        filter: brightness(1.3) drop-shadow(0 0 15px #ffd700);
    }
}

/* 繝繝｡繝ｼ繧ｸ繝昴ャ繝励い繝・・縺ｮ繝励Ο迚医い繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ */
.damage-popup {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 900;
    font-size: 38px;
    color: #ff4757;
    text-shadow: 2px 2px 0 #000, 0 0 10px rgba(255, 71, 87, 0.5);
    animation: pro-spring-pop 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    z-index: 200;
    pointer-events: none;
}

@keyframes pro-spring-pop {
    0% {
        transform: translate(-50%, 0) scale(0.3);
        opacity: 0;
    }

    20% {
        transform: translate(-50%, -40px) scale(1.3);
        opacity: 1;
    }

    40% {
        transform: translate(-50%, -35px) scale(0.9);
    }

    60% {
        transform: translate(-50%, -38px) scale(1.0);
    }

    100% {
        transform: translate(-50%, -80px);
        opacity: 0;
    }
}

/* 驪ｭ縺・脈謦・お繝輔ぉ繧ｯ繝・*/
.vfx-slash-pro {
    position: absolute;
    width: 150%;
    height: 8px;
    background: linear-gradient(90deg, transparent 0%, #fff 50%, transparent 100%);
    filter: blur(1px) drop-shadow(0 0 10px #ff6b6b);
    transform: rotate(var(--r)) scaleX(0);
    animation: slash-pro-anim 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes slash-pro-anim {
    0% {
        transform: rotate(var(--r)) scaleX(0) skewX(45deg);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: rotate(var(--r)) scaleX(1.2) skewX(45deg);
        opacity: 0;
    }
}

/* 鬲疲ｳ暮劵SVG縺ｮ蜃ｺ迴ｾ繧｢繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ */
.vfx-magic-circle-pro {
    position: absolute;
    width: 140px;
    height: 140px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='45' fill='none' stroke='%234facfe' stroke-width='1' stroke-dasharray='5 2'/%3E%3Ccircle cx='50' cy='50' r='38' fill='none' stroke='%234facfe' stroke-width='2'/%3E%3Cpath d='M50 5 L55 45 L95 50 L55 55 L50 95 L45 55 L5 50 L45 45 Z' fill='%234facfe' opacity='0.3'/%3E%3C/svg%3E") center/contain no-repeat;
    animation: magic-circle-anim 0.7s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes magic-circle-anim {
    0% {
        transform: scale(0.2) rotate(-180deg);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: scale(1.3) rotate(0deg);
        opacity: 0;
    }
}

/* 繧ｹ繧ｭ繝ｫ縲悟ｲｩ遏ｳ關ｽ縺ｨ縺励阪・繧医≧縺ｪ蟯ｩ縺ｮ遯√″荳翫￡ */
.vfx-rock-pro {
    position: absolute;
    bottom: 20px;
    width: 40px;
    height: 100px;
    background: #8b5e3c;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    /* 荳芽ｧ貞ｽ｢縺ｯ荳句髄縺・*/
    filter: brightness(var(--b)) drop-shadow(0 0 5px #000);
    transform: translateX(var(--x)) scaleY(0);
    animation: rock-pro-anim 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: var(--d);
}

@keyframes rock-pro-anim {
    0% {
        transform: translateX(var(--x)) scaleY(0);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translateX(var(--x)) scaleY(1.4);
        opacity: 0;
    }
}

/* 逕ｻ髱｢蜿崎ｻ｢繧ｨ繝輔ぉ繧ｯ繝・*/
.void-invert {
    animation: void-flash 0.8s ease-in-out;
}

@keyframes void-flash {
    0% {
        filter: invert(0);
    }

    50% {
        filter: invert(1) hue-rotate(180deg);
    }

    100% {
        filter: invert(0);
    }
}

/* === 繧ｭ繝｣繝ｩ蝗ｺ譛画橿繧ｨ繝輔ぉ繧ｯ繝・=== */

/* 豐ｻ逋偵せ繧ｭ繝ｫ縲後せ繧ｿ繝ｼ繝繧ｹ繝医搾ｼ壽弌螻代・霈昴″・亥ｼｷ蛹也沿・・*/
.vfx-stardust {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(160, 216, 239, 0.4) 0%, transparent 70%);
    box-shadow: 0 0 30px rgba(79, 172, 254, 0.3);
    /* 繧｢繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ譎る俣繧・.2s縺ｫ髟ｷ縺上＠縲∝・縺後ｆ縺｣縺上ｊ蠎・′繧九ｈ縺・↓隱ｿ謨ｴ */
    animation: stardust-spin 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 謨｣繧峨・繧区弌縺ｮ邊貞ｭ・*/
.vfx-star-particle {
    position: absolute;
    font-size: 30px;
    color: #a0d8ef;
    text-shadow: 0 0 15px #4facfe, 0 0 30px #fff;
    opacity: 0;
    pointer-events: none;
    /* 蜈峨ｒ謾ｾ縺｡縺ｪ縺後ｉ闊槭＞荳翫′繧九い繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ */
    animation: star-particle-anim 1.3s ease-out forwards;
    animation-delay: var(--delay);
}

@keyframes star-particle-anim {
    0% {
        transform: rotate(var(--angle)) translateY(0) scale(0.3) rotate(0deg);
        opacity: 0;
    }

    20% {
        opacity: 1;
        transform: rotate(var(--angle)) translateY(-30px) scale(1.1) rotate(45deg);
    }

    100% {
        transform: rotate(var(--angle)) translateY(-90px) scale(0.6) rotate(360deg);
        opacity: 0;
    }
}

@keyframes stardust-spin {
    0% {
        transform: scale(0.3) rotate(0deg);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: scale(2.5) rotate(180deg);
        opacity: 0;
    }
}

@keyframes stardust-orbit {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

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

/* 繧ｹ繧ｭ繝ｫ縲後せ繧ｫ繧､繝舌・繧ｹ繝医搾ｼ壼・縺ｮ譟ｱ縺ｨ繧ｹ繧ｿ繝ｼ繝舌・繧ｹ繝茨ｼ亥ｼｷ蛹也沿・・*/
.vfx-sky-burst {
    position: absolute;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #fff 0%, #4facfe 30%, transparent 70%);
    border-radius: 50%;
    mix-blend-mode: screen;
    /* 1.0s縺九￠縺ｦ繧・▲縺上ｊ縺ｨ蠎・′繧・*/
    animation: sky-burst-anim 1.0s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.vfx-sky-cross {
    position: absolute;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.vfx-sky-cross::before,
.vfx-sky-cross::after {
    content: '';
    position: absolute;
    background: #fff;
    box-shadow: 0 0 30px #00f2fe, 0 0 60px #fff;
    animation: sky-cross-anim 1.0s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.vfx-sky-cross::before {
    width: 100%;
    height: 2px;
}

/* 讓ｪ邱・*/
.vfx-sky-cross::after {
    width: 2px;
    height: 100%;
}

/* 邵ｦ邱・*/

@keyframes sky-burst-anim {
    0% {
        transform: scale(0);
        opacity: 0;
        filter: brightness(5);
    }

    10% {
        transform: scale(0.8);
        opacity: 1;
    }

    /* 譛蛻昴・荳迸ｬ */
    25% {
        transform: scale(0.7);
        filter: brightness(3);
    }

    /* 繧ｨ繝輔ぉ繧ｯ繝医・蜿守ｸｮ繝ｻ蠎・′繧・*/
    50% {
        transform: scale(3.5);
        opacity: 1;
        filter: brightness(2);
    }

    /* 譛螟ｧ諡｡螟ｧ */
    100% {
        transform: scale(4.5);
        opacity: 0;
        filter: brightness(1);
    }

    /* 豸域ｻ・*/
}

@keyframes sky-cross-anim {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    15% {
        opacity: 1;
        transform: scale(1.8);
    }

    /* 迸ｬ譎ゅ↓諡｡螟ｧ */
    45% {
        transform: scale(1.6);
        opacity: 0.8;
    }

    /* 荳ｭ髢薙〒縺ｮ蜿守ｸｮ */
    100% {
        transform: scale(2.2);
        opacity: 0;
    }

    /* 繧・▲縺上ｊ縺ｨ豸医∴繧・*/
}

/* 逕ｻ髱｢謠ｺ繧後お繝輔ぉ繧ｯ繝・*/
.screen-shake {
    animation: shake-anim 0.3s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake-anim {

    10%,
    90% {
        transform: translate3d(-2px, -1px, 0);
    }

    20%,
    80% {
        transform: translate3d(4px, 2px, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-6px, -3px, 0);
    }

    40%,
    60% {
        transform: translate3d(6px, 3px, 0);
    }
}

/* 雜・ｫ倬滄｣謦・畑縺ｮ邏ｰ縺九＞謠ｺ繧・*/
.screen-shake-rapid {
    animation: shake-rapid-anim 0.15s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake-rapid-anim {

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

    25% {
        transform: translate3d(-3px, 2px, 0);
    }

    50% {
        transform: translate3d(3px, -2px, 0);
    }

    75% {
        transform: translate3d(-2px, -2px, 0);
    }
}

/* 繧ｹ繧ｿ繝ｼ繝励Λ繝√リ・育ｩｺ譚｡謇ｿ螟ｪ驛趣ｼ会ｼ夊ｶ・ｫ倬溘Λ繝・す繝･ */
.vfx-star-platinum-rush {
    position: absolute;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.vfx-punch-trail {
    position: absolute;
    width: 120px;
    height: 80px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 215, 0, 0.8) 20%,
            rgba(255, 255, 255, 0.9) 50%,
            rgba(255, 215, 0, 0.8) 80%,
            transparent 100%);
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 40px rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transform: rotate(var(--angle, 0deg)) translateX(-50px);
    animation: punch-trail-anim 0.1s ease-out forwards;
    animation-delay: var(--delay, 0s);
    opacity: 0;
}

@keyframes punch-trail-anim {
    0% {
        opacity: 0;
        transform: rotate(var(--angle, 0deg)) translateX(-50px) scale(0.3);
    }

    30% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: rotate(var(--angle, 0deg)) translateX(20px) scale(1.5);
    }
}

.vfx-star-platinum-impact {
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(255, 215, 0, 0.6) 30%,
            rgba(255, 165, 0, 0.3) 60%,
            transparent 100%);
    border-radius: 50%;
    animation: star-impact-anim 0.1s ease-out forwards;
    mix-blend-mode: screen;
}

@keyframes star-impact-anim {
    0% {
        transform: scale(0.2);
        opacity: 0;
        filter: brightness(5);
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        filter: brightness(3);
    }

    100% {
        transform: scale(0.8);
        opacity: 0;
        filter: brightness(1);
    }
}

/* 繧ｯ繝ｬ繧､繧ｸ繝ｼ繝ｻD・域擲譁ｹ莉怜勧・会ｼ壹け繝ｪ繧ｹ繧ｿ繝ｫ繝ｻ繝ｪ繝壹い */
.vfx-crazy-diamond {
    position: absolute;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(255, 192, 203, 0.5) 0%, transparent 75%);
    z-index: 100;
}

/* 譛邨ら噪縺ｫSVG縺ｫ繧医ｋDiamond蠖｢迥ｶ繧帝←逕ｨ */
.vfx-crazy-diamond::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2300f2fe' 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'/%3E%3C/svg%3E") center/contain no-repeat;
    width: 130px;
    height: 130px;
    transform: translate(-50%, -50%) scale(0);
    filter: drop-shadow(0 0 15px #00f2fe) brightness(1.2);
    mix-blend-mode: screen;
    /* 遐ｴ迚・′髮・∪繧倶ｸｭ逶､(0.4s)縺九ｉ陦ｨ遉ｺ髢句ｧ九∵怙蠕後・蠑ｾ縺代※豸医∴繧・*/
    animation: crystal-heart-form 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.4s forwards;
}

@keyframes heal-heart-pop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.0);
        opacity: 0;
    }
}

/* 荳崎ｶｳ縺励※縺・◆繧｢繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ螳夂ｾｩ繧定ｿｽ蜉 */
@keyframes heal-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
        filter: brightness(1);
    }

    100% {
        transform: scale(1.1);
        opacity: 1;
        filter: brightness(1.3);
    }
}

/* 蝣募､ｩ鮴埼ｳｳ蜃ｰ邵幢ｼ域ｴ･蟲ｶ蝟・ｭ撰ｼ会ｼ壼ｼｷ蛹也沿 */
.vfx-fallen-bind {
    position: absolute;
    width: 300px;
    height: 300px;
}

.vfx-dark-aura {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(139, 0, 139, 0.4) 0%, transparent 70%);
    animation: dark-pulse 0.4s ease-out forwards;
}

@keyframes dark-pulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.vfx-chain {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 10px;
    background: linear-gradient(90deg, transparent, #9b59b6 20%, #d946ef 50%, #9b59b6 80%, transparent);
    filter: drop-shadow(0 0 15px #9b59b6) drop-shadow(0 0 25px #d946ef);
    transform-origin: center center;
    animation: chain-spiral 0.6s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes chain-spiral {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) scale(0);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    70% {
        transform: translate(-50%, -50%) rotate(var(--angle)) scale(1.1);
        opacity: 1;
    }

    85% {
        transform: translate(-50%, -50%) rotate(var(--angle)) scale(1);
        opacity: 0.7;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) scale(0.7);
        opacity: 0;
    }
}

.vfx-purple-lightning {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.6) 0%, transparent 50%);
    filter: drop-shadow(0 0 20px #a855f7);
    animation: lightning-flash 0.3s 0.9s ease-out forwards;
    opacity: 0;
}

@keyframes lightning-flash {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

/* 縺ｯ縺ｩ縺・□繧難ｼ医Ν繧ｫ繝ｪ繧ｪ・会ｼ壼ｼｷ蛹也沿 */
.vfx-aura-charge-actor {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #fff 0%, #4facfe 40%, #00f2fe 70%, transparent 90%);
    border-radius: 50%;
    filter: drop-shadow(0 0 25px #4facfe) drop-shadow(0 0 40px #00f2fe);
    animation: aura-actor-charge 0.5s ease-out forwards;
}

@keyframes aura-actor-charge {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }

    100% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
}

.vfx-aura-charge-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 3px solid rgba(79, 172, 254, 0.7);
    border-radius: 50%;
    filter: drop-shadow(0 0 15px #4facfe);
    animation: aura-charge-ring-pulse 0.6s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes aura-charge-ring-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.vfx-aura-sphere {
    position: absolute;
    width: 250px;
    height: 250px;
}

.vfx-aura-sphere-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #fff 0%, #4facfe 30%, #00f2fe 60%, transparent 100%);
    border-radius: 50%;
    filter: drop-shadow(0 0 30px #4facfe);
    animation: aura-charge 0.5s ease-out forwards, aura-pulse 0.3s 0.5s ease-in-out infinite;
}

@keyframes aura-charge {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes aura-pulse {

    0%,
    100% {
        filter: brightness(1) drop-shadow(0 0 30px #4facfe);
    }

    50% {
        filter: brightness(1.3) drop-shadow(0 0 40px #00f2fe);
    }
}

.vfx-aura-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 3px solid rgba(79, 172, 254, 0.6);
    border-radius: 50%;
    animation: aura-ring-rotate 0.8s linear infinite, aura-ring-expand 1.3s ease-out forwards;
    animation-delay: var(--delay);
    transform-origin: center;
}

@keyframes aura-ring-rotate {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle));
    }

    100% {
        transform: translate(-50%, -50%) rotate(calc(var(--angle) + 360deg));
    }
}

@keyframes aura-ring-expand {
    0% {
        opacity: 0;
    }

    20% {
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.vfx-aura-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 2px solid rgba(79, 172, 254, 0.4);
    border-radius: 50%;
    animation: aura-ripple-wave 0.6s 0.7s ease-out forwards;
}

@keyframes aura-ripple-wave {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.vfx-aura-impact {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(79, 172, 254, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    filter: drop-shadow(0 0 40px #4facfe);
    animation: aura-impact-burst 0.3s 1s ease-out forwards;
    opacity: 0;
}

@keyframes aura-impact-burst {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* 繧ｹ繧ｫ繝ｼ繝ｬ繝・ヨ繧ｹ繝医・繝・亥━譛ｨ縺帙▽闖懶ｼ会ｼ壼､壼ｱ､辷・匱縺ｨ髢・・ */
.vfx-scarlet-storm {
    position: absolute;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 辷・匱縺ｮ螟壼ｱ､繝ｬ繧､繝､繝ｼ */
.vfx-explosion-layer {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: explosion-burst 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.vfx-explosion-layer.inner {
    width: 100px;
    height: 100px;
    background: #fff;
    box-shadow: 0 0 40px #fff;
    z-index: 3;
    animation-delay: 0.1s;
}

.vfx-explosion-layer.mid {
    width: 200px;
    height: 200px;
    background: #ff8c00;
    box-shadow: 0 0 60px #ff4500;
    z-index: 2;
    animation-delay: 0.05s;
}

.vfx-explosion-layer.outer {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #ff4500, #800000, #000);
    filter: blur(10px);
    z-index: 1;
}

/* 謾ｾ蟆・憾縺ｮ髢・・ */
.vfx-flare {
    position: absolute;
    width: 400px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    transform: rotate(var(--r));
    opacity: 0;
    animation: flare-flash 0.6s ease-out forwards;
    animation-delay: 0.1s;
}

@keyframes explosion-burst {
    0% {
        transform: scale(0.1);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes flare-flash {
    0% {
        transform: rotate(var(--r)) scaleX(0);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: rotate(var(--r)) scaleX(1.5);
        opacity: 0;
    }
}

.vfx-flame:nth-child(1) {
    transform: translate(-50%, -100%) rotate(0deg);
}

.vfx-flame:nth-child(2) {
    transform: translate(-50%, -100%) rotate(72deg);
    animation-delay: 0.05s;
}

.vfx-flame:nth-child(3) {
    transform: translate(-50%, -100%) rotate(144deg);
    animation-delay: 0.1s;
}

.vfx-flame:nth-child(4) {
    transform: translate(-50%, -100%) rotate(216deg);
    animation-delay: 0.15s;
}

.vfx-flame:nth-child(5) {
    transform: translate(-50%, -100%) rotate(288deg);
    animation-delay: 0.2s;
}

@keyframes scarlet-spin {
    0% {
        transform: scale(0.3) rotate(0deg);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: scale(2.0) rotate(180deg);
        opacity: 0;
    }
}

@keyframes flame-dance {
    0% {
        transform: translate(-50%, -100%) scale(0.5);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -100%) scale(2.0) translateY(-40px);
        opacity: 0;
    }
}

/* 繝輔Η繝ｼ繧ｸ繝ｧ繝ｳ繧ｯ繝ｩ繧ｹ繝茨ｼ医そ繝ｩ繧ｹ・会ｼ夊・逕溷ｼｷ蛹也沿 */
.vfx-fusion-crust {
    position: absolute;
    width: 300px;
    height: 300px;
}

.vfx-blood-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px solid #dc2626;
    border-radius: 50%;
    box-shadow: 0 0 20px #dc2626, inset 0 0 20px rgba(220, 38, 38, 0.3);
    animation: blood-circle-expand 0.5s ease-out forwards;
}

@keyframes blood-circle-expand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1) rotate(180deg);
    }
}

.vfx-blood-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #ef4444, #dc2626);
    border-radius: 50%;
    filter: drop-shadow(0 0 8px #dc2626);
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(100px);
    animation: blood-converge 0.5s ease-in forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes blood-converge {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(100px);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0);
        opacity: 0;
    }
}

.vfx-revival-cross {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    animation: revival-cross-appear 0.4s 0.9s ease-out forwards;
    opacity: 0;
}

.vfx-revival-cross::before,
.vfx-revival-cross::after {
    content: '';
    position: absolute;
    background: linear-gradient(to right, transparent, #dc2626, #fff, #dc2626, transparent);
    filter: drop-shadow(0 0 15px #fff);
}

.vfx-revival-cross::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    transform: translateY(-50%);
}

.vfx-revival-cross::after {
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    transform: translateX(-50%);
}

@keyframes revival-cross-appear {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0;
    }
}

.vfx-revival-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.4) 0%, transparent 70%);
    filter: drop-shadow(0 0 30px #dc2626);
    animation: revival-glow-pulse 0.5s 1.2s ease-out forwards;
    opacity: 0;
}

@keyframes revival-glow-pulse {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* 繝峨す繝｣繝・ヨ・磯ｻ貞ｰｾ驩・恬・会ｼ夐亟蠕｡蠑ｷ蛹也沿 */
.vfx-doshatto {
    position: absolute;
    width: 280px;
    height: 280px;
}

.vfx-metal-wall {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 220px;
    background: linear-gradient(135deg, #a8a29e 0%, #e7e5e4 40%, #f5f5f4 50%, #e7e5e4 60%, #a8a29e 100%);
    border: 6px solid #78716c;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(120, 113, 108, 0.9), inset 0 0 25px rgba(255, 255, 255, 0.5);
    animation: wall-rise 0.4s ease-out forwards;
    opacity: 0;
}

@keyframes wall-rise {
    0% {
        transform: translate(-50%, 20%) scaleY(0);
        opacity: 0;
    }

    60% {
        transform: translate(-50%, -50%) scaleY(1.15);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scaleY(1);
        opacity: 1;
    }
}

.vfx-hex-barrier {
    position: absolute;
    width: 50px;
    height: 58px;
    background: rgba(251, 191, 36, 0.5);
    border: 3px solid #f59e0b;
    clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%);
    filter: drop-shadow(0 0 12px #f59e0b) drop-shadow(0 0 20px #fbbf24);
    animation: hex-appear 0.4s ease-out forwards;
    animation-delay: calc(0.5s + var(--delay));
    opacity: 0;
}

/* 蜷・・隗貞ｽ｢縺ｮ驟咲ｽｮ繧貞句挨縺ｫ險ｭ螳・*/
.vfx-hex-barrier:nth-child(2) {
    top: 50%;
    left: 50%;
}

.vfx-hex-barrier:nth-child(3) {
    top: 50%;
    left: calc(50% - 60px);
}

.vfx-hex-barrier:nth-child(4) {
    top: 50%;
    left: calc(50% + 60px);
}

.vfx-hex-barrier:nth-child(5) {
    top: calc(50% - 60px);
    left: 50%;
}

.vfx-hex-barrier:nth-child(6) {
    top: calc(50% + 60px);
    left: 50%;
}

.vfx-hex-barrier:nth-child(7) {
    top: calc(50% - 45px);
    left: calc(50% - 45px);
}

.vfx-hex-barrier:nth-child(8) {
    top: calc(50% - 45px);
    left: calc(50% + 45px);
}

@keyframes hex-appear {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
    }

    60% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2) rotate(180deg);
    }

    100% {
        transform: translate(-50%, -50%) scale(1) rotate(180deg);
        opacity: 0.8;
    }
}

.vfx-counter-aura {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.6) 0%, rgba(220, 38, 38, 0.4) 40%, transparent 70%);
    border-radius: 50%;
    filter: drop-shadow(0 0 35px #ef4444) drop-shadow(0 0 50px #dc2626);
    animation: counter-flame 0.5s 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes counter-flame {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0.7;
    }
}

/* 繝・Ο繝ｪ繧ｨ繝ｩ繝ｳ・郁凶闖懷屁蟄｣・会ｼ哺P蝗槫ｾｩ蠑ｷ蛹也沿 */
.vfx-delorieran {
    position: absolute;
    width: 320px;
    height: 320px;
}

.vfx-mp-particle {
    position: absolute;
    top: -60px;
    left: calc(50% + var(--x));
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #fff 0%, #c084fc 40%, #a855f7 70%, #7c3aed);
    border-radius: 50%;
    filter: drop-shadow(0 0 12px #a855f7) drop-shadow(0 0 20px #c084fc);
    animation: mp-particle-fall 0.8s ease-in forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes mp-particle-fall {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }

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

    100% {
        transform: translateY(200px) scale(0.7);
        opacity: 0;
    }
}

.vfx-music-note {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 32px;
    font-weight: bold;
    color: #c084fc;
    text-shadow: 0 0 15px #a855f7, 0 0 25px #c084fc;
    filter: drop-shadow(0 0 12px #fff);
    animation: note-dance 0.6s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes note-dance {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(60px) scale(0);
        opacity: 0;
    }

    40% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(140px) translateY(-40px) rotate(360deg) scale(1.5);
        opacity: 0;
    }
}

.vfx-mp-pillar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 350px;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(192, 132, 252, 0.3) 20%,
            rgba(168, 85, 247, 0.7) 40%,
            rgba(168, 85, 247, 0.9) 50%,
            rgba(168, 85, 247, 0.7) 60%,
            rgba(192, 132, 252, 0.3) 80%,
            transparent 100%);
    filter: drop-shadow(0 0 40px #a855f7) drop-shadow(0 0 60px #c084fc);
    animation: mp-pillar-rise 0.5s 0.7s ease-out forwards;
    opacity: 0;
}

@keyframes mp-pillar-rise {
    0% {
        transform: translate(-50%, 20%) scaleY(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scaleY(1.1);
    }

    100% {
        transform: translate(-50%, -50%) scaleY(1);
        opacity: 0;
    }
}

/* 遨ｿ螟ｩ豌ｷ螢・ｼ郁ｽ溽┬蜃搾ｼ会ｼ壼ｼｷ蛹也沿 */
.vfx-ice-wall {
    position: absolute;
    width: 300px;
    height: 300px;
}

.vfx-ice-growth {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 60px;
    background: radial-gradient(ellipse at bottom, rgba(135, 206, 235, 0.4) 0%, transparent 70%);
    filter: drop-shadow(0 0 15px #87ceeb);
    animation: ice-ground-growth 0.4s ease-out forwards;
}

@keyframes ice-ground-growth {
    0% {
        transform: translateX(-50%) scaleX(0);
        opacity: 0;
    }

    100% {
        transform: translateX(-50%) scaleX(1);
        opacity: 0.8;
    }
}

.vfx-ice-pillar {
    position: absolute;
    bottom: 0;
    left: calc(14.28% * var(--index));
    width: 35px;
    height: calc(120px + var(--index) * 15px - abs(var(--index) - 3) * 20px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(186, 230, 253, 0.85) 40%, rgba(56, 189, 248, 0.7) 100%);
    clip-path: polygon(50% 0%, 75% 15%, 90% 30%, 100% 100%, 0% 100%, 10% 30%, 25% 15%);
    border-top: 2px solid rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 0 12px #38bdf8);
    animation: ice-wall-rise 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: var(--delay);
    transform-origin: bottom;
}

@keyframes ice-wall-rise {
    0% {
        transform: scaleY(0) scaleX(0.8);
        opacity: 0;
    }

    60% {
        opacity: 1;
    }

    100% {
        transform: scaleY(1.1) scaleX(1);
    }
}

.vfx-ice-shard {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 20px;
    background: linear-gradient(135deg, #fff 0%, #38bdf8 100%);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    filter: drop-shadow(0 0 6px #38bdf8);
    transform: translate(-50%, -50%) rotate(var(--angle));
    animation: ice-shard-burst 0.4s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes ice-shard-burst {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(0);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-80px);
        opacity: 0;
    }
}

.vfx-ice-mist {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(186, 230, 253, 0.3) 0%, transparent 70%);
    filter: blur(8px) drop-shadow(0 0 20px #38bdf8);
    animation: ice-mist-spread 0.5s 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes ice-mist-spread {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 髮ｷ蛻・ｼ医・縺溘￠繧ｫ繧ｫ繧ｷ・会ｼ售VG縺ｫ繧医ｋ騾｣邨宣峭謦・ｼ育ｪ√″荳翫￡繝ｻ蠑ｷ蛹也沿・・*/
.vfx-raikiri-arc {
    position: absolute;
    bottom: -50px;
    left: 50%;
    width: 150px;
    /* 蟆代＠螟ｪ縺・*/
    height: 350px;
    /* 蟆代＠髟ｷ縺・*/
    transform: translateX(-50%);
    filter: drop-shadow(0 0 10px #00bfff) drop-shadow(0 0 20px #ffffff) drop-shadow(0 0 40px #00bfff);
    /* 逋ｺ蜈牙ｼｷ蛹・*/
    z-index: 10;
}

.raikiri-shape {
    fill: #e0ffff;
    filter: drop-shadow(0 0 5px #00bfff);
    clip-path: inset(100% 0 0 0);
    /* 荳九°繧我ｸ翫∈繝ｯ繧､繝礼畑蛻晄悄蛟､ */
    animation: raikiri-wipe 0.15s linear forwards;
    /* 雜・ｫ倬溘Ρ繧､繝・*/
}

.raikiri-shape.branch {
    fill: #87cefa;
    animation-delay: 0.05s;
}

@keyframes raikiri-wipe {
    0% {
        clip-path: inset(100% 0 0 0);
        opacity: 1;
    }

    100% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
}

/* 繝輔ぉ繝ｼ繝峨い繧ｦ繝医い繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ縺ｯJavaScript縺ｧ繧ｯ繝ｩ繧ｹ莉倅ｸ弱√∪縺溘・蛻･騾泌ｮ夂ｾｩ */
.vfx-raikiri-arc.fade-out .raikiri-shape {
    transition: opacity 0.3s;
    opacity: 0;
}

/* 繧､繝ｳ繝代け繝域凾縺ｮ陦晄茶豕｢ */
.vfx-raikiri-impact {
    position: absolute;
    top: 20px;
    /* 遯√″荳翫￡縺ｮ蛻ｰ驕皮せ莉倩ｿ・*/
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff, #00bfff, transparent);
    box-shadow: 0 0 50px #fff, 0 0 100px #00bfff;
    opacity: 0;
    animation: raikiri-impact-burst 0.5s ease-out 0.4s forwards;
    /* 0.4s譎らせ縺九ｉ逋ｺ逕・*/
}

@keyframes raikiri-flash-arc {
    0% {
        stroke-dashoffset: 800;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    50% {
        stroke-dashoffset: 0;
        opacity: 1;
        stroke-width: 10;
        /* 譛繧ょ､ｪ縺・*/
        filter: brightness(2.0);
    }

    100% {
        stroke-dashoffset: 0;
        opacity: 0;
        stroke-width: 4;
    }
}

@keyframes raikiri-impact-burst {
    0% {
        transform: translate(-50%, -50%) scale(0.1);
        opacity: 1;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(4.0);
        opacity: 0;
    }
}



/* 謚ｹ豸茨ｼ育嶌貔､豸亥､ｪ・会ｼ壼ｼｷ蛹也沿 */
.vfx-erasure {
    position: absolute;
    width: 300px;
    height: 300px;
}

.vfx-erasure-eye {
    position: absolute;
    top: 30%;
    width: 50px;
    height: 25px;
    background: radial-gradient(ellipse, #ff0000 0%, #dc2626 40%, transparent 70%);
    border-radius: 50%;
    filter: drop-shadow(0 0 30px #ff0000);
    animation: erasure-eye-open 0.3s ease-out forwards;
}

.vfx-erasure-eye.left {
    left: 20%;
}

.vfx-erasure-eye.right {
    left: 60%;
}

@keyframes erasure-eye-open {
    0% {
        transform: scaleY(0);
        opacity: 0;
    }

    50% {
        transform: scaleY(1.2);
        opacity: 1;
    }

    100% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.vfx-erasure-beam {
    position: absolute;
    top: 30%;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(239, 68, 68, 0.3) 30%,
            rgba(220, 38, 38, 0.5) 50%,
            rgba(239, 68, 68, 0.3) 70%,
            transparent 100%);
    filter: drop-shadow(0 0 20px #dc2626);
    animation: erasure-beam-fire 0.3s 0.3s ease-out forwards;
    opacity: 0;
}

@keyframes erasure-beam-fire {
    0% {
        opacity: 0;
        transform: scaleY(0);
    }

    50% {
        opacity: 1;
        transform: scaleY(1);
    }

    100% {
        opacity: 0.6;
        transform: scaleY(1);
    }
}

.vfx-erasure-band {
    position: absolute;
    top: calc(70% + var(--index) * 15px);
    left: 0;
    width: 100%;
    height: 10px;
    background: linear-gradient(90deg, transparent, #d4d4d4 20%, #a3a3a3 50%, #d4d4d4 80%, transparent);
    filter: drop-shadow(0 0 8px #a3a3a3);
    animation: erasure-wrap 0.3s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes erasure-wrap {
    0% {
        transform: scaleX(0);
        opacity: 0;
    }

    60% {
        opacity: 1;
    }

    100% {
        transform: scaleX(1);
        opacity: 0.8;
    }
}

.vfx-grayscale-filter {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(115, 115, 115, 0.4) 0%, transparent 70%);
    filter: grayscale(1) contrast(0.8);
    animation: grayscale-spread 0.3s 0.9s ease-out forwards;
    opacity: 0;
}

@keyframes grayscale-spread {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 演出 */
.vfx-solitude-rain {
    position: absolute;
    width: 300px;
    height: 300px;
    overflow: visible;
}

.vfx-rain-cloud {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(75, 85, 99, 0.6), rgba(55, 65, 81, 0.3));
    border-radius: 50%;
    filter: blur(8px) drop-shadow(0 0 10px rgba(75, 85, 99, 0.4));
    animation: cloud-appear 0.4s ease-out forwards;
}

@keyframes cloud-appear {
    0% {
        transform: translateX(-50%) scaleX(0);
        opacity: 0;
    }

    100% {
        transform: translateX(-50%) scaleX(1);
        opacity: 0.8;
    }
}

.vfx-raindrop {
    position: absolute;
    top: 20px;
    left: calc(50% + var(--x));
    width: 3px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, #a855f7 40%, #d946ef);
    filter: drop-shadow(0 0 6px #a855f7);
    animation: poison-rain-fall var(--duration) linear forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes poison-rain-fall {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    100% {
        transform: translateY(200px);
        opacity: 0.6;
    }
}

.vfx-poison-puddle {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 30px;
    background: radial-gradient(ellipse, rgba(168, 85, 247, 0.5) 0%, rgba(217, 70, 239, 0.3) 50%, transparent 80%);
    border-radius: 50%;
    filter: blur(4px);
    animation: puddle-spread 0.5s 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes puddle-spread {
    0% {
        transform: translateX(-50%) scaleX(0);
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: translateX(-50%) scaleX(1);
        opacity: 0.6;
    }
}

.vfx-poison-mist {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 150px;
    background: radial-gradient(ellipse at bottom, rgba(168, 85, 247, 0.3) 0%, transparent 70%);
    filter: blur(10px);
    animation: mist-rise 0.5s 1.1s ease-out forwards;
    opacity: 0;
}

@keyframes mist-rise {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(0);
        opacity: 0.4;
    }
}

@keyframes rain-fall-old {
    to {
        transform: translateY(300px);
        opacity: 0;
    }
}


/* === 繝懊せ蝗ｺ譛画橿繧ｨ繝輔ぉ繧ｯ繝・=== */

/* 繝舌う繧ｭ繝ｳ繝代Φ繝・ｼ医・縺・″繧薙∪繧難ｼ会ｼ夂ｴｫ縺ｮ谿ｴ謇楢｡晄茶 */
.vfx-baikin-punch {
    position: absolute;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(128, 0, 128, 0.7) 0%, transparent 60%);
    border-radius: 50%;
    animation: baikin-impact 0.5s ease-out forwards;
}

.vfx-baikin-punch::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
    border: 8px solid rgba(128, 0, 128, 0.5);
    border-radius: 50%;
    animation: baikin-ring 0.5s ease-out forwards;
}

@keyframes baikin-impact {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: scale(3.0);
        opacity: 0;
    }
}

@keyframes baikin-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }

    30% {
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.0);
        opacity: 0;
    }
}

/* 豈呈ｶｲ蝎ｴ蟆・ｼ医ぐ繧ｮ繝阪ヶ繝ｩ・会ｼ夂ｷ代・豈帝悸 */
.vfx-poison-spray {
    position: absolute;
    width: 300px;
    height: 210px;
}

.vfx-poison-cloud {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(50, 205, 50, 0.6), transparent);
    filter: blur(5px);
    animation: poison-expand 0.7s ease-out forwards;
}

.vfx-poison-cloud:nth-child(1) {
    width: 120px;
    height: 90px;
    top: 20%;
    left: 10%;
}

.vfx-poison-cloud:nth-child(2) {
    width: 150px;
    height: 100px;
    top: 30%;
    left: 40%;
    animation-delay: 0.1s;
}

.vfx-poison-cloud:nth-child(3) {
    width: 100px;
    height: 80px;
    top: 50%;
    left: 60%;
    animation-delay: 0.2s;
}

@keyframes poison-expand {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    30% {
        opacity: 0.8;
    }

    100% {
        transform: scale(2.0);
        opacity: 0;
    }
}

/* 闕芽侭縺ｮ蜑｣・亥､ｧ陋・ｸｸ・会ｼ夂ｷ代・陋・お繝輔ぉ繧ｯ繝・*/
.vfx-kusanagi {
    position: absolute;
    width: 240px;
    height: 120px;
}

.vfx-snake {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 24px;
    background: linear-gradient(90deg, #228b22, #32cd32, #228b22);
    filter: drop-shadow(0 0 15px #32cd32);
    border-radius: 50%;
    animation: snake-slither 0.5s ease-out forwards;
}

.vfx-snake::before {
    content: '';
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 20px solid #32cd32;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

@keyframes snake-slither {
    0% {
        transform: translateX(-100%) scaleX(0.5);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translateX(50%) scaleX(1);
        opacity: 0;
    }
}

/* 蜻ｪ髴頑桃陦難ｼ亥､乗ｲｹ蛯托ｼ会ｼ夐ｻ偵＞蜻ｪ髴翫す繝ｫ繧ｨ繝・ヨ */
.vfx-cursed-spirit {
    position: absolute;
    width: 160px;
    height: 180px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.8) 30%, transparent 70%);
    filter: drop-shadow(0 0 25px #000);
    animation: spirit-manifest 0.6s ease-out forwards;
}

.vfx-cursed-spirit::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 30%;
    width: 25px;
    height: 25px;
    background: #ff0000;
    border-radius: 50%;
    filter: drop-shadow(0 0 15px #ff0000);
}

.vfx-cursed-spirit::after {
    content: '';
    position: absolute;
    top: 20%;
    right: 30%;
    width: 25px;
    height: 25px;
    background: #ff0000;
    border-radius: 50%;
    filter: drop-shadow(0 0 15px #ff0000);
}

@keyframes spirit-manifest {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    70% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1.1);
        opacity: 0;
    }
}

/* 繝・せ繝懊・繝ｫ・医ヵ繝ｪ繝ｼ繧ｶ・会ｼ夊ｵ､鮟偵＞逅・ｽ・*/
.vfx-death-ball {
    position: absolute;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, #ff0000 0%, #800000 40%, #000 70%);
    border-radius: 50%;
    filter: drop-shadow(0 0 40px #ff0000);
    animation: death-ball-anim 0.7s ease-out forwards;
}

.vfx-death-ball::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    transform: translate(-50%, -50%);
    border: 5px solid rgba(255, 0, 0, 0.5);
    border-radius: 50%;
    animation: death-ring 0.7s ease-out forwards;
}

@keyframes death-ball-anim {
    0% {
        transform: scale(0.2);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes death-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    30% {
        opacity: 0.6;
    }

    100% {
        transform: translate(-50%, -50%) scale(3.0);
        opacity: 0;
    }
}

/* 繧ｶ繝ｻ繝ｯ繝ｼ繝ｫ繝会ｼ医ョ繧｣繧ｪ・会ｼ壽凾繧呈ｭ｢繧√ｋ貍泌・ */
.vfx-za-warudo {
    position: absolute;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    animation: time-stop 0.8s ease-out forwards;
}

.vfx-za-warudo::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%);
    border: 6px solid #ffd700;
    border-radius: 50%;
    filter: drop-shadow(0 0 20px #ffd700);
}

.vfx-za-warudo::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 50px;
    background: #ffd700;
    transform-origin: bottom center;
    transform: translate(-50%, -100%);
    animation: clock-hand 0.8s ease-out forwards;
}

@keyframes time-stop {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    60% {
        transform: scale(1.2);
    }

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

@keyframes clock-hand {
    0% {
        transform: translate(-50%, -100%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -100%) rotate(360deg);
    }
}

/* 髀｡闃ｱ豌ｴ譛茨ｼ郁絡譟捺Ε蜿ｳ莉具ｼ会ｼ夐升縺ｮ繧医≧縺ｪ蜿榊ｰ・*/
.vfx-kyoka-suigetsu {
    position: absolute;
    width: 200px;
    height: 260px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(200, 200, 255, 0.2), rgba(255, 255, 255, 0.3));
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    filter: drop-shadow(0 0 25px rgba(200, 200, 255, 0.5));
    animation: mirror-shimmer 0.7s ease-out forwards;
}

.vfx-kyoka-suigetsu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.4) 50%, transparent 60%);
    animation: mirror-shine 0.5s ease-out forwards;
}

@keyframes mirror-shimmer {
    0% {
        transform: scale(0.5) rotateY(90deg);
        opacity: 0;
    }

    30% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }

    100% {
        transform: scale(1.2) rotateY(-10deg);
        opacity: 0;
    }
}

@keyframes mirror-shine {
    0% {
        transform: translateX(-100%);
    }

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

/* 繝輔か繝医Φ繧ｲ繧､繧ｶ繝ｼ・医ロ繧ｯ繝ｭ繧ｺ繝橸ｼ会ｼ壼・縺ｮ譟ｱ */
.vfx-photon-geyser {
    position: absolute;
    width: 140px;
    height: 400px;
    background: linear-gradient(to top, transparent, rgba(255, 255, 200, 0.9), #fff, rgba(255, 255, 200, 0.9), transparent);
    filter: blur(4px) drop-shadow(0 0 40px #ffd700);
    animation: photon-burst 0.6s ease-out forwards;
}

@keyframes photon-burst {
    0% {
        transform: scaleY(0);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: scaleY(1);
        opacity: 0;
    }
}

/* 繧ｰ繝ｩ繝ｳ繝峨せ繝ｩ繝・医ヰ繧ｹ繧ｿ繝ｼ繝上Φ繝会ｼ会ｼ夂區縺・焔蠖｢陦晄茶 */
.vfx-grand-slam {
    position: absolute;
    width: 220px;
    height: 260px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 120'%3E%3Cpath fill='white' d='M50 10 L60 50 L90 60 L60 70 L50 110 L40 70 L10 60 L40 50 Z'/%3E%3C/svg%3E") center/contain no-repeat;
    filter: drop-shadow(0 0 30px #fff);
    animation: slam-impact 0.5s ease-out forwards;
}

@keyframes slam-impact {
    0% {
        transform: scale(0.3) translateY(-50px);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    50% {
        transform: scale(1.3) translateY(0);
    }

    100% {
        transform: scale(1.8) translateY(10px);
        opacity: 0;
    }
}

/* 蟠ｩ螢奇ｼ域ｭｻ譟・惠蠑費ｼ会ｼ壹・縺ｳ蜑ｲ繧梧ｼ泌・ */
.vfx-decay {
    position: absolute;
    width: 240px;
    height: 240px;
}

.vfx-crack {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 90px;
    background: linear-gradient(to bottom, #888, #444);
    transform-origin: top center;
    animation: crack-spread 0.4s ease-out forwards;
}

.vfx-crack:nth-child(1) {
    transform: translate(-50%, 0) rotate(0deg);
}

.vfx-crack:nth-child(2) {
    transform: translate(-50%, 0) rotate(45deg);
    animation-delay: 0.05s;
}

.vfx-crack:nth-child(3) {
    transform: translate(-50%, 0) rotate(90deg);
    animation-delay: 0.1s;
}

.vfx-crack:nth-child(4) {
    transform: translate(-50%, 0) rotate(135deg);
    animation-delay: 0.15s;
}

.vfx-crack:nth-child(5) {
    transform: translate(-50%, 0) rotate(180deg);
    animation-delay: 0.2s;
}

.vfx-crack:nth-child(6) {
    transform: translate(-50%, 0) rotate(225deg);
    animation-delay: 0.25s;
}

.vfx-crack:nth-child(7) {
    transform: translate(-50%, 0) rotate(270deg);
    animation-delay: 0.3s;
}

.vfx-crack:nth-child(8) {
    transform: translate(-50%, 0) rotate(315deg);
    animation-delay: 0.35s;
}

@keyframes crack-spread {
    0% {
        transform: translate(-50%, 0) scaleY(0);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 0) scaleY(1);
        opacity: 0;
    }
}

/* 繧ｯ繝・ヱ繝悶Ξ繧ｹ・医け繝・ヱ・会ｼ壹が繝ｬ繝ｳ繧ｸ縺ｮ轤・*/
.vfx-koopa-breath {
    position: absolute;
    width: 180px;
    height: 100px;
}

.vfx-fire-stream {
    position: absolute;
    top: 40%;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(90deg, #ff6b00, #ffa500, #ffcc00, transparent);
    border-radius: 50% 100% 100% 50%;
    filter: blur(3px) drop-shadow(0 0 20px #ff6b00);
    animation: fire-breath 0.6s ease-out forwards;
}

.vfx-fire-stream::before,
.vfx-fire-stream::after {
    content: '';
    position: absolute;
    left: 0;
    width: 80%;
    height: 20px;
    background: linear-gradient(90deg, #ff6b00, #ffa500, transparent);
    border-radius: 50%;
    filter: blur(2px);
    animation: fire-wave 0.5s ease-out forwards;
}

.vfx-fire-stream::before {
    top: -15px;
}

.vfx-fire-stream::after {
    bottom: -15px;
    animation-delay: 0.1s;
}

@keyframes fire-breath {
    0% {
        transform: scaleX(0);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: scaleX(1.2);
        opacity: 0;
    }
}

@keyframes fire-wave {
    0% {
        transform: scaleX(0);
        opacity: 0;
    }

    30% {
        opacity: 0.8;
    }

    100% {
        transform: scaleX(1);
        opacity: 0;
    }
}

/* 繧ｷ繝ｼ繝ｫ繝峨が繝ｼ繝ｩ・磯亟蠕｡繝ｻ繝舌ヵ邉ｻ蜈ｱ騾夲ｼ・*/
.shield-aura {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* 繧ｫ繝ｼ繝峨′邵ｦ髟ｷ縺ｧ繧よ･募・縺ｫ縺ｪ繧峨↑縺・ｈ縺・崋螳壹ヴ繧ｯ繧ｻ繝ｫ繧呈欠螳・*/
    width: 145px;
    height: 145px;
    border: 4px solid #4facfe;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 172, 254, 0.2) 0%, transparent 70%);
    filter: drop-shadow(0 0 15px #4facfe);
    animation: shield-pulse 0.8s ease-out forwards;
    pointer-events: none;
    z-index: 100;
}

@keyframes shield-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    70% {
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* 繝輔Λ繝・す繝･繧ｨ繝輔ぉ繧ｯ繝茨ｼ郁牡驕輔＞霑ｽ蜉・・*/
.flash-gold {
    animation: flash-gold-anim 0.3s ease-out;
}

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

    50% {
        filter: brightness(2) drop-shadow(0 0 20px #ffd700);
    }

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

.flash-purple {
    animation: flash-purple-anim 0.3s ease-out;
}

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

    50% {
        filter: brightness(1.5) drop-shadow(0 0 20px #9b59b6);
    }

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

/* 陲ｫ蠑ｾ譎ゅ・2騾｣繝輔Λ繝・す繝･・医ヵ繝ｪ繝・き繝ｼ・画ｼ泌・ */
.flash-flicker-white {
    animation: flash-flicker-white-anim 0.25s ease-out;
}

@keyframes flash-flicker-white-anim {

    0%,
    40%,
    100% {
        filter: brightness(1);
    }

    20%,
    70% {
        filter: brightness(3) drop-shadow(0 0 15px #fff);
    }
}

/* 蠑ｷ蛹也判髱｢繝ｬ繧､繧｢繧ｦ繝・*/
.enhance-layout {
    max-width: 500px;
    width: 95%;
    margin-top: 15px;
}

.enhance-char-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.enhance-tab-btn {
    padding: 5px;
    border: 2px solid transparent;
    border-radius: 8px;
    opacity: 0.6;
    cursor: pointer;
    transition: 0.2s;
}

.enhance-tab-btn.active {
    border-color: var(--primary);
    opacity: 1;
    transform: scale(1.1);
}

.enhance-tab-btn img {
    width: 50px;
    height: 50px;
    border-radius: 5px;
    object-fit: cover;
}

/* Enhance Screen Styles */
.enhance-layout {
    width: 100%;
}

.enhance-char-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.enhance-tab-btn {
    cursor: pointer;
    transition: 0.2s;
    opacity: 0.6;
}

.enhance-tab-btn.active {
    opacity: 1;
    transform: scale(1.1);
}

.enhance-tab-btn img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #444;
    /* Default border */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.enhance-tab-btn.active img {
    border-color: var(--primary);
    /* Gold/Primary border for active */
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.5);
}

.enhance-stat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.enhance-stat-item {
    display: grid;
    grid-template-columns: 40px 45px minmax(0, 1fr) auto;
    /* Label | Base (Right) | Flexible Delta | Buttons */
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    gap: 0px;
    width: 100%;
    box-sizing: border-box;
}

.stat-label {
    font-weight: bold;
    color: #ccc;
    text-align: left;
    padding-left: 2px;
}

.stat-val-base {
    text-align: right;
    font-weight: bold;
    padding-right: 2px;
    /* Gap before Delta */
}

.stat-val-delta {
    text-align: left;
    font-weight: bold;
    color: var(--success);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    padding-left: 2px;
}

/* .stat-values and .stat-delta removed/replaced by above */

.enhance-btns {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    /* Align buttons to right */
}

.enhance-btns button {
    display: flex;
    align-items: center;
    justify-content: center;
    /* width/height defined in btn-plus/minus styles */
}

/* 繧｢繧､繝・Β蜈･繧梧崛縺・*/
.item-swap-grid {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}

.item-swap-card {
    background: rgba(255, 255, 255, 0.08);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    text-align: left;
}

.item-swap-card:hover {
    background: rgba(255, 64, 129, 0.15);
    border-color: var(--primary);
}

.item-swap-card strong {
    color: var(--primary);
    display: block;
    margin-bottom: 4px;
}

.item-swap-card.new-item {
    border-color: var(--warning);
    background: rgba(245, 175, 25, 0.05);
}

/* 蠑ｷ蛹也判髱｢繝懊ち繝ｳ驟崎牡・茨ｼ九・襍､縲・ｼ阪・髱抵ｼ・*/
.btn-plus {
    width: 32px !important;
    color: #fff !important;
    background: linear-gradient(to bottom, #ff6b6b, #ee5253) !important;
    border: none !important;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.4);
}

.btn-minus {
    width: 32px !important;
    color: #fff !important;
    background: linear-gradient(to bottom, #2b5876, #4e4376) !important;
    /* Dark Blue */
    border: none !important;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(60, 80, 150, 0.4);
}

/* 繝槭ャ繝礼判髱｢繝ｻ蠑ｷ蛹悶・繧ｿ繝ｳ繧剃ｻ悶→邨ｱ荳 */
#enhance-btn {
    background: rgba(245, 175, 25, 0.2);
    border: 1px solid var(--warning);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
    margin-left: 8px;
}

#enhance-btn:hover {
    background: rgba(245, 175, 25, 0.4);
}

/* 繝｢繝ｼ繝繝ｫ蜀・・繝懊ち繝ｳ驟咲ｽｮ繧貞插遲峨↓縺吶ｋ縺溘ａ縺ｮ隱ｿ謨ｴ */
#modal-actions .btn-primary {
    box-shadow: none !important;
    border: 1px solid transparent !important;
}

#modal-actions button {
    margin: 0;
    /* 蠢ｵ縺ｮ縺溘ａ縺ｮ繝槭・繧ｸ繝ｳ繝ｪ繧ｻ繝・ヨ */
}

/* --- New Map Styles (Boss Preview & Grid Layout Support) --- */

.boss-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: linear-gradient(to bottom, rgba(50, 0, 0, 0.8), rgba(20, 0, 0, 0.6));
    border-bottom: 1px solid #ff4444;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(5px);
    margin-bottom: 10px;
}

.boss-label {
    font-size: 10px;
    color: #ff6b6b;
    letter-spacing: 0.3em;
    margin-bottom: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.boss-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.boss-mini-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.6);
    background: #000;
}

.boss-info span {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
}

.boss-node-img {
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

/* Map Node States */
.map-node.skipped {
    opacity: 0.15;
    filter: grayscale(100%);
    transform: scale(0.8);
    border-color: #444;
}

/* Unreachable nodes (grayed out but visible) */
.map-node.unreachable {
    opacity: 0.4;
    filter: grayscale(100%);
    pointer-events: none;
}

/* Reachable (Future) nodes - default state is bright, so no special class needed */
/* but we can ensure brightness */
.map-node:not(.unreachable):not(.completed):not(.skipped) {
    opacity: 1;
    filter: none;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.map-node.locked {
    /* Legacy keeping just in case, similar to unreachable */
    opacity: 0.4;
    filter: grayscale(100%);
    pointer-events: none;
}

/* Override existing margins if using grid */
/* Override existing margins if using grid */
.branching-map .map-layer-row {
    height: auto;
    /* Let it size by content + gap */
    min-height: 60px;
    margin-bottom: 30px;
    /* Vertical spacing between layers */

    /* Ensure the grid itself is centered if it doesn't take full width, though repeat(4, 1fr) usually does. */
    /* Add padding to simulate "centering" logic if lanes are skewed. */
}



/* Ensure container has scroll space for the boss header */
#node-map {
    padding-top: 0;
    /* Boss header is sticky or at top */
}

/* Shop Screen */
#shop-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    /* Scrollable content area */
    flex: 1;
    overflow-y: auto;
    padding-bottom: 80px;
    /* Space for fixed bottom button if needed */
}

#shop-screen {
    /*
       Normally screens are display: none via .screen class.
       We must not override it unless valid.
       So default is inherited from .screen (none).
       Only when active do we set flex.
    */
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    /* Background Update */
    background: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.85)), url('img/bg/bg_shop.png') no-repeat center center;
    background-size: cover;
    background-color: #1a0b1a;
}

#shop-screen.active {
    display: flex;
}

#shop-screen .shop-title {
    font-family: 'Zen Antique', serif;
    font-size: 28px;
    color: #d4af37;
    /* Metallic Gold */
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    border-bottom: 2px solid #554;
    padding-bottom: 10px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

#leave-shop-btn {
    /* Ensure button is always visible or accessible */
    margin-top: auto;
    flex-shrink: 0;
    z-index: 10;
}

.shop-section {
    width: 100%;
}

.shop-section-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--highlight);
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.shop-item {
    background: rgba(10, 10, 20, 0.7);
    /* Increased transparency */
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 8px;
    /* Compact padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    min-height: 100px;
    /* Reduced height constraint */
}

.shop-item h4 {
    margin: 2px 0 4px 0;
    font-size: 13px;
    /* Smaller font */
    color: #fff;
    font-weight: bold;
}

.shop-item p {
    font-size: 11px;
    /* Smaller description */
    color: #ccc;
    margin: 0 0 4px 0;
    line-height: 1.2;
    flex-grow: 1;
}

.shop-price {
    font-size: 14px;
    color: var(--warning);
    font-weight: bold;
    margin-top: auto;
}

.shop-item:hover:not(.purchased) {
    transform: translateY(-2px);
    border-color: var(--highlight);
    background: rgba(50, 50, 60, 0.9);
}

.shop-item.purchased {
    opacity: 0.5;
    filter: grayscale(100%);
    cursor: default;
    pointer-events: none;
}

.shop-item.too-expensive {
    border-color: var(--danger);
    opacity: 0.8;
}

.shop-item h4 {
    margin: 5px 0;
    font-size: 14px;
    color: #fff;
}

.shop-item p {
    font-size: 11px;
    color: var(--text-sub);
    margin-bottom: 8px;
    line-height: 1.3;
}

.shop-price {
    margin-top: auto;
    font-weight: bold;
    color: var(--warning);
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 8px;
    border-radius: 4px;
}

/* --- 繧ｯ繝ｬ繧､繧ｸ繝ｼ繝ｻD 遐ｴ迚・い繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ --- */
.vfx-diamond-shard {
    position: absolute;
    width: var(--size);
    height: calc(var(--size) * 1.5);
    background: linear-gradient(135deg, #fff, #00f2fe, #ff69b4);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    opacity: 0;
    top: 50%;
    left: 50%;
    filter: drop-shadow(0 0 5px #00f2fe);
    animation: shard-converge 0.6s ease-in forwards;
    animation-delay: var(--delay);
}

@keyframes shard-converge {
    0% {
        transform: translate(var(--tx), var(--ty)) rotate(0deg) scale(0);
        opacity: 0;
    }

    20% {
        opacity: 1;
        transform: translate(var(--tx), var(--ty)) rotate(180deg) scale(1);
    }

    /* 蜿取據・井ｿｮ蠕ｩ・峨・蜍輔″ */
    100% {
        transform: translate(0, 0) rotate(720deg) scale(0);
        opacity: 0;
    }
}

@keyframes crystal-heart-form {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
        filter: brightness(5);
    }

    /* 0.4s + 0.4s = 0.8s (蜈ｨ菴薙・荳ｭ逶､) 縺ｧ譛螟ｧ蛹・*/
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
        filter: brightness(2);
    }

    /* 1.0s莉倩ｿ代〒荳蠎ｦ關ｽ縺｡逹縺・*/
    80% {
        transform: translate(-50%, -50%) scale(1.0);
        opacity: 1;
        filter: brightness(1.2);
    }

    /* 1.2s縺ｧ蜈峨→縺ｪ縺｣縺ｦ髴ｧ謨｣縺吶ｋ */
    100% {
        transform: translate(-50%, -50%) scale(1.6);
        opacity: 0;
        filter: brightness(5);
    }
}

/* =========================================
   Game Over Modal (Rich Style)
   ========================================= */
.gameover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(50, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: overlayFadeIn 2s ease-out forwards;
}

@keyframes overlayFadeIn {
    from {
        background: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
    }

    to {
        background: radial-gradient(circle, rgba(50, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.95) 100%);
        backdrop-filter: blur(5px);
    }
}

.gameover-content {
    text-align: center;
    position: relative;
    padding: 40px;
    border-top: 2px solid rgba(255, 50, 50, 0.3);
    border-bottom: 2px solid rgba(255, 50, 50, 0.3);
    background: linear-gradient(90deg, transparent 0%, rgba(20, 0, 0, 0.8) 50%, transparent 100%);
}

.gameover-title {
    font-family: serif;
    font-size: 48px;
    font-weight: 700;
    color: #e0e0e0;
    letter-spacing: 0.2em;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
    margin-bottom: 16px;
    animation: textGlitch 3s infinite alternate;
}

@keyframes textGlitch {
    0% {
        text-shadow: 2px 2px 10px rgba(255, 0, 0, 0.8);
        transform: skew(0deg);
    }

    20% {
        text-shadow: -2px -2px 10px rgba(255, 0, 0, 0.8);
        transform: skew(-2deg);
    }

    40% {
        text-shadow: 2px -2px 10px rgba(255, 0, 0, 0.8);
        transform: skew(2deg);
    }

    100% {
        text-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
        transform: skew(0deg);
    }
}

.gameover-divider {
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ff4444, transparent);
    margin: 0 auto 24px;
    opacity: 0.7;
}

.gameover-message {
    font-family: serif;
    font-size: 16px;
    color: #bbb;
    margin-bottom: 40px;
    letter-spacing: 0.1em;
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 12px 32px;
    font-size: 14px;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

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

.btn-ghost:hover {
    border-color: #ff4444;
    color: #ff4444;
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
    background: rgba(20, 0, 0, 0.6);
}

.btn-ghost:hover::before {
    left: 100%;
}

/* Shop Screen Styles (Revised) */
#shop-screen {
    background-image: url('img/bg/bg_shop.png');
    background-size: cover;
    background-position: center;
    padding: 24px;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
}

#shop-screen.active {
    display: flex;
}

.shop-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.shop-header-row h2 {
    margin: 0;
    /* Remove default margin to align with gold */
}

#shop-gold-display {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

#shop-container {
    width: 100%;
    max-width: 800px;
}

/* Event Descriptions */
.event-desc {
    font-size: 0.85em;
    color: var(--text-sub);
    display: block;
    margin-top: 4px;
}

.success-rate {
    font-size: 0.85em;
    color: var(--success);
    display: block;
    margin-top: 2px;
}

/* =========================================
   Victory Modal (Rich Style)
   ========================================= */
.victory-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(30, 50, 0, 0.4) 0%, rgba(0, 0, 0, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: victoryOverlayFadeIn 2s ease-out forwards;
}

@keyframes victoryOverlayFadeIn {
    from {
        background: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
    }

    to {
        background: radial-gradient(circle, rgba(30, 50, 0, 0.4) 0%, rgba(0, 0, 0, 0.95) 100%);
        backdrop-filter: blur(5px);
    }
}

.victory-content {
    text-align: center;
    position: relative;
    padding: 50px 60px;
    border-top: 2px solid rgba(255, 215, 0, 0.5);
    border-bottom: 2px solid rgba(255, 215, 0, 0.5);
    background: linear-gradient(90deg, transparent 0%, rgba(30, 20, 0, 0.8) 50%, transparent 100%);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
}

.victory-title {
    font-family: serif;
    font-size: 40px;
    font-weight: 700;
    color: #ffd700;
    letter-spacing: 0.15em;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.6),
        0 0 30px rgba(255, 215, 0, 0.4),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
    animation: victoryGlow 2s ease-in-out infinite alternate;
}

@keyframes victoryGlow {
    0% {
        text-shadow:
            0 0 10px rgba(255, 215, 0, 0.8),
            0 0 20px rgba(255, 215, 0, 0.6),
            0 0 30px rgba(255, 215, 0, 0.4),
            2px 2px 4px rgba(0, 0, 0, 0.8);
        transform: scale(1);
    }

    50% {
        text-shadow:
            0 0 15px rgba(255, 215, 0, 1),
            0 0 30px rgba(255, 215, 0, 0.8),
            0 0 45px rgba(255, 215, 0, 0.6),
            2px 2px 4px rgba(0, 0, 0, 0.8);
        transform: scale(1.05);
    }

    100% {
        text-shadow:
            0 0 10px rgba(255, 215, 0, 0.8),
            0 0 20px rgba(255, 215, 0, 0.6),
            0 0 30px rgba(255, 215, 0, 0.4),
            2px 2px 4px rgba(0, 0, 0, 0.8);
        transform: scale(1);
    }
}

.victory-divider {
    width: 300px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffd700, #00ff00, #ffd700, transparent);
    margin: 0 auto 30px;
    opacity: 0.8;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.victory-message {
    font-family: serif;
    font-size: 18px;
    color: #e8e8e8;
    margin-bottom: 50px;
    letter-spacing: 0.1em;
    line-height: 1.8;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.victory-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-victory {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.1));
    border: 2px solid rgba(255, 215, 0, 0.6);
    color: #ffd700;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    position: relative;
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.3),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.8);
}

.btn-victory:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.5), rgba(255, 215, 0, 0.2));
    border-color: rgba(255, 215, 0, 0.9);
    box-shadow:
        0 0 30px rgba(255, 215, 0, 0.6),
        inset 0 0 30px rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
    color: #fff;
}

/* ========================================
   C繧ｰ繝ｫ繝ｼ繝・ 蜻ｳ譁ｹ蝗ｺ譛画橿 譁ｰ隕上お繝輔ぉ繧ｯ繝・
   ======================================== */

/* 逾樣∩・医す繝｣繝ｳ繧ｯ繧ｹ・会ｼ夊ｦ・ｰ励・譁ｬ謦・*/
.vfx-divine-departure {
    position: absolute;
    width: 350px;
    height: 350px;
}

.vfx-haki-aura {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(139, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 70%);
    filter: drop-shadow(0 0 30px rgba(139, 0, 0, 0.8));
    animation: haki-charge 0.4s ease-out forwards;
}

@keyframes haki-charge {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        opacity: 0.9;
    }

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

.vfx-haki-slash {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 6px;
    background: linear-gradient(90deg, transparent, rgba(139, 0, 0, 0.8) 10%, rgba(220, 38, 38, 1) 50%, rgba(139, 0, 0, 0.8) 90%, transparent);
    filter: drop-shadow(0 0 15px #dc2626);
    transform-origin: center;
    animation: haki-slash-appear 0.3s 0.4s ease-out forwards;
    opacity: 0;
}

.vfx-haki-slash.slash1 {
    transform: translate(-50%, -50%) rotate(-30deg);
}

.vfx-haki-slash.slash2 {
    transform: translate(-50%, -50%) rotate(30deg);
    animation-delay: 0.45s;
}

@keyframes haki-slash-appear {
    0% {
        transform: translate(-50%, -50%) rotate(var(--base-rotation, 0deg)) scaleX(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--base-rotation, 0deg)) scaleX(1.2);
        opacity: 0.8;
    }
}

.vfx-haki-bolt {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 80px;
    background: linear-gradient(to bottom, transparent, #fbbf24, #fff, #fbbf24, transparent);
    filter: drop-shadow(0 0 10px #fbbf24);
    transform: translate(-50%, -50%) rotate(var(--angle));
    animation: haki-bolt-flash 0.2s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes haki-bolt-flash {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) scaleY(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) scaleY(1);
        opacity: 0;
    }
}

.vfx-haki-shockwave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px solid rgba(220, 38, 38, 0.6);
    border-radius: 50%;
    filter: drop-shadow(0 0 20px #dc2626);
    animation: haki-shockwave-expand 0.5s 0.7s ease-out forwards;
    opacity: 0;
}

@keyframes haki-shockwave-expand {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    30% {
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* 繧ｭ繝ｧ繝繧､繝槭ャ繧ｯ繧ｹ・医き繝｡繝・け繧ｹ・会ｼ壼ｷｨ螟ｧ蛹・*/
.vfx-gmax {
    position: absolute;
    width: 450px;
    height: 450px;
}

.vfx-gmax-crack {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 6px;
    background: linear-gradient(90deg, transparent, #b91c1c 20%, #dc2626 40%, #ef4444 50%, #dc2626 60%, #b91c1c 80%, transparent);
    filter: drop-shadow(0 0 15px #dc2626) drop-shadow(0 0 25px #ef4444);
    animation: gmax-crack-split 0.5s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes gmax-crack-split {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) scaleX(0);
        opacity: 0;
    }

    60% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) scaleX(1.2);
        opacity: 0.9;
    }
}

.vfx-gmax-shadow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(127, 29, 29, 0.8) 0%, rgba(0, 0, 0, 0.5) 40%, transparent 70%);
    border-radius: 50%;
    filter: blur(15px) drop-shadow(0 0 30px rgba(127, 29, 29, 0.8));
    animation: gmax-shadow-grow 0.6s 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes gmax-shadow-grow {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0.7;
    }
}

.vfx-gmax-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border: 6px solid rgba(239, 68, 68, 0.8);
    border-radius: 50%;
    filter: drop-shadow(0 0 35px #ef4444) drop-shadow(0 0 50px #dc2626);
    animation: gmax-wave-expand 0.7s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes gmax-wave-expand {
    0% {
        transform: translate(-50%, -50%) scale(calc(0.3 * var(--scale)));
        opacity: 0;
    }

    40% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(calc(2.5 * var(--scale)));
        opacity: 0;
    }
}

.vfx-gmax-lightning {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 130px;
    background: linear-gradient(to bottom, #fde047 0%, #fbbf24 20%, #fff 50%, #fbbf24 80%, #fde047 100%);
    filter: drop-shadow(0 0 18px #fbbf24) drop-shadow(0 0 30px #fde047);
    animation: gmax-lightning-strike 0.25s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes gmax-lightning-strike {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) scaleY(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) scaleY(1);
        opacity: 0;
    }
}

/* 縺薙＞縺九●・磯ｫ伜椒讌難ｼ会ｼ壼━縺励＞鬚ｨ縺ｮ蝗槫ｾｩ */
.vfx-koikaze {
    position: absolute;
    width: 300px;
    height: 300px;
}

.vfx-wind-wave {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: var(--height);
    background: linear-gradient(90deg, transparent, rgba(134, 239, 172, 0.4), transparent);
    filter: blur(2px) drop-shadow(0 0 10px #86efac);
    transform: translateY(-50%);
    animation: wind-flow 0.6s ease-in-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes wind-flow {
    0% {
        transform: translateY(-50%) translateX(-100%);
        opacity: 0;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        transform: translateY(-50%) translateX(100%);
        opacity: 0;
    }
}

.vfx-sakura-petal {
    position: absolute;
    top: 30%;
    left: calc(50% + var(--x));
    width: 12px;
    height: 12px;
    background: radial-gradient(ellipse, #fff 0%, #fecdd3 60%, #fda4af);
    border-radius: 50% 0 50% 0;
    filter: drop-shadow(0 0 6px #fecdd3);
    transform: rotate(var(--rotation));
    animation: petal-float 0.7s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes petal-float {
    0% {
        transform: translateY(-20px) rotate(var(--rotation));
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translateY(100px) rotate(calc(var(--rotation) + 180deg));
        opacity: 0;
    }
}

.vfx-heal-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(134, 239, 172, 0.4) 0%, transparent 70%);
    filter: drop-shadow(0 0 30px #86efac);
    animation: heal-pulse 0.4s 0.7s ease-out forwards;
    opacity: 0;
}

@keyframes heal-pulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 蜷ｸ縺・ｾｼ縺ｿ・医き繝ｼ繝薙ぅ・会ｼ夂憾諷狗焚蟶ｸ豬・喧 */
.vfx-inhale {
    position: absolute;
    width: 300px;
    height: 300px;
}

.vfx-inhale-spiral {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--size);
    height: var(--size);
    border: 3px solid rgba(236, 72, 153, 0.6);
    border-radius: 50%;
    border-style: dashed;
    filter: drop-shadow(0 0 15px #ec4899);
    animation: inhale-spin 0.6s linear infinite, inhale-shrink 0.5s ease-in forwards;
    animation-delay: var(--delay);
}

@keyframes inhale-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes inhale-shrink {
    0% {
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }
}

.vfx-status-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: var(--color);
    border-radius: 50%;
    filter: drop-shadow(0 0 8px var(--color));
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(100px);
    animation: status-suck 0.5s ease-in forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes status-suck {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(100px);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) scale(0);
        opacity: 0;
    }
}

.vfx-purify-light {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0.6) 50%, transparent 70%);
    border-radius: 50%;
    filter: drop-shadow(0 0 30px #fff);
    animation: purify-flash 0.3s 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes purify-flash {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.vfx-sparkle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    filter: drop-shadow(0 0 8px #fbbf24);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(80px);
    animation: sparkle-burst 0.4s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes sparkle-burst {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(50px) scale(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(120px) scale(1.2);
        opacity: 0;
    }
}

/* 繧ｷ繝｣繧､繝九・繝医Ν繝阪・繝会ｼ医・繝ｪ・会ｼ夐≡濶ｲ縺ｮ遶懷ｷｻ */
.vfx-shiny-tornado {
    position: absolute;
    width: 320px;
    height: 320px;
}

.vfx-tornado-particle {
    position: absolute;
    bottom: calc(50% + var(--y));
    left: 50%;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #fff 0%, #fbbf24 40%, #f59e0b 80%);
    border-radius: 50%;
    filter: drop-shadow(0 0 10px #fbbf24) drop-shadow(0 0 18px #fde047);
    animation: tornado-spiral 0.8s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes tornado-spiral {
    0% {
        transform: translate(-50%, 0) rotate(var(--angle)) translateX(20px);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 0) rotate(calc(var(--angle) + 720deg)) translateX(80px);
        opacity: 0;
    }
}

.vfx-tornado-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.7) 0%, rgba(245, 158, 11, 0.5) 40%, transparent 70%);
    border-radius: 50%;
    filter: blur(6px) drop-shadow(0 0 35px #fbbf24) drop-shadow(0 0 50px #fde047);
    animation: tornado-core-pulse 0.4s ease-out forwards;
}

@keyframes tornado-core-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.vfx-tornado-burst {
    position: absolute;
    top: 30%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #fbbf24, #f59e0b);
    border-radius: 50%;
    filter: drop-shadow(0 0 10px #fbbf24);
    transform: translate(-50%, -50%) rotate(var(--angle));
    animation: tornado-burst-fly 0.4s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes tornado-burst-fly {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(120px);
        opacity: 0;
    }
}

/* 貊・・縺ｮ辷・｣ら明鬚ｨ蠑ｾ・磯搨逵ｼ縺ｮ逋ｽ鮴搾ｼ会ｼ夐搨逋ｽ繝薙・繝 */
.vfx-burst-stream {
    position: absolute;
    width: 380px;
    height: 380px;
}

.vfx-burst-charge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #fff 0%, #93c5fd 30%, #3b82f6 50%, #1e3a8a 75%, transparent 90%);
    border-radius: 50%;
    box-shadow: 0 0 40px #3b82f6, 0 0 60px #93c5fd, inset 0 0 30px rgba(255, 255, 255, 0.8);
    animation: burst-charge-grow 0.5s ease-out forwards;
}

@keyframes burst-charge-grow {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 0;
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.vfx-burst-beam-line {
    position: fixed;
    top: 0;
    left: 50%;
    width: 120px;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(59, 130, 246, 0.7) 0%,
            rgba(147, 197, 253, 1) 20%,
            rgba(255, 255, 255, 1) 50%,
            rgba(147, 197, 253, 1) 80%,
            rgba(59, 130, 246, 0.7) 100%);
    filter: drop-shadow(0 0 40px #3b82f6) drop-shadow(0 0 60px #93c5fd) drop-shadow(0 0 80px #fff);
    box-shadow: 0 0 50px #3b82f6, 0 0 80px #93c5fd, inset 0 0 30px rgba(255, 255, 255, 0.9);
    animation: burst-beam-shoot 0.4s 0.5s ease-out forwards;
    opacity: 0;
    z-index: 180;
    transform: translateX(-50%);
}

@keyframes burst-beam-shoot {
    0% {
        transform: translateX(-50%) scaleY(0);
        opacity: 0;
    }

    30% {
        opacity: 1;
        transform: translateX(-50%) scaleY(1);
    }

    70% {
        opacity: 1;
        transform: translateX(-50%) scaleY(1);
    }

    100% {
        transform: translateX(-50%) scaleY(0.8);
        opacity: 0;
    }
}

.vfx-burst-explosion {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 1) 0%,
            rgba(147, 197, 253, 0.95) 20%,
            rgba(59, 130, 246, 0.85) 40%,
            rgba(30, 58, 138, 0.6) 70%,
            transparent 90%);
    border-radius: 50%;
    filter: drop-shadow(0 0 40px #3b82f6) drop-shadow(0 0 60px #93c5fd);
    animation: burst-explosion-grow 0.5s 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes burst-explosion-grow {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5);
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.vfx-beam-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #fff, #3b82f6);
    border-radius: 50%;
    filter: drop-shadow(0 0 8px #3b82f6);
    transform: translate(-50%, -50%) rotate(var(--angle));
    animation: beam-particle-orbit 0.6s linear infinite, beam-particle-appear 0.3s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes beam-particle-orbit {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(40px);
    }

    100% {
        transform: translate(-50%, -50%) rotate(calc(var(--angle) + 360deg)) translateX(40px);
    }
}

@keyframes beam-particle-appear {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.vfx-burst-cross {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    animation: burst-cross-explode 0.5s 0.8s ease-out forwards;
    opacity: 0;
}

.vfx-burst-cross::before,
.vfx-burst-cross::after {
    content: '';
    position: absolute;
    background: linear-gradient(to right, transparent, #fff, #3b82f6, #fff, transparent);
    filter: drop-shadow(0 0 20px #fff);
}

.vfx-burst-cross::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 6px;
    transform: translateY(-50%);
}

.vfx-burst-cross::after {
    top: 0;
    left: 50%;
    width: 6px;
    height: 100%;
    transform: translateX(-50%);
}

@keyframes burst-cross-explode {
    0% {
        transform: translateX(-50%) scale(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateX(-50%) scale(1.5);
        opacity: 0;
    }
}

/* 魑ｳ譴ｨ逎費ｼ医・繝ｫ繧ｳ・会ｼ壻ｸ肴ｭｻ魑･縺ｮ髱偵＞轤・*/
.vfx-pineapple-stake {
    position: absolute;
    width: 300px;
    height: 300px;
}

.vfx-phoenix-feather {
    position: absolute;
    top: 10%;
    left: calc(50% + var(--x));
    width: 25px;
    height: 60px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8) 0%, rgba(147, 197, 253, 0.6) 50%, rgba(59, 130, 246, 0.4) 100%);
    clip-path: polygon(50% 0%, 70% 30%, 100% 100%, 50% 80%, 0% 100%, 30% 30%);
    filter: drop-shadow(0 0 12px #3b82f6);
    animation: feather-fall 0.6s ease-in forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes feather-fall {
    0% {
        transform: translateY(-30px) rotate(0deg);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translateY(150px) rotate(180deg);
        opacity: 0.6;
    }
}

.vfx-blue-flame-particle {
    position: absolute;
    top: 60%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #93c5fd, #3b82f6);
    border-radius: 50%;
    filter: drop-shadow(0 0 10px #3b82f6);
    transform: translate(-50%, -50%) rotate(var(--angle));
    animation: blue-flame-spread 0.4s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes blue-flame-spread {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(80px);
        opacity: 0;
    }
}

.vfx-phoenix-heal {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.4) 0%, transparent 70%);
    filter: drop-shadow(0 0 30px #3b82f6);
    animation: phoenix-heal-glow 0.5s 0.7s ease-out forwards;
    opacity: 0;
}

@keyframes phoenix-heal-glow {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 繝薙ャ繧ｰ繝ｩ繧､繝茨ｼ医ラ繝ｩ縺医ｂ繧難ｼ会ｼ壼・縺ｮ諡｡謨｣ */
.vfx-big-light {
    position: absolute;
    width: 350px;
    height: 350px;
}

.vfx-light-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 130px;
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(147, 197, 253, 0.9) 30%, rgba(59, 130, 246, 0.7) 60%, transparent 80%);
    border-radius: 50%;
    box-shadow: 0 0 40px #3b82f6, 0 0 60px #93c5fd, inset 0 0 30px rgba(255, 255, 255, 0.8);
    animation: light-ring-pulse 0.5s ease-out forwards;
}

@keyframes light-ring-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 0;
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.vfx-light-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #fff 0%, #93c5fd 50%, #3b82f6 80%);
    border-radius: 50%;
    filter: drop-shadow(0 0 12px #3b82f6) drop-shadow(0 0 20px #93c5fd);
    animation: light-particle-fly 0.7s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes light-particle-fly {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(30px);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) translateX(170px) scale(1.5);
        opacity: 0;
    }
}

.vfx-light-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    border: 5px solid rgba(59, 130, 246, 0.7);
    border-radius: 50%;
    filter: drop-shadow(0 0 25px #3b82f6) drop-shadow(0 0 40px #93c5fd);
    animation: light-ripple-expand 0.7s 0.4s ease-out forwards;
    opacity: 0;
}

@keyframes light-ripple-expand {
    0% {
        transform: translate(-50%, -50%) scale(0.4);
        opacity: 0;
    }

    40% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.vfx-power-aura {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.4) 0%, transparent 70%);
    filter: drop-shadow(0 0 30px #fbbf24);
    animation: power-aura-rise 0.3s 0.7s ease-out forwards;
    opacity: 0;
}

@keyframes power-aura-rise {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: scale(1.3);
        opacity: 0.6;
    }
}

/* 繧ｸ繝･繝峨Λ繧ｸ繝ｫ繝・医ヵ繝ｪ繝ｼ繝ｬ繝ｳ・会ｼ夂ｴ貊・・髮ｷ */
.vfx-judrajim {
    position: absolute;
    width: 400px;
    height: 400px;
}

.vfx-thunder-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border: 6px solid rgba(168, 85, 247, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 35px rgba(168, 85, 247, 1),
        0 0 50px rgba(217, 70, 239, 0.8),
        inset 0 0 35px rgba(168, 85, 247, 0.5);
    animation: thunder-circle-spin 0.6s linear infinite, thunder-circle-appear 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes thunder-circle-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes thunder-circle-appear {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.vfx-thunder-bolt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 200px;
    animation: thunder-bolt-strike 0.4s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

.thunder-shape {
    fill: url(#thunderGradient);
    filter: drop-shadow(0 0 20px #a855f7) drop-shadow(0 0 40px #d946ef) drop-shadow(0 0 60px #c084fc);
}

.vfx-thunder-bolt svg {
    width: 100%;
    height: 100%;
}

@keyframes thunder-bolt-strike {
    0% {
        transform: translate(-50%, -150%) translateX(var(--x)) scale(0.8);
        opacity: 0;
    }

    20% {
        transform: translate(-50%, -80%) translateX(var(--x)) scale(1);
        opacity: 1;
    }

    40% {
        transform: translate(-50%, -50%) translateX(var(--x)) scale(1.2);
        opacity: 1;
    }

    70% {
        transform: translate(-50%, -50%) translateX(var(--x)) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) translateX(var(--x)) scale(1.1);
        opacity: 0;
    }
}

.vfx-electric-spark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 100px;
    background: linear-gradient(to bottom,
            transparent 0%,
            #c084fc 10%,
            #a855f7 30%,
            #fff 50%,
            #a855f7 70%,
            #c084fc 90%,
            transparent 100%);
    filter: drop-shadow(0 0 15px #a855f7) drop-shadow(0 0 25px #d946ef);
    animation: electric-spark-flash 0.3s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

@keyframes electric-spark-flash {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) scaleY(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(var(--angle)) scaleY(1.2);
        opacity: 0;
    }
}

/* 縺ｯ縺ｩ縺・□繧鍋ｭ峨・鬟帷ｿ比ｽ薙い繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ */
.vfx-projectile-up {
    animation: projectile-up 0.5s ease-out forwards !important;
}

.vfx-projectile-down {
    animation: projectile-down 0.5s ease-out forwards !important;
}

@keyframes projectile-up {
    0% {
        transform: translate(-50%, 200%) scale(0.5);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes projectile-down {
    0% {
        transform: translate(-50%, -300%) scale(0.5);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}


/* Aura Sphere VFX */
.vfx-aura-sphere {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    pointer-events: none;
}

.vfx-projectile-dynamic {
    animation: projectile-dynamic 0.5s ease-out forwards !important;
}

@keyframes projectile-dynamic {
    0% {
        transform: translate(calc(-50% + var(--start-x)), calc(-50% + var(--start-y))) scale(0.5);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}


/* Blue-Eyes Burst Stream VFX */
.vfx-burst-charge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #fff, #60a5fa, #2563eb);
    border-radius: 50%;
    filter: drop-shadow(0 0 15px #3b82f6);
    animation: burst-charge 1s ease-in forwards;
    opacity: 0;
}

@keyframes burst-charge {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.vfx-burst-beam-line {
    position: absolute;
    top: var(--y1);
    left: var(--x1);
    width: var(--length);
    height: 60px;
    transform-origin: left center;
    transform: translateY(-50%) rotate(var(--angle)) scaleX(0);
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(96, 165, 250, 1) 5%,
            rgba(37, 99, 235, 1) 50%,
            rgba(147, 197, 253, 1) 95%,
            rgba(255, 255, 255, 0) 100%);
    border-radius: 30px;
    filter: drop-shadow(0 0 15px #3b82f6);
    z-index: 1000;
    pointer-events: none;
    animation: burst-beam-shoot 0.4s ease-out forwards 1s;
    opacity: 0;
}

@keyframes burst-beam-shoot {
    0% {
        transform: translateY(-50%) rotate(var(--angle)) scaleX(0);
        opacity: 1;
    }

    50% {
        transform: translateY(-50%) rotate(var(--angle)) scaleX(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-50%) rotate(var(--angle)) scaleX(1);
        opacity: 0;
    }
}

.vfx-burst-stream {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    pointer-events: none;
}

.vfx-burst-stream-global {
    position: absolute;
    top: var(--y);
    left: var(--x);
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 1001;
}

.vfx-burst-explosion {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #fff, #93c5fd, transparent 70%);
    opacity: 0;
    animation: burst-explosion 0.5s ease-out forwards 1.2s;
}

@keyframes burst-explosion {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.vfx-beam-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, #fff 30%, #fff 70%, transparent);
    filter: drop-shadow(0 0 8px #60a5fa);
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle));
    animation: beam-particle-spin 0.6s ease-out forwards 1.2s;
    border-radius: 100%;
}

@keyframes beam-particle-spin {
    0% {
        transform: translate(-50%, -50%) rotate(var(--angle)) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(calc(var(--angle) + 180deg)) scale(1.2);
        opacity: 0;
    }
}

.vfx-burst-cross {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 8px;
    background: linear-gradient(90deg, transparent, #fff 20%, #fff 80%, transparent);
    transform: translate(-50%, -50%) rotate(45deg);
    opacity: 0;
    box-shadow: 0 0 20px #60a5fa;
    animation: burst-cross 0.5s ease-out forwards 1.3s;
}

.vfx-burst-cross::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 300px;
    background: linear-gradient(180deg, transparent, #fff 20%, #fff 80%, transparent);
    transform: translate(-50%, -50%);
}

@keyframes burst-cross {
    0% {
        transform: translate(-50%, -50%) rotate(45deg) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) rotate(225deg) scale(1.5);
        opacity: 0;
    }
}

/* Kuroo Doshatto VFX */
.vfx-doshatto {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1000;
}

.vfx-metal-wall {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 100px;
    background: linear-gradient(180deg, rgba(80, 80, 80, 0.9), rgba(30, 30, 30, 0.95));
    border: 3px solid #a0a0a0;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.2);
    animation: metal-wall-rise 0.5s ease-out forwards;
    opacity: 0;
}

.vfx-metal-wall::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.4) 45%, rgba(255, 255, 255, 0.1) 50%, transparent 60%);
    pointer-events: none;
}

@keyframes metal-wall-rise {
    0% {
        transform: translate(-50%, 0%) scaleY(0);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scaleY(1);
        opacity: 1;
    }
}

.vfx-hex-barrier {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 37px;
    /* hex aspect ratio */
    background: rgba(200, 200, 200, 0.3);
    border: 1px solid #fff;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    box-shadow: 0 0 5px #fff;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: hex-appear 0.4s ease-out forwards;
    animation-delay: var(--delay);
}

/* Hexagon positioning pattern (Scaled down) */
.vfx-hex-barrier:nth-child(2) {
    margin-top: -32px;
}

.vfx-hex-barrier:nth-child(3) {
    margin-top: 32px;
}

.vfx-hex-barrier:nth-child(4) {
    margin-left: -28px;
    margin-top: -16px;
}

.vfx-hex-barrier:nth-child(5) {
    margin-left: 28px;
    margin-top: -16px;
}

.vfx-hex-barrier:nth-child(6) {
    margin-left: -28px;
    margin-top: 16px;
}

.vfx-hex-barrier:nth-child(7) {
    margin-left: 28px;
    margin-top: 16px;
}

@keyframes hex-appear {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
}

.vfx-counter-aura {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.4) 0%, transparent 70%);
    mix-blend-mode: screen;
    animation: counter-aura-pulse 1.5s infinite ease-in-out;
}

@keyframes counter-aura-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.5;
    }
}

/* Mobile Fixes */
@media (max-width: 400px) {
    #character-list {
        gap: 4px;
    }

    .screen {
        padding: 16px;
    }

    .character-card img {
        width: 50px;
        height: 50px;
    }
}

/* ========================================
   繝槭ャ繝励せ繧ｭ繝ｫ繝｢繝ｼ繝繝ｫ・域隼蝟・沿・・
   ======================================== */

.skill-screen-layout {
    width: 100%;
    height: 480px;
    /* 蝗ｺ螳夐ｫ倥＆ */
    display: flex;
    flex-direction: column;
}

/* 繧ｭ繝｣繝ｩ荳隕ｧ・郁ｩｳ邏ｰ繧ｫ繝ｼ繝牙ｽ｢蠑擾ｼ・*/
.skill-char-list-container {
    display: flex;
    gap: 8px;
    padding: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
    overflow-x: visible;
    flex-shrink: 0;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

/* 繧ｭ繝｣繝ｩ繧ｫ繝ｼ繝・*/
.skill-char-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px;
    width: 80px;
    /* 蟷・ｺ・￡繧・*/
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    opacity: 0.6;
    flex-shrink: 0;
}

.skill-char-card:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

.skill-char-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.3);
    background: rgba(79, 172, 254, 0.1);
    opacity: 1;
    /* transform縺ｪ縺・*/
}

.skill-char-status-text {
    font-size: 10px;
    color: #eee;
    margin-top: 2px;
    line-height: 1.2;
    white-space: nowrap;
}

.skill-char-card.dead {
    filter: grayscale(1);
    border-color: #555;
    opacity: 0.4;
}

.skill-char-card img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-bottom: 4px;
    object-fit: cover;
    border: 2px solid transparent;
}

.skill-char-card.active img {
    border-color: var(--primary);
}

/* 繝溘ル繝舌・ (HP/MP) */
.skill-char-bars {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

.mini-bar-bg {
    background: rgba(255, 255, 255, 0.1);
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    width: 100%;
}

.mini-bar-bg .hp-fill {
    background: #ff6b6b;
    height: 100%;
    transition: width 0.3s;
}

.mini-bar-bg .mp-fill {
    background: #4facfe;
    height: 100%;
    transition: width 0.3s;
}

.map-skill-list {
    flex: 1;
    /* 谿九ｊ縺ｮ鬮倥＆繧貞沂繧√ｋ */
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px;
    box-sizing: border-box;
}

.skill-msg-empty {
    padding: 24px;
    text-align: center;
    color: #888;
    font-size: 12px;
    margin-top: 40px;
}

/* 繧ｹ繧ｭ繝ｫ鬆・岼・域姶髣倡判髱｢鬚ｨ・・*/
.map-skill-item {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    margin-bottom: 8px;
    border-radius: 6px;
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
}

.map-skill-item:last-child {
    margin-bottom: 0;
}

.map-skill-item:hover:not(.disabled) {
    background: rgba(79, 172, 254, 0.15);
    border-color: var(--primary);
    /* transform蜑企勁 - 蜿ｳ縺ｫ縺壹ｌ繧句撫鬘後ｒ髦ｲ豁｢ */
}

.map-skill-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.skill-name {
    font-weight: bold;
    font-size: 14px;
    color: #fff;
}

.skill-cost {
    font-size: 12px;
    color: #4facfe;
    font-family: monospace;
}

.skill-body {
    font-size: 11px;
    color: #ccc;
}

.skill-row-main {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.skill-name {
    font-weight: bold;
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.unique-badge {
    background: var(--warning);
    color: #000;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.skill-cost {
    font-size: 11px;
    color: var(--primary);
    font-weight: bold;
}

.skill-desc {
    font-size: 10px;
    color: #aaa;
    line-height: 1.3;
}

/* 繧ｿ繝ｼ繧ｲ繝・ヨ驕ｸ謚橸ｼ育ｸｦ繝ｪ繧ｹ繝医・隕冶ｪ肴ｧ驥崎ｦ厄ｼ・*/
.skill-target-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}

.target-select-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.target-select-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

.target-select-card.valid-target:hover {
    border-color: var(--success);
    background: rgba(46, 204, 113, 0.1);
}

.target-select-card.invalid-target {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.target-select-card img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.target-info {
    flex: 1;
}

.target-name {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
}

.target-bars-mini {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
}

.bar-row .label {
    width: 14px;
    text-align: left;
    color: #888;
}

.bar-row .val {
    width: 30px;
    text-align: right;
    color: #aaa;
}

.bar-bg {
    flex: 1;
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    overflow: hidden;
}

.hp-fill {
    background: #ff6b6b;
    height: 100%;
}

.mp-fill {
    background: #4facfe;
    height: 100%;
}

/* ========================================
   驕翫・譁ｹ繝｢繝ｼ繝繝ｫ
   ======================================== */
.howto-modal-content {
    max-width: 90%;
    width: 360px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.howto-content {
    flex: 1;
    overflow-y: auto;
    text-align: left;
    padding: 16px 0;
    font-size: 13px;
    line-height: 1.6;
}

.howto-section {
    margin-bottom: 20px;
}

.howto-section h4 {
    color: var(--primary);
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(79, 172, 254, 0.3);
}

.howto-section p {
    color: var(--text-sub);
    margin-bottom: 8px;
}

.howto-section ul {
    margin-left: 16px;
    color: var(--text-sub);
}

.howto-section li {
    margin-bottom: 4px;
}

.howto-formula {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    color: #ccc;
    margin: 8px 0;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 12px 32px;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
}

.btn-secondary:hover {
    background: rgba(79, 172, 254, 0.1);
}

/* Item Swap Modal */
.item-swap-grid {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.item-swap-card {
    cursor: pointer;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.item-swap-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.item-swap-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    word-break: break-all;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-swap-card span {
    font-size: 11px;
    color: #aaa;
    line-height: 1.3;
}

.item-swap-card.cancel-card {
    border-color: rgba(255, 100, 100, 0.5);
    background: rgba(255, 0, 0, 0.1);
}

.item-swap-card.cancel-card:hover {
    background: rgba(255, 0, 0, 0.2);
}

/* Vertical List Item Styles for Item Swap & Rewards */
.vertical-list-item {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.vertical-list-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
}

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

.vertical-item-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.vertical-item-sub {
    font-size: 13px;
    color: #bbb;
}

.vertical-item-desc {
    font-size: 12px;
    color: #ccc;
    line-height: 1.5;
    text-align: left;
}

/* Special Item (Highlighted) */
.vertical-list-item.special-item {
    border-color: var(--warning);
    background: rgba(245, 175, 25, 0.15);
}

.vertical-list-item.special-item .vertical-item-name {
    color: var(--warning);
}

.vertical-list-item.special-item:hover {
    background: rgba(245, 175, 25, 0.25);
}

/* Cancel Item */
.vertical-list-item.cancel-item {
    border-color: #666;
    margin-top: 12px;
    background: rgba(0, 0, 0, 0.4);
}

.vertical-list-item.cancel-item .vertical-item-header {
    border-bottom: none;
    justify-content: center;
    margin-bottom: 0;
    padding-bottom: 2px;
}

.vertical-list-item.cancel-item .vertical-item-name {
    color: #999;
    font-size: 14px;
}

.vertical-list-item.cancel-item .vertical-item-desc {
    text-align: center;
    color: #777;
    font-size: 11px;
}

.vertical-list-item.cancel-item:hover {
    border-color: #999;
    background: rgba(255, 255, 255, 0.1);
}

.vertical-list-item.cancel-item:hover .vertical-item-name {
    color: #ccc;
}

/* Container adjustment */
.vertical-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* Shop Item States for Vertical List */
.vertical-list-item.purchased {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(100%);
    background: rgba(0, 0, 0, 0.5);
    border-color: #333;
}

.vertical-list-item.purchased .vertical-item-name {
    color: #888;
    text-decoration: line-through;
}

.vertical-list-item.purchased::after {
    content: "SOLD OUT";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-10deg);
    font-size: 24px;
    font-weight: 900;
    color: rgba(255, 50, 50, 0.7);
    border: 3px solid rgba(255, 50, 50, 0.7);
    padding: 4px 12px;
    border-radius: 4px;
    z-index: 5;
    text-shadow: 0 0 5px #000;
}

.vertical-list-item.too-expensive {
    opacity: 0.7;
    background: rgba(50, 10, 10, 0.3);
}

.vertical-list-item.too-expensive .vertical-item-name {
    color: #aaa;
}

/* Title Screen Sub Buttons */
.title-sub-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
    width: 100%;
    max-width: 250px;
}

.title-sub-buttons .btn-secondary {
    flex: 1;
    font-size: 14px;
    padding: 8px;
    min-height: auto;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid var(--glass-border);
    color: #fff;
}

.title-sub-buttons .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

/* Name Input Styles */
.name-input-container {
    margin: 10px auto;
    width: 100%;
    max-width: 300px;
    text-align: center;
}

.name-input-label {
    display: block;
    font-size: 10px;
    color: var(--primary);
    margin-bottom: 4px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.name-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    border-bottom: 2px solid var(--glass-border);
    padding: 8px 12px;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    text-align: center;
    transition: all 0.3s;
    border-radius: 4px 4px 0 0;
}

.name-input:focus {
    outline: none;
    border-bottom-color: var(--primary);
    background: rgba(79, 172, 254, 0.1);
    box-shadow: 0 4px 10px -4px rgba(79, 172, 254, 0.3);
}

.name-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

/* Records Modal Styles */
.records-modal-content {
    max-width: 400px;
    width: 90%;
    background: rgba(15, 20, 30, 0.95);
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    margin: auto;
    /* Center in flex container safely */
}

.records-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    font-size: 12px;
    color: var(--text-sub);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.records-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.records-list::-webkit-scrollbar {
    width: 6px;
}

.records-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.record-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.record-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.record-difficulty-badge {
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.record-player-name {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex: 1;
    margin-left: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-date {
    font-size: 10px;
    color: var(--text-sub);
}

.record-party-faces {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.record-face-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    /* Rounded square */
    border: 2px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
    cursor: pointer;
    transition: all 0.2s;
}

.record-face-img:hover {
    transform: scale(1.1);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.5);
}

.record-face-img:active {
    transform: scale(0.95);
}

/* Layer Management for Modals */
#records-modal {
    z-index: 10000;
}

#character-detail-modal {
    z-index: 11000;
    /* Ensure detail is above records */
}

.record-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: #ddd;
    display: none;
    /* Hidden by default */
}

.record-card.expanded .record-details {
    display: block;
    animation: fadeIn 0.3s ease;
}

.detail-member-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 2px;
}

.detail-member-name {
    color: var(--primary);
    font-weight: 700;
}

.detail-skills {
    color: var(--text-sub);
    font-size: 10px;
}

.loading-records {
    text-align: center;
    padding: 20px;
    color: var(--text-sub);
    font-style: italic;
}

/* ========================================
   Phase 4: Enhanced Skill Effects (VFX)
   ======================================== */

/* Loid: Scan Wave */
.vfx-scan-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, transparent 0%, rgba(0, 255, 0, 0.2) 50%, rgba(0, 255, 0, 0.6) 100%);
    opacity: 0;
    animation: vfx-scan-expand 1s ease-out forwards;
    pointer-events: none;
    z-index: 1000;
}

.vfx-scan-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 0, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 0, 0.3) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.5;
    transform: perspective(500px) rotateX(60deg);
}

.vfx-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: #0f0;
    box-shadow: 0 0 10px #0f0;
    animation: vfx-scan-move 1s linear infinite;
}

@keyframes vfx-scan-expand {
    0% {
        width: 0%;
        height: 0%;
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        width: 200%;
        height: 200%;
        opacity: 0;
    }
}

@keyframes vfx-scan-move {
    0% {
        top: 0%;
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Nyammy: Barrier */
.vfx-barrier-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
}

.vfx-cat-barrier {
    width: 120px;
    height: 120px;
    border: 4px solid #f472b6;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    /* Cat head shape approx */
    position: relative;
    box-shadow: 0 0 20px #f472b6, inset 0 0 20px #f472b6;
    animation: vfx-pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.vfx-cat-barrier::before,
.vfx-cat-barrier::after {
    content: '';
    position: absolute;
    top: -20px;
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 30px solid #f472b6;
}

.vfx-cat-barrier::before {
    left: 0;
    transform: rotate(-30deg);
}

.vfx-cat-barrier::after {
    right: 0;
    transform: rotate(30deg);
}

.vfx-hex-barrier-large {
    width: 150px;
    height: 150px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid white;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: vfx-pop-in 0.5s ease forwards;
}

@keyframes vfx-pop-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    80% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Sparkles (Anya, Hanamaru, Osamu, Atsumu) */
.vfx-sparkle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 950;
    pointer-events: none;
}

.vfx-sparkle-star {
    position: absolute;
    font-size: 24px;
    color: yellow;
    animation: vfx-sparkle-float 0.8s ease-out forwards;
    animation-delay: var(--delay);
    opacity: 0;
}

.vfx-sparkle-star::before {
    content: '';
}

.vfx-sparkle-circle {
    position: absolute;
    width: 15px;
    height: 15px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px white;
    opacity: 0;
    animation: vfx-float-up 0.8s ease-out forwards;
    animation-delay: var(--delay);
}

.vfx-sparkle-twin {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, white, transparent 70%);
    opacity: 0;
}

@keyframes vfx-sparkle-float {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }

    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}

@keyframes vfx-float-up {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

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

@keyframes vfx-flash {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    10% {
        transform: scale(1.5);
        opacity: 1;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* Heart Storm (Chiyuki) */
.vfx-heart-storm {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    z-index: 950;
    pointer-events: none;
}

/* CSS Heart Shape Construction */
.vfx-heart-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: #f472b6;
    transform: translate(-50%, -50%) rotate(45deg);
    opacity: 0;
    animation: vfx-heart-scatter 1s ease-out forwards;
    animation-delay: var(--delay);
    box-shadow: 0 0 5px #f472b6;
}

.vfx-heart-particle::before,
.vfx-heart-particle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #f472b6;
    border-radius: 50%;
}

.vfx-heart-particle::before {
    top: -10px;
    left: 0;
}

.vfx-heart-particle::after {
    top: 0;
    left: -10px;
}

/* Override text content if I removed it in JS, but for safety in CSS hide text if present */
.vfx-heart-particle {
    color: transparent;
}

@keyframes vfx-heart-scatter {
    0% {
        transform: translate(-50%, -50%) rotate(45deg) scale(0);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--x)), calc(-50% - 100px)) rotate(45deg) scale(0);
        opacity: 0;
    }
}

/* Butterflies (Akiko) */
.vfx-butterfly-swarm {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    z-index: 950;
}

.vfx-butterfly {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, gold, transparent);
    opacity: 0;
    animation: vfx-butterfly-fly 1.2s ease-in-out forwards;
    animation-delay: var(--delay);
}

.vfx-butterfly::before,
.vfx-butterfly::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 25px;
    background: rgba(255, 215, 0, 0.8);
    border-radius: 50% 50% 0 50%;
    top: -5px;
}

.vfx-butterfly::before {
    left: -12px;
    transform: rotate(30deg);
    transform-origin: right;
    animation: flutter 0.2s infinite alternate;
}

.vfx-butterfly::after {
    right: -12px;
    transform: rotate(-30deg) scaleX(-1);
    transform-origin: left;
    animation: flutter 0.2s infinite alternate;
}

@keyframes flutter {
    from {
        transform: rotate(30deg);
    }

    to {
        transform: rotate(0deg);
    }
}

@keyframes vfx-butterfly-fly {
    0% {
        transform: translate(-50%, 0) scale(0);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--x)), -150px) scale(1);
        opacity: 0;
    }
}

/* Critical Slash (Yor) */
.vfx-crit-slash {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    /* Fix: Centered correctly */
    z-index: 2000;
    pointer-events: none;
}

.vfx-slash-pro.red {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 40%, rgba(200, 0, 0, 0.9) 50%, transparent 60%);
    animation: vfx-slash-anim 0.2s cubic-bezier(0.1, 0.7, 1.0, 0.1) forwards;
}

.vfx-impact-flash {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, #fff, transparent);
    animation: vfx-flash-anim 0.3s ease-out forwards;
    animation-delay: 0.1s;
}

@keyframes vfx-flash-anim {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Koikaze (Kaho) - Ensure it exists if not already */
.vfx-koikaze {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 900;
}

.vfx-sakura-petal {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: #ffb3d9;
    border-radius: 10px 0 10px 0;
    opacity: 0;
    animation: vfx-petal-rise 1.5s ease-out forwards;
    animation-delay: var(--delay);
}

@keyframes vfx-petal-rise {
    0% {
        transform: translate(-50%, 0) rotate(0deg);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--x)), -300px) rotate(var(--rotation));
        opacity: 0;
    }
}


/* Starburst Stream Final Cross Slash */
.vfx-slash-cross {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 12px;
    transform: translate(-50%, -50%) rotate(var(--r, 0deg));
    pointer-events: none;
    opacity: 0;
    box-shadow: 0 0 15px currentColor;
    border-radius: 4px;
    animation: vfx-slash-flash 0.4s ease-out forwards;
}

@keyframes vfx-slash-flash {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scaleX(0.5);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scaleX(1.1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scaleX(1);
    }
}

/* Sumire: Galaxy Spotlight (Enhanced) */
.vfx-galaxy-spotlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.vfx-spotlight-beam {
    position: absolute;
    top: -20%;
    left: 50%;
    width: 400px;
    height: 100%;
    /* Pale Green gradient */
    background: linear-gradient(to bottom, rgba(165, 243, 252, 0.6), rgba(134, 239, 172, 0) 80%);
    transform: translateX(-50%) perspective(500px) rotateX(20deg);
    opacity: 0;
    animation: spotlight-on 1.5s ease-out forwards;
    filter: blur(15px);
}

@keyframes spotlight-on {
    0% {
        opacity: 0;
        transform: translateX(-50%) perspective(500px) rotateX(20deg) scaleX(0.5);
    }

    10% {
        opacity: 1;
        transform: translateX(-50%) perspective(500px) rotateX(20deg) scaleX(1);
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.vfx-galaxy-spiral {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%) scale(0);
    background: radial-gradient(circle, transparent 20%, rgba(216, 180, 254, 0.5) 40%, rgba(74, 222, 128, 0.5) 60%, transparent 80%);
    border-radius: 50%;
    opacity: 0;
    animation: galaxy-spiral-spin 1s ease-in-out forwards;
}

@keyframes galaxy-spiral-spin {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
    }

    30% {
        transform: translate(-50%, -50%) scale(0.8) rotate(180deg);
        opacity: 0.8;
    }

    80% {
        transform: translate(-50%, -50%) scale(0.2) rotate(360deg);
        opacity: 1;
    }

    /* Charge complete */
    100% {
        transform: translate(-50%, -50%) scale(2) rotate(720deg);
        opacity: 0;
    }

    /* Burst */
}

.vfx-galaxy-star {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    opacity: 0;
    animation: galaxy-burst 0.8s ease-out forwards;
    animation-delay: var(--delay);
}

@keyframes galaxy-burst {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(0) rotate(var(--rot));
        opacity: 0;
    }
}

.vfx-galaxy-shockwave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 5px solid rgba(168, 85, 247, 0.8);
    background: transparent;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.8);
    animation: galaxy-shockwave 0.5s ease-out forwards;
    animation-delay: 0.9s;
    /* Sync with particle burst */
}

@keyframes galaxy-shockwave {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
        border-width: 20px;
    }

    10% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(8);
        opacity: 0;
        border-width: 0px;
    }
}