:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #131829;
    --bg-card: #1a1f35;
    --text-primary: #00ff9f;
    --text-secondary: #7a8aa3;
    --text-light: #e0e7ff;
    --accent-cyan: #00d9ff;
    --accent-pink: #ff006e;
    --accent-yellow: #ffbe0b;
    --border-color: #2a3f5f;
    --firewall-color: #00b4d8;
    --damage-color: #ff006e;
    --font-main: 'Rajdhani', sans-serif;
    --font-display: 'Orbitron', monospace;
}

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

body {
    font-family: var(--font-main);
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-light);
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* サイバーパンク背景エフェクト */
/* サイバーパンク背景エフェクト */
#background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #050a14 0%, #0f1525 100%);
}

/* 遠景の街並み（CSSプロシージャル生成） */
.city-skyline {
    position: absolute;
    bottom: 10%;
    left: 0;
    width: 200%;
    height: 50%;
    background-image:
        linear-gradient(180deg, transparent 0%, rgba(0, 217, 255, 0.1) 100%),
        repeating-linear-gradient(90deg,
            transparent 0px, transparent 20px,
            #0a1020 20px, #0a1020 60px,
            transparent 60px, transparent 100px,
            #080c18 100px, #080c18 130px),
        repeating-linear-gradient(90deg,
            transparent 0px, transparent 15px,
            rgba(0, 255, 159, 0.05) 15px, rgba(0, 255, 159, 0.05) 16px,
            transparent 16px, transparent 40px);
    background-size: 50% 100%;
    animation: scrollCity 60s linear infinite;
    opacity: 0.6;
}

/* グリッドフロア */
.grid-floor {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background:
        linear-gradient(180deg, rgba(0, 217, 255, 0) 0%, rgba(0, 217, 255, 0.1) 100%),
        repeating-linear-gradient(0deg, transparent 0px, transparent 1px, rgba(0, 217, 255, 0.2) 2px, transparent 3px) 0 0 / 100% 20px,
        repeating-linear-gradient(90deg, transparent 0px, transparent 1px, rgba(0, 217, 255, 0.2) 2px, transparent 3px) 0 0 / 40px 100%;
    transform-origin: bottom;
    transform: perspective(500px) rotateX(60deg);
    animation: scrollGrid 20s linear infinite;
}

/* デジタルレイン */
.digital-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(180deg, rgba(0, 255, 159, 0) 0%, rgba(0, 255, 159, 0.2) 50%, rgba(0, 255, 159, 0) 100%);
    background-size: 100% 200%;
    animation: rainFall 3s linear infinite;
    opacity: 0.1;
    pointer-events: none;
}

@keyframes scrollCity {
    0% {
        transform: translateX(0);
    }

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

@keyframes scrollGrid {
    0% {
        background-position: 0 0;
    }

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

@keyframes rainFall {
    0% {
        background-position: 0 -100%;
    }

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

#game-container {
    position: relative;
    z-index: 1;
}

#game-ui {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100vh;
    /* padding-bottom: 100px; Removed for flex layout */
}

/* ヘッダー */
#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(26, 31, 53, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.header-left,
.header-right {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.layer-display {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--accent-cyan);
    font-weight: 700;
}

.game-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(90deg, var(--text-primary), var(--accent-cyan));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 255, 159, 0.5);
    letter-spacing: 4px;
}

.stat-display {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* 戦闘エリア */
#battle-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    overflow-y: auto;
    min-height: 0;
    /* Important for flex scrolling */
}

#enemies-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.enemy {
    background: rgba(26, 31, 53, 0.9);
    border: 2px solid var(--damage-color);
    border-radius: 12px;
    padding: 1.5rem;
    min-width: 200px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.enemy:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 0, 110, 0.3);
}

.enemy-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--damage-color);
    margin-bottom: 0.5rem;
}

.enemy-integrity {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.enemy-intent {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

/* プレイヤーエリア */
#player-area {
    display: flex;
    justify-content: center;
}

#player-character {
    background: rgba(26, 31, 53, 0.9);
    border: 2px solid var(--text-primary);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    text-align: center;
}

.character-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(0, 255, 159, 0.5);
}

.character-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-light);
}

.stat-icon {
    font-size: 1.3rem;
}

