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

body {
    font-family: 'Open Sans', sans-serif;
    background: radial-gradient(ellipse at center, #2d1b69, #16213e, #0f1419);
    min-height: 100vh;
    color: #f5f5dc;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Cosmic background with Kirby dots and emotional spectrum */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(0, 255, 0, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(220, 20, 60, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 60% 20%, rgba(0, 102, 255, 0.08) 0%, transparent 50%),
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 215, 0, 0.4), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(220, 20, 60, 0.3), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.2), transparent);
    background-repeat: repeat;
    background-size: 150px 150px, 200px 200px, 180px 180px, 160px 160px, 50px 50px, 60px 60px, 45px 45px, 70px 70px;
    pointer-events: none;
    z-index: -1;
    animation: kirbyDotsFloat 20s linear infinite;
}

@keyframes kirbyDotsFloat {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-10px, -10px) rotate(120deg); }
    66% { transform: translate(10px, -5px) rotate(240deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

/* Header Styles */
.header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, 
        rgba(45, 27, 105, 0.95), 
        rgba(22, 33, 62, 0.9), 
        rgba(45, 27, 105, 0.95));
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 215, 0, 0.2);
    position: relative;
    border-bottom: 3px solid #00ff00;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 40%, rgba(0, 255, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(220, 20, 60, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.title {
    font-family: 'Orbitron', monospace;
    font-size: 3.8em;
    font-weight: 900;
    background: linear-gradient(45deg, #00ff00, #ff6b35, #0066ff, #8b00ff, #00ff00);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 
        0 0 20px rgba(0, 255, 0, 0.6),
        3px 3px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 15px;
    letter-spacing: 4px;
    text-transform: uppercase;
    animation: emotionalSpectrumGlow 4s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes emotionalSpectrumGlow {
    0% { 
        background-position: 0% 50%;
        filter: drop-shadow(0 0 10px rgba(0, 255, 0, 0.4));
    }
    25% { 
        background-position: 25% 50%;
        filter: drop-shadow(0 0 15px rgba(220, 20, 60, 0.4));
    }
    50% { 
        background-position: 50% 50%;
        filter: drop-shadow(0 0 20px rgba(0, 102, 255, 0.6));
    }
    75% { 
        background-position: 75% 50%;
        filter: drop-shadow(0 0 15px rgba(139, 0, 255, 0.4));
    }
    100% { 
        background-position: 100% 50%;
        filter: drop-shadow(0 0 10px rgba(0, 255, 0, 0.4));
    }
}

.subtitle {
    font-size: 1.4em;
    color: #f5f5dc;
    font-weight: 400;
    margin-bottom: 30px;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 10px rgba(0, 255, 0, 0.3);
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

/* Navigation Tabs */
.navigation-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 25px;
    position: relative;
    z-index: 1;
}

.tab-btn {
    padding: 12px 18px;
    background: linear-gradient(145deg, 
        rgba(245, 245, 220, 0.9), 
        rgba(0, 255, 0, 0.8));
    border: 2px solid transparent;
    border-radius: 20px;
    color: #2d1b69;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
    transition: left 0.6s;
}

.tab-btn::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(220, 20, 60, 0.8), transparent);
    border-radius: 50%;
    opacity: 0.7;
}

.tab-btn:hover::before {
    left: 100%;
}

.tab-btn:hover {
    background: linear-gradient(145deg, #00ff00, #ff6b35);
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 255, 0, 0.4),
        0 0 15px rgba(255, 215, 0, 0.3);
    border-color: #f5f5dc;
    color: #1a1a2e;
}

