/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
    overflow: hidden; /* スクロールを防ぐ */
    position: fixed;
    width: 100%;
}

.app {
    height: 100vh;
    width: 100vw;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.screen {
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden;
}

/* TOP画面スタイル */
.top-screen {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow-y: auto;
    box-sizing: border-box;
}

.top-screen h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.error-message {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid #ef5350;
    box-shadow: 0 4px 12px rgba(239, 83, 80, 0.2);
    animation: errorPulse 2s infinite;
}

@keyframes errorPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.game-config {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 15px;
    display: block;
    text-align: left;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.config-item {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
}

.config-item label {
    font-weight: bold;
    color: #495057;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.config-item input,
.config-item select {
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.config-item input:focus,
.config-item select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.config-item input.invalid {
    border-color: #dc3545;
    background-color: #fff5f5;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.config-value {
    color: #6c757d;
    font-size: 0.9em;
    font-style: italic;
    margin-top: 5px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    border-left: 3px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.config-item:hover .config-value::before {
    left: 100%;
}

.validation-error {
    color: #dc3545;
    font-size: 0.85em;
    font-weight: 600;
    margin-top: 5px;
    padding: 5px 10px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
    border-left: 3px solid #dc3545;
}

.start-button {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 18px 35px;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-button:hover:not(.disabled) {
    background: linear-gradient(135deg, #45a049, #388e3c);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.start-button:active:not(.disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.start-button.disabled {
    background: linear-gradient(135deg, #cccccc, #b3b3b3);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    opacity: 0.7;
}

/* 戦闘画面スタイル */
.battle-screen {
    position: relative;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    padding: 10px;
}

.battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.back-button {
    background-color: #2196F3;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.back-button:hover {
    background-color: #1976D2;
}

.battle-info {
    font-weight: bold;
    color: #333;
}

.victory-message {
    text-align: center;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    animation: victory-pulse 2s infinite;
}

.victory-message h3 {
    font-size: 2em;
    margin-bottom: 10px;
    color: #333;
}

.victory-button {
    background-color: #4CAF50;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 15px;
}

@keyframes victory-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 戦闘エリア */
.battle-area {
    position: relative;
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    margin-bottom: 10px;
}

.enemy-grid {
    position: relative;
    width: 100%;
    height: 100%;
}

.enemy-container {
    position: absolute;
    transform: translate(-50%, -50%);
}

.enemy {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.enemy-alive:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.enemy-defeated {
    cursor: not-allowed;
    filter: grayscale(100%);
}

.enemy-emoji {
    font-size: 36px;
    margin-bottom: 4px;
}

.enemy-hp {
    font-size: 14px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.enemy-hp-bar {
    width: 90px;
    height: 6px;
    background-color: rgba(255,255,255,0.3);
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.enemy-hp-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* レスポンシブデザイン - スマホ専用 */
@media (max-width: 767px) {
    body {
        overflow: hidden;
        position: fixed;
        height: 100vh;
        width: 100vw;
    }
    
    .screen {
        padding: 5px;
        height: 100vh;
        width: 100vw;
    }
    
    .top-screen {
        padding: 15px;
        width: 95%;
        max-height: 95vh;
        font-size: 0.9em;
    }
    
    .top-screen h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    
    .game-config {
        padding: 15px;
    }
    
    .config-item {
        margin-bottom: 12px;
    }
    
    .config-item input,
    .config-item select {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .start-button {
        padding: 12px 20px;
        font-size: 1em;
    }
    
    .battle-screen {
        padding: 5px;
    }
    
    .battle-header {
        flex-direction: row;
        gap: 5px;
        padding: 5px 10px;
        margin-bottom: 5px;
    }
    
    .battle-header h2 {
        font-size: 1.2em;
    }
    
    .battle-info {
        font-size: 0.8em;
    }
    
    .enemy {
        width: 80px;
        height: 90px;
    }
    
    .enemy-emoji {
        font-size: 28px;
    }
    
    .enemy-hp-text {
        font-size: 12px;
    }
    
    .battle-stats {
        padding: 8px 15px;
        gap: 15px;
        flex-shrink: 0;
    }
    
    .stat-item {
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .top-screen {
        padding: 12px;
        width: 98%;
        max-height: 98vh;
        font-size: 0.85em;
    }
    
    .top-screen h1 {
        font-size: 1.6em;
        margin-bottom: 12px;
    }
    
    .game-config {
        padding: 12px;
    }
    
    .config-item {
        margin-bottom: 10px;
    }
    
    .config-item label {
        font-size: 0.9em;
    }
    
    .config-item input,
    .config-item select {
        padding: 6px 8px;
        font-size: 13px;
    }
    
    .config-value {
        font-size: 0.75em;
        padding: 4px 8px;
    }
    
    .validation-error {
        font-size: 0.75em;
        padding: 3px 6px;
    }
    
    .start-button {
        padding: 10px 15px;
        font-size: 0.9em;
        margin-top: 10px;
    }
    
    .battle-header {
        padding: 3px 8px;
    }
    
    .battle-header h2 {
        font-size: 1em;
    }
    
    .battle-info {
        font-size: 0.7em;
    }
    
    .enemy {
        width: 70px;
        height: 80px;
    }
    
    .enemy-emoji {
        font-size: 24px;
    }
    
    .enemy-hp-text {
        font-size: 10px;
    }
    
    .battle-stats {
        padding: 5px 10px;
        gap: 10px;
    }
    
    .stat-item {
        font-size: 0.7em;
    }
}

@media (max-width: 320px) {
    .top-screen {
        padding: 8px;
        width: 99%;
        max-height: 99vh;
        font-size: 0.8em;
    }
    
    .top-screen h1 {
        font-size: 1.4em;
        margin-bottom: 8px;
    }
    
    .game-config {
        padding: 8px;
    }
    
    .config-item {
        margin-bottom: 8px;
    }
    
    .config-item input,
    .config-item select {
        padding: 4px 6px;
        font-size: 12px;
    }
    
    .start-button {
        padding: 8px 12px;
        font-size: 0.8em;
    }
    
    .battle-header {
        padding: 2px 5px;
    }
    
    .battle-header h2 {
        font-size: 0.9em;
    }
    
    .enemy {
        width: 60px;
        height: 70px;
    }
    
    .enemy-emoji {
        font-size: 20px;
    }
}

/* App コンポーネント専用スタイル */
.app {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Arial', sans-serif;
}

.app .screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.app .battle-screen {
    justify-content: flex-start;
    padding-top: 20px;
}

.app .battle-header {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.app .back-button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.app .back-button:hover {
    background: #ff5252;
}

.app .battle-header h2 {
    color: white;
    margin: 0;
    font-size: 24px;
}

.app .battle-info {
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.app .victory-message {
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    animation: victoryPulse 2s infinite;
}

@keyframes victoryPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.app .victory-message h3 {
    margin: 0 0 15px 0;
    font-size: 28px;
}

.app .victory-message p {
    margin: 0 0 20px 0;
    font-size: 18px;
}

.app .victory-button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.app .victory-button:hover {
    background: #45a049;
}

.app .battle-area {
    width: 100%;
    max-width: 800px;
    height: 500px;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.app .enemy-grid {
    width: 100%;
    height: 100%;
    position: relative;
}

.app .enemy-container {
    position: absolute;
    transform: translate(-50%, -50%);
}

.app .enemy {
    width: 120px;
    height: 140px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.app .enemy:hover:not(.enemy-defeated) {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.app .enemy-defeated {
    cursor: not-allowed;
    filter: grayscale(100%);
}

.app .enemy-emoji {
    font-size: 40px;
    margin-bottom: 8px;
}

.app .enemy-hp {
    color: white;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

.app .enemy-hp-bar {
    width: 100px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.app .enemy-hp-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* App レスポンシブデザイン */
@media (max-width: 768px) {
    .app .battle-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .app .battle-area {
        height: 400px;
    }
    
    .app .enemy {
        width: 90px;
        height: 110px;
    }
    
    .app .enemy-emoji {
        font-size: 30px;
    }
    
    .app .enemy-hp {
        font-size: 14px;
    }
    
    .app .enemy-hp-bar {
        width: 70px;
        height: 6px;
    }
}/* 
追加の視覚的エフェクト */
.config-item {
    transition: all 0.3s ease;
}

.config-item:hover {
    transform: translateY(-2px);
}

.config-item input:valid,
.config-item select:valid {
    border-color: #28a745;
}

.config-item input:valid + .config-value {
    background: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
    color: #155724;
}

/* ローディング状態のスタイル */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* フォーカス時のアニメーション */
.config-item input:focus,
.config-item select:focus {
    animation: focusPulse 0.6s ease-in-out;
}

@keyframes focusPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* 成功状態のアニメーション */
.config-item.success {
    animation: successBounce 0.6s ease-in-out;
}

@keyframes successBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

/* エラー状態の改善 */
.config-item.error {
    animation: errorShake 0.6s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

/* ボタンのプレス効果 */
.start-button:active:not(.disabled) {
    animation: buttonPress 0.1s ease-in-out;
}

@keyframes buttonPress {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

/* ツールチップスタイル */
.config-item[data-tooltip] {
    position: relative;
}

.config-item[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    animation: tooltipFadeIn 0.3s ease-in-out forwards;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(5px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .top-screen {
        border: 2px solid #000;
    }
    
    .config-item input,
    .config-item select {
        border: 2px solid #000;
    }
    
    .start-button {
        border: 2px solid #000;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .top-screen {
        background: rgba(33, 37, 41, 0.95);
        color: #f8f9fa;
    }
    
    .top-screen h1 {
        color: #f8f9fa;
    }
    
    .game-config {
        background: linear-gradient(135deg, #495057, #6c757d);
    }
    
    .config-item label {
        color: #f8f9fa;
    }
    
    .config-item input,
    .config-item select {
        background: #495057;
        color: #f8f9fa;
        border-color: #6c757d;
    }
    
    .config-value {
        background: rgba(102, 126, 234, 0.2);
        color: #adb5bd;
    }
}

/* アクセシビリティ改善 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* フォーカス表示の改善 */
.config-item input:focus-visible,
.config-item select:focus-visible,
.start-button:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
/* Ene
my Component Styles */
.enemy {
    position: relative;
    width: 80px;
    height: 100px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    user-select: none;
    overflow: visible;
}

.enemy-alive:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.enemy-defeated {
    cursor: not-allowed;
    filter: grayscale(100%);
    opacity: 0.3 !important;
}

.enemy-emoji {
    font-size: 40px;
    margin-bottom: 8px;
    transition: transform 0.2s ease;
}

.enemy-hp-text {
    color: white;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.enemy-hp-bar {
    width: 100px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.enemy-hp-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* 攻撃エフェクト */
.enemy-attacking {
    animation: attackShake 0.3s ease-in-out;
}

@keyframes attackShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.enemy-attacking .enemy-emoji {
    transform: scale(1.2);
}

/* ダメージ数値表示 */
.damage-number {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    color: #ff4444;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 10;
}

.damage-animation {
    animation: damageFloat 0.8s ease-out forwards;
}

@keyframes damageFloat {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px) scale(1.2);
    }
}

/* 撃破エフェクト */
.enemy-being-defeated {
    animation: defeatEffect 1.5s ease-out forwards;
}

@keyframes defeatEffect {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.3;
    }
}

/* 撃破メッセージ */
.defeated-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffff00;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ffff00;
}

.defeated-animation {
    animation: defeatedPulse 1.5s ease-out forwards;
}

@keyframes defeatedPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

/* レスポンシブ対応 - Enemy Component */
@media (max-width: 768px) {
    .enemy {
        width: 90px;
        height: 110px;
    }
    
    .enemy-emoji {
        font-size: 30px;
    }
    
    .enemy-hp-text {
        font-size: 14px;
    }
    
    .enemy-hp-bar {
        width: 70px;
        height: 6px;
    }
    
    .damage-number {
        font-size: 16px;
        top: -20px;
    }
    
    .defeated-message {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .enemy {
        width: 80px;
        height: 100px;
    }
    
    .enemy-emoji {
        font-size: 26px;
    }
    
    .enemy-hp-text {
        font-size: 12px;
    }
    
    .enemy-hp-bar {
        width: 60px;
        height: 5px;
    }
    
    .damage-number {
        font-size: 14px;
        top: -15px;
    }
    
    .defeated-message {
        font-size: 12px;
        padding: 3px 6px;
    }
}

/* アクセシビリティ改善 - Enemy Component */
@media (prefers-reduced-motion: reduce) {
    .enemy-attacking,
    .damage-animation,
    .enemy-being-defeated,
    .defeated-animation {
        animation: none !important;
    }
    
    .enemy-alive:hover {
        transform: none;
    }
    
    .enemy-attacking .enemy-emoji {
        transform: none;
    }
}

/* 高コントラストモード - Enemy Component */
@media (prefers-contrast: high) {
    .enemy {
        border: 2px solid #000;
    }
    
    .enemy-hp-bar {
        border: 1px solid #000;
    }
    
    .damage-number {
        color: #ff0000;
        text-shadow: 2px 2px 0px #000;
    }
    
    .defeated-message {
        color: #ffff00;
        background: #000;
        border: 2px solid #ffff00;
    }
}
/
* BattleScreen Component Styles */
.battle-screen {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.battle-header .back-button {
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.battle-header .back-button:hover {
    background: linear-gradient(135deg, #ff5252, #f44336);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.battle-header .back-button:active {
    transform: translateY(0);
}

.battle-title {
    color: white;
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.battle-info .enemy-count {
    color: white;
    font-size: 16px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 勝利オーバーレイ */
.victory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    animation: victoryOverlayFadeIn 0.5s ease-out;
}

@keyframes victoryOverlayFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(5px);
    }
}

.victory-message {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    animation: victoryMessageBounce 0.6s ease-out;
    max-width: 90%;
    width: 400px;
}

@keyframes victoryMessageBounce {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.victory-title {
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: victoryTitlePulse 2s infinite;
}

@keyframes victoryTitlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.victory-text {
    margin: 0 0 25px 0;
    font-size: 18px;
    opacity: 0.9;
}

.victory-button {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.victory-button:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

/* 戦闘エリア */
.battle-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.enemy-battlefield {
    position: relative;
    width: 100%;
    height: 500px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.enemy-container {
    position: absolute;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

/* 戦闘統計情報 */
.battle-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* レスポンシブデザイン - BattleScreen */
@media (max-width: 768px) {
    .battle-screen {
        padding: 15px;
    }
    
    .battle-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }
    
    .battle-title {
        font-size: 20px;
    }
    
    .battle-info .enemy-count {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .enemy-battlefield {
        height: 400px;
    }
    
    .victory-message {
        padding: 30px 25px;
        width: 350px;
    }
    
    .victory-title {
        font-size: 24px;
    }
    
    .victory-text {
        font-size: 16px;
    }
    
    .battle-stats {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .stat-item {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .battle-screen {
        padding: 10px;
    }
    
    .battle-header {
        padding: 15px;
        gap: 10px;
    }
    
    .battle-header .back-button {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .battle-title {
        font-size: 18px;
    }
    
    .battle-info .enemy-count {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .enemy-battlefield {
        height: 350px;
    }
    
    .victory-message {
        padding: 25px 20px;
        width: 300px;
    }
    
    .victory-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .victory-text {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .victory-button {
        padding: 12px 25px;
        font-size: 14px;
    }
    
    .battle-stats {
        padding: 12px 15px;
        gap: 10px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 14px;
    }
}

@media (max-width: 320px) {
    .battle-header {
        padding: 12px;
    }
    
    .battle-title {
        font-size: 16px;
    }
    
    .enemy-battlefield {
        height: 300px;
    }
    
    .victory-message {
        padding: 20px 15px;
        width: 280px;
    }
    
    .victory-title {
        font-size: 18px;
    }
    
    .victory-text {
        font-size: 13px;
    }
}

/* アクセシビリティ改善 - BattleScreen */
@media (prefers-reduced-motion: reduce) {
    .victory-overlay,
    .victory-message,
    .victory-title {
        animation: none !important;
    }
    
    .battle-header .back-button:hover,
    .victory-button:hover {
        transform: none;
    }
}

/* 高コントラストモード - BattleScreen */
@media (prefers-contrast: high) {
    .battle-header,
    .enemy-battlefield,
    .battle-stats {
        border: 2px solid #fff;
    }
    
    .battle-header .back-button,
    .victory-button {
        border: 2px solid #fff;
    }
    
    .victory-overlay {
        background: rgba(0, 0, 0, 0.95);
    }
}

/* ダークモード対応 - BattleScreen */
@media (prefers-color-scheme: dark) {
    .battle-header,
    .enemy-battlefield,
    .battle-stats {
        background: rgba(33, 37, 41, 0.8);
        border-color: rgba(108, 117, 125, 0.3);
    }
    
    .battle-title,
    .battle-info .enemy-count,
    .stat-label,
    .stat-value {
        color: #f8f9fa;
    }
}/* Vic
tory Stats Styles */
.victory-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.victory-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.victory-stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
}

.victory-stat-value {
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Battle Status Styles */
.stat-victory {
    background: rgba(76, 175, 80, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(76, 175, 80, 0.4);
    animation: victoryGlow 2s infinite;
}

@keyframes victoryGlow {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
    }
    50% { 
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.6);
    }
}

.stat-victory .stat-value {
    color: #4CAF50;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Enhanced Battle Stats */
.battle-stats .stat-item {
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 6px;
}

.battle-stats .stat-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Responsive Victory Stats */
@media (max-width: 480px) {
    .victory-stats {
        margin: 15px 0;
        padding: 12px;
        gap: 8px;
    }
    
    .victory-stat-label {
        font-size: 12px;
    }
    
    .victory-stat-value {
        font-size: 14px;
    }
}/* Confet
ti Effects */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    border-radius: 2px;
    animation: confettiFall linear infinite;
    transform-origin: center;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Victory Screen Flash Effect */
.victory-screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    pointer-events: none;
    z-index: 998;
    animation: victoryFlash 3s ease-in-out infinite;
}

@keyframes victoryFlash {
    0%, 100% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Enhanced Victory Message with Particle Effects */
.victory-message {
    position: relative;
    overflow: visible;
}

.victory-message::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: linear-gradient(45deg, 
        rgba(255, 215, 0, 0.1), 
        rgba(255, 165, 0, 0.1), 
        rgba(255, 215, 0, 0.1));
    border-radius: 25px;
    animation: victoryAura 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes victoryAura {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Sparkle Effects */
.victory-title::after {
    content: '✨';
    position: absolute;
    animation: sparkle 1.5s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.3) rotate(180deg);
        opacity: 0.7;
    }
}

/* Enhanced Battle Area with Victory Effects */
.enemy-battlefield.victory-mode {
    animation: victoryBattlefield 2s ease-in-out infinite;
    box-shadow: 
        inset 0 0 20px rgba(255, 215, 0, 0.3),
        0 0 30px rgba(255, 215, 0, 0.2);
}

@keyframes victoryBattlefield {
    0%, 100% {
        border-color: rgba(255, 215, 0, 0.3);
    }
    50% {
        border-color: rgba(255, 215, 0, 0.6);
    }
}

/* Responsive Confetti */
@media (max-width: 768px) {
    .confetti {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 480px) {
    .confetti {
        width: 6px;
        height: 6px;
    }
    
    .victory-screen-flash {
        animation-duration: 4s;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .confetti,
    .victory-screen-flash,
    .victory-message::before,
    .victory-title::after,
    .enemy-battlefield.victory-mode {
        animation: none !important;
    }
    
    .confetti {
        display: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .victory-screen-flash {
        background: radial-gradient(circle, rgba(255, 255, 0, 0.5) 0%, transparent 70%);
    }
    
    .confetti {
        border: 1px solid #000;
    }
}

/* Additional Victory Particle Effects */
.victory-overlay::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 165, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255, 140, 0, 0.1) 0%, transparent 50%);
    animation: victoryParticles 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 997;
}

@keyframes victoryParticles {
    0%, 100% {
        opacity: 0;
        transform: scale(0.8);
    }
    25% {
        opacity: 0.6;
        transform: scale(1.1);
    }
    75% {
        opacity: 0.4;
        transform: scale(1.05);
    }
}

/* Enhanced Button Hover Effects */
.victory-button {
    position: relative;
    overflow: hidden;
}

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

.victory-button:hover::before {
    left: 100%;
}

.victory-button:hover {
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4), 0 0 20px rgba(255, 255, 255, 0.2);
}

/* Battle Stats Enhancement for Victory */
.battle-stats.victory-stats-enhanced {
    background: linear-gradient(135deg, 
        rgba(76, 175, 80, 0.2), 
        rgba(139, 195, 74, 0.2));
    border: 2px solid rgba(76, 175, 80, 0.4);
    animation: victoryStatsGlow 2s ease-in-out infinite;
}

@keyframes victoryStatsGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
    }
}

/* 追加の統合スタイル */
.victory-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.victory-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.victory-stat-label {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.victory-stat-value {
    font-size: 16px;
    font-weight: bold;
}

.victory-stats-enhanced {
    animation: statsGlow 2s infinite;
}

@keyframes statsGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(76, 175, 80, 0.3); }
    50% { box-shadow: 0 0 20px rgba(76, 175, 80, 0.6); }
}

.victory-mode {
    animation: victoryMode 3s infinite;
}

@keyframes victoryMode {
    0%, 100% { filter: hue-rotate(0deg); }
    33% { filter: hue-rotate(120deg); }
    66% { filter: hue-rotate(240deg); }
}

.victory-screen-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    animation: screenFlash 0.5s ease-out;
    pointer-events: none;
}

@keyframes screenFlash {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff6b6b;
    animation: confettiFall 5s linear infinite;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* 統合テスト用スタイル */
.integration-test-overlay {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    z-index: 10000;
    max-width: 300px;
}

.integration-test-success {
    color: #4CAF50;
}

.integration-test-error {
    color: #f44336;
}

.integration-test-warning {
    color: #ff9800;
}/* 勝利メッセージ
のモバイル対応 */
@media (max-width: 768px) {
    .victory-message {
        padding: 20px 15px;
        width: 90%;
        max-width: 350px;
    }
    
    .victory-title {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    
    .victory-text {
        font-size: 0.9em;
        margin-bottom: 15px;
    }
    
    .victory-stats {
        gap: 15px;
        margin: 15px 0;
    }
    
    .victory-stat-label {
        font-size: 0.7em;
    }
    
    .victory-stat-value {
        font-size: 0.9em;
    }
    
    .victory-button {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .victory-message {
        padding: 15px 10px;
        width: 95%;
        max-width: 300px;
    }
    
    .victory-title {
        font-size: 1.2em;
        margin-bottom: 10px;
    }
    
    .victory-text {
        font-size: 0.8em;
        margin-bottom: 12px;
    }
    
    .victory-stats {
        gap: 10px;
        margin: 10px 0;
    }
    
    .victory-stat-label {
        font-size: 0.6em;
    }
    
    .victory-stat-value {
        font-size: 0.8em;
    }
    
    .victory-button {
        padding: 8px 15px;
        font-size: 0.8em;
    }
}

/* タッチデバイス用の改善 */
@media (hover: none) and (pointer: coarse) {
    .enemy {
        cursor: default;
    }
    
    .enemy-alive {
        transform: none;
        transition: background-color 0.2s ease;
    }
    
    .enemy-alive:active {
        background-color: rgba(255, 255, 255, 0.3) !important;
        transform: scale(0.95);
    }
    
    .start-button:active,
    .back-button:active,
    .victory-button:active {
        transform: scale(0.95);
    }
}

/* 横向き表示の調整 */
@media (orientation: landscape) and (max-height: 500px) {
    .top-screen {
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .top-screen h1 {
        font-size: 1.5em;
        margin-bottom: 10px;
    }
    
    .game-config {
        padding: 10px;
    }
    
    .config-item {
        margin-bottom: 8px;
    }
    
    .battle-header {
        padding: 3px 8px;
        margin-bottom: 3px;
    }
    
    .battle-stats {
        padding: 3px 10px;
    }
}/* モンス
ター重複防止の改善 */
.enemy-battlefield {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
}

.enemy-container {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 1;
    transition: all 0.3s ease;
}

/* 敵数に応じたサイズ調整 - デスクトップ用も大きく */
.enemy-battlefield[data-enemy-count="1"] .enemy {
    width: 100px;
    height: 130px;
}

.enemy-battlefield[data-enemy-count="2"] .enemy {
    width: 90px;
    height: 120px;
}

.enemy-battlefield[data-enemy-count="3"] .enemy {
    width: 85px;
    height: 115px;
}

.enemy-battlefield[data-enemy-count="4"] .enemy,
.enemy-battlefield[data-enemy-count="5"] .enemy,
.enemy-battlefield[data-enemy-count="6"] .enemy {
    width: 80px;
    height: 110px;
}

.enemy-battlefield[data-enemy-count="7"] .enemy,
.enemy-battlefield[data-enemy-count="8"] .enemy,
.enemy-battlefield[data-enemy-count="9"] .enemy {
    width: 75px;
    height: 105px;
}

.enemy-battlefield[data-enemy-count="10"] .enemy {
    width: 70px;
    height: 100px;
}

/* モバイル用の敵サイズ調整 */
@media (max-width: 768px) {
    .enemy-battlefield[data-enemy-count="1"] .enemy {
        width: 60px;
        height: 75px;
    }

    .enemy-battlefield[data-enemy-count="2"] .enemy {
        width: 55px;
        height: 70px;
    }

    .enemy-battlefield[data-enemy-count="3"] .enemy {
        width: 50px;
        height: 65px;
    }

    .enemy-battlefield[data-enemy-count="4"] .enemy,
    .enemy-battlefield[data-enemy-count="5"] .enemy,
    .enemy-battlefield[data-enemy-count="6"] .enemy {
        width: 45px;
        height: 60px;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy,
    .enemy-battlefield[data-enemy-count="8"] .enemy,
    .enemy-battlefield[data-enemy-count="9"] .enemy {
        width: 40px;
        height: 55px;
    }

    .enemy-battlefield[data-enemy-count="10"] .enemy {
        width: 35px;
        height: 50px;
    }

    /* 敵の絵文字サイズも調整 */
    .enemy-battlefield[data-enemy-count="1"] .enemy-emoji {
        font-size: 20px;
    }

    .enemy-battlefield[data-enemy-count="2"] .enemy-emoji {
        font-size: 18px;
    }

    .enemy-battlefield[data-enemy-count="3"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="4"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="5"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="6"] .enemy-emoji {
        font-size: 16px;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="8"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="9"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="10"] .enemy-emoji {
        font-size: 14px;
    }

    /* HPテキストサイズも調整 */
    .enemy-battlefield[data-enemy-count="7"] .enemy-hp-text,
    .enemy-battlefield[data-enemy-count="8"] .enemy-hp-text,
    .enemy-battlefield[data-enemy-count="9"] .enemy-hp-text,
    .enemy-battlefield[data-enemy-count="10"] .enemy-hp-text {
        font-size: 8px;
    }

    /* HPバーサイズも調整 */
    .enemy-battlefield[data-enemy-count="7"] .enemy-hp-bar,
    .enemy-battlefield[data-enemy-count="8"] .enemy-hp-bar,
    .enemy-battlefield[data-enemy-count="9"] .enemy-hp-bar,
    .enemy-battlefield[data-enemy-count="10"] .enemy-hp-bar {
        width: 30px;
        height: 3px;
    }
}

/* 小型スマホ用のさらなる調整 */
@media (max-width: 480px) {
    .enemy-battlefield[data-enemy-count="1"] .enemy {
        width: 50px;
        height: 65px;
    }

    .enemy-battlefield[data-enemy-count="2"] .enemy {
        width: 45px;
        height: 60px;
    }

    .enemy-battlefield[data-enemy-count="3"] .enemy {
        width: 40px;
        height: 55px;
    }

    .enemy-battlefield[data-enemy-count="4"] .enemy,
    .enemy-battlefield[data-enemy-count="5"] .enemy,
    .enemy-battlefield[data-enemy-count="6"] .enemy {
        width: 35px;
        height: 50px;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy,
    .enemy-battlefield[data-enemy-count="8"] .enemy,
    .enemy-battlefield[data-enemy-count="9"] .enemy,
    .enemy-battlefield[data-enemy-count="10"] .enemy {
        width: 30px;
        height: 45px;
    }

    /* 絵文字サイズをさらに小さく */
    .enemy-battlefield[data-enemy-count="7"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="8"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="9"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="10"] .enemy-emoji {
        font-size: 12px;
    }
}

/* 極小画面用 */
@media (max-width: 320px) {
    .enemy-battlefield[data-enemy-count="4"] .enemy,
    .enemy-battlefield[data-enemy-count="5"] .enemy,
    .enemy-battlefield[data-enemy-count="6"] .enemy {
        width: 30px;
        height: 45px;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy,
    .enemy-battlefield[data-enemy-count="8"] .enemy,
    .enemy-battlefield[data-enemy-count="9"] .enemy,
    .enemy-battlefield[data-enemy-count="10"] .enemy {
        width: 25px;
        height: 40px;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="8"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="9"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="10"] .enemy-emoji {
        font-size: 10px;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy-hp-text,
    .enemy-battlefield[data-enemy-count="8"] .enemy-hp-text,
    .enemy-battlefield[data-enemy-count="9"] .enemy-hp-text,
    .enemy-battlefield[data-enemy-count="10"] .enemy-hp-text {
        font-size: 6px;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy-hp-bar,
    .enemy-battlefield[data-enemy-count="8"] .enemy-hp-bar,
    .enemy-battlefield[data-enemy-count="9"] .enemy-hp-bar,
    .enemy-battlefield[data-enemy-count="10"] .enemy-hp-bar {
        width: 20px;
        height: 2px;
    }
}

/* 重複防止のための追加スタイル */
.enemy-container:hover {
    z-index: 10;
}

.enemy-container.attacking {
    z-index: 15;
}

/* デバッグ用（開発時のみ使用） */
.debug-mode .enemy-container::before {
    content: attr(data-index);
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 10px;
    z-index: 20;
}/* iPad専用
スタイル */
@media (min-width: 768px) and (max-width: 1024px) {
    /* TOP画面のiPad対応 */
    .top-screen {
        padding: 40px;
        width: 80%;
        max-width: 700px;
        max-height: 85vh;
        font-size: 1.1em;
    }
    
    .top-screen h1 {
        font-size: 3em;
        margin-bottom: 30px;
    }
    
    .game-config {
        padding: 30px;
    }
    
    .config-item {
        margin-bottom: 20px;
    }
    
    .config-item input,
    .config-item select {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .config-item label {
        font-size: 1.2em;
        font-weight: bold;
    }
    
    .config-value {
        font-size: 1em;
        padding: 10px 15px;
    }
    
    .start-button {
        padding: 18px 35px;
        font-size: 1.3em;
        margin-top: 25px;
    }
    
    /* 戦闘画面のiPad対応 */
    .battle-screen {
        padding: 20px;
    }
    
    .battle-header {
        padding: 20px 30px;
        margin-bottom: 25px;
    }
    
    .battle-header h2 {
        font-size: 2em;
    }
    
    .battle-info {
        font-size: 1.2em;
    }
    
    .back-button {
        padding: 15px 25px;
        font-size: 1.1em;
    }
    
    /* 戦闘統計のiPad対応 */
    .battle-stats {
        padding: 20px 30px;
        gap: 40px;
    }
    
    .stat-item {
        font-size: 1.1em;
    }
    
    .stat-label {
        font-size: 0.9em;
    }
    
    .stat-value {
        font-size: 1.3em;
    }
}

/* iPad用の敵サイズ調整 - より大きく */
@media (min-width: 768px) and (max-width: 1024px) {
    .enemy-battlefield[data-enemy-count="1"] .enemy {
        width: 160px;
        height: 200px;
    }

    .enemy-battlefield[data-enemy-count="2"] .enemy {
        width: 140px;
        height: 180px;
    }

    .enemy-battlefield[data-enemy-count="3"] .enemy {
        width: 120px;
        height: 160px;
    }

    .enemy-battlefield[data-enemy-count="4"] .enemy,
    .enemy-battlefield[data-enemy-count="5"] .enemy,
    .enemy-battlefield[data-enemy-count="6"] .enemy {
        width: 110px;
        height: 150px;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy,
    .enemy-battlefield[data-enemy-count="8"] .enemy,
    .enemy-battlefield[data-enemy-count="9"] .enemy {
        width: 100px;
        height: 140px;
    }

    .enemy-battlefield[data-enemy-count="10"] .enemy {
        width: 90px;
        height: 130px;
    }

    /* 敵の絵文字サイズもiPad用に調整 - より大きく */
    .enemy-battlefield[data-enemy-count="1"] .enemy-emoji {
        font-size: 60px;
    }

    .enemy-battlefield[data-enemy-count="2"] .enemy-emoji {
        font-size: 55px;
    }

    .enemy-battlefield[data-enemy-count="3"] .enemy-emoji {
        font-size: 50px;
    }

    .enemy-battlefield[data-enemy-count="4"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="5"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="6"] .enemy-emoji {
        font-size: 45px;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="8"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="9"] .enemy-emoji {
        font-size: 40px;
    }

    .enemy-battlefield[data-enemy-count="10"] .enemy-emoji {
        font-size: 35px;
    }

    /* HPテキストサイズもiPad用に調整 - より大きく */
    .enemy-hp-text {
        font-size: 18px;
        font-weight: bold;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy-hp-text,
    .enemy-battlefield[data-enemy-count="8"] .enemy-hp-text,
    .enemy-battlefield[data-enemy-count="9"] .enemy-hp-text,
    .enemy-battlefield[data-enemy-count="10"] .enemy-hp-text {
        font-size: 16px;
    }

    /* HPバーサイズもiPad用に調整 - より大きく */
    .enemy-hp-bar {
        width: 90px;
        height: 12px;
        border-radius: 6px;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy-hp-bar,
    .enemy-battlefield[data-enemy-count="8"] .enemy-hp-bar,
    .enemy-battlefield[data-enemy-count="9"] .enemy-hp-bar,
    .enemy-battlefield[data-enemy-count="10"] .enemy-hp-bar {
        width: 80px;
        height: 10px;
        border-radius: 5px;
    }
}

/* iPad Pro (大型タブレット) 用のさらなる調整 */
@media (min-width: 1024px) and (max-width: 1366px) {
    .top-screen {
        padding: 50px;
        width: 70%;
        max-width: 800px;
        font-size: 1.2em;
    }
    
    .top-screen h1 {
        font-size: 3.5em;
        margin-bottom: 40px;
    }
    
    .game-config {
        padding: 40px;
    }
    
    .config-item {
        margin-bottom: 25px;
    }
    
    .config-item input,
    .config-item select {
        padding: 15px 20px;
        font-size: 18px;
    }
    
    .config-item label {
        font-size: 1.3em;
    }
    
    .start-button {
        padding: 20px 40px;
        font-size: 1.4em;
        margin-top: 30px;
    }
    
    /* 戦闘画面 */
    .battle-header h2 {
        font-size: 2.5em;
    }
    
    .battle-info {
        font-size: 1.4em;
    }
    
    .back-button {
        padding: 18px 30px;
        font-size: 1.2em;
    }
    
    .battle-stats {
        padding: 25px 40px;
        gap: 50px;
    }
    
    .stat-item {
        font-size: 1.3em;
    }
    
    .stat-value {
        font-size: 1.5em;
    }
    
    /* 敵サイズをさらに大きく - iPad Pro */
    .enemy-battlefield[data-enemy-count="1"] .enemy {
        width: 180px;
        height: 220px;
    }

    .enemy-battlefield[data-enemy-count="2"] .enemy {
        width: 160px;
        height: 200px;
    }

    .enemy-battlefield[data-enemy-count="3"] .enemy {
        width: 140px;
        height: 180px;
    }

    .enemy-battlefield[data-enemy-count="4"] .enemy,
    .enemy-battlefield[data-enemy-count="5"] .enemy,
    .enemy-battlefield[data-enemy-count="6"] .enemy {
        width: 130px;
        height: 170px;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy,
    .enemy-battlefield[data-enemy-count="8"] .enemy,
    .enemy-battlefield[data-enemy-count="9"] .enemy {
        width: 120px;
        height: 160px;
    }

    .enemy-battlefield[data-enemy-count="10"] .enemy {
        width: 110px;
        height: 150px;
    }

    /* 絵文字サイズ - iPad Pro */
    .enemy-battlefield[data-enemy-count="1"] .enemy-emoji {
        font-size: 70px;
    }

    .enemy-battlefield[data-enemy-count="2"] .enemy-emoji {
        font-size: 65px;
    }

    .enemy-battlefield[data-enemy-count="3"] .enemy-emoji {
        font-size: 60px;
    }

    .enemy-battlefield[data-enemy-count="4"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="5"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="6"] .enemy-emoji {
        font-size: 55px;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="8"] .enemy-emoji,
    .enemy-battlefield[data-enemy-count="9"] .enemy-emoji {
        font-size: 50px;
    }

    .enemy-battlefield[data-enemy-count="10"] .enemy-emoji {
        font-size: 45px;
    }

    /* HPテキストとバー - iPad Pro */
    .enemy-hp-text {
        font-size: 20px;
        font-weight: bold;
    }

    .enemy-hp-bar {
        width: 100px;
        height: 14px;
        border-radius: 7px;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy-hp-text,
    .enemy-battlefield[data-enemy-count="8"] .enemy-hp-text,
    .enemy-battlefield[data-enemy-count="9"] .enemy-hp-text,
    .enemy-battlefield[data-enemy-count="10"] .enemy-hp-text {
        font-size: 18px;
    }

    .enemy-battlefield[data-enemy-count="7"] .enemy-hp-bar,
    .enemy-battlefield[data-enemy-count="8"] .enemy-hp-bar,
    .enemy-battlefield[data-enemy-count="9"] .enemy-hp-bar,
    .enemy-battlefield[data-enemy-count="10"] .enemy-hp-bar {
        width: 90px;
        height: 12px;
        border-radius: 6px;
    }
}

/* 勝利メッセージのiPad対応 */
@media (min-width: 768px) and (max-width: 1024px) {
    .victory-message {
        padding: 40px 30px;
        width: 80%;
        max-width: 600px;
    }
    
    .victory-title {
        font-size: 2.5em;
        margin-bottom: 25px;
    }
    
    .victory-text {
        font-size: 1.3em;
        margin-bottom: 25px;
    }
    
    .victory-stats {
        gap: 30px;
        margin: 25px 0;
    }
    
    .victory-stat-label {
        font-size: 1em;
    }
    
    .victory-stat-value {
        font-size: 1.4em;
    }
    
    .victory-button {
        padding: 18px 35px;
        font-size: 1.2em;
    }
}

@media (min-width: 1024px) and (max-width: 1366px) {
    .victory-message {
        padding: 50px 40px;
        width: 70%;
        max-width: 700px;
    }
    
    .victory-title {
        font-size: 3em;
        margin-bottom: 30px;
    }
    
    .victory-text {
        font-size: 1.5em;
        margin-bottom: 30px;
    }
    
    .victory-stats {
        gap: 40px;
        margin: 30px 0;
    }
    
    .victory-stat-label {
        font-size: 1.1em;
    }
    
    .victory-stat-value {
        font-size: 1.6em;
    }
    
    .victory-button {
        padding: 20px 40px;
        font-size: 1.3em;
    }
}/* デスクト
ップ用の絵文字サイズ調整 */
.enemy-battlefield[data-enemy-count="1"] .enemy-emoji {
    font-size: 35px;
}

.enemy-battlefield[data-enemy-count="2"] .enemy-emoji {
    font-size: 32px;
}

.enemy-battlefield[data-enemy-count="3"] .enemy-emoji,
.enemy-battlefield[data-enemy-count="4"] .enemy-emoji,
.enemy-battlefield[data-enemy-count="5"] .enemy-emoji,
.enemy-battlefield[data-enemy-count="6"] .enemy-emoji {
    font-size: 28px;
}

.enemy-battlefield[data-enemy-count="7"] .enemy-emoji,
.enemy-battlefield[data-enemy-count="8"] .enemy-emoji,
.enemy-battlefield[data-enemy-count="9"] .enemy-emoji,
.enemy-battlefield[data-enemy-count="10"] .enemy-emoji {
    font-size: 24px;
}

/* デスクトップ用のHPテキストとバー */
.enemy-hp-text {
    font-size: 14px;
    font-weight: bold;
}

.enemy-hp-bar {
    width: 65px;
    height: 8px;
    border-radius: 4px;
}

.enemy-battlefield[data-enemy-count="7"] .enemy-hp-text,
.enemy-battlefield[data-enemy-count="8"] .enemy-hp-text,
.enemy-battlefield[data-enemy-count="9"] .enemy-hp-text,
.enemy-battlefield[data-enemy-count="10"] .enemy-hp-text {
    font-size: 12px;
}

.enemy-battlefield[data-enemy-count="7"] .enemy-hp-bar,
.enemy-battlefield[data-enemy-count="8"] .enemy-hp-bar,
.enemy-battlefield[data-enemy-count="9"] .enemy-hp-bar,
.enemy-battlefield[data-enemy-count="10"] .enemy-hp-bar {
    width: 55px;
    height: 6px;
}/* iP
ad用のダメージ表示と撃破メッセージ */
@media (min-width: 768px) and (max-width: 1024px) {
    .damage-number {
        font-size: 24px;
        top: -30px;
        font-weight: bold;
    }
    
    .defeated-message {
        font-size: 20px;
        padding: 8px 12px;
        border-radius: 8px;
        font-weight: bold;
    }
}

/* iPad Pro用のダメージ表示と撃破メッセージ */
@media (min-width: 1024px) and (max-width: 1366px) {
    .damage-number {
        font-size: 28px;
        top: -35px;
        font-weight: bold;
    }
    
    .defeated-message {
        font-size: 24px;
        padding: 10px 15px;
        border-radius: 10px;
        font-weight: bold;
    }
}

/* デスクトップ用のダメージ表示調整 */
@media (min-width: 1366px) {
    .damage-number {
        font-size: 20px;
        top: -25px;
        font-weight: bold;
    }
    
    .defeated-message {
        font-size: 18px;
        padding: 6px 10px;
        border-radius: 6px;
        font-weight: bold;
    }
}