@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --ladybug-red: #dc143c;
    --ladybug-black: #1a1a1a;
    --cat-green: #00ff41;
    --cat-black: #000000;
    --paris-blue: #4169e1;
    --miracle-gold: #ffd700;
    --rena-orange: #ff6600;
    --queen-yellow: #ffff00;
    --primary-gradient: linear-gradient(135deg, var(--ladybug-red) 0%, var(--paris-blue) 100%);
    --secondary-gradient: linear-gradient(135deg, var(--cat-green) 0%, var(--ladybug-black) 100%);
    --shadow-light: 0 4px 20px rgba(220, 20, 60, 0.15);
    --shadow-medium: 0 8px 40px rgba(220, 20, 60, 0.25);
    --shadow-heavy: 0 16px 60px rgba(220, 20, 60, 0.35);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #dc143c 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    position: relative;
}

.background-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(220, 20, 60, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(65, 105, 225, 0.1) 0%, transparent 50%);
    animation: particleFloat 20s ease-in-out infinite alternate;
}

@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-10px, -20px) rotate(1deg); }
    50% { transform: translate(10px, -10px) rotate(-1deg); }
    75% { transform: translate(-5px, 15px) rotate(0.5deg); }
}

.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.floating-elements::before,
.floating-elements::after {
    content: '🐞';
    position: absolute;
    font-size: 20px;
    animation: floatAround 15s linear infinite;
    opacity: 0.3;
}

.floating-elements::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-elements::after {
    content: '🐱';
    top: 60%;
    right: 15%;
    animation-delay: 7s;
}

@keyframes floatAround {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% { transform: translate(200px, -100px) rotate(360deg); opacity: 0; }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(20px);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-medium);
    border-bottom: 2px solid var(--ladybug-red);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-logo {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ladybug-icon, .cat-icon {
    font-size: 24px;
    animation: brandPulse 2s ease-in-out infinite alternate;
}

.cat-icon {
    animation-delay: 1s;
}

@keyframes brandPulse {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(5deg); }
}

.brand-text h1 {
    color: var(--ladybug-red);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.brand-subtitle {
    color: var(--miracle-gold);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: transparent;
    border: 2px solid var(--ladybug-red);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.nav-btn:hover {
    background: var(--ladybug-red);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.badge {
    background: var(--miracle-gold);
    color: var(--ladybug-black);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 20px 20px;
    position: relative;
    z-index: 10;
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 60px;
    min-height: 500px;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.title-section {
    position: relative;
}

.main-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 0.9;
    margin-bottom: 20px;
}

.title-word {
    display: block;
    position: relative;
}

.miraculous {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleShine 3s ease-in-out infinite;
}

.generator {
    color: white;
    text-shadow: 4px 4px 8px rgba(0,0,0,0.5);
    animation: titleFloat 4s ease-in-out infinite alternate;
}

@keyframes titleShine {
    0%, 100% { filter: brightness(1) saturate(1); }
    50% { filter: brightness(1.3) saturate(1.5); }
}

@keyframes titleFloat {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-10px); }
}

.title-accent {
    width: 200px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.title-accent::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    animation: accentShine 2s ease-in-out infinite;
}

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

.hero-subtitle {
    font-size: 1.3rem;
    color: rgba(255,255,255,0.9);
    font-weight: 400;
    line-height: 1.6;
    max-width: 600px;
}

.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--miracle-gold);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: counterPulse 2s ease-in-out infinite;
}

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

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

.hero-decoration {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
}

.miracle-box {
    width: 200px;
    height: 200px;
    background: var(--primary-gradient);
    border-radius: 20px;
    position: relative;
    box-shadow: var(--shadow-heavy);
    animation: miracleBoxFloat 6s ease-in-out infinite alternate;
    transform-style: preserve-3d;
}

.miracle-box::before {
    content: '🎁';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    animation: boxContentSpin 4s linear infinite;
}

@keyframes miracleBoxFloat {
    0% { transform: translateY(0px) rotateY(0deg); }
    100% { transform: translateY(-20px) rotateY(15deg); }
}

@keyframes boxContentSpin {
    0% { transform: translate(-50%, -50%) rotateZ(0deg); }
    100% { transform: translate(-50%, -50%) rotateZ(360deg); }
}