.tab-btn.active {
    background: linear-gradient(145deg, #00ff00, #ff6b35);
    border-color: #f5f5dc;
    transform: translateY(-3px);
    box-shadow: 
        0 10px 30px rgba(0, 255, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.4);
    color: #1a1a2e;
}

/* Corps-specific tab colors */
.tab-btn[data-section="green"] { background: linear-gradient(145deg, rgba(0, 255, 0, 0.9), rgba(144, 238, 144, 0.8)); }
.tab-btn[data-section="red"] { background: linear-gradient(145deg, rgba(220, 20, 60, 0.9), rgba(255, 102, 102, 0.8)); }
.tab-btn[data-section="yellow"] { background: linear-gradient(145deg, rgba(255, 255, 0, 0.9), rgba(255, 215, 0, 0.8)); }
.tab-btn[data-section="blue"] { background: linear-gradient(145deg, rgba(0, 102, 255, 0.9), rgba(135, 206, 235, 0.8)); }
.tab-btn[data-section="indigo"] { background: linear-gradient(145deg, rgba(75, 0, 130, 0.9), rgba(147, 112, 219, 0.8)); }
.tab-btn[data-section="violet"] { background: linear-gradient(145deg, rgba(139, 0, 255, 0.9), rgba(218, 112, 214, 0.8)); }
.tab-btn[data-section="orange"] { background: linear-gradient(145deg, rgba(255, 140, 0, 0.9), rgba(255, 165, 0, 0.8)); }
.tab-btn[data-section="white"] { background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(230, 230, 230, 0.8)); }
.tab-btn[data-section="black"] { background: linear-gradient(145deg, rgba(51, 51, 51, 0.9), rgba(26, 26, 26, 0.8)); color: #f5f5dc; }

/* Main Guide Container */
.guide-container {
    max-width: 1500px;
    margin: 40px auto;
    padding: 0 25px;
}

/* Pattern Sections */
.pattern-section {
    background: linear-gradient(145deg, 
        rgba(245, 245, 220, 0.95), 
        rgba(255, 255, 255, 0.9));
    border-radius: 25px;
    margin-bottom: 50px;
    padding: 45px;
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(0, 255, 0, 0.4);
    position: relative;
    overflow: hidden;
}

/* Corps-specific section borders */
#green-section { border-color: rgba(0, 255, 0, 0.6); }
#red-section { border-color: rgba(220, 20, 60, 0.6); }
#yellow-section { border-color: rgba(255, 255, 0, 0.6); }
#blue-section { border-color: rgba(0, 102, 255, 0.6); }
#indigo-section { border-color: rgba(75, 0, 130, 0.6); }
#violet-section { border-color: rgba(139, 0, 255, 0.6); }
#orange-section { border-color: rgba(255, 140, 0, 0.6); }
#white-section { border-color: rgba(255, 255, 255, 0.6); }
#black-section { border-color: rgba(51, 51, 51, 0.6); }
#generator-section { border-color: rgba(255, 215, 0, 0.6); }

.pattern-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        #00ff00, #dc143c, #ffff00, #0066ff, #4b0082, #8b00ff, #ff8c00, #ffffff, #000000, #00ff00);
    background-size: 400% 400%;
    border-radius: 25px;
    z-index: -1;
    opacity: 0.6;
    animation: emotionalSpectrumBorder 8s linear infinite;
}

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

.section-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.4em;
    font-weight: 700;
    background: linear-gradient(45deg, #2d1b69, #0d4f3c, #4a0e0e, #0e1a4a, #2d1b69);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 40px;
    letter-spacing: 3px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    position: relative;
    animation: emotionalTextShift 5s ease-in-out infinite;
}

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

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent, #00ff00, #dc143c, #0066ff, #8b00ff, #00ff00, transparent);
    border-radius: 2px;
    animation: emotionalUnderline 3s ease-in-out infinite;
}

@keyframes emotionalUnderline {
    0% { transform: translateX(-50%) scaleX(0.8); }
    50% { transform: translateX(-50%) scaleX(1.2); }
    100% { transform: translateX(-50%) scaleX(0.8); }
}

/* Logo Grids */
.logo-grid {
    display: grid;
    gap: 30px;
    justify-items: center;
}

