/* =====================================================================
   home-extras.css — extra home-page toys & effects
   Loaded only on the landing page. Theme-aware via the --accent vars
   defined in extras.css.
   ===================================================================== */

/* ---------------------------------------------------------------------
   7. Custom cursor + trailing particles
   --------------------------------------------------------------------- */
.cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent, #8B0000);
    pointer-events: none;
    z-index: 99990;
    opacity: 0.8;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px var(--accent-glow, rgba(139, 0, 0, 0.5));
    will-change: transform, opacity;
}

/* ---------------------------------------------------------------------
   8. Idle DVD screensaver
   --------------------------------------------------------------------- */
.idle-saver {
    position: fixed;
    inset: 0;
    z-index: 99980;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    cursor: none;
}
.idle-saver.show { display: block; }
.idle-dvd {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent, #8B0000);
    box-shadow: 0 0 30px var(--accent-glow, rgba(139, 0, 0, 0.6));
    will-change: left, top;
}
.idle-hint {
    position: absolute;
    bottom: 24px;
    left: 0;
    right: 0;
    text-align: center;
    color: #555;
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

/* ---------------------------------------------------------------------
   10. Spotlight / flashlight mode
   --------------------------------------------------------------------- */
.spotlight-overlay {
    position: fixed;
    inset: 0;
    z-index: 99970;
    pointer-events: none;
    display: none;
    background: radial-gradient(circle 140px at var(--mx, 50%) var(--my, 50%),
        transparent 0%, transparent 120px, rgba(0, 0, 0, 0.93) 220px);
}
.spotlight-overlay.show { display: block; }

/* ---------------------------------------------------------------------
   1. Glitch / corruption mode
   --------------------------------------------------------------------- */
html.fx-glitch body {
    animation: fx-glitch-shake 0.18s steps(2) infinite;
}
html.fx-glitch body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 99960;
    pointer-events: none;
    background:
        repeating-linear-gradient(0deg, rgba(255, 0, 0, 0.06) 0 2px, transparent 2px 4px),
        repeating-linear-gradient(90deg, rgba(0, 255, 255, 0.05) 0 3px, transparent 3px 6px);
    mix-blend-mode: screen;
    animation: fx-glitch-flicker 0.12s steps(2) infinite;
}
@keyframes fx-glitch-shake {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-3px, 1px); filter: hue-rotate(20deg); }
    50% { transform: translate(2px, -2px); }
    75% { transform: translate(-2px, -1px); filter: hue-rotate(-25deg); }
    100% { transform: translate(0, 0); }
}
@keyframes fx-glitch-flicker {
    0% { opacity: 0.6; transform: translateX(0); }
    50% { opacity: 0.9; transform: translateX(4px); }
    100% { opacity: 0.5; transform: translateX(-3px); }
}
.glitch-block {
    position: fixed;
    z-index: 99961;
    pointer-events: none;
    mix-blend-mode: screen;
    overflow: hidden;
}

/* ---------------------------------------------------------------------
   5. Earthquake
   --------------------------------------------------------------------- */
