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

:root {
    --primary: #ff0033;
    --primary-dark: #cc0029;
    --primary-glow: rgba(255, 0, 51, 0.6);
    --primary-subtle: rgba(255, 0, 51, 0.08);
    --secondary: #1a1a2e;
    --bg: #08080f;
    --bg-light: #12121e;
    --bg-card: rgba(18, 18, 32, 0.75);
    --bg-glass: rgba(18, 18, 32, 0.45);
    --text: #eef0f6;
    --text-muted: #7a7f9a;
    --accent: #ff4d6d;
    --accent-alt: #ffd700;
    --border: rgba(255, 0, 51, 0.2);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --glass-blur: 16px;
    --glass-border: rgba(255, 255, 255, 0.08);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-glow: 0 0 40px rgba(255, 0, 51, 0.12);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(255, 0, 51, 0.07) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 90%, rgba(100, 50, 255, 0.04) 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, rgba(255, 0, 51, 0.02) 0%, transparent 70%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated background noise texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.015'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* Floating geometric grid background */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(255, 0, 51, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 51, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridDrift 20s linear infinite;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 70%);
}

@keyframes gridDrift {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(60px, 60px);
    }
}

#app {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 50px 30px 40px;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    animation: headerAppear 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

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

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--accent), var(--accent-alt), var(--primary), transparent);
    background-size: 200% 100%;
    animation: borderSlide 4s linear infinite;
}

header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(255, 0, 51, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

@keyframes borderSlide {
    0% {
        background-position: 200% 0;
    }

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

@keyframes headerGlow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

header h1 {
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 2.6rem;
    margin-bottom: 12px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--accent-alt));
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 6s ease infinite;
    position: relative;
    z-index: 1;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% center;
    }

    50% {
        background-position: 200% center;
    }
}

@keyframes titlePulse {

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

    50% {
        filter: brightness(1.2);
    }
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

section {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 28px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border: 1px solid var(--glass-border);
    position: relative;
    transition: all var(--transition-smooth);
    box-shadow: var(--shadow-card);
    animation: sectionAppear 0.6s ease backwards;
}

section:nth-child(1) {
    animation-delay: 0.1s;
}

section:nth-child(2) {
    animation-delay: 0.2s;
}

section:nth-child(3) {
    animation-delay: 0.3s;
}

section:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes sectionAppear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

section:hover {
    border-color: rgba(255, 0, 51, 0.3);
    box-shadow: var(--shadow-card), 0 0 30px rgba(255, 0, 51, 0.1);
    transform: translateY(-2px);
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent), transparent);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    opacity: 0.7;
}

/* フォーム要素のスタイル */
select,
input[type="number"] {
    background: rgba(12, 12, 24, 0.7);
    color: var(--text);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 0.9em;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-fast);
}

select:hover,
input[type="number"]:hover {
    border-color: rgba(255, 0, 51, 0.35);
    background: rgba(18, 18, 32, 0.8);
}

select:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 0, 51, 0.15), 0 0 12px rgba(255, 0, 51, 0.1);
    background: rgba(18, 18, 32, 0.9);
}

select option {
    background: #1a1a2e;
    color: var(--text);
}

h2 {
    margin-bottom: 20px;
    color: var(--primary);
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    padding-left: 18px;
}

h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(255, 0, 51, 0.4);
}

/* 折りたたみ機能 */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    margin: -28px -28px 16px -28px;
    background: linear-gradient(135deg, rgba(255, 0, 51, 0.06), rgba(255, 77, 109, 0.03), transparent);
    border-bottom: 1px solid rgba(255, 0, 51, 0.1);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.collapsible-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent), transparent);
    transition: width 0.4s ease;
}

.collapsible-header:hover {
    background: linear-gradient(135deg, rgba(255, 0, 51, 0.1), rgba(255, 77, 109, 0.06), transparent);
    border-bottom-color: rgba(255, 0, 51, 0.25);
}

.collapsible-header:hover::before {
    width: 100%;
}

.collapsible-header:active {
    transform: scale(0.995);
}

.collapse-icon {
    font-size: 0.75em;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--primary);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 0, 51, 0.08);
    flex-shrink: 0;
}

.collapsible-header:hover .collapse-icon {
    background: rgba(255, 0, 51, 0.15);
    color: var(--accent);
}

.collapsible-content {
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    overflow: hidden;
}

.collapsible-content.collapsed {
    max-height: 0 !important;
    opacity: 0;
    padding: 0;
    margin: 0;
}

/* パーティ編成 */
.party-config {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
}

.party-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-subtle);
}

.party-section h3 {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

.party-members {
    display: grid;
    gap: 12px;
}

.party-member-config {
    background: rgba(12, 12, 24, 0.5);
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--primary);
    transition: all var(--transition-smooth);
    position: relative;
}

.party-member-config:hover {
    background: rgba(255, 0, 51, 0.04);
    border-left-color: var(--accent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.member-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
}

.member-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.party-member-config label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text);
}

.party-member-config label span {
    min-width: 80px;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.char-select,
.cons-select {
    flex: 1;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(12, 12, 24, 0.6);
    color: var(--text);
    border: 1px solid var(--border-subtle);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-fast);
}

.char-select:focus,
.cons-select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(18, 18, 32, 0.9);
    box-shadow: 0 0 0 3px rgba(255, 0, 51, 0.12);
}

.char-select:hover,
.cons-select:hover {
    border-color: rgba(255, 77, 109, 0.4);
}

/* ===== 戦場設定（ステージ+敵 統合） ===== */
.battlefield-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 12px;
}

.bf-panel {
    background: rgba(12, 12, 24, 0.6);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: all var(--transition-smooth);
    position: relative;
}

.bf-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.bf-panel-header {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.bf-panel-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
}

.bf-panel-header.bf-stage {
    background: linear-gradient(135deg, rgba(168, 218, 220, 0.12), rgba(69, 123, 157, 0.08));
    color: #a8dadc;
}

.bf-panel-header.bf-stage::after {
    background: linear-gradient(90deg, #a8dadc, transparent);
    opacity: 0.3;
}

.bf-panel-header.bf-enemy {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.12), rgba(255, 77, 109, 0.08));
    color: #e63946;
}

.bf-panel-header.bf-enemy::after {
    background: linear-gradient(90deg, #e63946, transparent);
    opacity: 0.3;
}

.bf-panel-body {
    padding: 12px;
}

/* ステージバフカード */
.stage-buff-card {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(168, 218, 220, 0.1);
    transition: all 0.2s ease;
}

.stage-buff-card:hover {
    border-color: rgba(168, 218, 220, 0.25);
    background: rgba(0, 0, 0, 0.35);
}

.stage-buff-card li {
    color: #a8dadc;
    font-size: 0.82rem;
    line-height: 1.7;
    list-style: none;
    padding-left: 14px;
    position: relative;
}

.stage-buff-card li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #457b9d;
}

/* 敵カード（コンパクト） */
.enemy-card {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border: 1px solid rgba(230, 57, 70, 0.1);
    display: grid;
    grid-template-columns: auto 1fr 1fr auto auto;
    gap: 8px;
    align-items: center;
    transition: all 0.2s ease;
}

.enemy-card:hover {
    border-color: rgba(230, 57, 70, 0.25);
    background: rgba(0, 0, 0, 0.35);
}

.enemy-card:last-child {
    margin-bottom: 0;
}