.green-grid, .red-grid, .yellow-grid, .blue-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    max-width: 1400px;
    margin: 0 auto;
}

.indigo-grid, .orange-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    max-width: 1200px;
    margin: 0 auto;
}

.violet-grid, .white-grid, .black-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo Items */
.logo-item {
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.95), 
        rgba(248, 248, 248, 0.9));
    border-radius: 20px;
    padding: 25px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: center;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    border: 2px solid transparent;
    overflow: hidden;
}

.logo-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, 
        rgba(0, 255, 0, 0.1) 0%, 
        rgba(255, 107, 53, 0.05) 50%, 
        transparent 70%);
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.logo-item::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, rgba(220, 20, 60, 0.8), transparent);
    border-radius: 50%;
    opacity: 0.6;
    animation: kirbyDotPulse 2s ease-in-out infinite;
}

/* Corps-specific logo item hover colors */
#green-section .logo-item:hover::before { background: radial-gradient(circle at center, rgba(0, 255, 0, 0.15), transparent 70%); }
#red-section .logo-item:hover::before { background: radial-gradient(circle at center, rgba(220, 20, 60, 0.15), transparent 70%); }
#yellow-section .logo-item:hover::before { background: radial-gradient(circle at center, rgba(255, 255, 0, 0.15), transparent 70%); }
#blue-section .logo-item:hover::before { background: radial-gradient(circle at center, rgba(0, 102, 255, 0.15), transparent 70%); }
#indigo-section .logo-item:hover::before { background: radial-gradient(circle at center, rgba(75, 0, 130, 0.15), transparent 70%); }
#violet-section .logo-item:hover::before { background: radial-gradient(circle at center, rgba(139, 0, 255, 0.15), transparent 70%); }
#orange-section .logo-item:hover::before { background: radial-gradient(circle at center, rgba(255, 140, 0, 0.15), transparent 70%); }
#white-section .logo-item:hover::before { background: radial-gradient(circle at center, rgba(255, 255, 255, 0.15), transparent 70%); }
#black-section .logo-item:hover::before { background: radial-gradient(circle at center, rgba(51, 51, 51, 0.15), transparent 70%); }

@keyframes kirbyDotPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 1; }
}

.logo-item:hover::before {
    opacity: 1;
}

.logo-item:hover {
    transform: translateY(-10px) scale(1.03) rotateZ(1deg);
    box-shadow: 
        0 20px 50px rgba(0, 255, 0, 0.3),
        0 10px 25px rgba(0, 0, 0, 0.2),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
    border-color: #00ff00;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.98), 
        rgba(255, 254, 245, 0.95));
}

.logo-image {
    width: 130px;
    height: 130px;
    object-fit: contain;
    margin: 0 auto 20px;
    border-radius: 12px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    transition: all 0.4s ease;
    display: block;
    background: linear-gradient(145deg, 
        rgba(248, 248, 248, 0.9), 
        rgba(232, 232, 232, 0.8));
    border: 2px solid rgba(0, 255, 0, 0.2);
    position: relative;
}

.logo-image.loading {
    background: linear-gradient(90deg, 
        rgba(45, 27, 105, 0.1) 25%, 
        rgba(0, 255, 0, 0.2) 50%, 
        rgba(45, 27, 105, 0.1) 75%);
    background-size: 200% 100%;
    animation: cosmicLoading 2s infinite;
    opacity: 0.8;
}

@keyframes cosmicLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.logo-image:hover {
    transform: scale(1.05) rotateZ(-1deg);
    border-color: #ff6b35;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.4);
}

.logo-label {
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    color: #2d1b69;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    background: linear-gradient(45deg, #2d1b69, #0d4f3c, #4a0e0e, #2d1b69);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: labelShimmer 4s ease-in-out infinite;
}

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