/* アクションエリア */
#action-area {
    /* position: fixed; Removed for flex layout */
    /* bottom: 20px; */
    /* left: 50%; */
    /* transform: translateX(-50%); */
    width: 100%;
    /* max-width: 1360px; */
    flex-shrink: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(26, 31, 53, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.btn-primary {
    padding: 0.8rem 2rem;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 159, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 0.8rem 2rem;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    background: rgba(122, 138, 163, 0.3);
    color: var(--text-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-secondary:hover {
    background: rgba(122, 138, 163, 0.5);
    border-color: var(--text-secondary);
}

.pile-info {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Sound Button */
.sound-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--accent-cyan);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.sound-btn:hover {
    background: var(--accent-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 10px var(--accent-cyan);
}

/* Tutorial Highlight */
.tutorial-highlight {
    position: relative;
    z-index: 2001;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7), 0 0 20px var(--accent-cyan);
    pointer-events: none;
    /* チュートリアル中は操作不可にする場合 */
}

/* モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--text-primary);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 0 50px rgba(0, 255, 159, 0.5);
}

.modal-content h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* グリッチエフェクト */
.glitch {
    animation: glitch 1s infinite;
}

@keyframes glitch {

    0%,
    100% {
        text-shadow: 0 0 10px var(--text-primary);
    }

    25% {
        text-shadow: -2px 0 10px var(--damage-color), 2px 0 10px var(--accent-cyan);
    }

    50% {
        text-shadow: 2px 0 10px var(--damage-color), -2px 0 10px var(--accent-cyan);
    }

    75% {
        text-shadow: 0 0 10px var(--text-primary);
    }
}

/* ダメージ数字アニメーション */
.damage-number {
    position: absolute;
    z-index: 2000;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    color: var(--damage-color);
    text-shadow: 0 0 10px var(--damage-color);
    pointer-events: none;
    animation: damageFloat 1s ease-out forwards;
}

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

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

.heal-number {
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--text-primary);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .game-title {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }

    #header {
        flex-direction: column;
        gap: 1rem;
    }

    #enemies-container {
        gap: 1rem;
    }

    .enemy {
        min-width: 150px;
        padding: 1rem;
    }
}

/* マップ画面スタイル */
.map-content {
    width: 90%;
    height: 90%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    background: rgba(10, 14, 26, 0.95);
    border: 2px solid var(--accent-cyan);
    box-shadow: 0 0 50px rgba(0, 217, 255, 0.2);
}

#map-visual-container {
    flex: 1;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 1rem 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    /* スクロールバーのカスタマイズ */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-cyan) var(--bg-primary);
}

#map-visual-container::-webkit-scrollbar {
    width: 8px;
}

#map-visual-container::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

#map-visual-container::-webkit-scrollbar-thumb {
    background-color: var(--accent-cyan);
    border-radius: 4px;
}

#map-nodes {
    position: relative;
    width: 100%;
    min-height: 100%;
    padding: 50px 0;
}

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

.map-node {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--text-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
    transform: translate(-50%, -50%);
}

.map-node:hover {
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 2;
}

.map-node.available {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.5);
    animation: pulse 2s infinite;
}

.map-node.completed {
    border-color: var(--text-secondary);
    opacity: 0.5;
    filter: grayscale(1);
}

.map-node.current {
    border-color: var(--accent-yellow);
    box-shadow: 0 0 20px rgba(255, 190, 11, 0.8);
    background: var(--accent-yellow);
    color: var(--bg-primary);
}

.map-node.locked {
    opacity: 0.3;
    cursor: not-allowed;
}

.map-node.boss {
    width: 80px;
    height: 80px;
    border-color: var(--damage-color);
    font-size: 2rem;
}

.map-connection {
    stroke: var(--text-secondary);
    stroke-width: 2;
    opacity: 0.3;
    fill: none;
}

.map-connection.available {
    stroke: var(--accent-cyan);
    opacity: 0.8;
    stroke-dasharray: 5;
    animation: dash 1s linear infinite;
}

.map-connection.completed {
    stroke: var(--text-secondary);
    opacity: 0.2;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 217, 255, 0.4);
    }

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

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

@keyframes dash {
    to {
        stroke-dashoffset: 0;
    }
}

/* ストーリーオーバーレイ */
.story-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.story-overlay.active {
    opacity: 1;
}

.story-box {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid var(--accent-cyan);
    border-radius: 12px;
    padding: 2rem;
    max-width: 700px;
    width: 90%;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.3);
    position: relative;
}