.enemy-card .enemy-name {
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.enemy-card label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-weight: 500;
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.enemy-card label input {
    max-width: 110px;
    padding: 5px 8px;
    font-size: 0.85rem;
}

.enemy-card select {
    max-width: 85px;
    padding: 5px 8px;
    font-size: 0.85rem;
}

.enemy-card .required-debuff {
    font-size: 0.7rem;
    white-space: nowrap;
}

/* 敵状態パネル (統合版) */
.bf-status-panel {
    grid-column: 1 / -1;
    background: rgba(12, 12, 24, 0.6);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: all 0.25s ease;
    animation: statusAppear 0.4s ease;
}

@keyframes statusAppear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.bf-status-panel .bf-panel-header {
    background: linear-gradient(135deg, rgba(231, 111, 81, 0.12), rgba(244, 162, 97, 0.08));
    color: #e76f51;
}

.bf-status-panel .bf-panel-header::after {
    background: linear-gradient(90deg, #e76f51, transparent);
    opacity: 0.3;
}

.bf-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px;
}

.bf-status-cell {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.78rem;
}

.bf-status-cell-title {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* スコアモード統合 */
.score-mode-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: rgba(244, 162, 97, 0.06);
    border-radius: 8px;
    border: 1px solid rgba(244, 162, 97, 0.15);
    margin-top: 8px;
}

/* 敵設定のレガシースタイル維持 */
.enemy-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.enemy-item {
    background: rgba(0, 0, 0, 0.25);
    padding: 10px 12px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 100px 1fr 1fr auto;
    gap: 8px;
    align-items: center;
    border: 1px solid rgba(230, 57, 70, 0.1);
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.enemy-item:hover {
    border-color: rgba(230, 57, 70, 0.25);
    background: rgba(0, 0, 0, 0.35);
}

.enemy-header {
    color: var(--primary);
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enemy-item label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-weight: 500;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.enemy-item label input {
    width: 100%;
    max-width: 130px;
    padding: 5px 8px;
    font-size: 0.82rem;
    box-sizing: border-box;
}

.required-debuff {
    font-size: 0.78rem;
    color: var(--accent-alt);
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(255, 215, 0, 0.08);
    border-radius: 6px;
    border-left: 3px solid var(--accent-alt);
    letter-spacing: 0.3px;
    white-space: nowrap;
    min-width: max-content;
}

.enemy-item select {
    display: none;
}

input[type="number"],
select {
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: rgba(12, 12, 24, 0.6);
    color: var(--text);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-fast);
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(18, 18, 32, 0.9);
    box-shadow: 0 0 0 3px rgba(255, 0, 51, 0.12);
}

input[type="number"]:hover,
select:hover {
    border-color: rgba(255, 77, 109, 0.35);
}

/* ターンタブ */
.turn-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    padding: 6px;
    background: rgba(12, 12, 24, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.tab {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tab::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all var(--transition-smooth);
    transform: translateX(-50%);
    border-radius: 1px;
}

.tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.tab:hover::after {
    width: 60%;
}

.tab.active {
    background: linear-gradient(135deg, rgba(255, 0, 51, 0.2), rgba(255, 77, 109, 0.1));
    color: var(--text);
    box-shadow: 0 0 20px rgba(255, 0, 51, 0.15);
}

.tab.active::after {
    width: 70%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    box-shadow: 0 0 8px rgba(255, 0, 51, 0.5);
}

/* ターン入力 */
#turn-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* アクションカード — Grid レイアウト */
.char-action {
    background: rgba(12, 12, 24, 0.45);
    backdrop-filter: blur(6px);
    padding: 0;
    border-radius: var(--radius-sm);
    display: grid;
    grid-template-columns: 36px 160px 160px 110px 1fr 180px;
    grid-template-rows: auto;
    grid-template-areas: "order charinfo skills target buffs damage";
    align-items: stretch;
    border: 1px solid var(--border-subtle);
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
    min-height: 52px;
    overflow: hidden;
}

.char-action:hover {
    background: rgba(255, 0, 51, 0.04);
    border-left-color: var(--primary);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25), 0 0 12px rgba(255, 0, 51, 0.04);
}

/* グリッド内各ゾーン共通 */
.action-zone {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    min-height: 52px;
}

/* ゾーン: 並び順 */
.action-zone-order {
    grid-area: order;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    padding: 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

/* ゾーン: キャラ情報（アイコン+名前+パッシブ） */
.action-zone-charinfo {
    grid-area: charinfo;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.12);
}

/* ゾーン: スキル選択 */
.action-zone-skills {
    grid-area: skills;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 6px 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    align-items: center;
}

/* ゾーン: ターゲット選択 */
.action-zone-target {
    grid-area: target;
    justify-content: center;
    align-items: center;
    padding: 6px 6px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.target-select {
    width: 88px;
    max-width: 88px;
    min-width: 0;
    padding: 4px 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    color: #f1faee;
    border: 1px solid rgba(69, 123, 157, 0.5);
    font-size: 0.75em;
    cursor: pointer;
    text-overflow: ellipsis;
    overflow: hidden;
    box-sizing: border-box;
}

/* ゾーン: バフ一覧 */
.action-zone-buffs {
    grid-area: buffs;
    flex-wrap: wrap;
    gap: 3px;
    padding: 6px 8px;
    font-size: 0.72rem;
    color: #a8dadc;
    align-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* ゾーン: ダメージ */
.action-zone-damage {
    grid-area: damage;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.15);
    flex-direction: column;
    gap: 2px;
}

/* ヘッダー行 */
.action-grid-header {
    display: grid;
    grid-template-columns: 36px 160px 160px 110px 1fr 180px;
    gap: 0;
    padding: 0;
    margin-bottom: 2px;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(168, 218, 220, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.action-grid-header>div {
    padding: 4px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* スキルゾーン内のドロップダウン幅制限 */
.action-zone-skills select {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ドラッグ＆ドロップ */
.char-action[draggable="true"] {
    cursor: grab;
}

.char-action[draggable="true"]:active {
    cursor: grabbing;
}

.char-action.dragging {
    opacity: 0.4;
    border: 1px dashed var(--primary);
    background: rgba(255, 0, 51, 0.05) !important;
    transform: scale(0.97);
    box-shadow: 0 0 20px rgba(255, 0, 51, 0.2);
}

.char-action.swap-anim {
    animation: swapSettle 0.25s ease-out;
}

.char-action.drop-settled {
    animation: dropSettle 0.3s ease-out;
}

@keyframes swapSettle {
    0% {
        transform: scale(0.96);
        opacity: 0.6;
        box-shadow: 0 0 12px rgba(255, 0, 51, 0.3);
    }

    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: none;
    }
}

@keyframes dropSettle {
    0% {
        transform: scale(1.03);
        box-shadow: 0 0 20px rgba(255, 0, 51, 0.5);
        background: rgba(255, 0, 51, 0.15);
    }

    60% {
        transform: scale(0.99);
    }

    100% {
        transform: scale(1);
        box-shadow: none;
    }
}

/* ドラッグハンドル */
.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    min-width: 16px;
    height: 32px;
    color: #555;
    cursor: grab;
    font-size: 10px;
    letter-spacing: 1px;
    transition: color 0.2s;
    user-select: none;
}

.drag-handle:hover {
    color: var(--primary);
}

.drag-handle:active {
    cursor: grabbing;
    color: var(--accent);
}

/* キャラ名 */
.char-name {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* キャラパッシブ情報（ブチ切れ、仮面等） */
.char-passive-info {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}

/* スキルボタンコンテナ */
.action-buttons {
    display: flex;
    gap: 3px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

/* ターゲット選択ラベル */
.target-label {
    font-size: 0.8em;
    color: #a8dadc;
    font-weight: 600;
    white-space: nowrap;
}

/* ダメージ表示 - 右寄せ */
.action-damage {
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 0.9em;
    font-weight: 700;
    color: var(--accent-alt);
    text-align: right;
    cursor: pointer;
    white-space: nowrap;
    min-width: 80px;
    flex-shrink: 0;
}

.action-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: rgba(12, 12, 24, 0.6);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.action-btn:hover {
    background: rgba(255, 0, 51, 0.12);
    border-color: rgba(255, 0, 51, 0.4);
    color: var(--text);
    transform: translateY(-1px);
}

.action-btn.selected {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 15px rgba(255, 0, 51, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

@keyframes selectedPulse {

    0%,
    100% {
        box-shadow: 0 0 15px var(--primary-glow);
    }

    50% {
        box-shadow: 0 0 25px var(--primary-glow);
    }
}

/* 長いスキル名用 */
.action-btn.long-name {
    font-size: 0.68rem;
    padding: 6px 8px;
}

/* 短いスキル名用 */
.action-btn.compact {
    padding: 6px 12px;
    min-width: 42px;
    text-align: center;
}

/* バフバッジ */
.buff-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    line-height: 1.3;
}

/* ダメージ表示エリア */
.damage-display {
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--accent-alt);
    font-weight: 700;
    padding: 5px 12px;
    background: rgba(255, 215, 0, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.damage-display:hover {
    background: rgba(255, 215, 0, 0.12);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
}

/* バフエリア */
.buff-area {
    grid-column: 2 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.75rem;
}

.hl-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(12, 12, 24, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.hl-checkbox:hover {
    border-color: rgba(255, 215, 0, 0.3);
}

.hl-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ナビ行専用スタイル */
.char-action.navi-active {
    border-color: rgba(46, 204, 113, 0.6) !important;
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.25), 0 0 24px rgba(46, 204, 113, 0.08);
    animation: naviGlow 2.5s ease-in-out infinite;
}

@keyframes naviGlow {

    0%,
    100% {
        box-shadow: 0 0 12px rgba(46, 204, 113, 0.25), 0 0 24px rgba(46, 204, 113, 0.08);
    }

    50% {
        box-shadow: 0 0 18px rgba(46, 204, 113, 0.4), 0 0 36px rgba(46, 204, 113, 0.12);
    }
}

.navi-skill-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    width: 100%;
}

.navi-enable-toggle {
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    flex-shrink: 0;
}

.navi-enable-toggle input {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #2ecc71;
    margin: 0;
}

.navi-enable-toggle label {
    font-size: 0.68rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
}

.navi-cd-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.15);
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.navi-skill-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.navi-skill-buttons .action-btn {
    padding: 3px 8px;
    font-size: 0.72rem;
}

/* 計算ボタン */
.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.controls button {
    flex: 1;
    padding: 16px 24px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.controls button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s ease;
}

.controls button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 0, 51, 0.35);
}

.controls button:hover::before {
    left: 100%;
}

.controls button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 0, 51, 0.3);
}

/* 結果表示 */
.total-damage {
    font-family: 'Orbitron', 'Inter', sans-serif;
    text-align: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(255, 0, 51, 0.08) 0%, rgba(18, 18, 32, 0.9) 100%);
    border: 1px solid rgba(255, 0, 51, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.score-triple {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.score-card {
    flex: 1;
    max-width: 200px;
    padding: 8px 10px;
    border-radius: 8px;
    text-align: center;
}

.score-card-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    opacity: 0.8;
}

.score-card-value {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.score-card-selected {
    background: rgba(168, 218, 220, 0.1);
    border: 1px solid rgba(168, 218, 220, 0.3);
}

.score-card-selected .score-card-label {
    color: #a8dadc;
}

.score-card-selected .score-card-value {
    color: #e0f4f4;
}

.score-card-cumulative {
    background: rgba(244, 162, 97, 0.1);
    border: 1px solid rgba(244, 162, 97, 0.3);
}

.score-card-cumulative .score-card-label {
    color: #f4a261;
}

.score-card-cumulative .score-card-value {
    color: #ffe0c0;
}

.score-card-total {
    background: rgba(255, 0, 51, 0.1);
    border: 1px solid rgba(255, 0, 51, 0.3);
}

.score-card-total .score-card-label {
    color: #ff6b6b;
}

.score-card-total .score-card-value {
    color: #ffd0d0;
}

.turn-breakdown,
.buffs-debuffs {
    background: rgba(12, 12, 24, 0.5);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border: 1px solid var(--border-subtle);
}

.turn-breakdown h3,
.buffs-debuffs h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* 折りたたみ式ターン内訳 */
.turn-breakdown-details {
    cursor: pointer;
}

.turn-breakdown-details summary {
    color: var(--primary);
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    list-style: none;
    user-select: none;
    padding: 4px 0;
    transition: color 0.2s;
}

.turn-breakdown-details summary::-webkit-details-marker {
    display: none;
}

.turn-breakdown-details summary:hover {
    color: var(--accent);
}

.turn-breakdown-details[open] summary span {
    display: inline-block;
    transform: rotate(180deg);
}

.turn-breakdown-items {
    margin-top: 8px;
}

.turn-item {
    padding: 10px 12px;
    background: rgba(12, 12, 24, 0.4);
    border-left: 3px solid var(--primary);
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.9em;
}

/* ===== スコアログ ===== */
.score-log-section {
    margin-top: 4px;
}

.score-log-details {
    background: rgba(12, 12, 24, 0.5);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(244, 162, 97, 0.15);
}

.score-log-details summary {
    color: #f4a261;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: 2px 0;
}

.score-log-details summary::-webkit-details-marker {
    display: none;
}

.score-log-list {
    margin-top: 6px;
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(244, 162, 97, 0.3) transparent;
}

.score-log-item {
    padding: 5px 8px;
    border-radius: 4px;
    margin-bottom: 2px;
    background: rgba(0, 0, 0, 0.2);
    transition: background 0.15s;
}

.score-log-item:hover {
    background: rgba(244, 162, 97, 0.08);
}

.score-log-current {
    background: rgba(168, 218, 220, 0.08);
    border: 1px solid rgba(168, 218, 220, 0.2);
}

.score-log-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8em;
}

.score-log-num {
    color: #666;
    font-weight: 600;
    min-width: 24px;
    font-family: 'Orbitron', monospace;
    font-size: 0.85em;
}

.score-log-time {
    color: #888;
    font-size: 0.9em;
    min-width: 52px;
}

.score-log-score {
    color: #e0e0e0;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    min-width: 70px;
    text-align: right;
}

.score-log-diff-up {
    color: #2ecc71;
    font-weight: 600;
    font-size: 0.9em;
}

.score-log-diff-down {
    color: #e74c3c;
    font-weight: 600;
    font-size: 0.9em;
}

.score-log-diff-zero {
    color: #666;
    font-size: 0.85em;
}

.score-log-load-btn {
    margin-left: auto;
    padding: 2px 8px;
    background: rgba(244, 162, 97, 0.15);
    border: 1px solid rgba(244, 162, 97, 0.35);
    border-radius: 3px;
    color: #f4a261;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.score-log-load-btn:hover {
    background: rgba(244, 162, 97, 0.3);
    border-color: rgba(244, 162, 97, 0.6);
    transform: scale(1.05);
}

.score-log-current-badge {
    margin-left: auto;
    padding: 1px 6px;
    background: rgba(168, 218, 220, 0.15);
    border: 1px solid rgba(168, 218, 220, 0.3);
    border-radius: 3px;
    color: #a8dadc;
    font-size: 0.8em;
    font-weight: 600;
}

.score-log-changes {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 3px;
    padding-left: 32px;
}

.score-log-change {
    display: inline-block;
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    font-size: 0.72em;
    color: #bbb;
    white-space: nowrap;
}

/* ===== 行動選択ハイライト ===== */
.char-action.action-selected {
    background: rgba(255, 215, 0, 0.08) !important;
    box-shadow:
        inset 0 0 0 2px rgba(255, 215, 0, 0.6),
        0 0 8px rgba(255, 215, 0, 0.25),
        0 0 20px rgba(255, 215, 0, 0.12);
    border-radius: 4px;
    animation: actionRipple 1.8s ease-in-out infinite;
    position: relative;
}

@keyframes actionRipple {

    0%,
    100% {
        box-shadow:
            inset 0 0 0 2px rgba(255, 215, 0, 0.6),
            0 0 8px rgba(255, 215, 0, 0.25),
            0 0 20px rgba(255, 215, 0, 0.12);
    }

    50% {
        box-shadow:
            inset 0 0 0 2px rgba(255, 215, 0, 0.9),
            0 0 14px rgba(255, 215, 0, 0.4),
            0 0 30px rgba(255, 215, 0, 0.2);
    }
}

/* ===== スナップショットバナー ===== */
.snapshot-banner {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    margin-bottom: 6px;
    background: rgba(12, 12, 24, 0.7);
    border-left: 3px solid #f4a261;
    border-radius: 4px;
    font-size: 0.8em;
    color: #ccc;
    animation: snapshotFadeIn 0.2s;
}

.snapshot-banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: snapshotPulse 1.5s ease-in-out infinite;
}

@keyframes snapshotFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

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

@keyframes snapshotPulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 4px currentColor;
    }

    50% {
        opacity: 0.6;
        box-shadow: 0 0 8px currentColor;
    }
}

/* スクロールバーカスタマイズ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 0, 51, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 0, 51, 0.5);
}

/* セレクション */
::selection {
    background: rgba(255, 0, 51, 0.3);
    color: white;
}

/* NOIR Passive UI Styles */
.noir-passive-ui {
    background: rgba(18, 18, 32, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 10px 0;
    font-family: 'Inter', 'Courier New', monospace;
    box-shadow: var(--shadow-card);
}

#character-passives-content .noir-passive-ui {
    background: none !important;
    backdrop-filter: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.noir-mods {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.noir-mods span {
    color: var(--accent-alt);
    font-weight: bold;
    font-size: 0.9rem;
}

.mod-icons {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.mod-icons span {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
    font-size: 1.1rem;
}

.mod-heat_energy {
    background: linear-gradient(135deg, #ff4444, #ff6666);
    color: white;
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
}

.mod-armor_piercing {
    background: linear-gradient(135deg, #44aa44, #66cc66);
    color: white;
    box-shadow: 0 0 8px rgba(68, 170, 68, 0.5);
}

.mod-spread {
    background: linear-gradient(135deg, #4444ff, #6666ff);
    color: white;
    box-shadow: 0 0 8px rgba(68, 68, 255, 0.5);
}

.mod-overclock {
    background: linear-gradient(135deg, #ff8800, #ffaa44);
    color: white;
    box-shadow: 0 0 8px rgba(255, 136, 0, 0.5);
    animation: pulse-overclock 2s infinite;
}

.mod-empty {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

@keyframes pulse-overclock {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(255, 136, 0, 0.5);
    }

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

.noir-bullets {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.noir-bullets span {
    color: var(--text);
    font-weight: bold;
    font-size: 0.9rem;
}

.bullet-icons {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.bullet {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.bullet.filled {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
}

.bullet.empty {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.noir-focus {
    padding: 8px 0;
}

.noir-focus span {
    color: var(--primary);
    font-weight: bold;
    font-size: 0.9rem;
}

/* Animation for when modifications change */
.noir-mods.updated {
    animation: mod-update 0.5s ease;
}

@keyframes mod-update {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
        background: rgba(255, 0, 51, 0.1);
    }

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

/* Animation for when bullets are used */
.noir-bullets.bullet-used {
    animation: bullet-flash 0.3s ease;
}

@keyframes bullet-flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
        background: rgba(255, 215, 0, 0.15);
    }
}

/* ========================================
   汎用パッシブUIスタイル（全キャラクター共通）
   ======================================== */

/* 基本パッシブUIコンテナ */
[class$="-passive-ui"] {
    background: rgba(18, 18, 32, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 10px 0;
    font-family: 'Inter', 'Courier New', monospace;
    box-shadow: var(--shadow-card);
}

/* Override when inside compact card wrapper */
#character-passives-content [class$="-passive-ui"],
#compact-passives-content [class$="-passive-ui"] {
    background: none !important;
    backdrop-filter: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    font-size: 0.82em;
    line-height: 1.4;
}

#character-passives-content [class$="-passive-ui"]>div,
#compact-passives-content [class$="-passive-ui"]>div {
    border-bottom: none;
    margin-bottom: 3px;
    padding: 0;
}

#character-passives-content [class$="-passive-ui"] span,
#compact-passives-content [class$="-passive-ui"] span {
    margin-right: 8px;
    font-size: 0.85em;
}

#character-passives-content .noir-mods,
#character-passives-content .noir-bullets,
#character-passives-content .noir-focus {
    margin-bottom: 4px;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#character-passives-content .mod-icons {
    gap: 4px;
    margin-top: 3px;
}

#character-passives-content .mod-icons span {
    width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 0.8rem;
}

#character-passives-content .bullet-icons {
    gap: 2px;
    margin-top: 3px;
}

#character-passives-content .bullet {
    width: 14px;
    height: 14px;
    line-height: 14px;
    font-size: 0.6rem;
}

/* MOKO用スタイル */
.moko-passive-ui .moko-sparks,
.moko-passive-ui .moko-triggers,
.moko-passive-ui .moko-bonuses,
.moko-passive-ui .moko-status {
    margin-bottom: 10px;
    padding: 5px 0;
}

.moko-passive-ui .ready {
    color: #ffd700;
    font-weight: bold;
    margin-left: 10px;
}

.moko-passive-ui .brilliant {
    color: #ff69b4;
    font-weight: bold;
}

/* MONT・Frostgale用スタイル */
.mont-frostgale-passive-ui .mont-form,
.mont-frostgale-passive-ui .mont-barriers,
.mont-frostgale-passive-ui .mont-crystals,
.mont-frostgale-passive-ui .mont-bonuses,
.mont-frostgale-passive-ui .mont-awakenings {
    margin-bottom: 10px;
    padding: 5px 0;
}

.mont-frostgale-passive-ui .spring-barrier {
    color: #90EE90;
    margin-right: 10px;
}

.mont-frostgale-passive-ui .winter-barrier {
    color: #87CEEB;
}

.mont-frostgale-passive-ui .spring-crystals {
    color: #FFB6C1;
    margin-right: 15px;
}

.mont-frostgale-passive-ui .winter-crystals {
    color: #B0E0E6;
}

.mont-frostgale-passive-ui .locked {
    color: #ff6b6b;
    margin-left: 10px;
}

.mont-frostgale-passive-ui .unlocked {
    color: #51cf66;
    margin-left: 10px;
}

/* NAVI用スタイル */
.navi-passive-ui .navi-hacking,
.navi-passive-ui .navi-virus,
.navi-passive-ui .navi-bonuses {
    margin-bottom: 10px;
    padding: 5px 0;
}

.navi-passive-ui .hack-level {
    color: #00ff00;
    font-weight: bold;
}

.navi-passive-ui .virus-infected {
    color: #ff00ff;
    font-weight: bold;
}

/* KEY用スタイル */
.key-passive-ui .key-sacrificer,
.key-passive-ui .key-bonuses {
    margin-bottom: 10px;
    padding: 5px 0;
}

.key-passive-ui .sacrificer-icons {
    display: inline-flex;
    gap: 5px;
    margin-left: 10px;
}

.key-passive-ui .sacrificer.filled {
    color: #ff4500;
}

.key-passive-ui .sacrificer.empty {
    color: #444;
}

/* その他の汎用スタイル */
[class$="-passive-ui"] span {
    display: inline-block;
    margin-right: 15px;
    font-size: 0.9rem;
}

[class$="-passive-ui"]>div {
    border-bottom: 1px solid var(--border-subtle);
}

[class$="-passive-ui"]>div:last-child {
    border-bottom: none;
}

/* CHERISH用スタイル */
.cherish-passive-ui .cherish-passive-section {
    margin-bottom: 4px;
    padding: 2px 0;
}

.cherish-passive-ui .cherish-passive-section:not(:last-child) {
    border-bottom: 1px solid rgba(135, 206, 235, 0.1);
}

.cherish-passive-ui .cherish-garden-active {
    color: #f9a8d4;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(249, 168, 212, 0.4);
}

.cherish-passive-ui .shield-types {
    color: #7dd3fc;
    font-size: 0.85em;
    word-break: break-all;
}

/* ========================================
   追加ユーティリティ・アニメーション
   ======================================== */

/* フローティングパーティクル (body背景装飾) */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.6;
    }
}

/* スムーズなフォーカスリング */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* チャート読み込みセクション */
.chart-loader {
    background: rgba(18, 18, 32, 0.6) !important;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-smooth);
}

.chart-loader:hover {
    border-color: rgba(46, 204, 113, 0.3) !important;
}

/* アクション順設定 */
.action-order-config {
    background: rgba(18, 18, 32, 0.5) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-md) !important;
}

/* ステージプリセット */
.stage-preset-selector {
    background: rgba(18, 18, 32, 0.5) !important;
    border-radius: var(--radius-md) !important;
}

/* J&C仮面設定 */
#jc-mask-config {
    border-radius: var(--radius-md) !important;
}

