/* Match'n Gacha - Mobile-First Responsive Styles */

:root {
    --primary-purple: #4a148c;
    --secondary-purple: #7b1fa2;
    --accent-gold: #ffc107;
    --background-dark: #1a0033;
    --text-light: #ffffff;
    --text-dark: #333333;
    --card-bg: rgba(255, 255, 255, 0.1);
    --modal-bg: rgba(0, 0, 0, 0.8);
    --success-green: #4caf50;
    --error-red: #f44336;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--background-dark), var(--primary-purple));
    color: var(--text-light);
    overflow: hidden;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-purple), var(--background-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-container {
    text-align: center;
    max-width: 300px;
    width: 90%;
}

.game-logo h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, var(--accent-gold), #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-logo p {
    opacity: 0.8;
    margin-bottom: 2rem;
}

.loading-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.loading-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), var(--secondary-purple));
    transition: width 0.3s ease;
}

.loading-text {
    opacity: 0.6;
    font-size: 0.9rem;
}

/* Game Container */
#game-container {
    position: relative;
    width: 100%;
    height: 100vh;
}

/* UI Overlay */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.top-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent);
    pointer-events: auto;
}

.currency-display {
    display: flex;
    gap: 1rem;
}

.currency-display span {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: bold;
}

.level-info {
    font-weight: bold;
    font-size: 1.1rem;
}

.settings-btn {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 0.7rem;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.settings-btn:hover {
    transform: scale(1.1);
}

.bottom-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.5), transparent);
    pointer-events: auto;
}

.action-btn {
    background: var(--primary-purple);
    color: var(--text-light);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.action-btn:hover {
    background: var(--secondary-purple);
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-bg);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-content {
    background: var(--primary-purple);
    border-radius: var(--border-radius);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .game-logo h1 {
        font-size: 2rem;
    }
    
    .top-hud {
        padding: 0.5rem;
    }
    
    .currency-display {
        gap: 0.5rem;
    }
    
    .currency-display span {
        padding: 0.3rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .bottom-actions {
        padding: 0.5rem;
    }
    
    .action-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
}

@media (max-width: 480px) {
    .game-logo h1 {
        font-size: 1.8rem;
    }
    
    .currency-display span {
        padding: 0.2rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .action-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Game-specific UI elements */
.collectible-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 0.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.collectible-card:hover {
    border-color: var(--accent-gold);
    transform: scale(1.05);
}

.collectible-card.common { border-left: 4px solid #9e9e9e; }
.collectible-card.uncommon { border-left: 4px solid #4caf50; }
.collectible-card.rare { border-left: 4px solid #2196f3; }
.collectible-card.epic { border-left: 4px solid #9c27b0; }
.collectible-card.legendary { border-left: 4px solid var(--accent-gold); }
.collectible-card.mythic { border-left: 4px solid #e91e63; }

.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.trade-offer {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

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

.pulse { animation: pulse 2s infinite; }
.slide-up { animation: slideUp 0.3s ease-out; }
.fade-in { animation: fadeIn 0.5s ease-out; }
/* Settings Modal Styles */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-item label {
    color: var(--accent-gold);
    font-weight: bold;
    font-size: 1.1em;
}

.setting-item select {
    background: var(--background-dark);
    border: 2px solid var(--secondary-purple);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-light);
    font-size: 16px;
    cursor: pointer;
}

.setting-item select:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.theme-apply-btn {
    margin-top: 10px \!important;
    background: var(--accent-gold) \!important;
    color: var(--text-dark) \!important;
    transition: all 0.3s ease;
}

.theme-apply-btn:hover {
    background: var(--success-green) \!important;
}