.story-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent-cyan), var(--accent-pink));
    border-radius: 12px;
    z-index: -1;
    opacity: 0.3;
    animation: pulse 2s ease-in-out infinite;
}

.story-character {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-cyan);
    text-transform: uppercase;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px var(--accent-cyan);
}

.story-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    min-height: 120px;
    margin-bottom: 1.5rem;
    transition: opacity 0.3s ease;
}

.story-continue {
    margin-left: auto;
    display: block;
    animation: pulse 1.5s ease-in-out infinite;
}

.story-skip {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.story-skip:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Credits Display */
.credits-display {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--accent-yellow);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Shop Interface */
.shop-content {
    width: 90%;
    max-width: 1000px;
    background: rgba(10, 14, 26, 0.98);
    border: 2px solid var(--accent-yellow);
    box-shadow: 0 0 50px rgba(255, 190, 11, 0.2);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.shop-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--accent-yellow);
    text-transform: uppercase;
    letter-spacing: 4px;
}

.shop-credits {
    font-size: 1.5rem;
    color: var(--accent-yellow);
    font-weight: 700;
}

.shop-section {
    margin-bottom: 2rem;
}

.shop-section-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    border-left: 4px solid var(--accent-cyan);
    padding-left: 1rem;
}

.shop-items {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.shop-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.shop-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-yellow);
    box-shadow: 0 5px 15px rgba(255, 190, 11, 0.2);
}

.shop-item.purchased {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
}

.shop-item.purchased::after {
    content: 'SOLD OUT';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--damage-color);
    border: 2px solid var(--damage-color);
    padding: 0.5rem 1rem;
    font-weight: 900;
    z-index: 10;
}

.shop-item-preview {
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.shop-item-name {
    font-weight: 700;
    color: var(--text-primary);
}

.shop-item-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex: 1;
}

.shop-item-price {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--accent-yellow);
}

.shop-buy-btn {
    background: transparent;
    border: 1px solid var(--accent-yellow);
    color: var(--accent-yellow);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-buy-btn:hover {
    background: var(--accent-yellow);
    color: var(--bg-primary);
}

.shop-leave-btn {
    align-self: center;
    margin-top: 2rem;
    background: var(--accent-yellow);
    color: var(--bg-primary);
    border: none;
    padding: 1rem 3rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Event Interface */
.event-content {
    width: 90%;
    max-width: 800px;
    background: rgba(10, 14, 26, 0.98);
    border: 2px solid var(--accent-pink);
    box-shadow: 0 0 50px rgba(255, 0, 110, 0.2);
    display: flex;
    flex-direction: column;
    padding: 3rem;
    text-align: left;
}

.event-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--accent-pink);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.event-description {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 2.5rem;
}

.event-choices {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.event-choice-btn {
    text-align: left;
    padding: 1.2rem 2rem;
    background: rgba(255, 0, 110, 0.1);
    border: 1px solid var(--accent-pink);
    color: var(--text-light);
    transition: all 0.3s ease;
}

/* Boss Phase Transition */
.phase-transition {
    animation: phaseShift 2s infinite;
    border-color: var(--accent-pink) !important;
    box-shadow: 0 0 30px var(--accent-pink) !important;
}

@keyframes phaseShift {
    0% {
        transform: scale(1);
        filter: hue-rotate(0deg);
    }

    50% {
        transform: scale(1.1);
        filter: hue-rotate(90deg);
    }

    100% {
        transform: scale(1);
        filter: hue-rotate(0deg);
    }
}

.phase-warning {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--damage-color);
    text-shadow: 0 0 20px var(--damage-color);
    z-index: 3000;
    pointer-events: none;
    animation: warningFlash 0.2s infinite;
    width: 100%;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 2rem 0;
}

@keyframes warningFlash {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Relic Bar */
#relic-bar {
    display: flex;
    gap: 0.5rem;
    margin-right: 1rem;
}

.relic-icon {
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--accent-yellow);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: help;
    position: relative;
}

.relic-tooltip {
    position: absolute;
    top: 120%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--text-secondary);
    padding: 0.5rem;
    width: 200px;
    font-size: 0.8rem;
    color: var(--text-light);
    z-index: 100;
    display: none;
    pointer-events: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.relic-icon:hover .relic-tooltip {
    display: block;
}

/* Player Status Effects */
#player-status-effects {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    min-height: 20px;
}

.status-effect {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--text-secondary);
}

