* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family:
        'Noto Sans Mono',
        monospace,
        'Inter',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        'Open Sans',
        'Helvetica Neue',
        sans-serif;
    /* Disable text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Ensure cursor is default instead of text selection cursor */
html,
body,
div,
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
button {
    cursor: default;
}

/* Allow text selection in input fields and textareas */
input,
textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: text;
}

/* Allow cursor pointer on clickable elements */
button,
a,
[role='button'],
.power-button,
.redeem-button {
    cursor: pointer;
}

:root {
    --primary-color: #397195;
    --text-color: #f8fafc;
    --background-color: #000;
    --accent-color: #397195;
    --grid-color: rgba(212, 164, 56, 0.15);
    --scan-line-color: rgba(57, 113, 149, 0.1);
    --retro-color-1: rgba(106, 15, 241); /* #6A0FF1 */
    --retro-color-2: rgba(212, 164, 56); /* #D4A438 */
    --retro-color-3: rgba(228, 80, 53); /* #E45035 */
    --retro-color-4: rgba(104, 173, 91); /* #68AD5B */
    --color-1: #65bfff;
    --color-2: #ffaa71;
    --color-3: #3effb2;
    --color-4: #f77e7e;
    --color-5: #f47ef7;
    --color-6: #9de97f;
    --color-7: #cde97e;

    /* Conic gradient variables */
    --conic-color-1: rgba(212, 164, 56, 0.1); /* #D4A438 */
    --conic-color-2: rgba(228, 80, 53, 0.1); /* #E45035 */
    --conic-color-3: rgba(106, 15, 241, 0.1); /* #6A0FF1 */
    --conic-color-4: rgba(104, 173, 91, 0.1); /* #68AD5B */

    /* Grid variables */
    --grid-size: 150px;
    --grid-line-color: rgba(104, 173, 91, 0.3);
    --grid-perspective: 1000px;
    --grid-rotation: 60deg;
    --grid-height: 150%;
    --grid-animation-duration: 20s;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: var(--background-color);
    color: var(--text-color);
    position: relative;
}

/* Add CSS grid effect */
body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -50%;
    width: 200%;
    height: var(--grid-height);
    background-image:
        linear-gradient(to bottom, rgba(57, 113, 149, 0) 0%, var(--grid-color) 100%),
        linear-gradient(to right, var(--grid-line-color) 3px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line-color) 4px, transparent 1px);
    background-size:
        100% 100%,
        var(--grid-size) 100%,
        100% var(--grid-size);
    transform: perspective(var(--grid-perspective)) rotateX(var(--grid-rotation));
    transform-origin: bottom;
    z-index: 0;
    pointer-events: none;
    animation: gridMove var(--grid-animation-duration) linear infinite;
    opacity: 0;
    transition: opacity 1.5s ease;
}

body.power-on::after {
    opacity: 1;
}

.container {
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(
        circle at center,
        rgba(57, 113, 149, 0.15) 0%,
        rgba(0, 0, 0, 0) 70%
    );
    position: relative;
    overflow: hidden;
}

/* CRT screen effect */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        var(--scan-line-color) 2px,
        var(--scan-line-color) 4px
    );
    pointer-events: none;
    opacity: 0.3;
    z-index: 1;
}

/* CRT screen curvature */
/* .container::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    pointer-events: none;
    z-index: 2;
    border-radius: 30% / 10%;
    box-shadow: inset 0 0 20px 10px rgba(0, 0, 0, 0.5);
} */

.content {
    text-align: center;
    max-width: 600px;
    padding: 2rem;
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    z-index: 3;
}

