/* Styles for the hidden extras in assets/js/konami.js. Nothing here affects normal pages. */
/* Konami Code Easter Egg Animation */
.barrel-roll {
    -webkit-animation: barrelRoll 2s ease 1 normal;
    animation: barrelRoll 2s ease 1 normal;
}

@-webkit-keyframes barrelRoll {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

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

/*
   HALO EASTER EGG ANIMATIONS
   Inspired by: Halo 3 (Grunt Birthday), Reach (Armor Lock), Halo 2 (Super Bounce), Halo 1 (Shields)
*/

/* STAGE 1: GRUNT BIRTHDAY PARTY */
.halo-grunt-yay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    font-size: 4rem;
    font-weight: bold;
    color: #32CD32; /* Lime green */
    text-shadow: 2px 2px 0 #000;
    pointer-events: none;
    z-index: 2000; /* Easter Eggs stay above normal UI (Bootstrap modals ~1050) */
    animation: gruntPop 1s ease-out forwards;
}

@keyframes gruntPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -150%) scale(1); opacity: 0; }
}

.halo-confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    z-index: 1999;
    pointer-events: none;
    animation: confettiExplosion 1.5s ease-out forwards;
}

@keyframes confettiExplosion {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) rotate(720deg); opacity: 0; }
}

/* STAGE 2: ARMOR LOCK (Reach) */
.halo-armor-lock {
    /* Freeze frame visual */
    filter: contrast(1.2) brightness(1.1) drop-shadow(0 0 10px #00ffff);
    /* "Locked" state */
    overflow: hidden;
    /* pointer-events: none; - Removed to allow interaction per review */
    animation: armorLockShake 0.1s infinite;
}

/* Overlay for tint to avoid using !important on body background */
.halo-armor-lock::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(224, 255, 255, 0.8); /* Cyan tint */
    box-shadow: inset 0 0 100px #00ffff;
    z-index: 2005;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.sandtrap-shake {
    animation: armorLockShake 0.1s ease-in-out;
    animation-iteration-count: 5; /* 0.5s duration approx */
}

@keyframes armorLockShake {
    0% { transform: translate(1px, 1px) scale(0.995); }
    50% { transform: translate(-1px, -1px) scale(0.995); }
    100% { transform: translate(1px, -1px) scale(0.995); }
}

/* STAGE 3: SUPER BOUNCE (Halo 2 Glitches) */
.halo-super-bounce {
    /* Simulating active camo + glitched physics */
    animation: superBounce 1.5s ease-in-out;
    filter: blur(2px) opacity(0.8); /* Reduced blur for accessibility */
}

@keyframes superBounce {
    0% { transform: translateY(0); }
    40% { transform: translateY(-30vh) scale(0.9); }
    100% { transform: translateY(0) scale(1); }
}

/* STAGE 4: SHIELD RECHARGE (Halo 1) */
.halo-shield-recharge::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2001;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 215, 0, 0.4) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shieldWipe 1.5s ease-out forwards;
    pointer-events: none;
}

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

/* SANDTRAP EASTER EGG */
#sandtrap-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2002;
}

.davinci-egg-canvas {
    position: absolute;
    top: 50px;
    width: 80px;
    height: 80px;
    opacity: 0;
    filter: drop-shadow(0 0 10px rgba(100, 100, 255, 0.4));
    animation: eggAppear 1s ease-out forwards;
}

@keyframes eggAppear {
    from { transform: translateY(-100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.guardian-beam {
    position: absolute;
    top: 50%; /* Center of canvas */
    left: 50%;
    width: 6px; /* Slightly wider beam */
    height: 0;
    background: linear-gradient(to bottom, rgba(255, 69, 0, 0.8), rgba(255, 69, 0, 0.4), transparent);
    transform: translateX(-50%);
    box-shadow: 0 0 25px 8px rgba(255, 69, 0, 0.6); /* Softer, wider glow */
    mix-blend-mode: screen; /* Blend with background for more sci-fi look */
    animation: fireBeam 0.2s linear forwards;
}

@keyframes fireBeam {
    to { height: 150vh; } /* Shoot off screen */
}

.halo-kill-feed {
    position: fixed;
    bottom: 40px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    font-size: 14px;
    z-index: 2003;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 3px solid #ff4500;
    animation: feedSlideIn 0.3s ease-out;
}

@keyframes feedSlideIn {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.kill-guardian {
    color: #ffcc00; /* Gold for Guardians */
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .barrel-roll,
    .halo-grunt-yay,
    .halo-confetti,
    .halo-armor-lock,
    .halo-super-bounce,
    .halo-shield-recharge::after,
    .davinci-egg-canvas,
    .guardian-beam,
    .halo-kill-feed,
    .sandtrap-shake {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }

    .halo-armor-lock::after {
        opacity: 0.5; /* Just show static tint */
    }

    /* Fallback visual cues */
    .halo-grunt-yay {
        opacity: 1;
        display: block;
    }
}

/*
   STAR TREK EASTER EGG ANIMATIONS
   Warp speed ("engage"), Red Alert ("redalert"), Transporter ("makeitso"), LCARS ("lcars")
*/

.trek-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2002;
}

.trek-warp-flash::after {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(219, 234, 254, 0.75), rgba(153, 204, 255, 0.25), transparent 70%);
    pointer-events: none;
    z-index: 2004;
    animation: trekWarpFlash 0.5s ease-out forwards;
}

@keyframes trekWarpFlash {
    0% { opacity: 0; transform: scale(0.4); }
    45% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0; transform: scale(1.4); }
}

.trek-red-alert::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(180, 15, 25, 0.14);
    box-shadow: inset 0 0 120px rgba(255, 38, 38, 0.75);
    pointer-events: none;
    z-index: 2001;
    animation: trekRedAlertPulse 0.85s ease-in-out infinite alternate;
}