/* トランジション付きgrid items */
.party-member-config,
.enemy-item,
.char-action,
.turn-item {
    will-change: transform;
}

/* 数値入力のスピンボタン非表示 (Chrome) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.5;
}

/* リンクスタイル */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-alt);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    header {
        padding: 30px 16px 24px;
    }

    header h1 {
        font-size: 1.6rem;
        letter-spacing: 1px;
    }

    header p {
        font-size: 0.75rem;
        letter-spacing: 3px;
    }

    section {
        padding: 16px;
        margin-bottom: 16px;
    }

    h2 {
        font-size: 1rem;
    }

    .turn-tabs {
        gap: 3px;
        padding: 4px;
    }

    .tab {
        padding: 8px 6px;
        font-size: 0.75rem;
        letter-spacing: 1px;
    }

    .total-damage {
        padding: 10px 8px;
    }

    .score-triple {
        flex-direction: column;
        gap: 6px;
    }

    .score-card {
        max-width: 100%;
    }

    .member-options {
        grid-template-columns: 1fr;
    }

    .enemy-list {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }

    .enemy-list {
        grid-template-columns: 1fr;
    }
}

/* アニメーション減少設定対応 */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   PREMIUM MODAL SYSTEM
   ======================================== */

/* Keyframes */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

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

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(255, 0, 51, 0.2), 0 0 60px rgba(255, 0, 51, 0.05);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 0, 51, 0.4), 0 0 80px rgba(255, 0, 51, 0.1);
    }
}