.title {
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
    position: relative;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    background-image: linear-gradient(
        0deg,
        var(--retro-color-1) 0%,
        var(--retro-color-1) 25%,
        var(--retro-color-2) 25%,
        var(--retro-color-2) 50%,
        var(--retro-color-3) 50%,
        var(--retro-color-3) 75%,
        var(--retro-color-4) 75%,
        var(--retro-color-4) 100%
    );
    text-shadow:
        3px 3px 0 rgba(0, 0, 0, 0.4),
        6px 6px 0 rgba(0, 0, 0, 0.2);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

/* Title letter animation styles */
.title span {
    display: inline-block;
    transform-origin: center;
    backface-visibility: hidden;
    will-change: transform, opacity;
    margin: 0 0.01em;
}

/* Add a bit more space before the "fun" part */
.title span:nth-child(3) {
    margin-right: 0.05em;
}

.subtitle-container {
    margin-bottom: 2rem;
    min-height: 30px; /* Ensure consistent height */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.subtitle {
    font-size: 1.5rem;
    margin-bottom: 0; /* Remove margin since container has margin */
    opacity: 0;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
    text-shadow: 0 0 5px rgba(57, 113, 149, 0.5);
    animation: subtitleTextGlitch 6s infinite;
    white-space: nowrap; /* Prevent text wrapping */
    min-width: 150px; /* Set a minimum width to prevent layout shifts */
    overflow: hidden; /* Prevent overflow during extreme glitch effects */
}

/* Animation for the subtitle text itself */
@keyframes subtitleTextGlitch {
    0%,
    100% {
        opacity: 0.8;
        transform: translateX(0);
    }
    88%,
    90% {
        opacity: 0.9;
        transform: translateX(-1px);
        text-shadow:
            -1px 0 0 rgba(255, 0, 0, 0.5),
            1px 1px 0 rgba(0, 255, 255, 0.5);
    }
    92%,
    94% {
        opacity: 1;
        transform: translateX(1px);
        text-shadow:
            1px 0 0 rgba(255, 0, 0, 0.5),
            -1px -1px 0 rgba(0, 255, 255, 0.5);
    }
    96% {
        opacity: 0.9;
        transform: translateX(0);
    }
}

/* Subtitle glitch animation */
@keyframes subtitleGlitch {
    0%,
    100% {
        transform: translateX(0);
        clip-path: none;
        opacity: 0.7;
    }
    5%,
    10% {
        transform: translateX(-3px);
        clip-path: inset(0 0 50% 0);
        opacity: 0.9;
    }
    15% {
        transform: translateX(3px);
        text-shadow:
            -2px 0 0 rgba(255, 0, 0, 0.7),
            2px 2px 0 rgba(0, 255, 255, 0.7);
    }
    20% {
        transform: translateX(0);
        clip-path: inset(50% 0 0 0);
        opacity: 0.8;
    }
    25% {
        clip-path: none;
        text-shadow:
            2px 0 0 rgba(255, 0, 0, 0.7),
            -2px -2px 0 rgba(0, 255, 255, 0.7);
    }
    30% {
        letter-spacing: 2px;
        opacity: 1;
    }
    35% {
        letter-spacing: 1px;
        opacity: 0.8;
    }
    40%,
    45% {
        transform: translateY(-1px) skewX(3deg);
        text-shadow:
            -2px 0 0 rgba(255, 0, 0, 0.7),
            2px 2px 0 rgba(0, 255, 255, 0.7),
            0 -2px 0 rgba(0, 255, 0, 0.5);
        opacity: 1;
    }
    50%,
    55% {
        transform: translateY(1px) skewX(-2deg);
        opacity: 0.9;
    }
    60%,
    100% {
        transform: translateX(0);
        text-shadow: 0 0 5px rgba(57, 113, 149, 0.5);
        opacity: 0.7;
    }
}

.cta {
    position: relative;
    z-index: 10;
}

/* Loading indicator styles */
.loading-container {
    width: 360px;
    position: relative;
    margin: 0 auto;
    text-align: center;
}

.loading-bar {
    height: 30px;
    width: 0%;
    background: linear-gradient(
        90deg,
        var(--conic-color-1) 0%,
        var(--conic-color-2) 25%,
        var(--conic-color-3) 50%,
        var(--conic-color-4) 75%,
        var(--conic-color-1) 100%
    );
    background-size: 400% 100%;
    position: relative;
    overflow: hidden;
    transition: width 0.1s ease-in-out;
    animation: gradientMove 2s linear infinite;
}

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

.loading-text {
    margin-top: 10px;
    font-family: 'Noto Sans Mono', monospace;
    font-weight: bold;
    background: linear-gradient(
        90deg,
        rgba(104, 173, 91, 0.3) 0%,
        /* var(--retro-color-4) with opacity */ rgba(228, 80, 53, 0.3) 25%,
        /* var(--retro-color-3) with opacity */ rgba(106, 15, 241, 0.3) 50%,
        /* var(--retro-color-1) with opacity */ rgba(212, 164, 56, 0.3) 75%,
        /* var(--retro-color-2) with opacity */ rgba(104, 173, 91, 0.3) 100%
            /* var(--retro-color-4) with opacity */
    );
    background-size: 400% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 5px rgba(57, 113, 149, 0.5);
    letter-spacing: 1px;
    /* animation: gradientMove 2s linear infinite; */
}

.loading-percentage {
    font-weight: bold;
    background: linear-gradient(
        90deg,
        rgba(104, 173, 91, 0.1) 0%,
        /* var(--retro-color-4) with opacity */ rgba(228, 80, 53, 0.1) 25%,
        /* var(--retro-color-3) with opacity */ rgba(106, 15, 241, 0.1) 50%,
        /* var(--retro-color-1) with opacity */ rgba(212, 164, 56, 0.1) 75%,
        /* var(--retro-color-2) with opacity */ rgba(104, 173, 91, 0.1) 100%
            /* var(--retro-color-4) with opacity */
    );
    background-size: 400% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    /* animation: gradientMove 2s linear infinite; */
}

/* CRT flicker animation */
@keyframes flicker {
    0% {
        opacity: 0.97;
    }
    5% {
        opacity: 0.9;
    }
    10% {
        opacity: 0.97;
    }
    15% {
        opacity: 0.92;
    }
    20% {
        opacity: 0.97;
    }
    50% {
        opacity: 0.96;
    }
    80% {
        opacity: 0.97;
    }
    90% {
        opacity: 0.9;
    }
    100% {
        opacity: 0.97;
    }
}

/* CRT RGB split effect */
@keyframes rgbSplit {
    0%,
    100% {
        text-shadow:
            -1px 0 0 rgba(255, 0, 0, 0.3),
            1px 0 0 rgba(0, 255, 255, 0.3);
    }
    50% {
        text-shadow:
            -1.5px 0 0 rgba(255, 0, 0, 0.3),
            1.5px 0 0 rgba(0, 255, 255, 0.3);
    }
}

body {
    animation: flicker 0.3s infinite alternate-reverse;
}

.title,
.subtitle {
    animation: rgbSplit 3s infinite alternate;
}

/* CRT turn off animation */
@keyframes crtOff {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    10% {
        transform: scale(1, 0.9);
        opacity: 1;
    }
    30% {
        transform: scale(1, 0.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(0, 0.1);
        opacity: 0;
    }
}

/* CRT turn on animation */
@keyframes crtOn {
    0% {
        transform: scale(0, 0.1);
        opacity: 0;
    }
    10% {
        transform: scale(1, 0.1);
        opacity: 0.3;
    }
    30% {
        transform: scale(1, 0.5);
        opacity: 0.7;
    }
    60% {
        transform: scale(1, 0.9);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Static noise effect */
@keyframes staticNoise {
    0%,
    100% {
        background-position: 0 0;
    }
    10% {
        background-position: -5% -10%;
    }
    20% {
        background-position: -15% 5%;
    }
    30% {
        background-position: 7% -25%;
    }
    40% {
        background-position: 20% 25%;
    }
    50% {
        background-position: -25% 10%;
    }
    60% {
        background-position: 15% 5%;
    }
    70% {
        background-position: 0% 15%;
    }
    80% {
        background-position: 25% 35%;
    }
    90% {
        background-position: -10% 10%;
    }
}

.static-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/><feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.5 0"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)"/></svg>');
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    mix-blend-mode: overlay;
}

.static-overlay.active {
    opacity: 0.1;
    animation: staticNoise 0.2s steps(2) infinite;
}

.crt-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0),
        rgba(0, 0, 0, 0) 1px,
        rgba(57, 113, 149, 0.03) 1px,
        rgba(57, 113, 149, 0.03) 2px
    );
    pointer-events: none;
    z-index: 4;
}

@media (max-width: 768px) {
    .title {
        font-size: 3.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }
}

/* Power off state for body */
.power-off-body {
    animation: none !important;
    background-image: none !important;
}

.power-off-body .container::before,
.power-off-body .container::after {
    opacity: 0 !important;
}

/* Don't override container animation when powering off */
.power-off-body .container {
    /* Animation will be set via JavaScript */
}

.power-off-body .title,
.power-off-body .subtitle {
    animation: none !important;
}

/* Power indicator light */
.power-indicator {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ff3333;
    top: 10px;
    right: 10px;
    box-shadow: 0 0 10px #ff3333;
    opacity: 0;
    transition: all 0.3s ease;
}

.power-indicator.on {
    background-color: #7dc6b1;
    box-shadow: 0 0 10px #7dc6b1;
    opacity: 1;
}

.power-indicator.off {
    background-color: #ff3333;
    box-shadow: 0 0 10px #ff3333;
    opacity: 1;
}

.redeem-container {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.redeem-button {
    background: linear-gradient(135deg, #f4d03f 0%, #f39c12 100%);
    opacity: 1;
    color: #2c3e50;
    border: 4px solid #8e44ad;
    padding: 16px 32px;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    box-shadow:
        4px 4px 0px #8e44ad,
        8px 8px 0px #6c3483,
        0 0 20px rgba(244, 208, 63, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 16px;
    font-family: 'Noto Sans Mono', monospace;
    animation: buttonFlicker 2.5s infinite;
}

/* Hover state for redeem button */
.redeem-button:hover {
    background: linear-gradient(135deg, #f7dc6f 0%, #e67e22 100%);
    box-shadow:
        6px 6px 0px #8e44ad,
        10px 10px 0px #6c3483,
        0 0 30px rgba(244, 208, 63, 0.5);
    transform: scale(1.02);
}

.redeem-button:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.1),
        transparent 50%,
        rgba(0, 0, 0, 0.05)
    );
    pointer-events: none;
    border-radius: 12px;
}

.redeem-button:active {
    transform: scale(0.98) translate(2px, 2px);
    box-shadow:
        2px 2px 0px #8e44ad,
        4px 4px 0px #6c3483,
        0 0 15px rgba(244, 208, 63, 0.3);
    background: linear-gradient(135deg, #f1c40f 0%, #d68910 100%);
    animation: none;
}

.redeem-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s ease;
    border-radius: 16px;
}

.redeem-button:hover::before {
    left: 100%;
}

/* Button flicker animation */
@keyframes buttonFlicker {
    0% {
        opacity: 0.8;
        box-shadow:
            0 0 10px rgba(153, 69, 255, 0.7),
            inset 0 0 5px rgba(0, 0, 0, 0.5);
    }
    3% {
        opacity: 0.6;
        box-shadow:
            0 0 5px rgba(153, 69, 255, 0.4),
            inset 0 0 3px rgba(0, 0, 0, 0.5);
    }
    5% {
        opacity: 0.9;
        box-shadow:
            0 0 12px rgba(153, 69, 255, 0.8),
            inset 0 0 6px rgba(0, 0, 0, 0.5);
    }
    7% {
        opacity: 0.7;
        box-shadow:
            0 0 7px rgba(153, 69, 255, 0.5),
            inset 0 0 4px rgba(0, 0, 0, 0.5);
    }
    9% {
        opacity: 0.8;
        box-shadow:
            0 0 10px rgba(153, 69, 255, 0.7),
            inset 0 0 5px rgba(0, 0, 0, 0.5);
    }
    11% {
        opacity: 0.75;
        box-shadow:
            0 0 8px rgba(153, 69, 255, 0.6),
            inset 0 0 4px rgba(0, 0, 0, 0.5);
    }
    13% {
        opacity: 0.9;
        box-shadow:
            0 0 11px rgba(153, 69, 255, 0.8),
            inset 0 0 6px rgba(0, 0, 0, 0.5);
    }
    40% {
        opacity: 0.8;
        box-shadow:
            0 0 10px rgba(153, 69, 255, 0.7),
            inset 0 0 5px rgba(0, 0, 0, 0.5);
    }
    42% {
        opacity: 0.65;
        box-shadow:
            0 0 6px rgba(153, 69, 255, 0.5),
            inset 0 0 3px rgba(0, 0, 0, 0.5);
    }
    44% {
        opacity: 0.85;
        box-shadow:
            0 0 10px rgba(153, 69, 255, 0.7),
            inset 0 0 5px rgba(0, 0, 0, 0.5);
    }
    100% {
        opacity: 0.8;
        box-shadow:
            0 0 10px rgba(153, 69, 255, 0.7),
            inset 0 0 5px rgba(0, 0, 0, 0.5);
    }
}

/* Add this keyframes animation for the moving grid */
@keyframes gridMove {
    0% {
        background-position:
            0 0,
            0 0,
            0 0;
    }
    100% {
        background-position:
            0 0,
            0 100%,
            0 100%;
    }
}

/* Add this to the power-off-body class to stop the animation when powered off */
.power-off-body::after {
    opacity: 0 !important;
    animation: none !important;
}

.sol-icon {
    height: 28px;
    width: 28px;
    background-color: #ffffff;
    padding: 6px;
    border-radius: 8px;
    border: 2px solid #2c3e50;
    box-shadow: 2px 2px 0px #8e44ad;
}

/* Nyan Cat styles */
.nyan-cat {
    position: fixed;
    z-index: 900;
    cursor: pointer;
}

.nyan-cat-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    opacity: 1;
    transform-origin: center center;
}

/* Default left-to-right direction */
.nyan-cat.ltr .nyan-cat-wrapper {
    flex-direction: row;
}

/* Right-to-left direction */
.nyan-cat.rtl .nyan-cat-wrapper {
    flex-direction: row-reverse;
}

.cat {
    width: 270px;
    height: 180px;
    background-image: url('assets/nyan.png');
    background-size: contain;
    background-repeat: no-repeat;
    animation: nyan-float 0.5s infinite alternate;
}

/* Flip the cat when going right-to-left */
.nyan-cat.rtl .cat {
    transform: scaleX(-1);
}

.rainbow-trail {
    width: 450px;
    height: 90px;
    margin-right: -45px;
    background: linear-gradient(
        to bottom,
        #ff0000 0%,
        #ff0000 16.6%,
        #ff9900 16.6%,
        #ff9900 33.2%,
        #ffff00 33.2%,
        #ffff00 49.8%,
        #33ff00 49.8%,
        #33ff00 66.4%,
        #0099ff 66.4%,
        #0099ff 83%,
        #6633ff 83%,
        #6633ff 100%
    );
    opacity: 1;
    animation: rainbow-stretch 0.5s infinite alternate;
}

/* Adjust margins for right-to-left direction */
.nyan-cat.rtl .rainbow-trail {
    margin-right: 0;
    margin-left: -45px;
}

@keyframes nyan-float {
    from {
        transform: translateY(-2px);
    }
    to {
        transform: translateY(2px);
    }
}

/* Adjust float animation for right-to-left direction */
.nyan-cat.rtl .cat {
    animation-name: nyan-float-rtl;
}

@keyframes nyan-float-rtl {
    from {
        transform: translateY(-2px) scaleX(-1);
    }
    to {
        transform: translateY(2px) scaleX(-1);
    }
}

@keyframes rainbow-stretch {
    from {
        width: 450px;
    }
    to {
        width: 540px;
    }
}

/* Alarm Overlay Styles */
.alarm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 0, 0, 0);
    pointer-events: none;
    z-index: 9999;
    transition: background-color 0.15s ease-in-out;
}