.floating-miraculous {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-miraculous::before,
.floating-miraculous::after {
    content: '💎';
    position: absolute;
    font-size: 24px;
    animation: miracleOrbit 8s linear infinite;
}

.floating-miraculous::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-miraculous::after {
    content: '✨';
    bottom: 20%;
    right: 10%;
    animation-delay: 4s;
}

@keyframes miracleOrbit {
    0% { transform: rotate(0deg) translateX(80px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(80px) rotate(-360deg); }
}

/* Music Controls */
.music-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(26, 26, 26, 0.9);
    padding: 10px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 2px solid var(--ladybug-red);
}

.music-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    animation: musicPulse 2s ease-in-out infinite;
}

.music-btn:hover {
    background: var(--ladybug-red);
    transform: scale(1.1);
}

.music-btn.playing {
    color: var(--miracle-gold);
    animation: musicPlay 1s ease-in-out infinite alternate;
}

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

@keyframes musicPlay {
    0% { text-shadow: 0 0 5px var(--miracle-gold); }
    100% { text-shadow: 0 0 15px var(--miracle-gold), 0 0 25px var(--miracle-gold); }
}

.volume-control {
    display: flex;
    align-items: center;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: #333;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--ladybug-red);
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--ladybug-red);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Compare Modal */
.compare-modal-content {
    max-width: 95vw;
    width: 1200px;
    max-height: 90vh;
}

.compare-selector {
    margin-bottom: 30px;
}

.compare-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.compare-section h4 {
    color: var(--ladybug-red);
    font-weight: 600;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--ladybug-red);
    padding-bottom: 5px;
}

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

.compare-option {
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.compare-option:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.compare-option.selected {
    border-color: var(--ladybug-red);
    background: #fff5f5;
    box-shadow: var(--shadow-light);
}

.compare-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.compare-info {
    flex: 1;
}

.compare-name {
    font-weight: 600;
    color: #212529;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.compare-rarity {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 500;
}

.compare-checkbox {
    font-size: 1.2rem;
    color: var(--ladybug-red);
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.clear-comparison {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.clear-comparison:hover {
    background: #c82333;
    transform: translateY(-1px);
}

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

.comparison-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-light);
    border: 2px solid #f8f9fa;
    transition: all 0.3s ease;
}

.comparison-card:hover {
    border-color: var(--ladybug-red);
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.comparison-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.comparison-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
}

.comparison-title h4 {
    margin: 0 0 5px 0;
    color: #212529;
    font-size: 1.1rem;
}

.comparison-emoji {
    font-size: 1.5rem;
}

.comparison-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

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

.stat-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.9rem;
    min-width: 80px;
}

.stat-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.stat-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.stat-value {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    min-width: 30px;
}

.stat-badge {
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-text {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.comparison-abilities h5 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
}

.ability-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ability-tag {
    background: var(--primary-gradient);
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.comparison-summary {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px;
    border-radius: 20px;
    border-left: 5px solid var(--miracle-gold);
}

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

.summary-item {
    background: white;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.summary-icon {
    font-size: 1.5rem;
}

.summary-content {
    flex: 1;
}

.summary-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.summary-value {
    font-weight: 600;
    color: #212529;
    font-size: 1rem;
}

.compatibility-analysis {
    background: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
}

.compatibility-analysis h5 {
    margin: 0 0 15px 0;
    color: #495057;
    font-weight: 600;
}

.compatibility-score {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: var(--shadow-light);
}

.score-description {
    max-width: 300px;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.mode-btn {
    background: rgba(255,255,255,0.1);
    border: 2px solid transparent;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
}

.mode-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-light);
}

.mode-btn.active {
    background: var(--primary-gradient);
    border-color: var(--miracle-gold);
    box-shadow: var(--shadow-medium);
}

.mode-btn[data-mode="villain"].active {
    background: var(--secondary-gradient);
}

/* Generator Section */
.generator-section {
    text-align: center;
    margin-bottom: 60px;
}

.generator-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.generate-btn {
    position: relative;
    background: var(--primary-gradient);
    border: none;
    padding: 20px 60px;
    font-size: 1.4rem;
    color: white;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.generate-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-heavy);
}

.generate-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.btn-icon {
    font-size: 1.5rem;
    animation: iconSpin 2s linear infinite;
}

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

.btn-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    animation: ripple 1.5s ease-out infinite;
}

