:root {
  --clr-bg: #070B19;
  --clr-text: #e0faff;
  --clr-primary: #00f0ff;
  --clr-secondary: #0077ff;
  --clr-accent: #ff003c;
  --clr-panel: rgba(5, 12, 25, 0.8); /* 髢ｭ譴ｧ蜍ｹ郢ｧ蝣､蜊邵ｺ荳奇ｼ邵ｺ貅ｷ繝ｻ邵ｲ竏ｵ譫夊氛蜉ｱ窶ｲ髫穂ｹ晢ｽ・ｸｺ蜷ｶ・樒ｹｧ蛹ｻ竕ｧ邵ｺ・ｫ郢昜ｻ｣繝ｭ郢晢ｽｫ髢ｾ・ｪ闖ｴ阮吶・隴牙干・･雎ｼ繝ｻ・･邵ｺ蜷ｶ・・*/
  --clr-glass: rgba(0, 119, 255, 0.1);
  --clr-glass-border: rgba(0, 240, 255, 0.4);
  --font-title: 'Orbitron', 'Noto Sans JP', sans-serif;
  --font-body: 'Rajdhani', 'Noto Sans JP', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 🌐 絶対確実な言語表示切り替え (i18n) */
html[lang="ja"] [data-i18n-lang]:not([data-i18n-lang="ja"]),
html[lang="en"] [data-i18n-lang]:not([data-i18n-lang="en"]),
html[lang="zh-Hant"] [data-i18n-lang]:not([data-i18n-lang="tw"]),
html[lang="zh-TW"] [data-i18n-lang]:not([data-i18n-lang="tw"]),
html[lang="tw"] [data-i18n-lang]:not([data-i18n-lang="tw"]),
html:not([lang="en"]):not([lang="zh-Hant"]):not([lang="zh-TW"]):not([lang="tw"]) [data-i18n-lang]:not([data-i18n-lang="ja"]) {
    display: none !important;
}

body { 
    background-color: var(--clr-bg); 
    background-image: 
        radial-gradient(circle at center, rgba(30, 50, 80, 0.2) 0%, rgba(5, 12, 25, 0.7) 100%),
        url('./assets/images/bg_main.jpg');
    background-size: cover;
    background-position: center 25%;
    background-attachment: fixed;
    color: var(--clr-text); 
    font-family: var(--font-body); 
    min-height: 100vh; 
    display: flex; 
    justify-content: center; 
    overflow-x: hidden;
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.5);
    zoom: 0.8;
    -moz-transform: scale(0.8);
    -moz-transform-origin: top center;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 0;
    pointer-events: none;
}

.app-container { width: 100%; max-width: 1800px; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; overflow-x: hidden; z-index: 1; }

.glass-panel { 
    background: var(--clr-panel); 
    border: 1px solid var(--clr-glass-border); 
    border-radius: 12px; 
    padding: 1.5rem; 
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1), inset 0 0 20px rgba(0, 0, 0, 0.5); 
    backdrop-filter: blur(14px); 
    -webkit-backdrop-filter: blur(14px);
}

.glass-overlay {
    background: rgba(255,255,255, 0.02);
    border: 1px solid rgba(255,255,255, 0.1);
    border-radius: 6px;
}

.app-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--clr-primary); }
.glitch-text { font-family: var(--font-title); font-size: clamp(1.5rem, 3.5vw, 2.2rem); color: var(--clr-primary); text-transform: uppercase; text-shadow: 0 0 10px var(--clr-primary); letter-spacing: 2px; }

.main-nav { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; align-items: stretch; width: 100%; max-width: 950px; justify-content: end; }
.nav-btn { background: transparent; border: 1px solid var(--clr-secondary); color: var(--clr-secondary); padding: 0.4rem; font-family: var(--font-title); font-size: 0.85rem; cursor: pointer; transition: all 0.3s ease; border-radius: 4px; text-transform: uppercase; display: flex; align-items: center; justify-content: center; text-align: center; word-break: keep-all; width: 100%; height: 100%; box-sizing: border-box; }
.nav-btn:hover { background: var(--clr-glass); color: var(--clr-primary); border-color: var(--clr-primary); box-shadow: 0 0 15px var(--clr-primary); }
.nav-btn.active { background: var(--clr-secondary); color: var(--clr-bg); font-weight: bold; box-shadow: 0 0 20px var(--clr-secondary); }