.alarm-overlay.active {
    background-color: rgba(255, 0, 0, 0.2);
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.8) inset;
}

/* Add a pulsing animation to the body when alarm is active */
body.alarm-active {
    animation: alarm-pulse 0.5s infinite alternate;
}

@keyframes alarm-pulse {
    from {
        background-color: rgba(0, 0, 0, 0);
    }
    to {
        background-color: rgba(255, 0, 0, 0.1);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px) rotate(-0.1deg);
    }
    50% {
        transform: translateX(0);
    }
    75% {
        transform: translateX(5px) rotate(0.1deg);
    }
}

/* Enhanced glitch effect for the active state */
.subtitle.glitch-active {
    animation:
        subtitleTextGlitch 6s infinite,
        flicker 4s infinite alternate-reverse;
}

.subtitle.glitch-active::before {
    opacity: 0.7;
    animation:
        subtitleGlitch 4s infinite,
        rgbSplit 3s infinite alternate-reverse;
}

.subtitle.glitch-active::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    opacity: 0.3;
    animation:
        subtitleGlitch 3.5s infinite 0.5s,
        rgbSplit 2.5s infinite alternate-reverse;
    z-index: -2;
    transform: translateX(-2px);
    white-space: nowrap;
}

/* Retro Power Button */
.power-button-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: none !important; /* Force hide by default */
    animation: powerButtonFlicker 2s infinite alternate;
}