@keyframes borderGlow {

    0%,
    100% {
        border-color: rgba(168, 218, 220, 0.3);
    }

    50% {
        border-color: rgba(168, 218, 220, 0.6);
    }
}

@keyframes floatUp {

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

    50% {
        transform: translateY(-6px);
    }
}

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

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

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

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

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

/* Modal Backdrop */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.3s ease-out;
}

/* Modal Content Card */
.modal-card {
    background: linear-gradient(145deg, rgba(18, 18, 32, 0.95), rgba(13, 27, 42, 0.98));
    color: #f1faee;
    padding: 0;
    border-radius: 20px;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    border: 1px solid rgba(168, 218, 220, 0.2);
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(255, 0, 51, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modal Header */
.modal-header {
    padding: 24px 28px 20px;
    border-bottom: 1px solid rgba(168, 218, 220, 0.15);
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--modal-accent, #f4a261), transparent);
    animation: shimmer 3s infinite linear;
    background-size: 200% 100%;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 700;
    color: #eef0f6;
    letter-spacing: 0.5px;
}

.modal-header .modal-subtitle {
    color: var(--text-muted, #7a7f9a);
    font-size: 0.85em;
    margin-top: 4px;
}

/* Modal Body */
.modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    max-height: calc(85vh - 160px);
    line-height: 1.8;
}

/* Damage Hero Display */
.damage-hero {
    text-align: center;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 0, 51, 0.08), rgba(244, 162, 97, 0.12));
    border: 1px solid rgba(244, 162, 97, 0.2);
    position: relative;
    overflow: hidden;
}

.damage-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: shimmer 4s infinite linear;
}

.damage-hero .damage-label {
    font-size: 0.85em;
    color: var(--text-muted, #7a7f9a);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 8px;
}

.damage-hero .damage-value {
    font-size: 2.2em;
    font-weight: 800;
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #f4a261, #ff6b6b, #ffd700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    animation: countUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Detail Section */
.detail-section {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(168, 218, 220, 0.1);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s;
}

.detail-section:hover {
    border-color: rgba(168, 218, 220, 0.25);
    background: rgba(255, 255, 255, 0.04);
}

.detail-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(168, 218, 220, 0.06);
    font-weight: 700;
    font-size: 0.95em;
    color: #a8dadc;
    border-bottom: 1px solid rgba(168, 218, 220, 0.08);
}

.detail-section-body {
    padding: 12px 16px;
    font-size: 0.9em;
    color: #ccc;
}

.detail-section-body .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
}

.detail-section-body .detail-row.highlight {
    color: #eef0f6;
    font-weight: 700;
    padding: 6px 0;
    margin-top: 4px;
    border-top: 1px solid rgba(168, 218, 220, 0.1);
}

/* Modal Footer / Close Button */
.modal-footer {
    padding: 16px 28px 24px;
}

.modal-close-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(168, 218, 220, 0.2);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(69, 123, 157, 0.2), rgba(29, 53, 87, 0.3));
    color: #a8dadc;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.5px;
}

.modal-close-btn:hover {
    background: linear-gradient(135deg, rgba(69, 123, 157, 0.4), rgba(29, 53, 87, 0.5));
    border-color: rgba(168, 218, 220, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(69, 123, 157, 0.2);
}

/* Help FAB Button */
.help-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    color: #ff0033;
    font-size: 22px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(255, 0, 51, 0.4);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 0, 51, 0.15);
    animation: helpFabPulse 3s ease-in-out infinite;
    text-shadow: 0 0 8px rgba(255, 0, 51, 0.5);
}

