/* This is for all the CSS related to the Crash Sequence Easter Eggs */

#crash-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #008080;
    font-family: 'MS Sans Serif', 'Courier New', monospace;
    font-size: 12px;
    overflow: hidden;
    cursor: default;
    user-select: none;
    animation: textShadow 1.6s infinite;
}

#crash-overlay::before {
    content: " ";
    display: block;
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    z-index: 10001;
    pointer-events: none;
}

#crash-overlay::after {
    content: " ";
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 10001;
    pointer-events: none;
    animation: flicker 4s infinite;
}

.desktop {
    position: absolute;
    inset: 0;
    bottom: 28px;
}

@keyframes crashShake {
    0%,  100% { transform: translate(0,    0   ); }
    10%       { transform: translate(-5px,  2px); }
    20%       { transform: translate( 4px, -3px); }
    30%       { transform: translate(-3px,  5px); }
    40%       { transform: translate( 5px, -2px); }
    50%       { transform: translate(-6px,  1px); }
    60%       { transform: translate( 4px,  4px); }
    70%       { transform: translate(-2px, -5px); }
    80%       { transform: translate( 3px,  3px); }
    90%       { transform: translate(-4px, -1px); }
}

.desktop.shaking {
    animation: crashShake 0.08s infinite;
}

.desktop-icon {
    position: absolute;
    width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.desktop-icon:hover .icon-img {
    outline: 1px dotted white;
}

.icon-img   { font-size: 28px; line-height: 1; }
.icon-label {
    color: white;
    font-size: 11px;
    text-align: center;
    text-shadow: 1px 1px 2px #000;
    word-break: break-word;
}

.win9x-taskbar {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 28px;
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    display: flex;
    align-items: center;
    padding: 2px 4px;
    gap: 4px;
    box-shadow: inset 0 1px 0 #808080;
}

.start-btn {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 2px 8px 2px 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.taskbar-item {
    background: #c0c0c0;
    border: 1px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 2px 8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.taskbar-item.active {
    border-color: #808080 #ffffff #ffffff #808080;
    background: #d4d0c8;
}

.taskbar-clock {
    margin-left: auto;
    border: 1px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 2px 8px;
    font-size: 11px;
    white-space: nowrap;
}

.win9x-window {
    position: absolute;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    box-shadow: 2px 2px 0 #000;
}

.win9x-titlebar {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: #ffffff;
    padding: 3px 4px 3px 6px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
    overflow: hidden;
}

.win9x-titlebar-btns { display: flex; gap: 2px; flex-shrink: 0; }

.win9x-btn {
    width: 16px; height: 14px;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    font-size: 9px;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
}

.notepad-content {
    background: #ffffff;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    margin: 4px;
    padding: 6px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
    color: #000;
    white-space: pre;
    min-height: 120px;
}

.error-dialog .win9x-content {
    padding: 12px 14px 8px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 11px;
    white-space: pre-line;
    line-height: 1.5;
}

.win9x-icon { font-size: 26px; flex-shrink: 0; margin-top: 2px; }

.win9x-btns {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 6px 8px 10px;
}

.win9x-action-btn {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 3px 0;
    font-size: 12px;
    font-family: 'MS Sans Serif', 'Courier New', monospace;
    cursor: pointer;
    min-width: 75px;
    text-align: center;
    color: #000;
}

.win9x-action-btn:active {
    border-color: #808080 #ffffff #ffffff #808080;
}

#flash-screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: clamp(13px, 2.2vw, 20px);
    text-align: center;
    padding: 40px;
    opacity: 0;          /* invisible until runFlash() sets opacity: 1 */
    pointer-events: none;
    white-space: pre-line;
    line-height: 1.6;
}

@keyframes overlayExit {
    0%   { opacity: 1; background: #0000AA; }
    100% { opacity: 0; background: #0000AA; }
}

#crash-overlay.exiting {
    animation: overlayExit 0.35s ease-in forwards;
    pointer-events: none;
}

.stop-code {
    margin-top: 2vh;
    font-size: 0.85em;
    opacity: 0.85;
    letter-spacing: 0.02em;
}

.clickable-code {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: background 0.1s, color 0.1s;
}

.clickable-code:hover {
    background: #ffffff;
    color: #0000AA;
}

#error-code-modal,
#teapot-modal {
    position: fixed;
    z-index: 99999;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    box-shadow: 4px 4px 0 #000;
    font-family: 'MS Sans Serif', 'Courier New', monospace;
    font-size: 12px;
}

#error-code-modal {
    width: clamp(280px, 40vw, 420px);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#teapot-modal {
    width: clamp(240px, 30vw, 340px);
    top: calc(50% + 40px);
    left: calc(50% + 40px);
    transform: translate(-50%, -50%);
}

#error-code-modal.hidden,
#teapot-modal.hidden {
    display: none;
}

.modal-titlebar {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: #ffffff;
    padding: 3px 4px 3px 6px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 14px 16px 8px;
    line-height: 1.6;
    color: #000;
}

.modal-body hr {
    border: none;
    border-top: 1px solid #808080;
    border-bottom: 1px solid #ffffff;
    margin: 8px 0;
}

.modal-body p { margin: 4px 0; }

.modal-footer {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px;
}