@keyframes trekRedAlertPulse {
    0% { opacity: 0.35; }
    100% { opacity: 0.95; }
}

.trek-red-alert-banner {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(24, 6, 8, 0.92);
    color: #ff6b6b;
    border: 2px solid #ff3b3b;
    border-radius: 6px;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    z-index: 2006;
    pointer-events: none;
    box-shadow: 0 0 24px rgba(255, 59, 59, 0.45);
    animation: trekBannerPulse 0.85s ease-in-out infinite alternate;
}

@keyframes trekBannerPulse {
    0% { border-color: #ff3b3b; color: #ff8585; }
    100% { border-color: #ff9900; color: #ffd166; }
}

.trek-transporter-sweep {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2003;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(125, 249, 255, 0.14) 40%,
        rgba(255, 209, 102, 0.32) 50%,
        rgba(125, 249, 255, 0.14) 60%,
        transparent 100%
    );
    background-size: 100% 200%;
    animation: trekBeamSweep 2.4s ease-in-out forwards;
}

@keyframes trekBeamSweep {
    0% { background-position: 0 180%; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { background-position: 0 -100%; opacity: 0; }
}

.trek-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    background: #141624;
    color: #f4f1e4;
    border: 2px solid #ff9900;
    border-radius: 999px;
    overflow: hidden;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    z-index: 2006;
    pointer-events: none;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    animation: trekSlideUp 0.25s ease-out;
}

.trek-toast__badge {
    background: #ff9900;
    color: #141624;
    padding: 8px 14px;
    font-weight: 800;
}

.trek-toast__text {
    padding: 8px 16px;
    color: #99ccff;
}

.trek-lcars-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: min(360px, calc(100vw - 32px));
    background: #111320;
    color: #f4f1e4;
    border-radius: 20px 8px 8px 20px;
    border: 2px solid #ff9900;
    overflow: hidden;
    z-index: 2006;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
    font-family: var(--font-mono, ui-monospace, monospace);
    animation: trekSlideUp 0.25s ease-out;
}

.trek-lcars-panel__elbow {
    background: linear-gradient(90deg, #ff9900 0%, #ff9900 58%, #cc99cc 58%, #cc99cc 84%, #99ccff 84%);
    color: #111320;
    padding: 8px 16px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.trek-lcars-panel__body {
    padding: 14px 16px;
}

.trek-lcars-panel__title {
    color: #ff9900;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.trek-lcars-panel__list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
    margin: 0 0 12px;
    font-size: 0.8rem;
}

.trek-lcars-panel__list dt {
    color: #cc99cc;
    font-weight: 700;
}

.trek-lcars-panel__list dd {
    margin: 0;
    color: #99ccff;
}

.trek-lcars-panel__close {
    background: #ff9900;
    color: #111320;
    border: none;
    border-radius: 999px;
    padding: 5px 14px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    cursor: pointer;
}

.trek-lcars-panel__close:hover,
.trek-lcars-panel__close:focus-visible {
    background: #99ccff;
    outline: 2px solid #f4f1e4;
    outline-offset: 2px;
}

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

@media (prefers-reduced-motion: reduce) {
    .trek-warp-flash::after,
    .trek-red-alert::after,
    .trek-red-alert-banner,
    .trek-transporter-sweep,
    .trek-toast,
    .trek-lcars-panel {
        animation: none !important;
        transition: none !important;
    }

    .trek-red-alert::after {
        opacity: 0.65;
    }
}
