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

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

body {
    font-family: 'Orbitron', 'Noto Sans JP', monospace, sans-serif;
    background: #1a1418;
    color: white;
    overflow: hidden;
    position: relative;
    font-feature-settings: "palt" 1;
    letter-spacing: 0.05em;
    height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, #2d1f2e 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, #3d2d2d 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, #1f1f2d 0%, transparent 50%);
    z-index: -2;
}

#backgroundCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.game-container {
    display: flex;
    height: 100vh;
    justify-content: center;
}

.main-area {
    flex: 1;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.stage-info {
    text-align: center;
    margin-bottom: 20px;
}

.stage-info h2 {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 900;
    text-shadow: 
        0 0 20px rgba(255,255,255,0.5),
        0 0 40px rgba(220,50,50,0.8),
        0 4px 8px rgba(0,0,0,0.5);
    position: relative;
}

.stage-info h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #dc3232, transparent);
    box-shadow: 0 0 10px rgba(220,50,50,0.8);
}

.enemy-hp-bar {
    width: 400px;
    height: 40px;
    background: linear-gradient(135deg, #2e1a1a 0%, #1e0f0f 100%);
    border: 3px solid transparent;
    background-clip: padding-box;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.8),
        0 0 20px rgba(139,0,0,0.3);
}

.enemy-hp-bar::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #8b0000, #dc3232, #8b0000);
    border-radius: 20px;
    z-index: -1;
    animation: gradient 3s ease infinite;
}

.enemy-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc3232, #ff4444, #ff6666);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        inset 0 2px 8px rgba(255,255,255,0.4),
        0 0 20px rgba(220,50,50,0.6);
    position: relative;
    overflow: hidden;
}

.enemy-hp-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: hpShine 2s infinite;
}

@keyframes hpShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.enemy-hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 900;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    letter-spacing: 0.1em;
    white-space: nowrap;
}

#gameCanvas {
    border: none;
    border-radius: 20px;
    cursor: crosshair;
    background: radial-gradient(ellipse at center, rgba(26,20,24,0.3) 0%, rgba(26,20,24,0.8) 100%);
    box-shadow: 
        0 0 50px rgba(139,0,0,0.3),
        inset 0 0 50px rgba(220,50,50,0.1);
    position: relative;
    touch-action: none;
}

#gameCanvas::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #8b0000, #dc3232, #8b0000, #dc3232);
    background-size: 400% 400%;
    border-radius: 25px;
    z-index: -1;
    animation: borderAnimation 4s ease infinite;
    opacity: 0.7;
}

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

.player-stats {
    display: flex;
    gap: 40px;
    margin-top: 20px;
    font-size: 1.5em;
}

.gold-display, .damage-display, .dps-display {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(139,0,0,0.1), rgba(220,50,50,0.1));
    padding: 15px 30px;
    border-radius: 50px;
    border: 2px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 20px rgba(0,0,0,0.3),
        inset 0 2px 4px rgba(255,255,255,0.1);
    font-weight: 700;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.gold-display:hover, .damage-display:hover, .dps-display:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 30px rgba(220,50,50,0.3),
        inset 0 2px 4px rgba(255,255,255,0.2);
}

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

.stat-label {
    font-size: 0.7em;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 700;
}

.stat-value {
    font-size: 1.2em;
    font-weight: 900;
}

.gold-icon, .damage-icon, .dps-icon {
    font-size: 1.5em;
    filter: drop-shadow(0 0 5px currentColor);
    animation: iconPulse 2s ease infinite;
}

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

.upgrade-panel {
    background: linear-gradient(135deg, rgba(20,20,40,0.9), rgba(10,10,20,0.9));
    padding: 30px;
    display: flex;
    flex-direction: column;
}

/* デスクトップ用のアップグレードパネル */
.desktop-only {
    display: block;
    width: 350px;
    border-left: 3px solid rgba(139,0,0,0.3);
    box-shadow: 
        -10px 0 30px rgba(0,0,0,0.5),
        inset 2px 0 10px rgba(220,50,50,0.2);
    height: 100vh;
    overflow-y: auto;
}

/* モバイル用のアップグレードパネル */
.mobile-only {
    display: none;
    width: 100%;
    max-width: 800px;
    margin-top: 30px;
    border-radius: 20px;
    border: 2px solid rgba(139,0,0,0.3);
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.5),
        inset 0 2px 10px rgba(220,50,50,0.2);
}