html.fx-quake body {
    animation: fx-quake 0.1s linear infinite;
}
@keyframes fx-quake {
    0% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(-6px, 4px) rotate(-0.4deg); }
    40% { transform: translate(5px, -5px) rotate(0.3deg); }
    60% { transform: translate(-4px, 3px) rotate(0.2deg); }
    80% { transform: translate(6px, 2px) rotate(-0.3deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* ---------------------------------------------------------------------
   4. Matrix rain
   --------------------------------------------------------------------- */
#matrix-canvas {
    position: fixed;
    inset: 0;
    z-index: 99950;
    pointer-events: none;
    display: none;
}
#matrix-canvas.show { display: block; }

/* ---------------------------------------------------------------------
   3. Vaporwave takeover
   --------------------------------------------------------------------- */
html.fx-vapor body {
    background: linear-gradient(180deg, #2b1055 0%, #7597de 100%) !important;
}
.vapor-layer {
    position: fixed;
    inset: 0;
    z-index: 99940;
    pointer-events: none;
    overflow: hidden;
}
.vapor-sun {
    position: absolute;
    left: 50%;
    top: 26%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff200 0%, #ff6 75 40%, #ff2d95 100%);
    box-shadow: 0 0 80px rgba(255, 45, 149, 0.6);
}
.vapor-grid {
    position: absolute;
    left: -50%;
    right: -50%;
    bottom: 0;
    height: 50%;
    background-image:
        linear-gradient(rgba(255, 45, 149, 0.6) 2px, transparent 2px),
        linear-gradient(90deg, rgba(255, 45, 149, 0.6) 2px, transparent 2px);
    background-size: 60px 60px;
    transform: perspective(300px) rotateX(60deg);
    animation: vapor-scroll 1.4s linear infinite;
}
@keyframes vapor-scroll {
    from { background-position: 0 0; }
    to { background-position: 0 60px; }
}
.vapor-word {
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Ubuntu', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 3px 3px 0 #ff2d95, -3px -3px 0 #00fff2;
    letter-spacing: 0.3em;
}

/* ---------------------------------------------------------------------
   2. Y2K / Win98 mode
   --------------------------------------------------------------------- */
html.fx-y2k body {
    background: #008080 !important;
}
.y2k-taskbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 34px;
    z-index: 99931;
    background: #c0c0c0;
    border-top: 2px solid #fff;
    display: flex;
    align-items: center;
    padding: 0 4px;
    font-family: 'Tahoma', 'MS Sans Serif', sans-serif;
    font-size: 12px;
    color: #000;
}
.y2k-start {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    padding: 3px 10px;
    border: 2px outset #fff;
    background: #c0c0c0;
    cursor: pointer;
}
.y2k-clock {
    margin-left: auto;
    padding: 3px 10px;
    border: 1px inset #fff;
    background: #c0c0c0;
}
.y2k-window {
    position: fixed;
    z-index: 99930;
    background: #c0c0c0;
    border: 2px outset #fff;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.4);
    font-family: 'Tahoma', 'MS Sans Serif', sans-serif;
    min-width: 280px;
}
.y2k-titlebar {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 3px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    user-select: none;
}
.y2k-titlebar button {
    width: 16px;
    height: 14px;
    border: 1px outset #fff;
    background: #c0c0c0;
    font-size: 9px;
    line-height: 1;
    cursor: pointer;
}
.y2k-body {
    padding: 14px;
    color: #000;
    font-size: 12px;
    line-height: 1.5;
}

/* ---------------------------------------------------------------------
   13. Click combo meter
   --------------------------------------------------------------------- */
.combo-meter {
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    z-index: 99920;
    font-family: 'Ubuntu', sans-serif;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s;
}
.combo-meter.show { opacity: 1; }
.combo-meter .combo-num {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent, #8B0000);
    text-shadow: 0 0 18px var(--accent-glow, rgba(139, 0, 0, 0.7));
    line-height: 1;
}
.combo-meter .combo-label {
    font-size: 0.85rem;
    color: #ddd;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* ---------------------------------------------------------------------
   15. Secret terminal
   --------------------------------------------------------------------- */
.term-overlay {
    position: fixed;
    inset: 0;
    z-index: 99910;
    background: rgba(0, 10, 0, 0.92);
    display: none;
    flex-direction: column;
    font-family: 'Courier New', monospace;
    padding: 18px;
    box-sizing: border-box;
}
.term-overlay.show { display: flex; }
.term-out {
    flex: 1;
    overflow-y: auto;
    color: #33ff66;
    font-size: 0.95rem;
    line-height: 1.45;
    white-space: pre-wrap;
    text-shadow: 0 0 6px rgba(51, 255, 102, 0.5);
}
.term-line { display: flex; align-items: baseline; }
.term-prompt { color: #33ff66; margin-right: 8px; }
.term-input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: #33ff66;
    font-family: inherit;
    font-size: 0.95rem;
    text-shadow: 0 0 6px rgba(51, 255, 102, 0.5);
}

/* ---------------------------------------------------------------------
   16/17/18. Visitor chip (live count + greeting)
   --------------------------------------------------------------------- */
.visitor-chip {
    margin: 0.6rem auto 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cfcfd6;
    font-size: 0.8rem;
    font-family: 'Ubuntu', sans-serif;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.visitor-chip .live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #43b581;
    box-shadow: 0 0 6px #43b581;
    animation: vc-pulse 1.6s ease-in-out infinite;
}
@keyframes vc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* throwable avatar gets a grab cursor */
.avatar.throwable { cursor: grab; }
.avatar.throwable:active { cursor: grabbing; }
