/* Flag easter egg: spin animation + retro CRT terminal overlay. */

#secret-flag {
    cursor: pointer;
}

@keyframes egg-flag-spin {
    0% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(360deg) scale(1.6);
    }

    100% {
        transform: rotate(720deg) scale(1);
    }
}

.egg-flag-spin {
    animation: egg-flag-spin 0.7s ease-in-out;
}

#egg-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #000;
    color: #33ff66;
    font-family: "Source Code Pro", monospace;
}

/* Darkened, pixelated Swiss flag backdrop. */
#egg-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/static/img/flag.png") center / min(70vmin, 560px) no-repeat;
    image-rendering: pixelated;
    filter: brightness(0.22);
    pointer-events: none;
}

/* CRT scanlines. */
#egg-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 0px,
            rgba(0, 0, 0, 0) 2px,
            rgba(0, 0, 0, 0.3) 2px,
            rgba(0, 0, 0, 0.3) 4px);
    pointer-events: none;
}

.egg-terminal {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 28px 24px;
    box-sizing: border-box;
}

.egg-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: 0;
    color: #33ff66;
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    text-shadow: 0 0 6px rgba(51, 255, 102, 0.55);
}

.egg-close:hover {
    opacity: 1;
}

.egg-output {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(51, 255, 102, 0.4) transparent;
}

.egg-line {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    font-size: 15px;
    min-height: 1.5em;
    text-shadow: 0 0 6px rgba(51, 255, 102, 0.55);
}

.egg-label {
    font-weight: 700;
    letter-spacing: 2px;
}

.egg-ok {
    color: #aaffbb;
}

.egg-err {
    color: #ff5555;
    text-shadow: 0 0 6px rgba(255, 85, 85, 0.55);
}

.egg-dim {
    opacity: 0.55;
}

.egg-echo {
    opacity: 0.8;
}

.egg-input-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
}

.egg-prompt {
    text-shadow: 0 0 6px rgba(51, 255, 102, 0.55);
}

.egg-input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: none;
    color: inherit;
    font-family: inherit;
    font-size: 15px;
    caret-color: #33ff66;
    text-shadow: 0 0 6px rgba(51, 255, 102, 0.55);
}

.egg-textarea {
    width: 100%;
    min-height: 96px;
    margin-top: 10px;
    padding: 8px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(51, 255, 102, 0.45);
    outline: none;
    color: inherit;
    font-family: inherit;
    font-size: 15px;
    caret-color: #33ff66;
    resize: vertical;
}

@media only screen and (max-width: 600px) {
    .egg-terminal {
        padding: 20px 12px;
    }

    /* 16px prevents mobile browsers from zooming into the inputs. */
    .egg-line,
    .egg-input,
    .egg-textarea {
        font-size: 16px;
    }
}