.view-section { display: none; animation: fadeIn 0.4s ease; }
.view-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Dashboard Settings Grid (PC Base) */
.dashboard-settings { padding: 1.5rem; margin-bottom: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.settings-row { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; width: 100%; }
.bottom-row { padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.15); }
.setting-item { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 280px; }
.season-item, .tags-item { flex: 2; min-width: 400px; }
.setting-divider { width: 2px; height: 30px; background: rgba(255,255,255,0.2); }
.setting-label { font-size: 1.2rem; font-weight: bold; white-space: nowrap; }
.boost-label { font-size: 1.1rem; }
.primary-label { color: var(--clr-primary); text-shadow: 0 0 5px var(--clr-primary); }
.accent-label { color: #ffdd55; text-shadow: 0 0 5px #ffdd55; }
.setting-select { font-size: 1.1rem; padding: 0.3rem 1rem; cursor: pointer; flex: 1; }
.primary-select { background: rgba(0,0,0,0.8); color: white; border: 1px solid var(--clr-primary); }
.accent-select { background: #111; color: white; border: 1px solid #00f0ff; font-weight: bold; }
.boost-select { background: #222; color: white; border: 1px solid #ffdd55; font-size: 1rem; padding: 0.4rem 0.5rem; }
.tag-select { background: #222; color: white; border: 1px solid #555; font-size: 1rem; padding: 0.4rem 0.5rem; width: 100%; min-width: 0; }
.tags-item { gap: 0.5rem; flex-wrap: nowrap; }
.or-text { color: #aaa; font-weight: bold; padding: 0 0.5rem; white-space: nowrap; }

/* Formation Grid Design Updates */
.formation-dashboard { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.team-split-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; min-width: 0; width: 100%; }
.team-panel { padding: 1.5rem; box-sizing: border-box; min-width: 0; overflow: visible; }
.team-panel h3 { text-align: center; margin-bottom: 1.5rem; font-family: var(--font-title); letter-spacing: 3px; font-size: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.5rem; }
.player-panel h3 { color: var(--clr-primary); text-shadow: 0 0 8px var(--clr-primary); border-bottom-color: var(--clr-primary); }
.enemy-panel h3 { color: var(--clr-accent); text-shadow: 0 0 8px var(--clr-accent); border-bottom-color: var(--clr-accent); }

/* Slot Card - Splitted into 2 columns for Unit and Pilot */
.slot-card { margin-bottom: 1.5rem; padding: 1rem; border-left: 4px solid var(--clr-secondary); display: flex; flex-direction: column; gap: 0.8rem; }
.enemy-panel .slot-card { border-left-color: var(--clr-accent); }
.slot-header { font-family: var(--font-title); font-weight: bold; color: #fff; letter-spacing: 2px; }

.selection-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.select-col { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.select-label { color: #aaa; font-size: 0.85rem; font-weight: bold; }

.custom-select { 
    background: #0B1121; 
    color: #e0e0e0; 
    border: 1px solid #333; 
    padding: 0.6rem; 
    font-family: var(--font-body); 
    border-radius: 4px; 
    cursor: pointer; 
    width: 100%; 
    max-width: 100%;
    transition: all 0.2s; 
    font-size: 16px; /* iOS zoom prevent */
    text-overflow: ellipsis;
}
.custom-select:focus { outline: none; border-color: var(--clr-primary); box-shadow: 0 0 5px var(--clr-primary); }
.enemy-panel .custom-select:focus { border-color: var(--clr-accent); box-shadow: 0 0 5px var(--clr-accent); }

/* Details Panels */
.details-panel { background: rgba(0,0,0,0.4); padding: 0.8rem; border-radius: 4px; font-size: 0.85rem; display: flex; flex-direction: column; gap: 0.3rem; border: 1px solid #222; }
.stat-row { display: flex; justify-content: space-between; border-bottom: 1px dashed #333; padding-bottom: 2px; }
.stat-row span:first-child { color: #888; }
.stat-row span:last-child { color: #fff; font-family: monospace; font-size: 0.9rem; }
.empty-state { text-align: center; color: #555; font-style: italic; padding: 1rem 0; }

.val-atk { color: #ff8888 !important; }
.val-def { color: #88ccff !important; }
.val-awaken { color: #eebbff !important; }
.val-eva { color: #88ffaa !important; }

/* Synthesized Totals Bar */
.total-stats-bar { display: flex; justify-content: space-around; background: rgba(0,0,0,0.6); padding: 0.6rem; border-radius: 4px; font-family: var(--font-title); font-size: 0.9rem; }
.total-stats-bar.PLAYER { border-bottom: 2px solid var(--clr-primary); }
.total-stats-bar.ENEMY { border-bottom: 2px solid var(--clr-accent); }
.total-stats-bar span { color: #888; }
.total-stats-bar strong { color: #fff; margin-left: 0.3rem; font-size: 1.1rem; }
.hp-txt { color: #fff !important; }
.atk-txt { color: #ff5555 !important; }
.def-txt { color: #55ccff !important; }

/* Support Select */
.support-select { padding: 1rem; margin-bottom: 1.5rem; text-align: center; }
.support-select label { display: block; margin-bottom: 0.5rem; color: #ddd; font-family: var(--font-title); letter-spacing: 1px; }

/* Battle Dashboard Updates */
.battle-dashboard { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 1rem; min-height: 800px; }
.field-and-timeline { display: grid; grid-template-columns: 3fr 1fr; gap: 1.5rem; align-items: start; }
.battle-map-grid { 
    display: grid; 
    grid-template-columns: repeat(17, 1fr); 
    grid-template-rows: repeat(11, 1fr); 
    background: transparent; 
    position: relative; 
    overflow: hidden; 
    aspect-ratio: 17 / 11;
    padding: 0 !important; /* Fix absolute positioning vs padding offset */
    background-size: calc(100% * 13 / 17) auto;
    background-position: center;
    background-repeat: repeat;
}
.battle-map-grid.field-space {
    background-image: url('./assets/field_space.png');
}
.battle-map-grid.field-ground {
    background-image: url('./assets/field_ground.png');
}
.map-cell { border: 1px solid rgba(255,255,255,0.15); transition: background 0.3s; }
.map-cell:hover { background: rgba(255,255,255,0.25); }

/* 全景（FIT）モード: 17×11全体を枠内にピッタリ収める（LINE配置用） */
.map-scroll-wrapper.mode-fit {
    aspect-ratio: 17 / 11 !important;
    overflow: hidden !important;
}
.map-scroll-wrapper.mode-fit .battle-map-grid {
    width: 100% !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* 拡大（ZOOM）モード: 従来の迫力ある拡大表示（3-2通常配置用） */
.map-scroll-wrapper.mode-zoom {
    aspect-ratio: 13 / 7 !important;
    overflow: auto !important;
}
.map-scroll-wrapper.mode-zoom .battle-map-grid {
    width: calc(100% * 17 / 13) !important;
}

/* Battle Log */
.battle-log { height: 250px; background: #020408; border: 1px solid #334; border-radius: 4px; padding: 1rem; font-family: monospace; overflow-y: auto; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.95rem; line-height: 1.5; color: #bbb; box-shadow: inset 0 0 15px rgba(0,0,0,0.8); }
.log-entry { word-break: break-all; padding: 2px 5px; border-radius: 2px; }
.log-entry.system { color: #88ccff; background: rgba(0,100,255,0.1); border-left: 2px solid #88ccff; }
.log-entry.player { color: var(--clr-primary); }
.log-entry.enemy { color: var(--clr-accent); }
.log-entry.highlight { color: #ffe600; font-weight: bold; font-size: 1.05rem; background: rgba(255,230,0,0.1); text-align: center; }

/* Map Units */
.map-unit { position: absolute; width: calc(100% / 17); height: calc(100% / 11); transition: transform 0.4s ease-in-out, top 0.4s ease-out, left 0.4s ease-out; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; z-index: 10; cursor: pointer; filter: drop-shadow(0 0 5px rgba(0,0,0,0.8)); }
.map-unit-icon { width: 90%; height: auto; aspect-ratio: 1 / 1; border-radius: 4px; border: 2px solid; background-size: cover; background-position: center; background-repeat: no-repeat; }
.map-unit.PLAYER .map-unit-icon { border-color: var(--clr-primary); box-shadow: inset 0 0 10px rgba(0,240,255,0.5); }
.map-unit.ENEMY .map-unit-icon { border-color: var(--clr-accent); box-shadow: inset 0 0 10px rgba(255,0,60,0.5); }

/* HP Bar on Map */
.hp-bar-container { position: relative; width: 90%; height: 4px; background: #222; border-radius: 2px; overflow: hidden; border: 1px solid #000; z-index: 2; flex-shrink: 0; }
.hp-bar-fill { height: 100%; transition: width 0.3s ease; }
.map-unit.PLAYER .hp-bar-fill { background: linear-gradient(90deg, #0055ff, var(--clr-primary)); }
.map-unit.ENEMY .hp-bar-fill { background: linear-gradient(90deg, #aa0000, var(--clr-accent)); }

/* NEW: Damage Absorption Barrier Gauge */
.barrier-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #39ff14, #7fff00);
    box-shadow: 0 0 4px #39ff14, 0 0 10px rgba(57, 255, 20, 0.7);
    transition: width 0.3s ease;
    z-index: 3; /* HPバー(z-index:なし)の上に重ねる */
}

/* NEW: HP Text Overlay */
.hp-text-overlay {
    position: absolute;
    bottom: 0px; 
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.70rem;
    font-weight: bold;
    font-family: var(--font-title);
    color: #fff;
    text-shadow: 1px 1px 1px #000, -1px -1px 1px #000, 1px -1px 1px #000, -1px 1px 1px #000, 0px 0px 3px #000;
    pointer-events: none;
    z-index: 12;
    transform: translateY(50%); /* HP郢晁・繝ｻ邵ｺ・ｫ邵ｺ・｡郢ｧ繝ｻ竕ｧ邵ｺ・ｩ髯ｲ・ｫ郢ｧ荵晢ｿ･郢ｧ蟲ｨ・樒ｸｺ・ｫ髫ｱ・ｿ隰ｨ・ｴ */
}

/* NEW: Debuff Container */
.debuff-container {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto; /* 髫ｧ・ｳ驍擾ｽｰ陞ｻ證ｮ蟷慕ｸｺ・ｮ邵ｺ貅假ｽ∫ｸｺ・ｫ郢晏ｸ吶Σ郢晢ｽｼ隶諛・｡咲ｹｧ蜻域剰怏・ｹ陋ｹ繝ｻ*/
    z-index: 15;
}

/* 隴趣ｽｮ隹ｿ・ｵ髯ｦ・ｨ驕会ｽｺ邵ｺ霈費ｽ檎ｹｧ荵昴″郢ｧ・ｦ郢晢ｽｳ郢ｧ・ｿ郢晢ｽｼ郢晁・繝｣郢ｧ・ｸ */
.buff-badge {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    border: 1px solid rgba(0, 240, 255, 0.5);
    border-radius: 12px;
    padding: 1px 8px;
    font-size: 0.70rem;
    font-family: var(--font-body);
    font-weight: bold;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
}

/* 郢晏ｸ吶Σ郢晢ｽｼ隴弱ｅ竊楢椽證ｮ蟷慕ｸｺ霈費ｽ檎ｹｧ荵昴Σ郢晁ｼ釆懃ｹｧ・ｹ郢昴・*/
.buff-list {
    display: none;
    flex-direction: column;
    position: absolute;
    bottom: 100%;
    margin-bottom: 5px;
    align-items: center;
    width: max-content;
    pointer-events: none;
}

/* 郢晏ｸ吶Σ郢晢ｽｼ隴弱ｅ繝ｻ髯ｦ・ｨ驕会ｽｺ髫ｪ・ｭ陞ｳ繝ｻ*/
.debuff-container:hover .buff-list {
    display: flex;
}

.debuff-item {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: bold;
    color: #ff4444;
    background: rgba(40, 0, 0, 0.8);
    border: 1px solid #ff4444;
    padding: 1px 4px;
    border-radius: 2px;
    white-space: nowrap;
    text-shadow: 1px 1px 0 #000;
    margin-bottom: 2px;
    animation: pulseDebuff 1.5s infinite alternate;
}
@keyframes pulseDebuff {
    0% { opacity: 0.8; box-shadow: 0 0 2px #ff0000; }
    100% { opacity: 1; box-shadow: 0 0 8px #ff0000; }
}
.buff-item {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: bold;
    color: #4ade80;
    background: rgba(0, 40, 0, 0.8);
    border: 1px solid #4ade80;
    padding: 1px 4px;
    border-radius: 2px;
    white-space: nowrap;
    text-shadow: 1px 1px 0 #000;
    margin-bottom: 2px;
    animation: pulseBuff 1.5s infinite alternate;
}
@keyframes pulseBuff {
    0% { opacity: 0.8; box-shadow: 0 0 2px #00ff00; }
    100% { opacity: 1; box-shadow: 0 0 8px #00ff00; }
}

/* Timeline UI */
.battle-timeline { display: flex; flex-direction: column; gap: 0.8rem; overflow-y: auto; padding: 1rem; max-height: 550px; }
.battle-timeline::-webkit-scrollbar, #box-grid-container::-webkit-scrollbar { width: 8px; }
.battle-timeline::-webkit-scrollbar-track, #box-grid-container::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); border-radius: 4px; }
.battle-timeline::-webkit-scrollbar-thumb, #box-grid-container::-webkit-scrollbar-thumb { background: var(--clr-primary); border-radius: 4px; }
.battle-timeline::-webkit-scrollbar-thumb:hover, #box-grid-container::-webkit-scrollbar-thumb:hover { background: var(--clr-secondary); }
.timeline-header { color: var(--clr-text); font-family: var(--font-title); border-bottom: 2px solid #555; padding-bottom: 0.5rem; text-shadow: 0 0 5px rgba(255,255,255,0.5); font-size: 1.1rem; }
.timeline-list { display: flex; flex-direction: column; gap: 0.5rem; overflow-y: auto; flex: 1; padding-right: 5px; }
.timeline-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 4px; transition: transform 0.2s, box-shadow 0.2s; }
.timeline-item.active-turn { border-color: var(--clr-primary); box-shadow: 0 0 10px rgba(0, 240, 255, 0.4); background: rgba(0, 240, 255, 0.1); transform: translateX(-4px); }
.timeline-item.dead { opacity: 0.4; filter: grayscale(1); }
.tml-icon { width: 36px; height: 36px; aspect-ratio: 1/1; border-radius: 4px; background-size: cover; background-position: center; flex-shrink: 0; border: 1px solid #555; }
.timeline-item.PLAYER .tml-icon { border-color: var(--clr-primary); box-shadow: 0 0 5px var(--clr-primary); }
.timeline-item.ENEMY .tml-icon { border-color: var(--clr-accent); box-shadow: 0 0 5px var(--clr-accent); }
.tml-name { font-size: 0.85rem; font-weight: bold; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tml-team-player { color: var(--clr-secondary); }
.tml-team-enemy { color: var(--clr-accent); }


/* Animations */
.anim-attack-right { animation: thrustRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.anim-attack-left { animation: thrustLeft 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes thrustRight { 0% { transform: translateX(0); filter: brightness(1) drop-shadow(0 0 0); } 50% { transform: translateX(40%); filter: brightness(1.5) drop-shadow(0 0 10px #fff); } 100% { transform: translateX(0); filter: brightness(1) drop-shadow(0 0 0); } }
@keyframes thrustLeft { 0% { transform: translateX(0); filter: brightness(1) drop-shadow(0 0 0); } 50% { transform: translateX(-40%); filter: brightness(1.5) drop-shadow(0 0 10px #fff); } 100% { transform: translateX(0); filter: brightness(1) drop-shadow(0 0 0); } }

.damage-popup { position: absolute; pointer-events: none; font-weight: bold; font-family: var(--font-title); font-size: 1.8rem; color: #fff; text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 0 0 10px #f00; animation: damageFloat 0.8s ease-out forwards; z-index: 9999; }
@keyframes damageFloat { 0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); } 20% { transform: translate(-50%, -100%) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -200%) scale(1); } }

.heal-popup { position: absolute; pointer-events: none; font-weight: bold; font-family: var(--font-title); font-size: 1.8rem; color: #55ff55; text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 0 0 10px #00ff00; animation: healFloat 0.8s ease-out forwards; z-index: 9999; }
@keyframes healFloat { 0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); } 20% { transform: translate(-50%, -100%) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -200%) scale(1); } }

/* Buttons */
.btn { text-transform: uppercase; font-family: var(--font-title); font-weight: bold; font-size: 1.2rem; padding: 1rem 2rem; border: none; border-radius: 4px; cursor: pointer; transition: all 0.3s; letter-spacing: 3px; }
.btn-primary { background: linear-gradient(45deg, #0055ff, var(--clr-secondary)); color: #fff; box-shadow: 0 0 15px rgba(0, 119, 255, 0.6); border: 1px solid var(--clr-primary); }
.btn-primary:hover { background: linear-gradient(45deg, var(--clr-secondary), var(--clr-primary)); box-shadow: 0 0 25px var(--clr-primary); transform: translateY(-2px); }
.btn:disabled { background: #333; color: #777; box-shadow: none; border-color: #444; filter: grayscale(100%); cursor: not-allowed; transform: none; }

/* 1. Skill Popup Animation */
.skill-popup {
    position: absolute;
    pointer-events: none;
    font-weight: bold;
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: #eebbff;
    background: rgba(40, 0, 80, 0.8);
    border: 1px solid #eebbff;
    padding: 2px 8px;
    border-radius: 4px;
    box-shadow: 0 0 10px #eebbff;
    text-shadow: 1px 1px 0 #000;
    white-space: nowrap;
    animation: skillFloat 1.2s ease-out forwards;
    z-index: 105;
}
@keyframes skillFloat {
    0% { opacity: 0; transform: translate(-50%, 0) scale(0.8); }
    15% { opacity: 1; transform: translate(-50%, -150%) scale(1.1); }
    80% { opacity: 1; transform: translate(-50%, -200%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -250%) scale(0.9); }
}

/* 1.b Weapon Popup (Static, Below unit) */
.weapon-popup {
    position: absolute;
    pointer-events: none;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: #ffd700;
    background: rgba(40, 20, 0, 0.9);
    border: 1px solid #ffaa00;
    padding: 2px 6px;
    border-radius: 2px;
    box-shadow: 0 0 5px #ffaa00;
    white-space: nowrap;
    z-index: 106;
    left: 50%; /* 闕ｳ・ｭ陞滂ｽｮ */
    top: 100%; /* 郢晢ｽｦ郢昜ｹ昴Ε郢晏現繝ｻ闕ｳ迢暦ｽｫ・ｯ */
    transform: translate(-50%, 5px); /* 邵ｺ霈費ｽ臥ｸｺ・ｫ5px闕ｳ荵昶・ */
    animation: weaponFadeInOut 1.5s ease-in-out forwards;
}
@keyframes weaponFadeInOut {
    0% { opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

/* 2. Active Unit Pulse */
.active-unit {
    z-index: 50 !important;
}
.active-unit .map-unit-icon {
    box-shadow: 0 0 15px 5px var(--clr-primary);
    animation: pulseActive 1.5s infinite alternate;
}
@keyframes pulseActive {
    0% { filter: brightness(1) drop-shadow(0 0 5px var(--clr-primary)); }
    100% { filter: brightness(1.3) drop-shadow(0 0 15px var(--clr-primary)); transform: scale(1.05); }
}

/* 3. Attack Laser Pointer */
.attack-laser {
    position: absolute;
    height: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.8), rgba(255,255,255,0));
    box-shadow: 0 0 8px #fff;
    transform-origin: left center;
    pointer-events: none;
    z-index: 40;
    opacity: 0;
    animation: fireLaser 0.4s ease-out forwards;
}
.attack-laser.PLAYER { background: linear-gradient(90deg, var(--clr-primary), transparent); box-shadow: 0 0 10px var(--clr-primary); }
.attack-laser.ENEMY { background: linear-gradient(90deg, var(--clr-accent), transparent); box-shadow: 0 0 10px var(--clr-accent); }
@keyframes fireLaser {
    0% { opacity: 1; transform: scaleX(0); }
    40% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(1); }
}

/* 4. Tension Shift Popup */
.tension-up-popup {
    position: absolute; pointer-events: none; font-weight: bold; font-family: var(--font-title); font-size: 1.4rem; color: #ff5555; text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 0 0 10px #ff0000; animation: tensionUpFloat 1.5s ease-out forwards; z-index: 110; white-space: nowrap;
}
@keyframes tensionUpFloat { 
    0% { opacity: 0; transform: translate(-50%, 20%) scale(0.5); } 
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); } 
    80% { opacity: 1; transform: translate(-50%, -100%) scale(1); } 
    100% { opacity: 0; transform: translate(-50%, -150%) scale(0.8); } 
}

.tension-down-popup {
    position: absolute; pointer-events: none; font-weight: bold; font-family: var(--font-title); font-size: 1.4rem; color: #55aaff; text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 0 0 10px #0055ff; animation: tensionDownFloat 1.5s ease-out forwards; z-index: 110; white-space: nowrap;
}
@keyframes tensionDownFloat { 
    0% { opacity: 0; transform: translate(-50%, -150%) scale(0.8); } 
    20% { opacity: 1; transform: translate(-50%, -100%) scale(1.3); } 
    80% { opacity: 1; transform: translate(-50%, -30%) scale(1); } 
    100% { opacity: 0; transform: translate(-50%, 20%) scale(0.5); } 
}

/* Defender Cover Transition - Added to unit */
.map-unit.covering {
    z-index: 105; /* 驕抵ｽｺ陞ｳ貅倪・隴崢陷大涵謫・・莠･・ｮ蛹ｻ・臥ｹｧ蠕鯉ｽ狗ｹ晢ｽｦ郢昜ｹ昴Ε郢晏現・育ｹｧ雍具ｽｸ螂・ｽｼ蟲ｨ竊馴勗・ｨ驕会ｽｺ邵ｺ霈披雷郢ｧ繝ｻ*/
    filter: brightness(1.2) drop-shadow(0 0 10px rgba(0, 255, 100, 0.5));
}

/* 4. Action Popup (Attack, Defend, Evade) */
.action-popup {
    position: absolute;
    pointer-events: none;
    font-weight: bold;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    animation: actionFloat 1s ease-out forwards;
    z-index: 104;
    text-shadow: 1px 1px 0 #000;
}
.action-popup.attack  { color: #ff5555; background: rgba(80, 0, 0, 0.8); border: 1px solid #ff5555; box-shadow: 0 0 8px #ff5555; }
.action-popup.support { color: #ffaa00; background: rgba(80, 50, 0, 0.8); border: 1px solid #ffaa00; box-shadow: 0 0 8px #ffaa00; }
.action-popup.defend  { color: #55ccff; background: rgba(0, 40, 80, 0.8); border: 1px solid #55ccff; box-shadow: 0 0 8px #55ccff; }
.action-popup.evade   { color: #55ff55; background: rgba(0, 80, 0, 0.8); border: 1px solid #55ff55; box-shadow: 0 0 8px #55ff55; }

@keyframes actionFloat {
    0% { opacity: 0; transform: translate(-50%, -100%) scale(0.8); }
    15% { opacity: 1; transform: translate(-50%, -200%) scale(1.1); }
    80% { opacity: 1; transform: translate(-50%, -250%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -300%) scale(0.9); }
}

@keyframes actionFloatMobile {
    0% { opacity: 0; transform: translate(-50%, -20%) scale(0.8); }
    15% { opacity: 1; transform: translate(-50%, -80%) scale(1.1); }
    80% { opacity: 1; transform: translate(-50%, -100%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -120%) scale(0.9); }
}

/* =========================================
   Mobile Responsive Layout (max-width 768px)
   ========================================= */
@media (max-width: 768px) {
    /* 1. スマホ(iOS等)特有の「背景ドアップバグ」を根本から防ぐ王道設定 */
    body {
        margin: 0;
        background-color: var(--clr-bg) !important;
        background-image: none !important; /* body自体の背景画像を一旦消す */
    }

    /* 画面サイズ固定のダミー要素を用意し、ここに等倍比率で画像を貼る */
    body::after {
        content: '';
        position: fixed; /* スクロールに合わせて追従 */
        top: 0; left: 0;
        width: 100vw; height: 100vh; /* 画面サイズにピッタリ固定して巨大化を防ぐ */
        background-image: 
            radial-gradient(circle at center, rgba(30, 50, 80, 0.2) 0%, rgba(5, 12, 25, 0.7) 100%),
            url('./assets/images/bg_main.jpg') !important;
        background-size: cover !important; /* スマホ画面のサイズに正しくフィット */
        background-position: center top !important;
        z-index: -2 !important;
        pointer-events: none;
    }

    /* 2. 動画リンクを含む1番目のセクション（背景透過）まではそのまま */
    .app-footer {
        background-color: transparent !important;
        padding: 0 !important;
        margin-top: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* 3. アルゴリズム解説（2番目）以降をブログ風カードレイアウトにする */
    .app-footer .seo-content:not(:first-child) {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 1.5rem !important; /* スマホに適した文字幅を確保 */
        box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
        border: none !important;
        border-top: 2rem solid #f0f2f5 !important; /* 背景のグレーの隙間を擬似余白で表現（ここで画像が見えなくなる） */
        border-radius: 0 !important;
        color: #333 !important;
        text-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .app-footer .seo-content:not(:first-child) * {
        text-shadow: none !important;
        color: #333 !important;
    }

    /* 黒テーブル等を白系の見やすいボックスに上書き */
    .app-footer .seo-content:not(:first-child) div[style*="rgba(0,0,0,0.4)"],
    .app-footer .seo-content:not(:first-child) p[style*="rgba(0,0,0,0.4)"] {
        background: #f8f9fa !important;
        border-color: #dee2e6 !important;
        color: #333 !important;
    }

    /* 見出しの色調整 */
    .app-footer .seo-content:not(:first-child) h2,
    .app-footer .seo-content:not(:first-child) h3 {
        color: #222 !important;
        border-color: #dd8800 !important;
    }
    
    /* 最後の免責事項下の余白 */
    .app-footer .seo-content:last-child {
        border-bottom: 2rem solid #f0f2f5 !important;
    }
    .app-container { padding: 0.5rem; }
    
    /* Header & Navigation */
    .app-header { flex-direction: column; gap: 0.8rem; padding-bottom: 0.8rem; }
    .glitch-text { font-size: 1.5rem; text-align: center; word-break: break-all; }
    
    /* モバイル版ナビゲーション（6ボタンを3列×2段に配置して横幅をフル活用） */
    .main-nav { 
        display: grid; 
        grid-template-columns: repeat(3, 1fr); 
        gap: 0.2rem; 
        width: 100%; 
    }
    .nav-btn { 
        padding: 0.2rem; 
        font-size: 0.60rem; 
        margin: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center; 
        word-break: break-all; 
        letter-spacing: -0.5px;
    }
    
    /* モバイル版のみ言語セレクターを完全な右端に固定配置 */
    .lang-selector {
        position: fixed !important;
        top: 0px !important;
        right: 2px !important;
        z-index: 10001 !important;
        margin: 0 !important;
        width: auto !important;
        height: auto !important;
        font-size: 0.65rem !important;
        padding: 2px 4px !important;
        background: rgba(0, 0, 0, 0.8) !important;
        border: 1px solid #555 !important;
        border-radius: 3px !important;
    }

    /* 並び順（order）の指定 */
    .main-nav > .btn-ranked-match { order: 1; grid-column: auto; font-size: 0.70rem; padding: 0.4rem; } /* 左上: ランクマッチ */
    .main-nav > button[data-target="formation-view"] { order: 2; } /* 右上: 編成 */
    .main-nav > button[data-target="battle-view"] { order: 3; } /* 左中: シミュ */
    .main-nav > button[data-target="box-view"] { order: 4; } /* 右中: MY BOX */
    .main-nav > button[onclick*="youtube"] { order: 5; } /* 左下: YouTube */
    .main-nav > button[onclick*="BugReport"] { order: 6; } /* 右下: 不具合 */
    

    /* Formation View */
    /* Dashboard Settings Grid (Mobile Compact) */
    .dashboard-settings { padding: 1rem; gap: 1rem; }
    .settings-row { gap: 1rem; display: grid; grid-template-columns: 1fr 1fr; }
    .bottom-row { padding-top: 0.8rem; }
    .setting-item { flex-direction: column; align-items: stretch; gap: 0.3rem; min-width: 0; }
    .season-item, .tags-item { min-width: 0; grid-column: span 2; }
    .setting-label, .boost-label { font-size: 0.8rem; text-align: center; }
    .setting-divider { display: none; }
    .setting-select, .boost-select, .tag-select { font-size: 0.85rem; padding: 0.4rem; }
    .tags-item { flex-direction: column; align-items: stretch; justify-content: center; gap: 0.2rem; }
    .or-text { display: none; }

    .team-split-view { grid-template-columns: 1fr; gap: 1.5rem; }
    .selection-grid { grid-template-columns: 1fr; gap: 0.8rem; }
    
    /* Battle View */
    .battle-dashboard { height: auto; gap: 1rem; min-height: auto; }
    .field-and-timeline { grid-template-columns: 1fr; gap: 1rem; }
    
    .battle-map-grid { 
        width: 100%;
        height: auto;
        aspect-ratio: 17 / 11;
        margin-bottom: 0.5rem;
    }
    
    .battle-timeline {
        max-height: 230px;
    }
    
    .battle-log { 
        height: 200px; 
        font-size: 0.85rem;
    }

    /* Adjust Map UI scaling */
    .map-unit-icon { border-width: 1px; }
    .hp-bar-container { height: 3px; }
    .damage-popup { font-size: 1.2rem; }
    .skill-popup { font-size: 0.9rem; }
    .heal-popup { font-size: 1.2rem; }
    .tension-up-popup, .tension-down-popup { font-size: 1.0rem; }
    .action-popup { 
        font-size: 0.8rem; 
        padding: 1px 4px; 
        animation: actionFloatMobile 1s ease-out forwards;
    }

    /* --- コラム・過去記事用のスマホ対応 --- */
    .columns-layout-container {
        flex-direction: column-reverse !important; /* 記事を上に、サイドバーを下にする */
        gap: 20px !important;
        max-width: 100% !important;
    }
    .columns-layout-sidebar {
        flex: 0 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .columns-layout-content {
        flex: 0 0 auto !important;
        min-width: 0 !important; /* はみ出し防止！ */
        width: 100% !important;
        gap: 30px !important;
    }
    .columns-layout-content .seo-content {
        max-width: 100% !important;
        padding: 15px !important;
    }
    /* 記事内の画像のレスポンシブ対応 */
    .columns-layout-content img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    .column-card-link {
        flex-direction: column !important; /* カードを縦並びに */
        gap: 12px !important;
        padding: 15px !important;
    }
    .column-card-link .thumb-wrapper {
        flex: 0 0 auto !important;
        width: 100% !important;
    }
    .column-card-link .thumb-wrapper img {
        width: 100% !important;
        max-height: 200px;
        object-fit: cover;
    }
    .column-card-link .content-wrapper {
        width: 100% !important;
    }
}

/* =========================================
   Footer (Ad Placeholders & SEO Content)
   ========================================= */
.app-footer {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px dashed rgba(255,255,255,0.1);
}

.ad-placeholder-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.ad-slot {
    background: rgba(0, 0, 0, 0.4);
    border: 2px dashed #666;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #666;
    font-weight: bold;
    border-radius: 8px;
    letter-spacing: 1px;
}

.primary-ad {
    width: 100%;
    max-width: 728px;
    height: 90px;
}

.seo-content {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    color: #ccc;
    background: rgba(5, 12, 25, 0.9) !important;
}

.seo-content h2 {
    font-family: var(--font-title);
    letter-spacing: 2px;
}

.seo-content h3 {
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    text-shadow: 0 0 5px rgba(255,255,255,0.2);
}

.seo-content p {
    margin-bottom: 1rem;
}

/* Autocomplete Suggest UI */
.autocomplete-container {
    position: relative;
    display: flex;
    align-items: center;
}
.autocomplete-list {
    position: absolute;
    top: 100%;
    right: 0;
    width: 250px;
    max-height: 250px;
    overflow-y: auto;
    background: #111;
    border: 1px solid #00f0ff;
    border-radius: 4px;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0,240,255,0.3);
    display: none;
    text-align: left;
}
.autocomplete-list.active {
    display: block;
}
.autocomplete-item {
    padding: 8px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
}
.autocomplete-item:last-child {
    border-bottom: none;
}
.autocomplete-item:hover {
    background: #004466;
}

/* Mobile Tabs (Hidden on PC) */
.mobile-tabs {
    display: none;
}

/* ==============================================
   Deck Preview & Editor UI (Social-game style)
   ============================================== */
.deck-slot-wrapper {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
}
.deck-slots-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    padding: 1rem 0;
    width: 100%;
    box-sizing: border-box;
    /* Grid陷繝ｻﾎ夐囎竏ｫ・ｴ・ｰ邵ｺ譴ｧ譽ｧ郢ｧ蝣､・ｪ竏ｫ・ｰ・ｴ邵ｺ蜉ｱ竊醍ｸｺ繝ｻ笳・ｹｧ竏壹・邵ｺ鄙ｫ竏ｪ邵ｺ蛟･竊醍ｸｺ繝ｻ*/
    min-width: 0;
}
.deck-slot-card {
    width: 100%;
    aspect-ratio: 1 / 1;    
    min-width: 0;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #555;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.deck-slot-card:hover {
    border-color: var(--clr-primary);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    background: rgba(0, 240, 255, 0.1);
}
.enemy-panel .deck-slot-card:hover {
    border-color: var(--clr-accent);
    box-shadow: 0 0 10px rgba(255, 85, 85, 0.5);
    background: rgba(255, 85, 85, 0.1);
}
.deck-slot-unit-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}
    /* 繝代う繝ｭ繝・ヨ繧呈ｩ滉ｽ薙・蜿ｳ荳九↓荳ｸ蝙九〒驥阪・繧具ｼ亥・騾夲ｼ・*/
    .deck-slot-pilot-icon {
        position: absolute !important;
        bottom: 4px !important;
        right: 4px !important;
        width: 40% !important; /* 隕∵悍縺ｮ40%繧ｵ繧､繧ｺ */
        height: auto !important;
        aspect-ratio: 1 / 1 !important; /* 荳ｸ縺上☆繧九◆繧∵ｭ｣譁ｹ蠖｢ */
        background: #111 !important;
        border: 2px solid #ffffff !important; /* 荳ｸ縺ｮ繝輔メ繧堤區縺ｫ */
        border-radius: 50% !important; /* 蜀・ｽ｢縺ｫ螟画峩 */
        box-shadow: -2px -2px 5px rgba(0,0,0,0.8), 0 0 8px rgba(255,255,255,0.3) !important;
        z-index: 5 !important;
        overflow: hidden !important;
    }
    .deck-slot-pilot-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important; /* 荳ｸ譫縺ｫ蜷医ｏ縺帙※蛻・ｊ謚懊″ */
        object-position: top center !important; /* 鬘秘Κ蛻・′荳ｭ蠢・↓縺ｪ繧九ｈ縺・↓ */
    }
.deck-slot-empty-text {
    color: #555;
    font-weight: bold;
    font-size: 1.5rem;
}
.deck-slot-label {
    position: absolute;
    top: -2px;
    left: -2px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 0.65rem;
    padding: 0 4px;
    border-radius: 0 0 4px 0;
    font-weight: bold;
    font-family: var(--font-title);
    z-index: 3;
}

/* Deck Editor Modal */
.deck-editor-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}
.deck-editor-modal-overlay.active {
    display: flex;
}
.deck-editor-modal-content {
    background: #0B1121;
    border: 2px solid var(--clr-primary);
    box-shadow: 0 0 30px rgba(0,240,255,0.2);
    border-radius: 12px;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    padding: 1.5rem;
    overflow-y: auto;
    position: relative;
    animation: popIn 0.3s ease;
}
.enemy-panel-modal {
    border-color: var(--clr-accent) !important;
    box-shadow: 0 0 30px rgba(255,85,85,0.2) !important;
}
.deck-editor-close-btn {
    position: absolute;
    top: 5px; right: 5px;
    background: #ff3344;
    border: 2px solid #fff;
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.8);
}
.deck-editor-title {
    margin-top: 0;
    color: var(--clr-primary);
    text-shadow: 0 0 10px rgba(0,240,255,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-family: var(--font-title);
    letter-spacing: 1px;
}
.enemy-panel-modal .deck-editor-title {
    color: var(--clr-accent);
    text-shadow: 0 0 10px rgba(255,85,85,0.5);
}

@keyframes popIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ==============================================
   Mobile Responsive Styles (max-width: 768px)
   ============================================== */
@media (max-width: 768px) {
    * {
        box-sizing: border-box;
    }
    
    body {
        zoom: 1 !important;
        -moz-transform: none !important;
        padding-bottom: 2rem;
        overflow-x: hidden;
    }
    
    .app-container {
        padding: 0.5rem;
        gap: 0.8rem;
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* 隴√・・ｭ蜉ｱ・・ｹ晄㈱縺｡郢晢ｽｳ邵ｺ・ｮ邵ｺ・ｯ邵ｺ・ｿ陷・ｽｺ邵ｺ驤ｴ莠溯ｱ・ｽ｢ */
    .btn, button, input, select {
        max-width: 100%;
        white-space: normal;
        word-break: break-all;
    }
    
    /* Header & Nav */
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding-bottom: 1rem;
    }
    .glitch-text {
        font-size: 1.6rem;
    }
    .main-nav {
        flex-wrap: wrap;
        width: 100%;
        gap: 0.5rem;
        justify-content: flex-start;
    }
    .nav-btn {
        flex: 1 1 auto;
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
        text-align: center;
        justify-content: center;
    }

    /* Team Panel Headers (Save slots, AI buttons) */
    .team-panel > div:first-child {
        flex-wrap: wrap !important;
        gap: 0.8rem;
        justify-content: center !important;
    }
    .team-panel > div:first-child > div {
        flex-wrap: wrap !important;
        width: 100%;
        justify-content: center;
    }
    .team-panel h3 {
        width: 100%;
        text-align: center;
        white-space: normal !important;
        letter-spacing: 1px !important;
        font-size: 1.2rem !important;
    }
    
    /* Support Select */
    .support-select {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
        align-items: stretch;
    }
    .support-select select {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Environment & Season selectors */
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding-bottom: 1rem;
    }
    .glitch-text {
        font-size: 1.6rem;
    }
    .main-nav {
        flex-wrap: wrap;
        width: 100%;
        gap: 0.5rem;
        justify-content: flex-start;
    }
    .nav-btn {
        flex: 1 1 auto;
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
        text-align: center;
        justify-content: center;
    }

    /* Environment & Season selectors */
    .field-selector {
        padding: 1rem;
    }
    .field-selector > div {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
    }
    .field-selector > div > div {
        min-width: 0 !important;
        width: 100% !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    .field-selector select {
        width: 100% !important;
        font-size: 0.95rem !important;
    }
    .field-selector > div > div[style*="width: 2px"] {
        display: none !important;
    }

    /* Formation Editor */
    .team-split-view {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .selection-grid {
        grid-template-columns: 1fr;
    }
    
    /* Slot & Autocomplete adjustments */
    .slot-card {
        padding: 0.8rem;
        gap: 0.5rem;
        border-left-width: 3px;
        min-width: 0;
        width: 100%;
    }
    .select-col {
        margin-bottom: 0.5rem;
        min-width: 0;
    }
    .autocomplete-container {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.4rem;
        width: 100%;
        min-width: 0;
    }
    .autocomplete-container input {
        width: 100% !important;
    }
    .autocomplete-list {
        width: 100%;
        max-width: 100%;
    }
    .unit-select-row {
        flex-direction: column; /* Select and Detail button stack */
        min-width: 0;
    }
    
    .custom-select {
        text-overflow: ellipsis;
        padding-right: 0.5rem;
    }

    /* Total Stats */
    .total-stats-bar {
        font-size: 0.75rem;
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    .total-stats-bar strong {
        font-size: 0.95rem;
    }
    
    /* Battle View */
    .field-and-timeline {
        grid-template-columns: 1fr;
    }

    
    /* Ad Placeholder */
    .ad-slot.primary-ad {
        height: auto;
        min-height: 50px;
        font-size: 0.8rem;
    }
    
    /* Bug report modal / Glass panels general */
    .glass-panel {
        padding: 1rem;
    }
    
    /* Mobile Tabs Design */
    .mobile-tabs {
        display: flex !important;
        width: 100%;
        margin-bottom: 0.5rem;
        background: rgba(0,0,0,0.5);
        border: 1px solid #444;
        border-radius: 6px;
        overflow: hidden;
    }
    .mobile-tab-btn {
        flex: 1;
        padding: 0.8rem 0.2rem;
        background: transparent;
        color: #666;
        border: none;
        font-family: var(--font-title);
        font-size: clamp(0.8rem, 3.5vw, 1.1rem); /* 騾包ｽｻ鬮ｱ・｢陝ｷ繝ｻ竊楢惺蛹ｻ・冗ｸｺ蟶吮ｻ隴√・・ｭ蜉ｱ窶ｲ髢ｾ・ｪ陷肴・蝎ｪ邵ｺ・ｫ驍ｵ・ｮ陝・ｸ翫・隲｡・｡陞滂ｽｧ邵ｺ霈費ｽ檎ｹｧ繝ｻ*/
        font-weight: bold;
        white-space: nowrap; /* 闕ｳ閧ｴ・ｰ・ｼ陞ゑｽｽ邵ｺ・ｪ隰ｾ・ｹ髯ｦ蠕鯉ｽ帝お・ｶ陝・ｽｾ邵ｺ・ｫ鬮ｦ・ｲ邵ｺ繝ｻ*/
        cursor: pointer;
        transition: all 0.3s;
    }
    .mobile-tab-btn.player-tab.active {
        color: var(--clr-primary);
        border-bottom: 3px solid var(--clr-primary);
        background: rgba(0, 240, 255, 0.1);
        text-shadow: 0 0 8px var(--clr-primary);
    }
    .mobile-tab-btn.enemy-tab.active {
        color: var(--clr-accent);
        border-bottom: 3px solid var(--clr-accent);
        background: rgba(255, 85, 85, 0.1);
        text-shadow: 0 0 8px var(--clr-accent);
    }
    
    /* Panel Visibility Toggle for Mobile */
    .team-panel {
        display: none !important;
    }
    .team-panel.active-tab {
        display: block !important;
    }
    .team-split-view {
        gap: 0;
    }

    /* === 繝｢繝舌う繝ｫ蟆ら畑繝・ャ繧ｭ繧ｹ繝ｭ繝・ヨ陦ｨ遉ｺ === */
    .deck-slot-card {
        aspect-ratio: auto !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        overflow: visible !important;
        margin-top: 1.5rem !important;
    }
    
    .deck-slot-label {
        position: absolute !important;
        top: -1.3rem !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: max-content !important;
        white-space: nowrap !important;
        text-align: center !important;
        background: transparent !important;
        border-radius: 0 !important;
        padding: 0 !important;
        font-size: 0.8rem !important;
        font-weight: bold !important;
        letter-spacing: 0 !important;
        color: white !important;
        margin: 0 !important;
    }

    .deck-slot-unit-img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 3 / 4 !important;
        object-fit: cover !important;
    }

    .deck-slot-empty-text {
        width: 100% !important;
        aspect-ratio: 3 / 4 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
    }

    .deck-slot-pilot-icon {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important; /* 邵ｦ讓ｪ豈・:1(豁｣譁ｹ蠖｢) */
        border-radius: 0 !important;
        border: none !important;
        border-top: 1px solid #444 !important;
        background: #111 !important;
        box-shadow: none !important;
    }

    .deck-slot-pilot-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important; /* 蛻・ｌ縺ｪ縺・ｈ縺・↓荳ｸ縲・｡ｨ遉ｺ */
        object-position: center !important;
    }
}

/* =========================================
   NEW SELECTION MODAL STYLES (TAP PANEL)
========================================= */
.selectable-panel {
    transition: all 0.2s ease;
}
.selectable-panel:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.5) !important;
    border-color: var(--clr-primary) !important;
}

.selection-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.85);
    z-index: 20000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}
.selection-modal-content {
    width: 90%;
    max-width: 500px;
    height: 85vh;
    background: #111;
    border: 2px solid var(--clr-primary);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0,240,255,0.2);
}
.selection-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #333;
    background: rgba(0,240,255,0.1);
}
.selection-modal-header h3 {
    margin: 0; color: #fff; font-size: 1.2rem;
}
.selection-close-btn {
    background: none; border: none; color: #aaa; font-size: 2rem; cursor: pointer;
}
.selection-search-bar {
    padding: 1rem;
    border-bottom: 1px solid #333;
}
.selection-search-bar input {
    width: 100%;
    padding: 0.8rem;
    background: #000;
    border: 1px solid var(--clr-primary);
    color: #fff;
    font-size: 1rem;
    border-radius: 4px;
}
.selection-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}
.selection-list-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}
.selection-list-item:hover {
    background: rgba(0,240,255,0.15);
    border-color: var(--clr-primary);
}

/* =========================================
   MOBILE PORTRAIT OPTIMIZATION (繧ｹ繝槭・邵ｦ謖√■蟆ら畑)
   繧ｹ繝槭・邵ｦ謖√■譎ゅ・隕冶ｪ肴ｧ譛螟ｧ蛹悶→諠・ｱ髢灘ｼ輔″
========================================= */
@media (max-width: 768px) and (orientation: portrait) {
    /* 繧ｷ繝溘Η繝ｬ繝ｼ繧ｷ繝ｧ繝ｳ繧ｳ繝ｳ繝・リ繧偵・繧､繝翫せ繝槭・繧ｸ繝ｳ縺ｧ逕ｻ髱｢蟷・＞縺｣縺ｱ縺・100vw)縺ｫ蠎・￡繧・*/
    #battle-view {
        margin-left: -0.5rem !important;
        margin-right: -0.5rem !important;
        width: 100vw !important;
    }
    #battle-container {
        padding: 0 !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        width: 100vw !important;
    }
    .simulation-controls {
        padding: 0 0.5rem !important; /* 謫堺ｽ懊・繧ｿ繝ｳ鬘槭・菴咏區繧呈綾縺・*/
    }
    .battle-map-grid {
        padding: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    /* 荳崎ｦ√↑繧｢繧､繧ｳ繝ｳ縺ｮ髱櫁｡ｨ遉ｺ・医ヰ繝輔・繝・ヰ繝輔↑縺ｩ・・*/
    .buff-icon, .debuff-icon, .status-icons, .debuff-container, .buff-badge, .buff-list {
        display: none !important;
    }

    /* HP縺ｪ縺ｩ縺ｮ謨ｰ蟄励・陦ｨ險倥・讌ｵ蟆丞喧 */
    .hp-text-overlay {
        display: none !important;
    }
    .tension-up-popup, .tension-down-popup {
        font-size: 0.55rem !important;
        padding: 1px 2px !important;
    }
    .action-popup {
        font-size: 0.6rem !important;
        padding: 1px 3px !important;
    }
    .skill-popup {
        display: block !important;
        font-size: 0.6rem !important;
        white-space: nowrap !important;
        width: auto !important;
        min-width: max-content !important;
        z-index: 100 !important;
    }
    .weapon-popup {
        font-size: 0.55rem !important;
    }
    .damage-popup {
        font-size: 0.9rem !important;
    }
}

/* =========================================
   MOBILE DEVICES (繧ｹ繝槭・蜈ｱ騾夲ｼ夂ｸｦ讓ｪ蜈ｱ騾・
========================================= */
@media (max-width: 768px) {
    #btn-stop-sim {
        flex: 1 !important;
        min-width: 200px !important;
        font-size: 1rem !important;
        padding: 0.8rem 1.5rem !important;
        height: auto !important;
    }
}

/* =========================================
   MOBILE HEADER & NAV BUTTONS FIX
========================================= */
@media (max-width: 768px) {
    .app-header {
        align-items: center !important;
        text-align: center;
    }
    /* モバイル専用ヘッダー配置修正 */
    h1.main-header-title {
        align-items: center !important;
    }
    .main-header-subtitle {
        text-align: center !important;
    }
    .main-header-logo-group {
        align-items: flex-start !important;
    }
    .glitch-text {
        text-align: left !important;
        width: auto !important;
        margin-left: 0 !important;
    }
    .main-nav {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
        width: 100% !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .main-nav .nav-btn, .main-nav a, .main-nav a .nav-btn {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        text-align: center !important;
        justify-content: center !important;
        font-size: 0.8rem !important;
        padding: 0.5rem 0.2rem !important;
        height: 44px !important;
        min-height: 44px !important;
    }
    .main-nav {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }
    
    /* モバイル時のみ、orderを変更して言語切り替えを一番右上に配置する */
    #nav-btn-formation { order: 1; }
    #nav-btn-lang      { order: 2; }
    #nav-btn-sim       { order: 3; }
    #nav-btn-box       { order: 4; }
    #nav-btn-youtube   { order: 5; }
    #nav-btn-bug       { order: 6; }
}

/* ==============================================
   Text Readability Fixes
   ============================================== */
/* 逋ｽ閭梧勹縺ｮ繝悶Ο繧ｰ險倅ｺ九お繝ｪ繧｢遲峨〒縺ｯ縲∝・菴薙↓縺九°縺｣縺ｦ縺・ｋ繝阪が繝ｳ繧ｷ繝｣繝峨え繧ｨ繝輔ぉ繧ｯ繝医ｒ辟｡蜉ｹ蛹悶＠隕冶ｪ肴ｧ繧帝ｫ倥ａ繧・*/
.seo-content article,
.seo-content article *,
div[style*="background: rgba(255, 255, 255"],
div[style*="background: rgba(255, 255, 255"] *,
div[style*="background: #ffffff"],
div[style*="background: #ffffff"] * {
    text-shadow: none !important;
}


/* ==============================================
   Turn Splash Animation
   ============================================== */
.turn-splash {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px #00f0ff, 0 0 40px #0055ff, 0 0 60px #8a2be2;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    font-family: 'Arial Black', sans-serif;
    letter-spacing: 5px;
    animation: turnSplashAnim 1.8s ease-out forwards;
    white-space: nowrap;
}

@keyframes turnSplashAnim {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.0);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.3);
    }
}

/* ▽ モバイル環境向け（縦画面・横画面）のアニメーション文字サイズ自動切り替え ▽ */
@media (max-width: 768px) and (orientation: portrait) {
    .turn-splash {
        font-size: 2rem;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .turn-splash {
        font-size: 2.8rem;
    }
}

/* =========================================================
   Simulation Controls (Responsive Layout)
   ========================================================= */
#sim-controls-panel {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    gap: 0.5rem;
    align-items: stretch; /* 高さを揃える */
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 5px; /* スクロールバー用 */
}

#sim-controls-panel > button,
#sim-controls-panel > div {
    flex: 1 1 auto; /* 文字数に合わせて幅を自動調整しつつ均等化 */
    min-width: 0;
    height: 44px; /* 高さを完全に統一 */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 6px; /* 少しパディングを復活 */
    font-size: clamp(0.7rem, 1.2vw, 0.9rem); /* 幅に合わせて文字サイズを自動調整 */
    white-space: nowrap;
    overflow: hidden; /* はみ出しを防止 */
    text-overflow: ellipsis; /* 限界を超えたら「...」で省略 */
    box-sizing: border-box;
    margin: 0;
}

#btn-start-sim, #btn-pause-sim {
    flex: 1.5 1 0; /* STARTだけ少し広めの完全固定比率 */
}

#speed-toggle-btn {
    min-width: 60px; /* 固定幅を解除し自動拡張を許可 */
    font-weight: bold;
}

#skip-btn {
    min-width: 80px; /* 固定幅を解除し自動拡張を許可 */
    background: rgba(150, 0, 150, 0.8);
    color: #fff;
    border: 1px solid #ff55ff;
    font-weight: bold;
}

/* Manual Mode Container inside controls */
#manual-mode-panel {
    flex-direction: row;
    background: rgba(0,0,0,0.5);
    border: 1px solid #777;
    border-radius: 4px;
    gap: 6px;
}

.manual-mode-label {
    font-size: 0.85rem;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

#btn-next-step {
    width: auto;
    height: 80%; /* 親の44pxに合わせつつ少し小さく */
    padding: 0 0.8rem;
    font-size: 0.85rem;
    border-color: #55ff55;
    color: #55ff55;
    background: rgba(0, 40, 0, 0.8);
}

/* モバイル向け対応：完全ブロック型の整列レイアウト */
@media (max-width: 768px) {
    #sim-controls-panel {
        display: grid;
        grid-template-columns: repeat(4, 1fr); /* 4列の均等グリッド */
        gap: 4px;
        flex-wrap: unset;
        overflow-x: hidden;
    }
    
    #sim-controls-panel > button,
    #sim-controls-panel > div {
        height: 38px; /* スマホでも高さを完全に固定して統一 */
        font-size: clamp(0.6rem, 2.5vw, 0.75rem); /* スマホ画面幅に合わせて文字を自動縮小 */
        padding: 0 2px;
        margin: 0;
        width: 100%;
        overflow: hidden;
    }
    
    #btn-start-sim, #btn-pause-sim {
        grid-column: 1 / 3; /* 4列中2列を使用（50%） */
        grid-row: 1 / 2;
    }
    
    #camera-toggle-btn {
        grid-column: 3 / 5; /* 4列中2列を使用（50%） */
        grid-row: 1 / 2;
    }
    
    #speed-toggle-btn {
        grid-column: 1 / 2; /* 4列中1列を使用（25%） */
        grid-row: 2 / 3;
    }
    
    #skip-btn {
        grid-column: 2 / 3; /* 4列中1列を使用（25%） */
        grid-row: 2 / 3;
    }
    
    #manual-mode-panel {
        grid-column: 3 / 5; /* 4列中2列を使用（50%） */
        grid-row: 2 / 3;
        flex-direction: row;
        gap: 2px;
        padding: 0 2px;
    }
    
    .manual-mode-label {
        font-size: clamp(0.55rem, 2.2vw, 0.7rem); /* 限界まで自動縮小 */
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    #btn-next-step {
        height: 85%;
        padding: 0 4px;
        font-size: clamp(0.55rem, 2.2vw, 0.7rem);
    }
}

/* --- Update Info Details (Collapsible) --- */
details.update-info-bar {
    background: rgba(0, 40, 60, 0.6);
    border-left: 3px solid var(--clr-primary);
    border-radius: 4px;
    font-size: 0.85rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    margin-bottom: 5px;
}
details.update-info-bar summary {
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    list-style: none; /* Hide default triangle */
}
details.update-info-bar summary::-webkit-details-marker {
    display: none;
}
details.update-info-bar summary::after {
    content: "▼";
    margin-left: auto;
    font-size: 0.8em;
    color: var(--clr-primary);
    transition: transform 0.2s;
    padding-left: 8px;
}
details.update-info-bar[open] summary::after {
    transform: rotate(180deg);
}
.update-history {
    padding: 4px 12px 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px dashed rgba(255,255,255,0.2);
}
.update-history-item {
    color: #ccc;
    font-size: 0.8rem;
    display: flex;
    align-items: flex-start;
    line-height: 1.4;
}
.update-history-item::before {
    content: "•";
    color: var(--clr-primary);
    margin-right: 6px;
    font-weight: bold;
}

/* --- Mobile Fullscreen Modals & Scroll Bleed Prevent --- */
body.modal-open {
    overflow: hidden !important;
    height: 100vh !important;
    overscroll-behavior: none !important;
}

@media (max-width: 768px) {
    .selection-modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
}

/* --- コラム用のグローバルCSSクラス (PCベース) --- */
.columns-layout-container {
    display: flex;
    gap: 30px;
    max-width: 95%;
    margin: 0 auto;
    flex-wrap: wrap;
}
.columns-layout-sidebar {
    flex: 0 0 300px;
    max-width: 350px;
}
.columns-layout-content {
    flex: 1;
    min-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.column-card {
    background: rgba(0, 20, 40, 0.6);
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.column-card-link {
    text-decoration: none;
    display: flex;
    flex-direction: row;
    gap: 20px;
    padding: 20px;
    transition: all 0.3s;
}
.column-card-link .thumb-wrapper {
    flex: 0 0 200px;
}
.column-card-link .thumb-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
}
.column-card-link .content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- コラム用レスポンシブ対応 (768px以下) --- */
@media (max-width: 768px) {
    .column-card-link {
        flex-direction: column; /* スマホ画面では縦並びに変更 */
        gap: 15px;
        padding: 15px;
    }
    .column-card-link .thumb-wrapper {
        flex: none;
        width: 100%; /* スマホ画面でサムネイル画像を横幅いっぱいに広げる */
    }
    .column-card-link .thumb-wrapper img {
        width: 100%;
        height: auto;
        max-height: 200px; /* 画像が過大に広がるのを抑制 */
        object-fit: cover;
    }
}

/* --- コラム用レスポンシブ対応 (768px以下) --- */
@media (max-width: 768px) {
    .column-card-link {
        flex-direction: column; /* スマホ画面では縦並びに変更 */
        gap: 15px;
        padding: 15px;
    }
    .column-card-link .thumb-wrapper {
        flex: none;
        width: 100%; /* スマホ画面でサムネイル画像を横幅いっぱいに広げる */
    }
    .column-card-link .thumb-wrapper img {
        width: 100%;
        height: auto;
        max-height: 200px; /* 画像が過大に広がるのを抑制 */
        object-fit: cover;
    }
}

/* MAP兵器射程ハイライト */
.map-range-highlight {
    position: absolute;
    background: rgba(255, 50, 50, 0.22);
    border: 1px dashed rgba(255, 0, 0, 0.4);
    box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.3);
    pointer-events: none;
    z-index: 1; /* ユニット(z-index: 10)より背面に描画 */
    animation: pulse-red 1.5s infinite alternate;
}
@keyframes pulse-red {
    from { background: rgba(255, 50, 50, 0.15); }
    to { background: rgba(255, 50, 50, 0.28); }
}

/* ターゲットユニットを囲う緑の〇 */
.target-marker-green {
    position: absolute;
    top: -10%; left: -10%;
    width: 120%; height: 120%;
    border: 3px solid #39ff14;
    border-radius: 50%;
    box-shadow: 0 0 15px #39ff14, inset 0 0 10px #39ff14;
    pointer-events: none;
    z-index: 15;
    animation: pulse-green-marker 0.6s ease-out forwards;
}
@keyframes pulse-green-marker {
    0% { transform: scale(1.6); opacity: 0; }
    50% { transform: scale(1.0); opacity: 1; }
    100% { transform: scale(1.05); opacity: 0.8; }
}


