* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow: hidden;
}

.webgl {
    position: fixed;
    top: 0;
    left: 0;
    outline: none;
    width: 100%;
    height: 100%;
}

/* Tooltip for hovering over a star */
.memory-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    color: white;
    padding: 10px 15px;
    width: 200px;
    text-align: center;
    pointer-events: none; /* Allows clicks to pass through to the 3D canvas */
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.3s forwards;
    z-index: 1000;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tooltip-content h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #ffd700;
}

.tooltip-thumbnail {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.tooltip-content p {
    font-size: 12px;
    margin: 0;
    color: #ccc;
}

/* Close button for the exploded star view – top-right like a modal */
.explosion-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.collapse-button {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    backdrop-filter: blur(8px);
    transition: background 0.2s, border-color 0.2s;
}

.collapse-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Login Screen Styles */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #1a0a1a 0%, #1e1025 25%, #1a1a2e 50%, #16213e 75%, #1a1528 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    font-family: 'Quicksand', sans-serif;
}

.login-screen__sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    color: rgba(255, 215, 0, 0.5);
    font-size: 1rem;
    animation: sparkleTwinkle 3s ease-in-out infinite;
}

.sparkle--1 { top: 18%; left: 12%; animation-delay: 0s; }
.sparkle--2 { top: 25%; right: 15%; animation-delay: 0.5s; }
.sparkle--3 { top: 60%; left: 18%; animation-delay: 1s; }
.sparkle--4 { bottom: 25%; right: 20%; animation-delay: 1.5s; }
.sparkle--5 { bottom: 30%; left: 10%; animation-delay: 2s; }
.sparkle--6 { top: 40%; right: 8%; animation-delay: 2.5s; }

@keyframes sparkleTwinkle {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.15); }
}

.login-container {
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    border-radius: 28px;
    padding: 44px 40px;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 230, 240, 0.15);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 60px rgba(255, 182, 193, 0.06);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-title {
    color: #ffd700;
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: 0.02em;
    text-shadow: 0 0 24px rgba(255, 215, 0, 0.45);
    animation: titleGlow 4s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 24px rgba(255, 215, 0, 0.45); }
    50% { text-shadow: 0 0 32px rgba(255, 215, 0, 0.6); }
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05rem;
    font-weight: 500;
    margin: 0;
}

.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 22px;
}

.form-group input {
    width: 100%;
    padding: 16px 18px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 16px;
    font-family: 'Quicksand', sans-serif;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.3s ease;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus {
    outline: none;
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15), 0 0 24px rgba(255, 182, 193, 0.12);
    background: rgba(255, 255, 255, 0.12);
}

.login-btn {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    cursor: pointer;
    transition: transform 0.25s ease, filter 0.25s ease;
    letter-spacing: 0.02em;
}

.login-btn__heart {
    display: block;
    width: 88px;
    height: 88px;
    object-fit: contain;
    pointer-events: none;
    transition: transform 0.25s ease;
}

.login-btn__text {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.login-btn:hover {
    transform: translateY(-3px);
}

.login-btn:hover .login-btn__heart {
    transform: scale(1.1);
}

.login-btn:active {
    transform: translateY(-1px);
}

.login-btn:active .login-btn__heart {
    transform: scale(1.05);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer p {
    color: #ccc;
    margin: 10px 0;
}

.login-footer a {
    color: #ffd700;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: #ffed4e;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.error-message {
    color: #ff8fa3;
    text-align: center;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 140, 160, 0.12);
    border: 1px solid rgba(255, 140, 160, 0.25);
    display: none;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
}

.error-message.message--success {
    color: #7dd3a0;
    background: rgba(125, 211, 160, 0.15);
    border-color: rgba(125, 211, 160, 0.35);
}

.scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Loading overlay (after login, until scene ready) */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: loadingSpin 0.9s linear infinite;
}

@keyframes loadingSpin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: #ccc;
    font-size: 1.1rem;
    margin: 0;
}

/* Welcome toast (once per session when galaxy appears) */
.welcome-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #ffd700;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 1rem;
    text-align: center;
    z-index: 1500;
    border: 1px solid rgba(255, 215, 0, 0.3);
    animation: fadeIn 0.4s ease-out;
    pointer-events: none;
}

/* Intro Showcase: Prezi-style infinite canvas (mobile-first) */
.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    z-index: 9999;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}

.prezi-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none;
}

.prezi-canvas {
    --prezi-x: 0;
    --prezi-y: 0;
    --prezi-scale: 1;
    --prezi-rotate: 0;
    --prezi-cx: 3000;
    --prezi-cy: 2000;
    position: absolute;
    left: 50vw;
    top: 50vh;
    width: 6000px;
    height: 4000px;
    margin-left: -3000px;
    margin-top: -2000px;
    transform-origin: 0 0;
    transform:
        scale(calc(1 / var(--prezi-scale)))
        translate(calc((var(--prezi-cx) - var(--prezi-x)) * 1px), calc((var(--prezi-cy) - var(--prezi-y)) * 1px))
        rotate(calc(-1 * var(--prezi-rotate) * 1deg));
    transition: transform 1s cubic-bezier(0.65, 0, 0.35, 1);
    transform-style: preserve-3d;
    will-change: transform;
}

.prezi-frame {
    position: absolute;
    width: 800px;
    height: 600px;
    left: 0;
    top: 0;
    transform-origin: center center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

.prezi-frame img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.prezi-frame p {
    color: #fff;
    font-size: 1.25rem;
    line-height: 1.6;
    margin: 0;
}

.prezi-frame__title {
    color: #ffd700;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.prezi-frame__subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0.5rem 0 0 0;
    max-width: 32em;
    white-space: pre-line;
    max-height: 50vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.4) transparent;
}

.prezi-frame__subtitle::-webkit-scrollbar {
    width: 6px;
}

.prezi-frame__subtitle::-webkit-scrollbar-track {
    background: transparent;
}

.prezi-frame__subtitle::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.35);
    border-radius: 3px;
}

.prezi-frame__subtitle::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

.prezi-frame__fun-facts {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    color: rgba(255, 255, 255, 0.9);
}

.prezi-frame__fun-facts .fun-fact {
    font-size: 1.1rem;
    line-height: 1.5;
}

.prezi-frame__fun-facts .fun-fact::before {
    content: '✦ ';
    color: #ffd700;
    margin-right: 0.25em;
}

/* Micro-slide: hidden until camera zooms in (scale >= 10) */
.prezi-micro {
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.prezi-micro.prezi-micro-visible {
    opacity: 1;
    pointer-events: auto;
    z-index: 10;
}

/* Enter button fixed over viewport */
.intro-screen .intro-enter-btn {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    min-height: 48px;
    padding: 14px 32px;
    border: none;
    border-radius: 24px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
    -webkit-tap-highlight-color: transparent;
    z-index: 1000;
}

.intro-screen .intro-enter-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.intro-screen .intro-enter-btn:active {
    transform: translateX(-50%) translateY(0);
}

@media (min-width: 500px) {
    .prezi-frame p {
        font-size: 1.35rem;
    }
    .intro-screen .intro-enter-btn {
        font-size: 18px;
    }
} 