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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: 
        url('music-genres-tube-map.svg?v=2') center center / 150% auto no-repeat fixed,
        linear-gradient(135deg, #0d1117 0%, #111827 100%);
    min-height: 100vh;
    padding: 20px;
    color: #e2e8f0;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 17, 23, 0.88);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px 30px;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

header h1 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 800;
    font-size: 4em;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #667eea 0%, #ed64a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.tagline {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 1.2em;
    letter-spacing: -0.01em;
    color: #8892a4;
}

.share-btn {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 12px 24px;
    color: #e2e8f0;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

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

.share-btn span:first-child {
    font-size: 1.3em;
}

main {
    background: rgba(22, 27, 34, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-selection h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.8em;
    margin-bottom: 30px;
    color: #e2e8f0;
    text-align: center;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.mode-btn {
    background: linear-gradient(135deg, #1c2333 0%, #161b22 100%);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.mode-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #222c42 0%, #1c2333 100%);
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.mode-emoji {
    font-size: 2.5em;
}

.mode-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.3em;
    letter-spacing: -0.01em;
    color: #e2e8f0;
}

.mode-description {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1em;
    color: #8892a4;
}

.mode-btn.active .mode-label {
    color: white;
}

.mode-btn.active .mode-description {
    color: rgba(255, 255, 255, 0.9);
}

.upload-section,
.style-section,
.name-section {
    margin-top: 30px;
    display: none;
}

.upload-section.active,
.style-section.active,
.name-section.active {
    display: block;
}

.upload-area {
    border: 3px dashed rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(28, 35, 51, 0.6);
    color: #8892a4;
}

.upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.12);
}

input[type="file"] {
    display: none;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.preview-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 120px;
    margin: 0 auto;
}

.preview-item img {
    width: auto;
    max-width: 120px;
    max-height: 160px;
    object-fit: contain;
    background: transparent;
    margin: 0 auto;
    display: block;
    border-radius: 8px;
}

.preview-image {
    width: auto !important;
    max-width: 120px !important;
    max-height: 160px !important;
    object-fit: contain !important;
    background: transparent;
    margin: 0 auto;
    display: block;
    border-radius: 8px;
}

.remove-preview {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 1.2em;
}

.style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.style-btn {
    background: linear-gradient(135deg, #1c2333 0%, #161b22 100%);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.style-btn:hover {
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #222c42 0%, #1c2333 100%);
}

.style-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.style-btn .emoji {
    font-size: 2em;
    display: block;
    margin-bottom: 8px;
}

.style-btn .label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1em;
    display: block;
    margin-bottom: 4px;
    color: #e2e8f0;
}

.style-btn .description {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.9em;
    color: #8892a4;
    display: block;
}

.style-btn.selected .label,
.style-btn.selected .description {
    color: white;
}

.style-emoji {
    font-size: 2em;
    display: block;
    margin-bottom: 8px;
}

input[type="text"] {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 1em;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease;
    margin-bottom: 15px;
    background: rgba(28, 35, 51, 0.8);
    color: #e2e8f0;
}

input[type="text"]::placeholder {
    color: #8892a4;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(28, 35, 51, 1);
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

#loading {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

#results {
    display: none;
    margin-top: 40px;
}

.score-display h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5em;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 20px;
}

.score-display {
    text-align: center;
    margin-bottom: 30px;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.4);
}

.score-number {
    font-size: 4.5em;
    font-weight: 900;
    font-family: 'Space Grotesk', sans-serif;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.score-label {
    font-size: 1.3em;
    color: #e2e8f0;
    font-weight: 700;
    margin-top: 10px;
}

.analysis-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: -0.01em;
    color: #c9d1d9;
    font-size: 1.05em;
    white-space: pre-wrap;
}

.battle-scores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.score-box {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #1c2333 0%, #161b22 100%);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.score-box h3 {
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 15px;
    color: #e2e8f0;
}

