/* Universe-specific styles - Building on portal-style.css base */

/* Enhanced universe background with deeper space effect */
body.universe-page {
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
}

/* Enhanced stars for universe page */
.stars-background {
    background-image: 
        radial-gradient(3px 3px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 160px 30px, #fff, transparent),
        radial-gradient(1px 1px at 200px 50px, rgba(255,215,0,0.8), transparent),
        radial-gradient(2px 2px at 250px 90px, rgba(0,191,255,0.6), transparent),
        radial-gradient(1px 1px at 300px 20px, rgba(255,105,180,0.7), transparent);
    background-size: 300px 200px;
    animation: universeSparkle 30s linear infinite;
}

@keyframes universeSparkle {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(300px, 0, 0); }
}

/* Companion sprite that follows cursor */
.companion-sprite {
    position: fixed;
    font-size: 24px;
    pointer-events: none;
    z-index: 1000;
    transition: all 0.1s ease-out;
    animation: companionFloat 3s ease-in-out infinite;
    opacity: 0.8;
}

@keyframes companionFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(5deg); }
    50% { transform: translateY(-10px) rotate(0deg); }
    75% { transform: translateY(-5px) rotate(-5deg); }
}

/* Universe main content */
.universe-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Universe Hero Section */
.universe-hero {
    text-align: center;
    padding: 80px 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(230, 245, 255, 0.98) 100%);
    border-radius: 30px;
    margin: 40px 0;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.universe-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 177, 153, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 226, 0.1) 0%, transparent 50%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.universe-hero h2 {
    font-size: 3.5em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 25px;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.3)); }
    to { filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.6)); }
}

.hero-description {
    font-size: 1.4em;
    color: #2c3e50;
    margin-bottom: 50px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.early-access-teaser {
    margin-top: 40px;
    padding: 25px;
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 8px 25px rgba(255, 171, 160, 0.3);
    animation: gentlePulse 4s ease-in-out infinite;
}

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

.scroll-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 12px 25px;
    background: #2d3436;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.scroll-btn:hover {
    background: #636e72;
    transform: translateY(-2px);
}

/* Realms Section */
.realms-section {
    margin: 100px 0;
    position: relative;
}

.realms-section h2 {
    text-align: center;
    font-size: 3em;
    color: #fff;
    margin-bottom: 30px;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 255, 255, 0.3);
}

.section-description {
    text-align: center;
    font-size: 1.3em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 60px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Realms Grid */
.realms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.realm-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 25px;
    padding: 35px;
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.15),
        0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
    overflow: hidden;
}

.realm-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.05) 0%, 
        rgba(118, 75, 162, 0.05) 50%, 
        rgba(255, 179, 153, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.realm-card:hover::before,
.realm-card:focus::before {
    opacity: 1;
}

.realm-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.2),
        0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.realm-card.hovered {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.2),
        0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.realm-card > * {
    position: relative;
    z-index: 2;
}

/* Focus styles for accessibility */
.realm-card:focus {
    outline: 3px solid #ffa500;
    outline-offset: 2px;
}

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

.realm-icon {
    font-size: 4em;
    animation: realmFloat 4s ease-in-out infinite;
}

.realm-card[data-realm="math-galaxy"] .realm-icon { animation-delay: 0s; }
.realm-card[data-realm="wonder-keeper"] .realm-icon { animation-delay: 0.5s; }
.realm-card[data-realm="spell-quest"] .realm-icon { animation-delay: 1s; }
.realm-card[data-realm="science-lab"] .realm-icon { animation-delay: 1.5s; }
.realm-card[data-realm="discovery-worlds"] .realm-icon { animation-delay: 2s; }
.realm-card[data-realm="art-corner"] .realm-icon { animation-delay: 2.5s; }

@keyframes realmFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(2deg); }
    50% { transform: translateY(-15px) rotate(0deg); }
    75% { transform: translateY(-8px) rotate(-2deg); }
}

.realm-badge {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.realm-card h3 {
    font-size: 2.2em;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: bold;
}

.realm-card p {
    color: #34495e;
    line-height: 1.8;
    margin-bottom: 25px;
    font-size: 1.1em;
}

.realm-features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.realm-features .feature {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 8px 14px;
    border-radius: 15px;
    font-size: 0.95em;
    color: #1565c0;
    font-weight: 600;
    border: 1px solid rgba(21, 101, 192, 0.2);
}

/* Secret Constellation */
.secret-constellation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: constellationReveal 2s ease-out;
}

.secret-constellation.active {
    display: flex;
}

@keyframes constellationReveal {
    from { opacity: 0; background: rgba(0, 0, 0, 0); }
    to { opacity: 1; background: rgba(0, 0, 0, 0.9); }
}

.constellation-message {
    text-align: center;
    color: white;
    max-width: 600px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.constellation-message h3 {
    font-size: 2.5em;
    margin-bottom: 20px;
    animation: starTwinkle 2s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
    from { text-shadow: 0 0 20px rgba(255, 255, 255, 0.5); }
    to { text-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 40px rgba(255, 215, 0, 0.6); }
}

/* AI Companion Section */
.companion-section {
    margin: 120px 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 248, 255, 0.95) 100%);
    border-radius: 30px;
    padding: 80px 60px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.companion-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 70%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(255, 107, 107, 0.05) 0%, transparent 50%);
    animation: companionBackground 20s linear infinite;
    z-index: 1;
}