.upgrades-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 10px;
}

.upgrades-list::-webkit-scrollbar {
    width: 8px;
}

.upgrades-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

.upgrades-list::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #8b0000, #dc3232);
    border-radius: 4px;
}

.upgrade-panel h3 {
    font-size: 1.8em;
    margin-bottom: 30px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    font-weight: 900;
    text-shadow: 
        0 0 15px rgba(255,255,255,0.4),
        0 0 30px rgba(220,50,50,0.6),
        0 3px 6px rgba(0,0,0,0.5);
    position: relative;
}

.upgrade-panel h3::before {
    content: '⚔️';
    position: absolute;
    left: 10px;
    opacity: 0.5;
}

.upgrade-panel h3::after {
    content: '⚔️';
    position: absolute;
    right: 10px;
    opacity: 0.5;
    transform: scaleX(-1);
}

.upgrade-item {
    background: linear-gradient(135deg, rgba(40,40,80,0.4), rgba(20,20,40,0.4));
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

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

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

.upgrade-item:hover {
    background: linear-gradient(135deg, rgba(120,60,60,0.6), rgba(60,30,30,0.6));
    transform: scale(1.01);
    border-color: rgba(220,50,50,0.5);
    box-shadow: 
        0 5px 20px rgba(220,50,50,0.3),
        inset 0 0 20px rgba(255,255,255,0.1);
}

.upgrade-item.can-afford {
    border: 2px solid transparent;
    background: 
        linear-gradient(135deg, rgba(40,80,40,0.6), rgba(20,40,20,0.6)) padding-box,
        linear-gradient(45deg, #00ff00, #00ffff, #00ff00) border-box;
    box-shadow: 
        0 0 20px rgba(0, 255, 0, 0.5),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    animation: canAffordPulse 2s ease infinite;
}

@keyframes canAffordPulse {
    0%, 100% { 
        box-shadow: 
            0 0 20px rgba(0, 255, 0, 0.5),
            inset 0 0 20px rgba(0, 255, 255, 0.1);
    }
    50% { 
        box-shadow: 
            0 0 30px rgba(0, 255, 0, 0.8),
            inset 0 0 25px rgba(0, 255, 255, 0.2);
    }
}

.upgrade-name {
    font-weight: 900;
    font-size: 1.1em;
    margin-bottom: 5px;
    letter-spacing: 0.08em;
}

.upgrade-level {
    color: #ffeb3b;
    font-size: 0.9em;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.upgrade-effect {
    font-size: 0.9em;
    color: #bbdefb;
    margin: 5px 0;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.upgrade-cost {
    font-size: 1em;
    color: #ffd54f;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.damage-number {
    position: fixed;
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(45deg, #ffdd00, #dc3232, #ff8800);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 
        0 0 10px rgba(255,221,0,0.8),
        0 0 20px rgba(220,50,50,0.6);
    pointer-events: none;
    animation: floatUp 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    letter-spacing: 2px;
    z-index: 50;
}

.damage-number.crit {
    font-size: 48px;
    animation: criticalHit 1.5s ease forwards;
}

@keyframes criticalHit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.5) rotate(-10deg);
    }
    20% {
        transform: translateY(-20px) scale(1.5) rotate(5deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px) scale(1) rotate(0deg);
    }
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.9);
    }
}

.combo-display {
    position: fixed;
    top: 160px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    text-shadow: 
        0 0 10px rgba(255,255,255,0.5),
        0 0 20px rgba(220,50,50,0.5),
        0 0 30px rgba(255,136,0,0.5);
    white-space: nowrap;
}

.combo-display.active {
    opacity: 1;
    animation: comboAnimation 0.5s ease;
}

@keyframes comboAnimation {
    0% { transform: translateX(-50%) scale(0.5); }
    50% { transform: translateX(-50%) scale(1.3); }
    100% { transform: translateX(-50%) scale(1); }
}

.upgrade-category {
    margin-top: 20px;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    text-align: center;
}

.upgrade-category h4 {
    font-size: 1.2em;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.9);
}

.upgrade-category:first-child {
    margin-top: 0;
}

.pet-item {
    border-color: rgba(100,255,100,0.3);
}