@keyframes helpFabPulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 0, 51, 0.15);
        border-color: rgba(255, 0, 51, 0.4);
    }

    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 0, 51, 0.3);
        border-color: rgba(255, 0, 51, 0.7);
    }
}

.help-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 0, 51, 0.4);
    border-color: rgba(255, 0, 51, 0.8);
    background: linear-gradient(135deg, #2a0a0a 0%, #1a0000 100%);
}

/* Help Guide Sections */
.help-guide-section {
    margin-bottom: 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 0, 51, 0.15);
    background: linear-gradient(180deg, rgba(255, 0, 51, 0.04) 0%, rgba(0, 0, 0, 0.3) 100%);
    overflow: hidden;
    transition: border-color 0.3s;
}

.help-guide-section:hover {
    border-color: rgba(255, 0, 51, 0.35);
}

.help-guide-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(255, 0, 51, 0.06);
    border-bottom: 1px solid rgba(255, 0, 51, 0.1);
}

.help-guide-icon {
    font-size: 1.2em;
}

.help-guide-title {
    font-size: 0.95em;
    font-weight: 700;
    color: var(--section-color, #ff4d6d);
    text-shadow: 0 0 12px rgba(255, 0, 51, 0.3);
}

.help-guide-body {
    padding: 10px 16px;
    font-size: 0.85em;
    line-height: 1.7;
    color: #bbb;
}

.help-guide-body p {
    margin: 4px 0;
}

.help-guide-body ul,
.help-guide-body ol {
    margin: 6px 0;
    padding-left: 20px;
}

.help-guide-body li {
    margin: 3px 0;
}

.help-guide-body strong {
    color: #ff6b81;
}

.help-substep {
    margin: 8px 0;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    border-left: 3px solid var(--section-color, #ff0033);
}

.help-substep-title {
    font-weight: 700;
    color: var(--section-color, #ff4d6d);
    margin-bottom: 4px;
    font-size: 0.9em;
}

/* Mobile Warning */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #0a0f1e, #0d1b2a, #1d3557);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    animation: modalFadeIn 0.5s ease-out;
}

.mobile-overlay .mobile-icon {
    font-size: 72px;
    animation: floatUp 3s ease-in-out infinite;
    margin-bottom: 24px;
}

.mobile-overlay h2 {
    color: #f4a261;
    font-size: 1.4em;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.mobile-overlay p {
    color: #a8dadc;
    line-height: 1.9;
    font-size: 0.95em;
    margin-bottom: 28px;
}

.mobile-overlay .mobile-dismiss-btn {
    padding: 14px 36px;
    background: linear-gradient(135deg, rgba(69, 123, 157, 0.3), rgba(29, 53, 87, 0.4));
    color: #f1faee;
    font-weight: 600;
    font-size: 1em;
    border: 1px solid rgba(168, 218, 220, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.mobile-overlay .mobile-dismiss-btn:hover {
    background: linear-gradient(135deg, rgba(69, 123, 157, 0.5), rgba(29, 53, 87, 0.6));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ===== クイーンブチ切れ: 青い炎メラメラエフェクト ===== */
.char-action.enraged-flame {
    position: relative;
    overflow: hidden;
    border-color: #00bcd4 !important;
    box-shadow: 0 0 12px rgba(0, 188, 212, 0.3), inset 0 0 20px rgba(0, 150, 255, 0.08);
}

.char-action.enraged-flame::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 30px 90% at 5% 100%, rgba(0, 180, 220, 0.5) 0%, transparent 55%),
        radial-gradient(ellipse 25px 80% at 15% 100%, rgba(0, 150, 255, 0.45) 0%, transparent 50%),
        radial-gradient(ellipse 35px 100% at 28% 100%, rgba(0, 200, 240, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse 20px 70% at 38% 100%, rgba(30, 144, 255, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse 30px 95% at 50% 100%, rgba(0, 180, 220, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse 25px 85% at 62% 100%, rgba(0, 200, 255, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse 35px 100% at 72% 100%, rgba(0, 150, 255, 0.5) 0%, transparent 60%),
        radial-gradient(ellipse 20px 75% at 82% 100%, rgba(30, 180, 255, 0.45) 0%, transparent 50%),
        radial-gradient(ellipse 30px 90% at 92% 100%, rgba(0, 200, 240, 0.4) 0%, transparent 55%);
    animation: flame-dance1 1.2s ease-in-out infinite alternate;
}

.char-action.enraged-flame::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 28px 85% at 8% 100%, rgba(0, 220, 255, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse 22px 75% at 20% 100%, rgba(30, 180, 255, 0.35) 0%, transparent 45%),
        radial-gradient(ellipse 32px 95% at 33% 100%, rgba(0, 200, 240, 0.4) 0%, transparent 55%),
        radial-gradient(ellipse 26px 80% at 45% 100%, rgba(0, 180, 255, 0.45) 0%, transparent 50%),
        radial-gradient(ellipse 30px 90% at 57% 100%, rgba(30, 200, 255, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 24px 85% at 68% 100%, rgba(0, 220, 255, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse 28px 100% at 78% 100%, rgba(0, 150, 255, 0.45) 0%, transparent 60%),
        radial-gradient(ellipse 22px 70% at 88% 100%, rgba(30, 180, 255, 0.35) 0%, transparent 45%),
        radial-gradient(ellipse 26px 80% at 96% 100%, rgba(0, 200, 240, 0.4) 0%, transparent 50%);
    animation: flame-dance2 1.6s ease-in-out infinite alternate-reverse;
}

.char-action.enraged-flame>* {
    position: relative;
    z-index: 1;
}

@keyframes flame-dance1 {
    0% {
        transform: scaleY(0.92) scaleX(1);
        opacity: 0.65;
    }

    20% {
        transform: scaleY(1.0) scaleX(1.03);
        opacity: 0.85;
    }

    40% {
        transform: scaleY(0.95) scaleX(0.97);
        opacity: 0.7;
    }

    60% {
        transform: scaleY(1.05) scaleX(1.02);
        opacity: 0.9;
    }

    80% {
        transform: scaleY(0.9) scaleX(1.01);
        opacity: 0.65;
    }

    100% {
        transform: scaleY(1.02) scaleX(0.98);
        opacity: 0.8;
    }
}

@keyframes flame-dance2 {
    0% {
        transform: scaleY(0.95) scaleX(1.02);
        opacity: 0.5;
    }

    25% {
        transform: scaleY(1.08) scaleX(0.97);
        opacity: 0.75;
    }

    50% {
        transform: scaleY(0.9) scaleX(1.04);
        opacity: 0.55;
    }

    75% {
        transform: scaleY(1.0) scaleX(1.0);
        opacity: 0.7;
    }

    100% {
        transform: scaleY(0.93) scaleX(0.98);
        opacity: 0.6;
    }
}

/* ===== パンサー ラビアンローズ: 赤い炎メラメラエフェクト ===== */
.char-action.lavieenrose-flame {
    position: relative;
    overflow: hidden;
    border-color: #ff4444 !important;
    box-shadow: 0 0 12px rgba(255, 68, 68, 0.3), inset 0 0 20px rgba(255, 50, 50, 0.08);
}

.char-action.lavieenrose-flame::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 30px 90% at 5% 100%, rgba(255, 80, 30, 0.5) 0%, transparent 55%),
        radial-gradient(ellipse 25px 80% at 15% 100%, rgba(255, 50, 50, 0.45) 0%, transparent 50%),
        radial-gradient(ellipse 35px 100% at 28% 100%, rgba(255, 100, 30, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse 20px 70% at 38% 100%, rgba(255, 60, 60, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse 30px 95% at 50% 100%, rgba(255, 80, 30, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse 25px 85% at 62% 100%, rgba(255, 100, 50, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse 35px 100% at 72% 100%, rgba(255, 50, 50, 0.5) 0%, transparent 60%),
        radial-gradient(ellipse 20px 75% at 82% 100%, rgba(255, 80, 40, 0.45) 0%, transparent 50%),
        radial-gradient(ellipse 30px 90% at 92% 100%, rgba(255, 100, 30, 0.4) 0%, transparent 55%);
    animation: flame-dance1 1.2s ease-in-out infinite alternate;
}

.char-action.lavieenrose-flame::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 28px 85% at 8% 100%, rgba(255, 120, 40, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse 22px 75% at 20% 100%, rgba(255, 60, 60, 0.35) 0%, transparent 45%),
        radial-gradient(ellipse 32px 95% at 33% 100%, rgba(255, 100, 30, 0.4) 0%, transparent 55%),
        radial-gradient(ellipse 26px 80% at 45% 100%, rgba(255, 80, 50, 0.45) 0%, transparent 50%),
        radial-gradient(ellipse 30px 90% at 57% 100%, rgba(255, 100, 40, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse 24px 85% at 68% 100%, rgba(255, 120, 40, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse 28px 100% at 78% 100%, rgba(255, 50, 50, 0.45) 0%, transparent 60%),
        radial-gradient(ellipse 22px 70% at 88% 100%, rgba(255, 80, 40, 0.35) 0%, transparent 45%),
        radial-gradient(ellipse 26px 80% at 96% 100%, rgba(255, 100, 30, 0.4) 0%, transparent 50%);
    animation: flame-dance2 1.6s ease-in-out infinite alternate-reverse;
}

.char-action.lavieenrose-flame>* {
    position: relative;
    z-index: 1;
}

/* ===== ハイライト: 黄色い縦線シュンシュン上昇エフェクト ===== */
.char-action.hl-rising-lines {
    position: relative;
    overflow: hidden;
}

.char-action.hl-rising-lines::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(0deg, rgba(244, 162, 97, 0.7) 0%, rgba(255, 220, 50, 0.3) 30%, transparent 60%) 3% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 200, 50, 0.6) 0%, rgba(244, 162, 97, 0.2) 25%, transparent 55%) 7% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.65) 0%, rgba(255, 180, 50, 0.25) 35%, transparent 65%) 12% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 220, 80, 0.5) 0%, transparent 40%) 17% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.7) 0%, rgba(255, 200, 50, 0.3) 30%, transparent 55%) 22% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 200, 50, 0.55) 0%, transparent 45%) 28% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.6) 0%, rgba(255, 220, 50, 0.2) 35%, transparent 60%) 33% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 220, 80, 0.5) 0%, transparent 40%) 38% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.65) 0%, rgba(255, 180, 50, 0.3) 30%, transparent 55%) 44% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 200, 50, 0.6) 0%, transparent 45%) 49% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.7) 0%, rgba(255, 220, 50, 0.25) 35%, transparent 60%) 55% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 220, 80, 0.5) 0%, transparent 40%) 60% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.6) 0%, rgba(255, 200, 50, 0.3) 30%, transparent 55%) 66% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 200, 50, 0.55) 0%, transparent 45%) 72% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.65) 0%, rgba(255, 180, 50, 0.2) 35%, transparent 60%) 78% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 220, 80, 0.5) 0%, transparent 40%) 83% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.7) 0%, rgba(255, 220, 50, 0.3) 30%, transparent 55%) 89% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 200, 50, 0.6) 0%, transparent 45%) 94% 0 / 1.5px 100%;
    background-repeat: no-repeat;
    animation: hl-lines-rise 1.4s linear infinite;
}