@keyframes ripple {
    0% { width: 0; height: 0; opacity: 1; }
    100% { width: 300px; height: 300px; opacity: 0; }
}

.btn-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="20">⭐</text></svg>') repeat;
    opacity: 0;
    animation: particleShower 3s ease-in-out infinite;
}

@keyframes particleShower {
    0%, 70%, 100% { opacity: 0; transform: scale(0.5); }
    15%, 55% { opacity: 0.7; transform: scale(1); }
}

.secondary-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.secondary-btn {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.secondary-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-action-btn {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
}

.quick-action-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-light);
}

.search-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-input:focus {
    outline: none;
    border-color: var(--miracle-gold);
    background: rgba(255,255,255,0.25);
}

.filter-select {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.filter-select option {
    background: var(--ladybug-black);
    color: white;
}

/* Search Panel */
.search-panel {
    background: white;
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
}

.panel-header {
    background: var(--primary-gradient);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-panel {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-results {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item, .history-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.search-result-item:hover, .history-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.result-image, .history-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
}

.result-info, .history-info {
    flex: 1;
}

.result-info h4, .history-info h4 {
    margin: 0 0 5px 0;
    color: #212529;
    font-size: 1rem;
}

.result-info p, .history-info p {
    margin: 0 0 5px 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.result-rarity {
    background: var(--miracle-gold);
    color: var(--ladybug-black);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* History Modal Enhancements */
.history-modal-content {
    max-width: 95vw;
    width: 1000px;
    max-height: 90vh;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.danger-btn {
    background: #dc3545;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.danger-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.history-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.history-search {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 25px;
    font-size: 0.9rem;
}

.history-filter {
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 25px;
    background: white;
    cursor: pointer;
}

.history-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.history-actions {
    display: flex;
    gap: 8px;
}

.mini-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.mini-btn:hover {
    background: #f8f9fa;
    transform: scale(1.1);
}

/* Compatible Results Modal */
.compatible-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.compatible-item {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.compatible-item:hover {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-color: var(--ladybug-red);
    transform: translateY(-3px);
    box-shadow: var(--shadow-light);
}

.compatible-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.compatible-info {
    flex: 1;
}

.compatible-info h4 {
    margin: 0 0 8px 0;
    color: #212529;
    font-size: 1.1rem;
    font-weight: 600;
}

.compatible-info p {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 0.95rem;
}

.compatible-details {
    display: flex;
    gap: 12px;
    align-items: center;
}

.compatible-rarity {
    background: var(--miracle-gold);
    color: var(--ladybug-black);
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.compatible-score {
    background: var(--primary-gradient);
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.compatible-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 100px;
}

.preview-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
}

.preview-label {
    color: #6c757d;
    font-weight: 500;
}

.preview-value {
    color: #212529;
    font-weight: 600;
}

.compatible-header {
    text-align: center;
    color: #495057;
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #fff5f5, #ffe8e8);
    border-radius: 15px;
    border-left: 4px solid var(--ladybug-red);
}

/* Keyboard Shortcuts Help */
.keyboard-shortcuts {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: rgba(26, 26, 26, 0.95);
    color: white;
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(20px);
    border: 2px solid var(--ladybug-red);
    z-index: 1000;
    min-width: 250px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.keyboard-shortcuts.show {
    transform: translateX(0);
}

.shortcuts-content h4 {
    margin: 0 0 15px 0;
    color: var(--miracle-gold);
    font-weight: 600;
    text-align: center;
}

.shortcuts-list {
    display: grid;
    gap: 8px;
}

.shortcuts-list div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.shortcuts-list kbd {
    background: #333;
    color: var(--miracle-gold);
    padding: 4px 8px;
    border-radius: 5px;
    font-family: monospace;
    font-weight: 600;
    border: 1px solid #555;
    min-width: 25px;
    text-align: center;
}

.close-shortcuts {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Help Button */
.help-btn {
    position: fixed;
    bottom: 140px;
    right: 20px;
    background: var(--paris-blue);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 1000;
    box-shadow: var(--shadow-medium);
}

.help-btn:hover {
    background: #3051d3;
    transform: scale(1.1) rotate(5deg);
}

/* Quick Button Styling */
.quick-btn {
    background: linear-gradient(135deg, var(--cat-green), #00cc33) !important;
    animation: quickPulse 1.5s ease-in-out infinite;
}

@keyframes quickPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(0, 255, 65, 0); }
}

/* Performance Optimizations */
.miraculous-card {
    contain: layout style paint;
    will-change: transform;
}

.loading-container {
    contain: layout style paint;
}

.modal-content {
    contain: layout style paint;
}

/* Loading Container */
.loading-container {
    text-align: center;
    margin: 60px 0;
    padding: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 30px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
}

.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.miracle-spinner {
    position: relative;
    width: 120px;
    height: 120px;
}

.spinner-ring {
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top: 4px solid var(--ladybug-red);
    border-right: 4px solid var(--paris-blue);
    border-radius: 50%;
    animation: spinRing 2s linear infinite;
    transform: translateZ(0);
}

.spinner-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    animation: spinCenter 1s ease-in-out infinite alternate;
}

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

@keyframes spinCenter {
    0% { transform: translate(-50%, -50%) scale(1); }
    100% { transform: translate(-50%, -50%) scale(1.2); }
}

.loading-text {
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.loading-text p {
    font-size: 1.2rem;
    font-weight: 600;
}

.loading-dots {
    display: flex;
    gap: 5px;
}

.loading-dots span {
    font-size: 1.5rem;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 3px;
    transition: width 0.3s ease;
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Miraculous Card */
.miraculous-card {
    background: white;
    border-radius: 30px;
    box-shadow: var(--shadow-heavy);
    overflow: hidden;
    animation: cardAppear 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    margin-top: 40px;
    position: relative;
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(100px) scale(0.8) rotateX(45deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
    }
}

.card-header {
    position: relative;
    background: var(--primary-gradient);
    color: white;
    padding: 40px;
    text-align: center;
    overflow: hidden;
}

.header-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    animation: backgroundMove 20s linear infinite;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100px, -100px); }
}

.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.miraculous-title-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.miraculous-name {
    font-size: 2.8rem;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: nameGlow 3s ease-in-out infinite;
}

@keyframes nameGlow {
    0% { text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
    100% { text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 20px rgba(255,255,255,0.4); }
}

.miraculous-emoji {
    font-size: 4rem;
    animation: emojiDance 3s ease-in-out infinite;
}

@keyframes emojiDance {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-10deg) scale(1.1); }
    75% { transform: rotate(10deg) scale(1.1); }
}

.rarity-badge {
    background: var(--miracle-gold);
    color: var(--ladybug-black);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5); }
}

.card-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 5px 20px rgba(255,255,255,0.2);
}

.action-btn.active {
    background: var(--miracle-gold);
    color: var(--ladybug-black);
    border-color: var(--miracle-gold);
}

.favorite-btn.active .icon::before {
    content: '💖';
}

/* Card Content */
.card-content {
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    align-items: start;
}

.image-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

.miraculous-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-container:hover .miraculous-image {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-container:hover .image-overlay {
    opacity: 1;
}

.overlay-btn {
    background: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.overlay-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(255,255,255,0.3);
}

.power-meter {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    text-align: center;
}

.meter-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.meter-bar {
    height: 12px;
    background: #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

.meter-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 6px;
    transition: width 1s ease-out;
    position: relative;
    overflow: hidden;
}

.meter-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: meterShine 2s ease-in-out infinite;
}

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

.meter-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ladybug-red);
}