.pet-item.can-afford {
    border: 2px solid transparent;
    background: 
        linear-gradient(135deg, rgba(40,80,40,0.6), rgba(20,40,20,0.6)) padding-box,
        linear-gradient(45deg, #00ff88, #00ffff, #00ff88) border-box;
}

.damage-number.pet-damage {
    background: linear-gradient(45deg, #4169e1, #1e90ff, #4169e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 
        0 0 10px rgba(65,105,225,0.8),
        0 0 20px rgba(30,144,255,0.6);
}

.gold-popup {
    position: fixed;
    font-size: 48px;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 
        0 0 20px rgba(255,215,0,1),
        0 0 40px rgba(255,215,0,0.8),
        0 0 60px rgba(255,215,0,0.6),
        3px 3px 6px rgba(0,0,0,1);
    pointer-events: none;
    animation: goldPopup 2.5s ease-out forwards;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translate(-50%, -50%);
}

.gold-plus {
    color: #00ff00;
    font-size: 0.8em;
}

.gold-amount {
    color: #ffd700;
}

.gold-coin {
    font-size: 0.9em;
    filter: drop-shadow(0 0 10px rgba(255,215,0,0.8));
}

@keyframes goldPopup {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3) rotate(-15deg);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5) rotate(5deg);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3) rotate(-5deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -200px) scale(1) rotate(0deg);
    }
}

.gold-particle {
    position: fixed;
    font-size: 36px;
    pointer-events: none;
    animation: goldParticle 1.5s ease-out forwards;
    z-index: 50;
    filter: drop-shadow(0 0 15px rgba(255,215,0,1));
}

@keyframes goldParticle {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translate(var(--end-x), var(--end-y)) scale(1.5) rotate(360deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--end-x), calc(var(--end-y) + 50px)) scale(0.8) rotate(720deg);
    }
}

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

/* レスポンシブデザイン */
@media (max-width: 1024px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    .game-container {
        flex-direction: column;
    }
    
    .main-area {
        order: 2;
        padding: 10px;
    }
    
    .upgrade-panel.mobile-only {
        order: 1;
        width: 100%;
        height: 200px;
        border-left: none;
        border-bottom: 3px solid rgba(139,0,0,0.3);
        padding: 15px;
    }
    
    .upgrades-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-bottom: 10px;
        overflow-y: auto;
        max-height: calc(100% - 120px);
    }
    
    .upgrade-item {
        width: 100%;
        margin-bottom: 0;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 500px;
        height: auto;
        aspect-ratio: 4/3;
    }
}

@media (max-width: 768px) {
    body {
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
        min-height: 100vh;
    }
    
    .game-container {
        min-height: 100vh;
        overflow: visible;
        flex-direction: column;
        height: auto;
    }
    
    .upgrade-panel.mobile-only {
        position: relative;
        width: 100%;
        height: auto;
        max-height: none;
        border-top: 3px solid rgba(139,0,0,0.3);
        border-bottom: none;
        border-left: none;
        background: linear-gradient(135deg, rgba(20,20,40,0.95), rgba(10,10,20,0.95));
        margin-top: 20px;
        padding: 20px;
        display: block;
    }
    
    .main-area {
        padding-bottom: 20px;
        min-height: auto;
        flex-shrink: 0;
    }
    
    .upgrades-list {
        padding: 0 10px 20px 10px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        overflow-y: visible;
        max-height: none;
        flex: none;
    }

    .stage-info h2 {
        font-size: 2em;
        letter-spacing: 2px;
    }
    
    .enemy-hp-bar {
        width: 90%;
        max-width: 400px;
        min-width: 280px;
        height: 35px;
    }
    
    .player-stats {
        flex-direction: column;
        gap: 10px;
        margin-top: 10px;
    }
    
    .gold-display, .damage-display, .dps-display {
        padding: 10px 20px;
        font-size: 1.2em;
    }
    
    .stat-label {
        font-size: 0.6em;
    }
    
    .stat-value {
        font-size: 1em;
    }
    
    .upgrade-panel h3 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    
    .combo-display {
        font-size: 1.5em;
        top: 140px;
    }
}