.char-action.hl-rising-lines::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        linear-gradient(0deg, rgba(255, 180, 50, 0.6) 0%, rgba(244, 162, 97, 0.25) 30%, transparent 55%) 5% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.65) 0%, transparent 50%) 10% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 200, 50, 0.5) 0%, rgba(255, 180, 50, 0.2) 35%, transparent 60%) 15% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.6) 0%, transparent 45%) 20% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 220, 80, 0.55) 0%, rgba(244, 162, 97, 0.25) 30%, transparent 55%) 26% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.7) 0%, transparent 50%) 31% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 200, 50, 0.5) 0%, rgba(255, 220, 50, 0.2) 35%, transparent 60%) 36% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.6) 0%, transparent 45%) 42% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 180, 50, 0.65) 0%, rgba(244, 162, 97, 0.3) 30%, transparent 55%) 47% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.55) 0%, transparent 50%) 53% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 220, 80, 0.5) 0%, rgba(255, 200, 50, 0.2) 35%, transparent 60%) 58% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.65) 0%, transparent 45%) 64% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 200, 50, 0.6) 0%, rgba(244, 162, 97, 0.25) 30%, transparent 55%) 70% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.55) 0%, transparent 50%) 75% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 220, 80, 0.5) 0%, rgba(255, 180, 50, 0.2) 35%, transparent 60%) 81% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.6) 0%, transparent 45%) 87% 0 / 2px 100%,
        linear-gradient(0deg, rgba(255, 180, 50, 0.65) 0%, rgba(255, 220, 50, 0.3) 30%, transparent 55%) 92% 0 / 1.5px 100%,
        linear-gradient(0deg, rgba(244, 162, 97, 0.5) 0%, transparent 50%) 97% 0 / 2px 100%;
    background-repeat: no-repeat;
    animation: hl-lines-rise 1.8s linear infinite;
    animation-delay: -0.6s;
}

.char-action.hl-rising-lines>* {
    position: relative;
    z-index: 1;
}

@keyframes hl-lines-rise {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }

    8% {
        opacity: 1;
    }

    60% {
        opacity: 0.7;
    }

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

/* ===== HL行: キャラカラー光る枠 ===== */
@keyframes hl-border-glow {

    0%,
    100% {
        box-shadow: 0 0 8px var(--hl-char-color, #f4a261),
            0 0 20px color-mix(in srgb, var(--hl-char-color, #f4a261) 30%, transparent),
            inset 0 0 12px color-mix(in srgb, var(--hl-char-color, #f4a261) 8%, transparent);
    }

    50% {
        box-shadow: 0 0 16px var(--hl-char-color, #f4a261),
            0 0 40px color-mix(in srgb, var(--hl-char-color, #f4a261) 40%, transparent),
            inset 0 0 20px color-mix(in srgb, var(--hl-char-color, #f4a261) 12%, transparent);
    }
}

.char-action.hl-char-glow {
    border-color: var(--hl-char-color, #f4a261) !important;
    animation: hl-border-glow 2s ease-in-out infinite;
}

/* データ掌握「今回発動！」パルスアニメーション */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* J&C強化二者合一のグローアニメーション */
@keyframes jcEnhancedGlow {

    0%,
    100% {
        box-shadow: inset 0 0 15px rgba(160, 100, 255, 0.25), 0 0 12px rgba(168, 85, 247, 0.3), 0 0 24px rgba(128, 60, 220, 0.15);
        border-color: rgba(168, 85, 247, 0.5);
    }

    50% {
        box-shadow: inset 0 0 20px rgba(160, 100, 255, 0.35), 0 0 18px rgba(168, 85, 247, 0.45), 0 0 32px rgba(128, 60, 220, 0.25);
        border-color: rgba(168, 85, 247, 0.8);
    }
}

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

    40% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-30px) scale(0.2);
        opacity: 0;
    }
}

/* ===== MESSA 執行官(バスター)モード: 血エフェクト ===== */
.char-action.messa-buster-card {
    position: relative;
    overflow: hidden;
    border-color: #8b0000 !important;
    box-shadow: 0 0 12px rgba(139, 0, 0, 0.4), inset 0 0 20px rgba(139, 0, 0, 0.1);
}

.char-action.messa-buster-card::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -100%;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        /* Blood drips from top */
        radial-gradient(ellipse 6px 40px at 5% 0%, rgba(139, 0, 0, 0.7) 0%, transparent 80%),
        radial-gradient(ellipse 8px 55px at 12% 0%, rgba(180, 0, 0, 0.6) 0%, transparent 75%),
        radial-gradient(ellipse 5px 35px at 22% 0%, rgba(139, 0, 0, 0.65) 0%, transparent 80%),
        radial-gradient(ellipse 7px 50px at 35% 0%, rgba(160, 0, 0, 0.55) 0%, transparent 70%),
        radial-gradient(ellipse 6px 45px at 48% 0%, rgba(139, 0, 0, 0.7) 0%, transparent 80%),
        radial-gradient(ellipse 9px 60px at 58% 0%, rgba(180, 0, 0, 0.5) 0%, transparent 75%),
        radial-gradient(ellipse 5px 38px at 70% 0%, rgba(139, 0, 0, 0.6) 0%, transparent 80%),
        radial-gradient(ellipse 7px 48px at 82% 0%, rgba(160, 0, 0, 0.65) 0%, transparent 70%),
        radial-gradient(ellipse 6px 42px at 93% 0%, rgba(139, 0, 0, 0.55) 0%, transparent 80%);
    animation: messa-blood-drip 2.5s ease-in infinite;
}

.char-action.messa-buster-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -100%;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 7px 45px at 8% 0%, rgba(180, 0, 0, 0.5) 0%, transparent 75%),
        radial-gradient(ellipse 5px 38px at 18% 0%, rgba(139, 0, 0, 0.6) 0%, transparent 80%),
        radial-gradient(ellipse 8px 52px at 28% 0%, rgba(160, 0, 0, 0.55) 0%, transparent 70%),
        radial-gradient(ellipse 6px 42px at 42% 0%, rgba(139, 0, 0, 0.65) 0%, transparent 80%),
        radial-gradient(ellipse 7px 48px at 55% 0%, rgba(180, 0, 0, 0.5) 0%, transparent 75%),
        radial-gradient(ellipse 5px 35px at 65% 0%, rgba(139, 0, 0, 0.6) 0%, transparent 80%),
        radial-gradient(ellipse 8px 55px at 75% 0%, rgba(160, 0, 0, 0.55) 0%, transparent 70%),
        radial-gradient(ellipse 6px 40px at 88% 0%, rgba(139, 0, 0, 0.65) 0%, transparent 80%),
        radial-gradient(ellipse 7px 46px at 96% 0%, rgba(180, 0, 0, 0.5) 0%, transparent 75%);
    animation: messa-blood-drip 3.2s ease-in infinite;
    animation-delay: -1.2s;
}

.char-action.messa-buster-card>* {
    position: relative;
    z-index: 1;
}

@keyframes messa-blood-drip {
    0% {
        transform: translateY(0%);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    70% {
        opacity: 0.6;
    }

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

/* MESSA img-toggle バスターON: 円形アイコン周りの血の回転リング */
.img-toggle.messa-buster-on .img-toggle-icon {
    position: relative;
}

.img-toggle.messa-buster-on .img-toggle-icon::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #8b0000;
    border-right-color: rgba(180, 0, 0, 0.6);
    animation: messa-blood-ring 1.5s linear infinite;
    box-shadow: 0 0 8px rgba(139, 0, 0, 0.5), inset 0 0 6px rgba(139, 0, 0, 0.3);
}

.img-toggle.messa-buster-on .img-toggle-icon::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    border-bottom-color: rgba(200, 0, 0, 0.4);
    border-left-color: rgba(139, 0, 0, 0.3);
    animation: messa-blood-ring 2.2s linear infinite reverse;
}

@keyframes messa-blood-ring {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== AI アシスタント チャットスタイル ===== */
.ai-msg {
    display: flex;
    max-width: 88%;
    animation: aiMsgIn 0.3s ease;
}

.ai-msg-user {
    align-self: flex-end;
}

.ai-msg-assistant {
    align-self: flex-start;
}

.ai-msg-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88em;
    line-height: 1.6;
    color: #e8e8e8;
    word-break: break-word;
}

.ai-msg-user .ai-msg-content {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(109, 40, 217, 0.25));
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-bottom-right-radius: 4px;
}

.ai-msg-assistant .ai-msg-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
}

.ai-msg-thinking {
    align-self: flex-start;
}

.ai-msg-thinking .ai-msg-content {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #888;
    font-style: italic;
}

.ai-thinking-dots::after {
    content: '';
    animation: aiDots 1.5s infinite;
}

@keyframes aiDots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }
}

@keyframes aiMsgIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* チャット履歴スクロールバー */
#ai-chat-history::-webkit-scrollbar {
    width: 4px;
}

