/* =========================
   FONTS
========================= */
@font-face {
    font-family: "PPMondwest";
    src: url(fonts/PPMondwest-Regular.otf);
}

@font-face {
    font-family: "PPNeueBit";
    src: url(fonts/PPNeueBit-Bold.otf);
}


/* =========================
   GLOBAL RESET
========================= */
* {
    box-sizing: border-box;
    image-rendering: pixelated;
    -webkit-font-smoothing: none;
}


/* =========================
   COLOR SYSTEM
========================= */
:root {
    /* Core */
    --white: #ffffff;
    --off-black: #0E1620;

    /* CRT Blues */
    --cyan-glow: #BDF2F2;
    --cyan-active: #7DD9E8;
    --cyan-soft: #ECFEFF;

    --blue-button: #3FA6C9;
    --blue-frame: #1F5F8B;
    --blue-shell: #1A2E3F;

    /* UI Structure */
    --bg: var(--blue-shell);
    --gradient-bottom: #162838;

    --ui-border-dark: var(--off-black);
    --ui-border-mid: var(--blue-frame);
    --ui-border-light: var(--cyan-glow);

    /* Screen */
    --ui-gradient-top: var(--white);
    --ui-gradient-bottom: var(--cyan-soft);

    /* Frame */
    --ui-frame-top: var(--cyan-active);
    --ui-frame-bottom: var(--blue-frame);
}


/* =========================
   BODY
========================= */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 60px 10px;

    background: url(imgs/bg2.gif) center / cover no-repeat fixed;
    font-family: "PPMondwest", sans-serif;
    overflow-x: hidden;
    padding: 80px 20px;
}

.console-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.audio-container {
    position: relative;
    top: 0;
    margin-bottom: 40px;
    width: fit-content; 
    z-index: 10;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 8px 10px;

    background: rgba(26, 46, 63, .9);
    border: 2px ridge var(--ui-border-mid);
    border-radius: 6px;

    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, .3),
        0 0 12px rgba(189, 242, 242, .25);

    backdrop-filter: blur(4px);
}

.audio-container button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.audio-container img {
    width: 18px;
    height: 18px;
}

/* SLIDER */
#volumeSlider {
    width: 80px;
    appearance: none;
    height: 4px;

    background: linear-gradient(to right,
            var(--cyan-glow),
            var(--blue-frame));

    border-radius: 2px;
    outline: none;
}

#volumeSlider::-webkit-slider-thumb {
    appearance: none;
    width: 10px;
    height: 10px;

    background: var(--cyan-active);
    border: 2px solid var(--off-black);
    border-radius: 2px;

    box-shadow: 0 0 6px rgba(189, 242, 242, .8);
    cursor: pointer;
}


/* =========================
   CONSOLE SHELL
========================= */
.console-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    /* This prevents the scaled console from overlapping elements above/below it */
    padding: 40px 0; 
}
.console {
    width: 90vw;
    max-width: 500px;
    padding: 20px;
    border-radius: 6px;

    background-color: var(--gradient-bottom);
    background-image:
        repeating-radial-gradient(circle at 0 0,
            transparent 0,
            var(--gradient-bottom) 8px),
        repeating-linear-gradient(var(--bg), var(--bg));

    border: 4px ridge var(--ui-border-mid);
    outline: 3px solid var(--ui-border-dark);
    outline-offset: 4px;
    transform-origin: center;
}

@media (min-height: 700px) and (min-width: 600px) {
    .console {
        transform: scale(1.15);
    }
}

@media (min-height: 900px) and (min-width: 700px) {
    .console {
        transform: scale(1.3);
    }
}

/* =========================
   SOCIAL ICON BAR
========================= */
.socials {
    margin-top: 80px;
    /* feels “placed”, not floating */
    display: flex;
    gap: 14px;
}


/* Icon Button Shell */
.socials a {
    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;

    background: linear-gradient(to bottom,
            var(--cyan-active),
            var(--blue-button));

    outline: 2px solid var(--ui-border-dark);
    outline-offset: -4px;

    border-radius: 6px;

    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, .6),
        inset -1px -1px 0 rgba(0, 0, 0, .4);

    transition: transform .1s ease, box-shadow .1s ease;
}

/* Icon Image */
.socials img {
    max-width: 32px;
    max-width: 32px;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .5));
    image-rendering: pixelated;
}

/* Hover = CRT Bloom */
.socials a:hover {
    box-shadow:
        0 0 6px rgba(189, 242, 242, .6),
        0 0 14px rgba(189, 242, 242, .4),
        inset 1px 1px 0 rgba(255, 255, 255, .7);
}

/* Press */
.socials a:active {
    transform: translateY(2px);
    box-shadow:
        inset 2px 2px 0 rgba(0, 0, 0, .5),
        inset -1px -1px 0 rgba(255, 255, 255, .4);
}

/* Keyboard focus (important + sexy) */
.socials a:focus-visible {
    outline: 2px solid var(--cyan-glow);
    outline-offset: 2px;
}



/* =========================
   SCREEN FRAME
========================= */
.screen-frame {
    width: 320px;
    max-width: 400px;
    aspect-ratio: 4 / 3;
    padding: 6px;

    background: linear-gradient(to bottom,
            var(--ui-frame-top),
            var(--ui-frame-bottom));

    border: 3px ridge var(--blue-frame);
    outline: 2px solid var(--white);
    outline-offset: -6px;
}