.details-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    border-left: 4px solid var(--ladybug-red);
}

.detail-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-light);
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
}

.detail-icon {
    font-size: 2rem;
    animation: iconBob 2s ease-in-out infinite alternate;
}

@keyframes iconBob {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-3px); }
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.value {
    font-weight: 600;
    color: #212529;
    font-size: 1.1rem;
}

.transformation-phrase {
    color: var(--ladybug-red);
    font-style: italic;
    font-weight: 700;
}

.hero-name {
    color: var(--paris-blue);
    font-weight: 800;
    font-size: 1.3rem;
}

.transformation-card, .hero-card {
    grid-column: 1 / -1;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 15px;
}

.title-icon {
    font-size: 1.5rem;
    animation: titleIconSpin 3s linear infinite;
}

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

.description-section {
    background: linear-gradient(135deg, #fff5f5, #ffe8e8);
    padding: 25px;
    border-radius: 20px;
    border-left: 5px solid var(--ladybug-red);
}

.description-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #495057;
    margin: 0;
}

.abilities-section {
    background: linear-gradient(135deg, #f0f8ff, #e6f3ff);
    padding: 25px;
    border-radius: 20px;
    border-left: 5px solid var(--paris-blue);
}

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

.ability-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.ability-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.ability-icon {
    font-size: 1.5rem;
}

.ability-text {
    font-weight: 500;
    color: #495057;
}

.compatibility-section {
    background: linear-gradient(135deg, #fff0f6, #ffe0e6);
    padding: 25px;
    border-radius: 20px;
    border-left: 5px solid var(--rena-orange);
}

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

.compatibility-item {
    background: white;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.compatibility-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

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

.compatibility-name {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.compatibility-score {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
}

/* Card Footer */
.card-footer {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #dee2e6;
}

.footer-stats {
    display: flex;
    gap: 30px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #6c757d;
}

.stat-icon {
    font-size: 1.1rem;
}

.stat-text {
    font-weight: 500;
}

.footer-actions {
    display: flex;
    gap: 15px;
}

.footer-btn {
    background: var(--ladybug-red);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-btn:hover {
    background: #b91c3c;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

/* Fun Facts Section */
.fun-facts-section {
    margin-top: 60px;
    padding: 30px;
    background: rgba(255,255,255,0.1);
    border-radius: 25px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
}

.fact-card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: var(--shadow-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.fact-card p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #495057;
    margin: 0;
    flex: 1;
}

.fact-refresh {
    background: var(--paris-blue);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.fact-refresh:hover {
    background: #3051d3;
    transform: rotate(90deg) scale(1.1);
}

/* Modals */
.modal {
    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: 10000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-heavy);
    animation: modalAppear 0.3s ease-out;
    contain: layout style paint;
}

@keyframes modalAppear {
    0% { opacity: 0; transform: scale(0.8) translateY(-50px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #212529;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #6c757d;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 25px;
}

.image-modal-content {
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.modal-image {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: var(--shadow-heavy);
}

/* Settings */
.setting-group {
    margin-bottom: 20px;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    cursor: pointer;
    color: #495057;
}

.setting-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--ladybug-red);
}

.setting-label select {
    background: white;
    border: 2px solid #dee2e6;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1rem;
    color: #495057;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.setting-label select:focus {
    outline: none;
    border-color: var(--ladybug-red);
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        padding: 100px 15px 20px;
    }
    
    .hero-section {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .card-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .quick-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-container {
        flex-direction: column;
        width: 100%;
    }
    
    .search-input {
        min-width: auto;
        width: 100%;
    }
    
    .keyboard-shortcuts {
        bottom: 160px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }
    
    .help-btn {
        bottom: 200px;
        right: 10px;
    }
    
    .music-controls {
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }
    
    .search-results, .history-container {
        grid-template-columns: 1fr;
    }
    
    .secondary-controls {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
    }
    
    .secondary-btn {
        justify-content: center;
        flex: 1;
    }
    
    .navbar {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        gap: 20px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .mode-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .generate-btn {
        padding: 15px 40px;
        font-size: 1.2rem;
    }
    
    .secondary-controls {
        gap: 10px;
    }
    
    .miraculous-name {
        font-size: 2rem;
    }
    
    .miraculous-emoji {
        font-size: 3rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .card-actions {
        justify-content: center;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .card-footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .music-controls {
        bottom: 15px;
        right: 15px;
        padding: 8px 12px;
    }
    
    .volume-slider {
        width: 60px;
    }
    
    .compare-options {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .comparison-container {
        grid-template-columns: 1fr;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .compatibility-score {
        flex-direction: column;
        gap: 15px;
    }
    
    .quick-action-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .search-input, .filter-select {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .shortcuts-list {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 90px 10px 10px;
    }
    
    .brand-text h1 {
        font-size: 1.2rem;
    }
    
    .nav-btn span:not(.icon) {
        display: none;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .generate-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .card-content,
    .loading-container,
    .fun-facts-section {
        padding: 20px;
    }
    
    .miraculous-image {
        height: 250px;
    }
}

/* Focus Management */
.modal-content:focus {
    outline: 3px solid var(--ladybug-red);
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid var(--miracle-gold);
    outline-offset: 2px;
}

input:focus, select:focus {
    outline: 2px solid var(--ladybug-red);
    outline-offset: 2px;
}

/* Animations for slideDown */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}