#ai-chat-history::-webkit-scrollbar-track {
    background: transparent;
}

#ai-chat-history::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.3);
    border-radius: 2px;
}

#ai-chat-history::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.5);
}

/* ===== ブルートフォースUI ===== */
.bf-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(6, 214, 160, 0.15);
    border-radius: 10px;
    padding: 12px 14px;
}

.bf-section-title {
    font-size: 0.82em;
    font-weight: 700;
    color: #06d6a0;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

/* ターンチップ */
.bf-turn-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    font-size: 0.82em;
    color: #bbb;
    transition: all 0.2s;
}

.bf-turn-chip:has(input:checked) {
    background: rgba(6, 214, 160, 0.15);
    border-color: rgba(6, 214, 160, 0.4);
    color: #06d6a0;
}

.bf-turn-chip input {
    accent-color: #06d6a0;
    width: 14px;
    height: 14px;
}

/* WONDERスキルチェックボックス */
.bf-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    font-size: 0.88em;
    color: #ccc;
    transition: all 0.2s;
}

.bf-checkbox:has(input:checked) {
    background: rgba(167, 139, 250, 0.15);
    border-color: rgba(167, 139, 250, 0.4);
    color: #a78bfa;
}

.bf-checkbox input {
    accent-color: #a78bfa;
    width: 14px;
    height: 14px;
}

/* ペルソナチップ */
.bf-persona-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    font-size: 0.85em;
    color: #ccc;
    transition: all 0.2s;
}

.bf-persona-chip:has(input:checked) {
    background: rgba(244, 162, 97, 0.15);
    border-color: rgba(244, 162, 97, 0.4);
    color: #f4a261;
}

.bf-persona-chip input {
    accent-color: #f4a261;
    width: 14px;
    height: 14px;
}

.bf-persona-idx {
    font-size: 0.72em;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #888;
}

/* 他キャラ行 */
.bf-char-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.bf-char-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    min-width: 120px;
}

.bf-char-toggle input {
    accent-color: #00b4d8;
    width: 14px;
    height: 14px;
}

.bf-char-name {
    font-size: 0.85em;
    color: #ccc;
}

.bf-char-skills {
    display: flex;
    gap: 8px;
}

.bf-checkbox-sm {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8em;
    color: #aaa;
    cursor: pointer;
}

.bf-checkbox-sm input {
    accent-color: #00b4d8;
    width: 12px;
    height: 12px;
}

/* パターン数推定 */
.bf-estimate {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88em;
    font-weight: 600;
    text-align: center;
}

.bf-estimate-ok {
    background: rgba(6, 214, 160, 0.1);
    border: 1px solid rgba(6, 214, 160, 0.3);
    color: #06d6a0;
}

.bf-estimate-warn {
    background: rgba(244, 162, 97, 0.1);
    border: 1px solid rgba(244, 162, 97, 0.3);
    color: #f4a261;
}

.bf-estimate-over {
    background: rgba(255, 77, 109, 0.1);
    border: 1px solid rgba(255, 77, 109, 0.3);
    color: #ff4d6d;
}

.bf-estimate-zero {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
}

/* 結果エリアスクロールバー */
#bf-results-area::-webkit-scrollbar {
    width: 4px;
}

#bf-results-area::-webkit-scrollbar-track {
    background: transparent;
}

#bf-results-area::-webkit-scrollbar-thumb {
    background: rgba(6, 214, 160, 0.3);
    border-radius: 2px;
}

#bf-results-area::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 214, 160, 0.5);
}

/* 設定エリアスクロールバー */
#bf-config-area::-webkit-scrollbar {
    width: 4px;
}

#bf-config-area::-webkit-scrollbar-track {
    background: transparent;
}

#bf-config-area::-webkit-scrollbar-thumb {
    background: rgba(6, 214, 160, 0.2);
    border-radius: 2px;
}

/* ===== BFサーバーステータス ===== */
.bf-server-status {
    transition: all 0.3s ease;
}

.bf-server-online {
    background: rgba(6, 214, 160, 0.1);
    border: 1px solid rgba(6, 214, 160, 0.3);
    color: #06d6a0;
}

.bf-server-offline {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
}

/* ============================================
   画像トグル: クイーンブチ切れ / J&C強化
   ============================================ */

/* 共通: 画像トグルコンテナ */
.img-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

/* アイコンラッパー: エフェクトはここだけに適用 */
.img-toggle-icon {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.img-toggle img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
    transition: filter 0.3s ease, transform 0.3s ease;
}

/* OFF状態: グレースケール + 暗め */
.img-toggle.off img {
    filter: grayscale(1) brightness(0.5);
}

.img-toggle.off {
    opacity: 0.5;
}

/* ---- クイーン ブチ切れ ON: 青い渦ぐるぐるエフェクト ---- */
.img-toggle.queen-enrage-on img {
    filter: drop-shadow(0 0 4px rgba(0, 188, 212, 0.8)) drop-shadow(0 0 8px rgba(0, 150, 200, 0.6));
    animation: queenEnrageIcon 2s ease-in-out infinite;
}

.img-toggle.queen-enrage-on .img-toggle-icon::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: rgba(0, 188, 212, 0.8);
    border-right-color: rgba(0, 150, 200, 0.4);
    animation: queenSwirl 1.2s linear infinite;
    pointer-events: none;
}

.img-toggle.queen-enrage-on .img-toggle-icon::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 1px solid transparent;
    border-bottom-color: rgba(100, 200, 255, 0.5);
    border-left-color: rgba(0, 188, 212, 0.3);
    animation: queenSwirl 1.8s linear infinite reverse;
    pointer-events: none;
}

@keyframes queenSwirl {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes queenEnrageIcon {

    0%,
    100% {
        filter: drop-shadow(0 0 4px rgba(0, 188, 212, 0.8)) drop-shadow(0 0 8px rgba(0, 150, 200, 0.5));
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 6px rgba(0, 220, 255, 1)) drop-shadow(0 0 14px rgba(0, 188, 212, 0.8));
        transform: scale(1.05);
    }
}

/* ---- クイーン ブチ切れ 持続中: やや落ち着いた青グロー ---- */
.img-toggle.queen-enrage-sustain img {
    filter: drop-shadow(0 0 3px rgba(0, 151, 167, 0.6)) drop-shadow(0 0 6px rgba(0, 120, 140, 0.4));
}

.img-toggle.queen-enrage-sustain .img-toggle-icon::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    border-top-color: rgba(0, 151, 167, 0.5);
    animation: queenSwirl 2.5s linear infinite;
    pointer-events: none;
}

/* ---- クイーン HL経由ブチ切れ: 明るい青エフェクト ---- */
.img-toggle.queen-enrage-hl img {
    filter: drop-shadow(0 0 5px rgba(0, 188, 212, 0.9)) drop-shadow(0 0 10px rgba(0, 150, 200, 0.7));
    animation: queenEnrageIcon 1.5s ease-in-out infinite;
}

.img-toggle.queen-enrage-hl .img-toggle-icon::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: rgba(0, 220, 255, 0.9);
    border-right-color: rgba(0, 188, 212, 0.5);
    animation: queenSwirl 1s linear infinite;
    pointer-events: none;
}

/* ---- J&C 強化 ON: 青い炎メラメラエフェクト ---- */
.img-toggle.jc-enhance-on img {
    filter: drop-shadow(0 0 4px rgba(80, 60, 220, 0.8)) drop-shadow(0 0 8px rgba(100, 80, 255, 0.5)) drop-shadow(0 -3px 6px rgba(0, 100, 255, 0.4));
    animation: jcFlameIcon 0.8s ease-in-out infinite alternate;
}