/* Generator Section using existing styles with emotional spectrum theming */
.generator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.generator-controls {
    background: linear-gradient(145deg, 
        rgba(45, 27, 105, 0.9), 
        rgba(22, 33, 62, 0.9));
    padding: 35px;
    border-radius: 20px;
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(0, 255, 0, 0.2);
    border: 2px solid #00ff00;
    position: relative;
    overflow: hidden;
}

.generator-controls::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 255, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(220, 20, 60, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.control-group {
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.control-group label {
    display: block;
    color: #00ff00;
    font-weight: 600;
    font-family: 'Orbitron', monospace;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.control-group select {
    width: 100%;
    padding: 14px;
    border: 2px solid #00ff00;
    border-radius: 10px;
    background: linear-gradient(145deg, 
        rgba(245, 245, 220, 0.95), 
        rgba(255, 255, 255, 0.9));
    color: #2d1b69;
    font-family: 'Open Sans', sans-serif;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.control-group select:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 
        0 0 15px rgba(0, 255, 0, 0.4),
        inset 0 2px 5px rgba(0, 0, 0, 0.1);
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.98), 
        rgba(245, 245, 220, 0.95));
}

/* Sliders with emotional spectrum theming */
.energy-slider, .dots-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, 
        #2d1b69 0%, 
        #00ff00 25%,
        #dc143c 50%,
        #0066ff 75%,
        #8b00ff 100%);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.energy-slider::-webkit-slider-thumb, .dots-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #00ff00, #ff6b35);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.energy-slider::-webkit-slider-thumb:hover, .dots-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
}

.energy-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.75em;
    color: #87ceeb;
    font-family: 'Orbitron', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.generate-button, .download-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(145deg, #00ff00, #ff6b35);
    border: none;
    border-radius: 12px;
    color: #2d1b69;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
    margin-top: 10px;
}

.generate-button::before, .download-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: left 0.6s;
}

.generate-button:hover::before, .download-button:hover::before {
    left: 100%;
}

.generate-button:hover, .download-button:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 30px rgba(0, 255, 0, 0.4),
        0 0 20px rgba(255, 215, 0, 0.3);
    background: linear-gradient(145deg, #ff6b35, #dc143c);
}

.generator-preview {
    background: linear-gradient(145deg, 
        rgba(245, 245, 220, 0.95), 
        rgba(255, 255, 255, 0.9));
    padding: 35px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 2px solid #00ff00;
    position: relative;
}

.preview-container {
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, 
        rgba(248, 248, 248, 0.9), 
        rgba(232, 232, 232, 0.8));
    border-radius: 15px;
    margin-bottom: 25px;
    position: relative;
    border: 2px dashed rgba(0, 255, 0, 0.3);
}

.generated-image {
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.loading-spinner {
    color: #2d1b69;
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: cosmicPulse 1.5s ease-in-out infinite;
}

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

/* Modal Styles with emotional spectrum theming */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at center, 
        rgba(45, 27, 105, 0.9) 0%, 
        rgba(0, 0, 0, 0.8) 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(8px);
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: linear-gradient(145deg, 
        rgba(245, 245, 220, 0.98), 
        rgba(255, 255, 255, 0.95));
    margin: 2% auto;
    padding: 0;
    border-radius: 25px;
    width: 92%;
    max-width: 1000px;
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transform: translateY(-50px) scale(0.9);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    border: 3px solid #00ff00;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, 
        #00ff00, #dc143c, #ffff00, #0066ff, #8b00ff, #00ff00);
    background-size: 300% 300%;
    border-radius: 25px;
    z-index: -1;
    opacity: 0.8;
    animation: modalBorder 6s linear infinite;
}

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

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