@media (max-width: 480px) {
    body {
        padding-bottom: 30px;
    }
    
    .upgrade-panel h3 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .upgrade-panel h3::before,
    .upgrade-panel h3::after {
        display: none;
    }

    .stage-info h2 {
        font-size: 1.5em;
        letter-spacing: 1px;
    }
    
    .enemy-hp-bar {
        height: 32px;
        min-width: 250px;
    }
    
    .enemy-hp-text {
        font-size: 0.85em;
        font-weight: 700;
        white-space: nowrap;
    }
    
    .player-stats {
        width: 100%;
        align-items: stretch;
    }
    
    .gold-display, .damage-display, .dps-display {
        padding: 8px 15px;
        font-size: 1em;
        text-align: center;
        justify-content: center;
    }
    
    .upgrade-panel {
        height: 150px;
    }
    
    .upgrade-item {
        width: 100%;
        padding: 12px;
        touch-action: manipulation;
    }
    
    .upgrade-name {
        font-size: 1em;
    }
    
    .upgrade-level, .upgrade-effect, .upgrade-cost {
        font-size: 0.85em;
    }
    
    .damage-number {
        font-size: 24px;
    }
    
    .damage-number.crit {
        font-size: 36px;
    }
}

/* スマホ横向き対応 */
@media (max-height: 500px) and (orientation: landscape) {
    .game-container {
        flex-direction: row;
    }
    
    .upgrade-panel {
        position: relative;
        width: 300px;
        height: 100vh;
        max-height: none;
        border-left: 3px solid rgba(139,0,0,0.3);
        border-bottom: none;
        border-top: none;
    }
    
    .main-area {
        padding-bottom: 20px;
    }
    
    .upgrades-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .upgrade-item {
        width: 100%;
        margin-bottom: 0;
    }
    
    .main-area {
        padding: 10px;
    }
    
    #gameCanvas {
        max-height: calc(100vh - 200px);
    }
}

/* タッチデバイス対応 */
.share-section {
    margin: 20px 0;
    text-align: center;
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(40, 40, 40, 0.8));
    color: white;
    border: 2px solid rgba(220, 50, 50, 0.5);
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
    letter-spacing: 0.05em;
    font-family: 'Noto Sans JP', sans-serif;
}

.share-button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.9), rgba(60, 60, 60, 0.8));
    border-color: rgba(220, 50, 50, 0.8);
    box-shadow: 
        0 6px 20px rgba(220, 50, 50, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.share-button:active {
    transform: translateY(0);
}

.share-icon {
    fill: currentColor;
}

@media (hover: none) {
    .upgrade-item:hover {
        transform: none;
    }
    
    .upgrade-item:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .upgrade-item.can-afford:active {
        box-shadow: 
            0 0 30px rgba(0, 255, 0, 0.8),
            inset 0 0 30px rgba(0, 255, 255, 0.3);
    }
    
    .gold-display:hover, .damage-display:hover {
        transform: none;
    }
    
    #gameCanvas {
        cursor: default;
    }
    
    /* モバイルでのスクロールを優先 */
    .upgrades-list {
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
    
    .upgrade-item {
        touch-action: manipulation;
    }
}


/* ヘルプボタン */
.help-button {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(139,0,0,0.9), rgba(220,50,50,0.8));
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(0,0,0,0.3),
        inset 0 2px 4px rgba(255,255,255,0.2);
    -webkit-tap-highlight-color: transparent;
}

.help-button:hover {
    transform: scale(1.1);
    box-shadow: 
        0 6px 20px rgba(220,50,50,0.4),
        inset 0 2px 4px rgba(255,255,255,0.3);
}

/* ヘルプモーダル */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.help-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: visible;
    opacity: 1;
}

.help-content {
    background: linear-gradient(135deg, #2a1f2e, #1a1418);
    border: 3px solid rgba(220,50,50,0.5);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.5),
        inset 0 2px 10px rgba(255,255,255,0.1);
}

.help-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.help-close:hover {
    background: rgba(220,50,50,0.8);
    transform: scale(1.1);
}

.help-content h2 {
    color: #fff;
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 0 0 20px rgba(220,50,50,0.8);
}

.help-content h3 {
    color: #dc3232;
    font-size: 1.3em;
    margin: 25px 0 15px;
    border-bottom: 2px solid rgba(220,50,50,0.3);
    padding-bottom: 10px;
}

.help-content p {
    color: #ddd;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

.help-content ol, .help-content ul {
    color: #ddd;
    line-height: 1.8;
    margin-left: 20px;
}

.help-content li {
    margin-bottom: 10px;
}

.help-content strong {
    color: #ff8888;
    font-weight: bold;
}

/* スクロールバー */
.help-content::-webkit-scrollbar {
    width: 8px;
}

.help-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

.help-content::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #8b0000, #dc3232);
    border-radius: 4px;
}

/* ハイDPIディスプレイ対応 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .damage-number {
        font-weight: 700;
    }
}