/* Shooting Game Overlay Styles */

#shooting-game-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    pointer-events: auto !important;
    z-index: 2147483647 !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

#shooting-game-container {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
}

#shooting-game-ui {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 10 !important;
    font-family: Arial, sans-serif !important;
}

/* Phaser canvas styling */
#shooting-game-container canvas {
    display: block !important;
    margin: 0 auto !important;
}

/* Prevent text selection during gameplay */
#shooting-game-overlay * {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Difficulty Selection Dialog Styles */
.difficulty-dialog-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.85) !important;
    z-index: 2147483648 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: Arial, sans-serif !important;
    animation: fadeIn 0.3s ease-in-out !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.difficulty-dialog {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    border: 3px solid #0f4c75 !important;
    border-radius: 20px !important;
    padding: 40px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
    max-width: 600px !important;
    width: 90% !important;
    animation: slideUp 0.4s ease-out !important;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.difficulty-button-container {
    margin: 15px 0 !important;
    transition: transform 0.2s !important;
}

.difficulty-button {
    width: 100% !important;
    padding: 20px !important;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    font-size: 18px !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    text-align: left !important;
    outline: none !important;
}

.difficulty-button:hover {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%) !important;
    transform: scale(1.02) !important;
}

.difficulty-button:active {
    transform: scale(0.98) !important;
}

/* Store modal */
.store-modal {
    position: fixed;
    inset: 0;
    background: rgba(3, 6, 15, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;
    padding: 12px;
}

.store-modal.hidden {
    display: none;
}

.store-modal__panel {
    width: min(860px, 95vw);
    max-height: 85vh;
    overflow-y: auto;
    background: rgba(13, 19, 33, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #f2f6ff;
}

.store-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.store-modal__header h2 {
    margin: 0;
    font-size: 20px;
    color: #ffe873;
}

.store-modal__header p {
    margin: 2px 0 0 0;
    color: #b8c3ff;
    font-size: 12px;
}

.store-modal__close {
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.store-modal__close:hover {
    opacity: 1;
}

.store-modal__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}

.store-stat {
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.store-stat span {
    display: block;
    font-size: 11px;
    color: #9db1ff;
    margin-bottom: 2px;
}

.store-stat strong {
    font-size: 17px;
    color: #ffffff;
}

.store-modal__section {
    margin-bottom: 12px;
}

.store-modal__section h3 {
    margin: 0 0 6px 0;
    font-size: 15px;
    color: #ffe873;
}

.store-note {
    margin: 0 0 6px 0;
    font-size: 12px;
    color: #99a8ff;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.store-grid--ammo {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.store-grid--defense {
    grid-template-columns: 1fr;
    max-width: 100%;
}

.store-card {
    background: rgba(10, 14, 26, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 96px;
}

/* Overrides base .store-card min-height — must come after .store-card */
.store-card.store-card--defense-expand {
    min-height: 0;
    padding: 8px 10px;
    gap: 6px;
}

.store-card.store-card--defense-expand .store-card__weapon-header {
    margin: 0;
}

.store-card.store-card--defense-expand .store-card__title {
    font-size: 13px;
    line-height: 1.2;
}

.store-card__defense-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.store-card__desc--defense-inline {
    flex: 1;
    min-width: 0;
    margin: 0;
    min-height: 0;
    font-size: 11px;
    line-height: 1.35;
}

.store-card__action--defense-expand {
    width: 200px;
    flex-shrink: 0;
    margin-top: 0;
    box-sizing: border-box;
    padding: 6px 8px;
}

.store-card__icon {
    font-size: 24px;
}

.store-card__weapon-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.store-card__weapon-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.store-card__title {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
}

.store-card__desc {
    margin: 0;
    font-size: 11px;
    color: #bfcaff;
    min-height: 18px;
}

.store-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #9db1ff;
}

.store-card__meta strong {
    color: #ffffff;
    font-size: 13px;
}

.store-card__action {
    margin-top: auto;
    background: linear-gradient(135deg, #4e9eff, #3460ff);
    border: none;
    color: #ffffff;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 11px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s, transform 0.2s;
}

.store-card__action:hover:not(.store-card__action--disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.store-card__action--disabled,
.store-card__action:disabled {
    background: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
    transform: none;
}

.store-modal__footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.store-message {
    min-height: 16px;
    font-size: 11px;
    color: #bfcaff;
}

.store-message[data-type="success"] {
    color: #4caf50;
}

.store-message[data-type="error"] {
    color: #ff6b6b;
}

.store-message[data-type="warning"] {
    color: #ffd166;
}

#store-back-button {
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: bold;
    background: linear-gradient(135deg, #46c38f, #2f9e68);
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

#store-back-button:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

body.store-modal-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .store-card:not(.store-card--defense-expand) {
        min-height: 92px;
    }
}