.close {
    position: absolute;
    right: 25px;
    top: 20px;
    color: #2d1b69;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: linear-gradient(145deg, #00ff00, #ff6b35);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.close:hover {
    background: linear-gradient(145deg, #ff6b35, #dc143c);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 
        0 0 20px rgba(0, 255, 0, 0.6),
        0 6px 20px rgba(0, 0, 0, 0.3);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 45px;
    padding: 45px;
}

.modal-image {
    text-align: center;
    position: relative;
}

.large-logo-image {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 20px;
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    image-rendering: pixelated;
    background: linear-gradient(145deg, 
        rgba(248, 248, 248, 0.9), 
        rgba(232, 232, 232, 0.8));
    border: 3px solid rgba(0, 255, 0, 0.4);
    transition: all 0.3s ease;
}

.large-logo-image:hover {
    transform: scale(1.02);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.4),
        0 0 25px rgba(0, 255, 0, 0.4);
}

.modal-info h3 {
    font-family: 'Orbitron', monospace;
    font-size: 2.2em;
    font-weight: 700;
    background: linear-gradient(45deg, #2d1b69, #0d4f3c, #4a0e0e, #2d1b69);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: modalTitleGlow 4s ease-in-out infinite;
}

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

.modal-info h4 {
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    color: #2d1b69;
    margin: 30px 0 15px 0;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 3px solid #00ff00;
    padding-bottom: 10px;
    position: relative;
}

.modal-info h4::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 30%;
    height: 3px;
    background: #ff6b35;
    transition: width 0.3s ease;
}

.modal-info h4:hover::after {
    width: 60%;
}

.modal-info p {
    color: #1a1a2e;
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 0.95em;
    text-align: justify;
}

.era-info {
    background: linear-gradient(145deg, 
        rgba(0, 255, 0, 0.1), 
        rgba(255, 107, 53, 0.1));
    padding: 25px;
    border-radius: 15px;
    margin: 25px 0;
    border-left: 5px solid #00ff00;
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    position: relative;
}

.era-info::before {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, rgba(220, 20, 60, 0.8), transparent);
    border-radius: 50%;
    animation: kirbyDotPulse 2s ease-in-out infinite;
}

/* Cosmic Animations */
@keyframes cosmicSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(50px) scale(0.8) rotateZ(-5deg); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1) rotateZ(0deg); 
    }
}

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

/* Accessibility */
.logo-item:focus {
    outline: 3px solid #00ff00;
    outline-offset: 3px;
}

.tab-btn:focus,
.generate-button:focus,
.download-button:focus {
    outline: 2px solid #f5f5dc;
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .modal-body {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px;
    }
    
    .generator-container {
        grid-template-columns: 1fr;
        gap: 35px;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2.8em;
        letter-spacing: 2px;
    }
    
    .subtitle {
        font-size: 1.2em;
    }

    .navigation-tabs {
        gap: 6px;
    }

    .tab-btn {
        padding: 10px 14px;
        font-size: 0.7em;
    }

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

    .logo-item {
        padding: 20px;
        min-height: 190px;
    }

    .logo-image {
        width: 110px;
        height: 110px;
    }

    .logo-label {
        font-size: 0.7em;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .modal-info h3 {
        font-size: 1.8em;
    }

    .section-title {
        font-size: 2em;
    }

    .pattern-section {
        padding: 30px;
        margin-bottom: 35px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 30px 15px;
    }

    .title {
        font-size: 2.2em;
        letter-spacing: 1px;
    }

    .tab-btn {
        padding: 8px 10px;
        font-size: 0.6em;
    }

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

    .logo-image {
        width: 90px;
        height: 90px;
    }

    .guide-container {
        padding: 0 15px;
    }

    .generator-controls, .generator-preview {
        padding: 25px;
    }

    .pattern-section {
        padding: 20px;
        border-radius: 15px;
    }

    .modal-content {
        border-radius: 15px;
        margin: 10% auto;
    }
}

/* Print styles */
@media print {
    .header, .navigation-tabs, .modal, .generator-section {
        display: none !important;
    }
    
    .guide-container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    .pattern-section {
        break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        background: white;
        color: black;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section-title, .logo-label {
        color: black;
    }
}

/* High DPI Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: pixelated;
    }
}