/* =========================
   SCREEN (CRT GLASS)
========================= */
.screen-inner {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 18px;
    border-radius: 6px;


    background: linear-gradient(to bottom,
            var(--ui-gradient-top),
            var(--ui-gradient-bottom));

    border: 2px ridge var(--ui-border-mid);
    outline: 2px solid var(--ui-border-light);
    outline-offset: -6px;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;

    overflow: hidden;

    box-shadow:
        0 0 18px rgba(189, 242, 242, .35),
        inset 0 0 12px rgba(255, 255, 255, .2);
}

/* CRT Bloom */
.screen-inner::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;

    background: radial-gradient(circle at center,
            rgba(189, 242, 242, .25),
            transparent 60%);

    mix-blend-mode: screen;
}

/* =========================
   CUSTOM SCROLLBAR
========================= */
.screen-content::-webkit-scrollbar {
    width: 6px;
    border-radius: 4px;
    /* Slim and clean */
}

.screen-content::-webkit-scrollbar-track {
    background: rgba(26, 46, 63, 0.3);
    /* Transparent version of your blue-shell */
    border-radius: 4px;
}

.screen-content::-webkit-scrollbar-thumb {
    background: var(--blue-button);
    border: 1px solid var(--cyan-glow);
    border-radius: 4px;
    box-shadow: 0 0 5px var(--cyan-glow);
    
    /* Slight glow effect */
}

.screen-content::-webkit-scrollbar-thumb:hover {
    background: var(--cyan-active);
    border-radius: 4px;
}

/* For Firefox support */
.screen-content {
    scrollbar-width: thin;
    scrollbar-color: var(--blue-button) var(--blue-shell);
    border-radius: 4px;
}


/* =========================
   LAYOUT
========================= */
.screen-area {
    display: grid;
    grid-template-columns: 90px auto;
    gap: 24px;
    align-items: center;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: auto;
}

.screen-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-top: auto;
    /* Pushes to bottom of screen-inner */
    padding-top: 10px;
}


/* =========================
   TEXT
========================= */
.title {
    text-align: center;
    font-size: clamp(1.2rem, 4vw, 2rem);
    color: var(--white);

    text-shadow:
        0 2px 0 #000,
        0 0 12px rgba(255, 255, 255, .6);

    margin-bottom: 32px;
}

.screen-content {
    max-width: 300px;
    font-size: 1rem;
    line-height: 1.3;
    white-space: pre-wrap;
    overflow-y: scroll;

    color: var(--off-black);
    flex: 1;
    display: flex;
    flex-direction: column;
}


/* =========================
   BUTTON SYSTEM
========================= */
.btn,
.side-buttons button,
.screen-continue,
.screen-back {
    font-family: "PPNeueBit", sans-serif;
    cursor: pointer;
    border-radius: 6px;

    background: linear-gradient(to bottom,
            var(--cyan-active),
            var(--blue-button));

    border: 2px ridge var(--ui-border-mid);
    color: var(--off-black);

    text-shadow: 0 1px 0 rgba(255, 255, 255, .4);

    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, .6),
        inset -1px -1px 0 rgba(0, 0, 0, .4);

    transition: transform .1s ease, box-shadow .1s ease;
}

.side-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Button Sizes */
.btn {
    padding: 16px 28px;
    font-size: 1.5rem;
}

.side-buttons button {
    font-size: 1rem;
    padding: 6px 10px;
}

.screen-continue,
.screen-back {
    font-size: 1rem;
    /* Increased from .6rem */
    padding: 8px 16px;
    /* Increased padding */
    letter-spacing: .05em;
    flex: 1;
    /* Makes them share space equally */
    max-width: 120px;
    /* Keeps them from getting TOO huge */
    text-align: center;
}


/* Hover / Focus (CRT Glow) */
.btn:hover,
.side-buttons button:hover,
.screen-continue:hover,
.screen-back:hover {
    box-shadow:
        0 0 6px rgba(189, 242, 242, .6),
        0 0 14px rgba(189, 242, 242, .4),
        inset 1px 1px 0 rgba(255, 255, 255, .7);
}

/* Active */
.btn:active,
.side-buttons button:active,
.screen-continue:active,
.screen-back:active {
    transform: translateY(2px);
    box-shadow:
        inset 2px 2px 0 rgba(0, 0, 0, .5),
        inset -1px -1px 0 rgba(255, 255, 255, .4);
}

/* =========================
   FOOTER
========================= */
footer {
    margin-bottom: 30px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--white);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 1);
}


/* =========================
   ANIMATIONS
========================= */
.screen-continue:not(.hidden) {
    animation: blink 1.2s infinite;
}

@keyframes blink {

    0%,
    50%,
    100% {
        opacity: 1;
    }

    25%,
    75% {
        opacity: .3;
    }
}


/* =========================
   EFFECTS
========================= */
.scanlines {
    pointer-events: none;
    position: absolute;
    inset: 0;

    background: repeating-linear-gradient(to bottom,
            rgba(255, 255, 255, .03),
            rgba(255, 255, 255, .03) 2px,
            transparent 2px,
            transparent 4px);

    mix-blend-mode: overlay;
}


/* =========================
   UTILITIES
========================= */
.hidden {
    display: none !important;
}

/* =========================
   RESPONSIVE ADJUSTMENTS
========================= */
@media (max-width: 480px) {
    .screen-area {
        grid-template-columns: 1fr;
        /* Stack buttons on narrow mobile */
        gap: 15px;
    }

    .side-buttons {
        flex-direction: row;
        /* Buttons sit side-by-side on mobile */
        justify-content: center;
    }

    .screen-frame {
        width: 100%;
        /* Frame fits inside console width */
        height: auto;
    }

    .audio-container {
        width: auto;
        white-space: nowrap;
    }
}