.effect-virus {
    color: var(--accent-pink);
    border-color: var(--accent-pink);
}

.effect-exposed {
    color: var(--accent-yellow);
    border-color: var(--accent-yellow);
}

.effect-lag {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

/* CRT Effect */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background:
        /* Scanlines */
        linear-gradient(rgba(18, 16, 16, 0) 50%,
            rgba(0, 0, 0, 0.25) 50%),
        /* RGB Scanlines */
        linear-gradient(90deg,
            rgba(255, 0, 0, 0.06),
            rgba(0, 255, 0, 0.02),
            rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    z-index: 9999;
    animation: flicker 0.15s infinite;
    opacity: 0.6;

    /* Vignette */
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.9);
}

/* Chromatic Aberration / Phosphor Glow */
body {
    text-shadow: 2px 0 4px rgba(0, 255, 0, 0.3), -2px 0 4px rgba(255, 0, 255, 0.3);
}

@keyframes flicker {
    0% {
        opacity: 0.55;
    }

    5% {
        opacity: 0.6;
    }

    10% {
        opacity: 0.55;
    }

    15% {
        opacity: 0.6;
    }

    20% {
        opacity: 0.55;
    }

    50% {
        opacity: 0.55;
    }

    55% {
        opacity: 0.6;
    }

    60% {
        opacity: 0.55;
    }

    90% {
        opacity: 0.55;
    }

    100% {
        opacity: 0.6;
    }
}

/* Card Hover Effects */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 255, 255, 0.3);
    border-color: var(--accent-cyan);
    z-index: 10;
}

/* Glitch Effect for heavy damage */
@keyframes glitch-anim {
    0% {
        transform: translate(0)
    }

    20% {
        transform: translate(-2px, 2px)
    }

    40% {
        transform: translate(-2px, -2px)
    }

    60% {
        transform: translate(2px, 2px)
    }

    80% {
        transform: translate(2px, -2px)
    }

    100% {
        transform: translate(0)
    }
}

.glitch-effect {
    animation: glitch-anim 0.2s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: var(--damage-color);
    text-shadow: 2px 0 var(--accent-cyan), -2px 0 var(--accent-purple);
}

/* === Deck Viewer === */
.deck-viewer-modal .modal-content {
    background: linear-gradient(135deg, rgba(26, 31, 53, 0.98) 0%, rgba(19, 24, 41, 0.98) 100%);
    border: 2px solid var(--accent-cyan);
}

.deck-viewer-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.deck-viewer-header h2 {
    font-family: var(--font-display);
    color: var(--text-primary);
    margin-bottom: 10px;
    text-shadow: 0 0 10px var(--text-primary);
}

.deck-viewer-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.deck-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(0, 217, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 217, 255, 0.2);
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    color: var(--accent-cyan);
    font-size: 1.5rem;
    font-weight: bold;
    font-family: var(--font-display);
}

.deck-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.deck-card {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1) 0%, rgba(0, 255, 159, 0.1) 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
}

.deck-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 217, 255, 0.3);
    border-color: var(--accent-cyan);
}

.deck-card.type-attack {
    border-left: 4px solid var(--damage-color);
}

.deck-card.type-defense {
    border-left: 4px solid var(--firewall-color);
}

.deck-card.type-skill {
    border-left: 4px solid var(--accent-yellow);
}

.deck-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.deck-card-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: bold;
}

.deck-card-cost {
    background: var(--accent-cyan);
    color: var(--bg-primary);
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 50%;
    min-width: 30px;
    text-align: center;
    font-family: var(--font-display);
}

.deck-card-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 10px;
}

.deck-card-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 217, 255, 0.2);
    color: var(--accent-cyan);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* パーティクル */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    will-change: transform, opacity;
}

.particle-spark {
    background-color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
}

.particle-damage {
    background-color: var(--damage-color);
    box-shadow: 0 0 10px var(--damage-color);
}

.particle-explosion {
    background-color: var(--accent-pink);
    box-shadow: 0 0 15px var(--accent-pink);
}

.particle-heal {
    background-color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
}

.particle-buff {
    background-color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
}
/* Settings Screen Styles */
.settings-group {
    margin: 1.5rem 0;
}

.settings-group label {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.settings-group input[type="range"] {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}

.settings-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-cyan);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-cyan);
}

.settings-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-cyan);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-cyan);
    border: none;
}

.settings-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    accent-color: var(--accent-cyan);
    cursor: pointer;
}