.score-box .score-number {
    font-size: 3em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2.2em;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .mode-grid {
        grid-template-columns: 1fr;
    }
    
    .battle-scores {
        grid-template-columns: 1fr;
    }
    
    main {
        padding: 25px;
    }
}

/* Auth Styles */
#authContainer {
    max-width: 400px;
    margin: 0 auto;
}

.auth-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.auth-toggle button {
    flex: 1;
    background: rgba(28, 35, 51, 0.8);
    color: #667eea;
    border: 2px solid rgba(102, 126, 234, 0.3);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: none;
}

.auth-toggle button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.auth-form {
    background: rgba(22, 27, 34, 0.98);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-form h2 {
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 20px;
    text-align: center;
    color: #e2e8f0;
}

.auth-form input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 1em;
    background: rgba(28, 35, 51, 0.8);
    color: #e2e8f0;
}

.auth-form input::placeholder {
    color: #8892a4;
}

.auth-form input:focus {
    outline: none;
    border-color: #667eea;
}

.auth-form button {
    width: 100%;
    margin-top: 10px;
}

.error {
    color: #fc8181;
    font-size: 0.9em;
    margin-top: 10px;
    text-align: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    color: #e2e8f0;
}

.user-info .badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a202c;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85em;
}

.user-info button {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Premium Pricing Styles */
#premiumPlans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 800px;
    margin: 40px auto;
}

.pricing-card {
    background: rgba(22, 27, 34, 0.98);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    transition: transform 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.25);
}

.plan-badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
}

.pricing-card h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2em;
    margin: 20px 0 10px 0;
    text-align: center;
    color: #e2e8f0;
}

.price {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.5em;
    font-weight: 900;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #ed64a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 20px 0;
}

.price span {
    font-size: 0.4em;
    font-weight: 600;
    color: #8892a4;
    -webkit-text-fill-color: #8892a4;
}

.savings {
    text-align: center;
    color: #68d391;
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.features {
    list-style: none;
    padding: 0;
    margin: 30px 0;
}

.features li {
    padding: 12px 0;
    font-size: 1.05em;
    color: #c9d1d9;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.features li:last-child {
    border-bottom: none;
}

.premium-btn {
    width: 100%;
    padding: 18px;
    font-size: 1.2em;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.premium-btn.annual {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.premium-btn.monthly {
    background: linear-gradient(135deg, #4299e1 0%, #667eea 100%);
    color: white;
}

.premium-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.premium-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.upgrade-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a202c;
    padding: 8px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9em;
    transition: transform 0.2s ease;
    display: inline-block;
}

.upgrade-btn:hover {
    transform: scale(1.05);
}

.admin-badge {
    background: linear-gradient(135deg, #f56565 0%, #ed64a6 100%) !important;
}

/* Premium Feature Badges */
.mode-btn.premium-feature::after,
.style-btn.premium-feature::after {
    content: '⭐ Premium';
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a202c;
    font-size: 0.7em;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.mode-btn.premium-limited::after {
    content: '1 Free ⭐';
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #4299e1 0%, #667eea 100%);
    color: white;
    font-size: 0.7em;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
}

/* Auth Page Styles */
.auth-toggle {
    flex: 1;
    padding: 12px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    background: rgba(28, 35, 51, 0.8);
    color: #667eea;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-toggle.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#authContainer input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 1em;
    background: rgba(28, 35, 51, 0.8);
    color: #e2e8f0;
}

#authContainer input:focus {
    outline: none;
    border-color: #667eea;
}

.primary-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.primary-btn:hover {
    transform: scale(1.02);
}

.guest-btn {
    padding: 12px 32px;
    background: rgba(28, 35, 51, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #e2e8f0;
    box-shadow: none;
}

.guest-btn:hover {
    background: rgba(40, 50, 70, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

.error-message {
    color: #fc8181;
    font-size: 0.9em;
    margin-top: 10px;
    min-height: 20px;
}