.power-off-body .power-button-container {
    display: block !important; /* Only show when power is off */
}

.power-button {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f4d03f 0%, #f39c12 100%);
    border: 4px solid #8e44ad;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: visible;
    box-shadow:
        4px 4px 0px #8e44ad,
        8px 8px 0px #6c3483,
        0 0 20px rgba(244, 208, 63, 0.3);
}

/* Add a multi-color border effect using all four retro colors */
/* .power-button::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: conic-gradient(
        var(--retro-color-1),
        var(--retro-color-2),
        var(--retro-color-3),
        var(--retro-color-4),
        var(--retro-color-1)  
    );
    z-index: -1;
    opacity: 0.7;
    animation: rotateBorder 10s linear infinite;
    pointer-events: none;
} */

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

/* Add scan lines and glare effect to the power button */
.power-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.3) 2px,
            rgba(0, 0, 0, 0.3) 4px
        ),
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 100%
        );
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.5;
}

.power-button:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #f7dc6f 0%, #e67e22 100%);
    box-shadow:
        6px 6px 0px #8e44ad,
        10px 10px 0px #6c3483,
        0 0 30px rgba(244, 208, 63, 0.5);
}

.power-button:hover .power-symbol {
    box-shadow:
        3px 3px 0px #8e44ad,
        0 0 12px rgba(46, 62, 80, 0.6);
}