@keyframes companionBackground {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.companion-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.companion-preview {
    text-align: center;
}

.companion-avatar {
    font-size: 8em;
    margin-bottom: 30px;
    display: inline-block;
    animation: companionBounce 3s ease-in-out infinite;
}

@keyframes companionBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

.companion-bubble {
    background: white;
    padding: 25px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    margin-top: 20px;
}

.companion-bubble::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-top-color: white;
}

.companion-info h2 {
    font-size: 2.8em;
    color: #2c3e50;
    margin-bottom: 25px;
}

.companion-features {
    display: grid;
    gap: 30px;
    margin-top: 40px;
}

.companion-feature {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.companion-feature:hover {
    transform: translateX(5px);
}

.companion-feature .feature-icon {
    font-size: 2.5em;
    min-width: 60px;
}

.companion-feature h3 {
    font-size: 1.4em;
    color: #2c3e50;
    margin-bottom: 5px;
}

/* Bridge Section */
.bridge-section {
    margin: 120px 0;
    text-align: center;
}

.bridge-section h2 {
    font-size: 3em;
    color: #fff;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.bridge-description {
    font-size: 1.4em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 60px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.bridge-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.bridge-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.bridge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.bridge-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.bridge-card h3 {
    font-size: 1.8em;
    color: #2c3e50;
    margin-bottom: 15px;
}

.bridge-card p {
    color: #34495e;
    line-height: 1.7;
    font-size: 1.1em;
}

/* Early Access Section */
.early-access-section {
    margin: 120px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 30px;
    padding: 80px 60px;
    color: white;
    box-shadow: 0 25px 60px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.early-access-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    z-index: 1;
}

.early-access-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.early-access-content h2 {
    font-size: 3em;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.early-access-content > p {
    font-size: 1.3em;
    margin-bottom: 50px;
    opacity: 0.95;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.access-form-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 60px;
    margin-top: 50px;
    text-align: left;
}

.access-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: #2c3e50;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-help {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 5px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: normal;
}

.checkbox-label:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkmark {
    font-size: 1.2em;
}

.access-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
    font-family: inherit;
}

.access-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.4);
}

.form-privacy {
    margin-top: 20px;
    text-align: center;
}

.form-privacy p {
    font-size: 0.9em;
    color: #6c757d;
    margin: 0;
}

.access-benefits {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.access-benefits h3 {
    font-size: 1.8em;
    margin-bottom: 25px;
    text-align: center;
}

.access-benefits ul {
    list-style: none;
    padding: 0;
}

.access-benefits li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.1em;
}

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

/* Konami Secret */
.konami-secret {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    animation: secretReveal 1s ease-out;
}

.konami-secret.active {
    display: flex;
}

@keyframes secretReveal {
    from { 
        opacity: 0; 
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

.secret-message {
    max-width: 700px;
    padding: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    color: white;
    text-align: center;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.secret-message h2 {
    font-size: 2.5em;
    margin-bottom: 25px;
    animation: secretGlow 2s ease-in-out infinite alternate;
}

@keyframes secretGlow {
    from { text-shadow: 0 0 20px rgba(255, 255, 255, 0.5); }
    to { text-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 40px rgba(255, 215, 0, 0.6); }
}

.secret-message p {
    font-size: 1.2em;
    line-height: 1.8;
    margin-bottom: 20px;
}

.secret-message em {
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
}

.close-secret-btn {
    margin-top: 30px;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.close-secret-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Universe Footer */
.universe-footer {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(44, 62, 80, 0.9) 100%);
    color: white;
    margin-top: 100px;
    position: relative;
    overflow: hidden;
}

.universe-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

/* Sparkle Animation on Interaction */
@keyframes sparkleEffect {
    0% { 
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1) rotate(180deg);
        opacity: 0.8;
    }
    100% { 
        transform: scale(1.5) rotate(360deg);
        opacity: 0;
    }
}

.sparkle {
    position: absolute;
    pointer-events: none;
    font-size: 20px;
    z-index: 1000;
    animation: sparkleEffect 1s ease-out forwards;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .companion-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .access-form-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .universe-hero h2 {
        font-size: 2.5em;
    }
    
    .realms-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .realm-card {
        padding: 25px;
    }
    
    .realm-icon {
        font-size: 3em;
    }
    
    .companion-section,
    .early-access-section {
        padding: 50px 30px;
    }
    
    .companion-avatar {
        font-size: 6em;
    }
    
    .bridge-examples {
        grid-template-columns: 1fr;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .universe-main {
        padding: 0 15px;
    }
    
    .universe-hero {
        padding: 50px 20px;
        margin: 20px 0;
    }
    
    .universe-hero h2 {
        font-size: 2em;
    }
    
    .realms-section h2,
    .bridge-section h2 {
        font-size: 2.2em;
    }
    
    .realm-card {
        padding: 20px;
    }
    
    .early-access-section {
        padding: 40px 20px;
    }
    
    .access-form {
        padding: 25px;
    }
    
    .secret-message {
        padding: 30px;
        margin: 20px;
    }
    
    .constellation-message {
        padding: 25px;
        margin: 20px;
    }
}