.img-toggle.jc-enhance-on .img-toggle-icon::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -3px;
    right: -3px;
    bottom: -2px;
    border-radius: 40%;
    background: radial-gradient(ellipse at center bottom,
            rgba(60, 80, 255, 0.15) 0%,
            rgba(100, 60, 255, 0.08) 40%,
            transparent 70%);
    animation: jcFlameAura 1.2s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes jcFlameIcon {
    0% {
        filter: drop-shadow(0 0 3px rgba(80, 60, 220, 0.7)) drop-shadow(0 0 6px rgba(100, 80, 255, 0.4)) drop-shadow(0 -2px 5px rgba(0, 100, 255, 0.3));
        transform: scale(1) translateY(0);
    }

    100% {
        filter: drop-shadow(0 0 6px rgba(80, 60, 220, 1)) drop-shadow(0 0 12px rgba(100, 80, 255, 0.7)) drop-shadow(0 -4px 8px rgba(0, 140, 255, 0.6));
        transform: scale(1.03) translateY(-1px);
    }
}

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

    100% {
        opacity: 1;
        transform: scale(1.08) translateY(-2px);
    }
}

/* ---- NOIR 銃撃 ON: 黄色・ピンク・水色のリング拡大エフェクト ---- */
.img-toggle.noir-gunfire-on img {
    filter: drop-shadow(0 0 4px rgba(200, 100, 255, 0.8)) drop-shadow(0 0 8px rgba(255, 80, 200, 0.5));
    animation: noirGunfireIcon 2s ease-in-out infinite;
}

.img-toggle.noir-gunfire-on .img-toggle-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    margin-top: -17px;
    margin-left: -17px;
    border-radius: 50%;
    border: 2px solid rgba(255, 230, 0, 0.8);
    box-shadow: 0 0 6px rgba(255, 230, 0, 0.5), inset 0 0 4px rgba(255, 230, 0, 0.3);
    animation: noirRingExpand 1.6s ease-out infinite;
    pointer-events: none;
}

.img-toggle.noir-gunfire-on .img-toggle-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    margin-top: -17px;
    margin-left: -17px;
    border-radius: 50%;
    border: 2px solid rgba(255, 50, 200, 0.8);
    box-shadow: 0 0 6px rgba(255, 50, 200, 0.5), inset 0 0 4px rgba(255, 50, 200, 0.3);
    animation: noirRingExpand 1.6s ease-out infinite 0.53s;
    pointer-events: none;
}

/* 3つ目のリングは追加要素で */
.img-toggle.noir-gunfire-on .noir-ring-3 {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    margin-top: -17px;
    margin-left: -17px;
    border-radius: 50%;
    border: 2px solid rgba(0, 220, 255, 0.8);
    box-shadow: 0 0 6px rgba(0, 220, 255, 0.5), inset 0 0 4px rgba(0, 220, 255, 0.3);
    animation: noirRingExpand 1.6s ease-out infinite 1.06s;
    pointer-events: none;
}

@keyframes noirRingExpand {
    0% {
        transform: scale(0.6);
        opacity: 1;
    }

    60% {
        opacity: 0.6;
    }

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

@keyframes noirGunfireIcon {

    0%,
    100% {
        filter: drop-shadow(0 0 4px rgba(200, 100, 255, 0.8)) drop-shadow(0 0 8px rgba(255, 80, 200, 0.5));
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 6px rgba(220, 120, 255, 1)) drop-shadow(0 0 14px rgba(255, 100, 220, 0.7));
        transform: scale(1.06);
    }
}

/* NOIR 銃撃 弾丸なし: 暗いが認識可能 */
.img-toggle.noir-gunfire-empty img {
    filter: grayscale(0.6) brightness(0.6) drop-shadow(0 0 2px rgba(155, 89, 182, 0.3));
}

.img-toggle.noir-gunfire-empty {
    opacity: 0.6;
    cursor: default;
}

/* NOIR 銃撃行（noir_gunfire）のカードエフェクト: ピンク・水色・黄色 */
.char-action.noir-gunfire-card {
    position: relative;
    overflow: hidden;
    animation: noirGunfireCardGlow 3s ease-in-out infinite;
}

.char-action.noir-gunfire-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 60px 100% at 10% 50%, rgba(255, 50, 200, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 50px 100% at 35% 50%, rgba(0, 220, 255, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse 55px 100% at 60% 50%, rgba(255, 230, 0, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse 45px 100% at 85% 50%, rgba(255, 50, 200, 0.07) 0%, transparent 60%);
    animation: noirGunfireCardShimmer 2.4s ease-in-out infinite;
}

.char-action.noir-gunfire-card>* {
    position: relative;
    z-index: 1;
}

@keyframes noirGunfireCardGlow {

    0%,
    100% {
        box-shadow:
            inset 0 0 12px rgba(255, 50, 200, 0.1),
            0 0 8px rgba(0, 220, 255, 0.12),
            0 0 16px rgba(255, 230, 0, 0.08);
        border-color: rgba(255, 50, 200, 0.35);
    }

    33% {
        box-shadow:
            inset 0 0 12px rgba(0, 220, 255, 0.1),
            0 0 8px rgba(255, 230, 0, 0.12),
            0 0 16px rgba(255, 50, 200, 0.08);
        border-color: rgba(0, 220, 255, 0.35);
    }

    66% {
        box-shadow:
            inset 0 0 12px rgba(255, 230, 0, 0.1),
            0 0 8px rgba(255, 50, 200, 0.12),
            0 0 16px rgba(0, 220, 255, 0.08);
        border-color: rgba(255, 230, 0, 0.35);
    }
}

@keyframes noirGunfireCardShimmer {

    0%,
    100% {
        opacity: 0.6;
        transform: translateX(-3%);
    }

    50% {
        opacity: 1;
        transform: translateX(3%);
    }
}

/* クールタイム: 暗い + 半透明 */
.img-toggle.cooldown img {
    filter: grayscale(0.8) brightness(0.4);
}

.img-toggle.cooldown {
    opacity: 0.4;
    cursor: default;
}

/* ---- 春節リン 鉄花の舞 ON: 赤い渦ぐるぐるエフェクト ---- */
.img-toggle.rin-melee-on img {
    filter: drop-shadow(0 0 4px rgba(255, 60, 30, 0.9)) drop-shadow(0 0 10px rgba(255, 100, 50, 0.6));
    animation: rinMeleeIcon 1.8s ease-in-out infinite;
}

.img-toggle.rin-melee-on .img-toggle-icon::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    border-top-color: rgba(255, 50, 20, 0.9);
    border-right-color: rgba(255, 120, 50, 0.5);
    animation: rinMeleeSwirl 1s linear infinite;
    box-shadow: 0 0 10px rgba(255, 50, 20, 0.4), inset 0 0 6px rgba(255, 80, 30, 0.3);
    pointer-events: none;
}

.img-toggle.rin-melee-on .img-toggle-icon::after {
    content: '';
    position: absolute;
    top: -7px;
    left: -7px;
    right: -7px;
    bottom: -7px;
    border-radius: 50%;
    border: 1.5px solid transparent;
    border-bottom-color: rgba(255, 160, 50, 0.6);
    border-left-color: rgba(255, 80, 20, 0.4);
    animation: rinMeleeSwirl 1.6s linear infinite reverse;
    pointer-events: none;
}

@keyframes rinMeleeSwirl {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes rinMeleeIcon {

    0%,
    100% {
        filter: drop-shadow(0 0 4px rgba(255, 60, 30, 0.8)) drop-shadow(0 0 8px rgba(255, 100, 50, 0.5));
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 8px rgba(255, 80, 20, 1)) drop-shadow(0 0 16px rgba(255, 120, 50, 0.8));
        transform: scale(1.06);
    }
}

/* 鉄花の舞カードエフェクト: 赤い炎オーラ */
.char-action.rin-melee-card {
    position: relative;
    overflow: hidden;
    animation: rinMeleeCardGlow 2.5s ease-in-out infinite;
}

.char-action.rin-melee-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 50px 100% at 15% 50%, rgba(255, 50, 20, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse 45px 100% at 50% 50%, rgba(255, 120, 50, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 50px 100% at 85% 50%, rgba(255, 50, 20, 0.1) 0%, transparent 55%);
    animation: rinMeleeCardShimmer 2s ease-in-out infinite;
}

.char-action.rin-melee-card>* {
    position: relative;
    z-index: 1;
}

@keyframes rinMeleeCardGlow {

    0%,
    100% {
        box-shadow: inset 0 0 12px rgba(255, 50, 20, 0.12), 0 0 10px rgba(255, 80, 30, 0.1);
        border-color: rgba(255, 80, 30, 0.35);
    }

    50% {
        box-shadow: inset 0 0 18px rgba(255, 50, 20, 0.18), 0 0 16px rgba(255, 100, 50, 0.15);
        border-color: rgba(255, 100, 50, 0.5);
    }
}

@keyframes rinMeleeCardShimmer {

    0%,
    100% {
        opacity: 0.5;
        transform: translateX(-2%);
    }

    50% {
        opacity: 1;
        transform: translateX(2%);
    }
}