.power-button:active {
    transform: scale(0.95) translate(2px, 2px);
    box-shadow:
        2px 2px 0px #8e44ad,
        4px 4px 0px #6c3483,
        0 0 15px rgba(244, 208, 63, 0.3);
}

.power-symbol {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #2c3e50;
    border-radius: 50%;
    background: #ffffff;
    box-shadow:
        2px 2px 0px #8e44ad,
        0 0 8px rgba(46, 62, 80, 0.4);
    transition: all 0.3s ease;
}

.power-symbol::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -120%);
    width: 4px;
    height: 15px;
    background-color: #2c3e50;
    box-shadow: 1px 1px 0px #8e44ad;
}

@keyframes buttonGlare {
    0% {
        transform: translate(-100%, -100%) rotate(45deg);
    }
    100% {
        transform: translate(100%, 100%) rotate(45deg);
    }
}

/* Add a subtle flicker to the power button */
@keyframes powerButtonFlicker {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.95;
    }
}

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

@keyframes socialGlow {
    0% {
        box-shadow:
            0 0 8px rgba(106, 15, 241, 0.2),
            inset 0 0 3px rgba(106, 15, 241, 0.1);
    }
    100% {
        box-shadow:
            0 0 12px rgba(106, 15, 241, 0.4),
            inset 0 0 6px rgba(106, 15, 241, 0.15);
    }
}

/* Main X Link (top left) */
.x-link-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 500;
    opacity: 0;
    transform: translateY(-10px);
    transition:
        opacity 0.8s ease,
        transform 0.8s ease;
}

.main-x-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--retro-color-2);
    font-family: 'Noto Sans Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    background: rgba(106, 15, 241, 0.1);
    border: 1px solid var(--retro-color-2);
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow:
        0 0 6px rgba(106, 15, 241, 0.2),
        inset 0 0 3px rgba(106, 15, 241, 0.1);
}

.main-x-link:hover {
    background: rgba(106, 15, 241, 0.2);
    box-shadow:
        0 0 15px rgba(106, 15, 241, 0.5),
        inset 0 0 8px rgba(106, 15, 241, 0.15);
    transform: translateY(-2px);
}

.x-logo {
    width: 16px;
    height: 16px;
    color: var(--retro-color-2);
    filter: drop-shadow(0 0 3px rgba(106, 15, 241, 0.4));
}

.x-handle {
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
}
