/* =========================================================
   POLICE
========================================================= */

@font-face {

    font-family: "GraffitiPiece";

    src:
        url("fonts/GraffitiPieceRegular-gwXVE.ttf")
        format("truetype");

    font-weight: normal;

    font-style: normal;

}

@font-face {

    font-family: "DS-Digital";

    src:
        url("fonts/DS-DIGIT.TTF")
        format("truetype");

    font-weight: normal;

    font-style: normal;

}

@font-face {

    font-family: "Bringthanoize";

    src:
        url("fonts/Bringthanoize.ttf")
        format("truetype");

    font-weight: normal;

    font-style: normal;

}


/* =========================================================
   RESET
========================================================= */

* {

    margin: 0;

    padding: 0;

    box-sizing: border-box;

    -webkit-user-select: none;

    -moz-user-select: none;

    -ms-user-select: none;

    user-select: none;

}

::selection {

    background: transparent;

    color: inherit;

}

::-moz-selection {

    background: transparent;

    color: inherit;

}

img {

    -webkit-user-drag: none;

    user-drag: none;

    -webkit-user-select: none;

    -moz-user-select: none;

    -ms-user-select: none;

    user-select: none;

    -webkit-touch-callout: none;

}


/* =========================================================
   HTML
========================================================= */

html {

    width: 100%;

    height: 100%;

    overflow: hidden;

    touch-action: pan-x pan-y;

}


/* =========================================================
   BODY
========================================================= */

body {

    width: 100%;

    height: 100vh;

    overflow: hidden;

    background-color: #000;

    background-image:
        url("images/dj-texture.jpg");

    background-size: cover;

    background-position: center;

    background-repeat: no-repeat;

    color: #fff;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

}

body::before {

    content: "";

    position: fixed;

    inset: 0;

    pointer-events: none;

    background: rgba(0, 0, 0, 1);

    opacity: 0.25;

    z-index: 900;

}

body.page-transition-start::before {

    animation: page-dark-flicker 2.0s ease-out both;

}

@keyframes page-dark-flicker {

    0% {
        opacity: 0;
    }

    8% {
        opacity: 0.30;
    }

    20% {
        opacity: 0.14;
    }

    34% {
        opacity: 0.24;
    }

    48% {
        opacity: 0.16;
    }

    62% {
        opacity: 0.22;
    }

    74% {
        opacity: 0.14;
    }

    82% {
        opacity: 0.10;
    }

    88% {
        opacity: 0.08;
    }

    92% {
        opacity: 0.05;
    }

    96% {
        opacity: 0.03;
    }

    100% {
        opacity: 0;
    }

}


/* =========================================================
   BANDEAU
========================================================= */

.top-bar {

    position: relative;

    width: 100%;

    height: 90px;

    background: #000;

    display: flex;

    align-items: center;

    justify-content: center;

    z-index: 1000;

}


.top-bar h1 {

    font-family:
        "GraffitiPiece",
        sans-serif;

    font-size: 46px;

    font-weight: normal;

    color: #ff0000;

    letter-spacing: 2px;

}


/* =========================================================
   BOUTON RETOUR
========================================================= */

.back {

    position: absolute;

    left: 30px;

    top: 50%;

    transform:
        translateY(-50%);

    display: block;

    width: 110px;

    height: 110px;

    z-index: 1100;

}


.back img {

    width: 100%;

    height: 100%;

    object-fit: contain;

    display: block;

}


.back:hover {

    opacity: 0.6;

}


/* =========================================================
   INTERFACE
========================================================= */

.interface {

    position: relative;

    width: 100%;

    height:
        calc(100vh - 90px);

    max-width: 1500px;

    margin: 0 auto;

    padding:
        0 35px;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        500px;

    gap: 40px;

    align-items: stretch;

}


/* =========================================================
   TV
========================================================= */

.tv-section {

    position: relative;

    width: 100%;

    max-width: 945px;

    margin: 0 auto;

}


/* =========================================================
   TV
========================================================= */

.tv {

    position: relative;

    width: 100%;

    max-height:
        calc(100vh - 210px);

    aspect-ratio: 1 / 1;

}


/* =========================================================
   PLAYER YOUTUBE
========================================================= */

.video {

    position: absolute;

    width: 58%;

    aspect-ratio: 4 / 3;

    top: calc(16% - 50px);

    left: 50%;

    transform:
        translateX(-50%);

    background: #000;

    overflow: hidden;

    z-index: 1;

}


.video iframe {

    position: absolute;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    border: none;

}


/* =========================================================
   CADRE TV
========================================================= */

.tv-frame {

    position: absolute;

    top: -2.5%;

    left: -2.5%;

    width: 105%;

    height: 105%;

    object-fit: contain;

    pointer-events: none;

    z-index: 2;

    /* shadow only around the PNG frame */
    filter: drop-shadow(0 0 40px rgba(0, 0, 0, 0.95));

}


/* =========================================================
   LECTEUR CD
========================================================= */

.cd-player {

    position: relative;

    width: 100%;

    max-width: 780px;

    margin: -30px auto 0;

    z-index: 3;

}


/* =========================================================
   IMAGE DU LECTEUR
========================================================= */

.cd-player-image {

    display: block;

    width: 100%;

    height: auto;

    object-fit: contain;

    /* shadow only around the PNG player image */
    filter: drop-shadow(0 0 40px rgba(0, 0, 0, 1));

    transition: filter 0.2s ease-out;

}

.cd-player:hover .cd-player-image {

    filter: drop-shadow(0 0 50px rgba(0, 0, 0, 1));

}


/* =========================================================
   ÉCRAN DU LECTEUR
========================================================= */

.current-info {

    position: absolute;

    /*
     * Position de l'écran :
     * centre gauche / légèrement vers le haut
     */

    left: 18%;

    top: calc(32% - 8px);

    transform:
        translateY(-50%);

    width: 38%;

    padding: 0;

    background: transparent;

    text-align: left;

    pointer-events: none;

}


/* =========================================================
   TITRE SUR L'ÉCRAN
========================================================= */

.current-info h2 {

    margin: 0;

    font-family:
        "DS-Digital",
        "Courier New",
        monospace;

    font-size: 29px;

    font-weight: normal;

    color: #dffcff;

    letter-spacing: 2px;

    line-height: 1.1;

    text-shadow:
        0 0 5px
        rgba(180, 245, 255, 0.8);

}


/* =========================================================
   NUMÉRO SUR L'ÉCRAN
========================================================= */

.current-info p {

    margin-top: 5px;

    font-family:
        "DS-Digital",
        "Courier New",
        monospace;

    font-size: 15px;

    letter-spacing: 2px;

    color: #dffcff;

    line-height: 1;

    text-shadow:
        0 0 5px
        rgba(180, 245, 255, 0.8);

}


/* =========================================================
   ZONE VHS
========================================================= */

.vhs-section {

    position: relative;

    width: 100%;

    height:
        calc(100vh - 90px);

    min-height: 0;

    display: flex;

    justify-content: flex-start;

    align-items: stretch;

    gap: 20px;

    overflow: visible;

    overscroll-behavior:
        contain;

}

.vhs-stack {
    flex: 1;
    width: auto;

    justify-content: flex-start;

    align-items: stretch;

    padding-top: 10px;

}


/* =========================================================
   PILE VHS
========================================================= */

.vhs-stack {

    position: relative;

    width: 100%;

    height: 100%;

    display: flex;

    justify-content: center;

    align-items: center;
    padding-left: 90px;
    transform: translateX(70px);
    overflow: visible;
}


/* =========================================================
   VHS
========================================================= */

.vhs {

    position: absolute;

    width: 390px;

    height: 220px;

    padding: 0;

    border: none;

    outline: none;

    background: transparent;

    cursor: pointer;

    transform-origin:
        center center;

    transition:
        transform 0.18s ease-out,
        opacity 0.18s ease-out,
        filter 0.18s ease-out;

    isolation: isolate;

    appearance: none;

    -webkit-appearance: none;

}

.vhs-vibrate {
    animation: vhs-vibrate 0.22s ease-in-out;
}

@keyframes vhs-vibrate {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    20% {
        transform: translate(-4px, 0) rotate(-2deg);
    }
    40% {
        transform: translate(4px, 0) rotate(2deg);
    }
    60% {
        transform: translate(-3px, 0) rotate(-1.5deg);
    }
    80% {
        transform: translate(3px, 0) rotate(1.5deg);
    }
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

/* Small vibration for CD player on click (restored) */
.cd-vibrate {
    animation: cd-vibrate 0.18s ease-in-out;
}

@keyframes cd-vibrate {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-2px, 0) rotate(-0.8deg); }
    50% { transform: translate(2px, 0) rotate(0.8deg); }
    75% { transform: translate(-1px, 0) rotate(-0.5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* Very light vibration when a DJ set gets selected */
.cd-selection-vibrate {
    animation: cd-selection-vibrate 0.26s ease-in-out;
}

@keyframes cd-selection-vibrate {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-0.6px, 0) rotate(-0.15deg); }
    50% { transform: translate(0.6px, 0) rotate(0.15deg); }
    75% { transform: translate(-0.4px, 0) rotate(-0.1deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}


/* =========================================================
   IMAGE VHS
========================================================= */

.vhs img {

    position: absolute;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    object-fit: contain;

    display: block;

    pointer-events: none;

    filter: drop-shadow(0 0 21px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 12px rgba(0, 0, 0, 0.7));
    z-index: 1 !important; /* keep PNG behind scotch and text */

}


/* =========================================================
   TEXTE VHS
========================================================= */

.vhs-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-25deg);
    font-family: "Bringthanoize", Arial, Helvetica, sans-serif;
    font-size: 23px; /* reduced ~10% from 26px */
    font-weight: bold;
    color: #000;
    letter-spacing: 1px;
    /* remove white outline shadow, keep subtle dark drop shadow */
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    -webkit-text-stroke: 0;
    pointer-events: none;
    white-space: nowrap;
    display: inline-block;
    padding: 0 10px;
    z-index: 100; /* above image but below other UI if needed */
}

/* explicit scotch element (guaranteed stacking order) */
.vhs-scotch {
    position: absolute;
    top: 50%;
    left: 50%;
    /* base placement kept; actual rotation applied inline to match text */
    transform: translate(-50%, -50%);
    width: 61%; /* ~10% wider than previous 55% */
    height: 26px;
    /* tape-like appearance: slightly yellowed base + subtle stripes */
    background-image:
        linear-gradient(180deg, #fff 0%, #fbf7e6 100%),
        repeating-linear-gradient(135deg, rgba(0,0,0,0.03) 0 2px, rgba(0,0,0,0) 2px 8px);
    background-blend-mode: multiply;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: inset 0 -2px 6px rgba(0, 0, 0, 0.12);
    z-index: 90; /* just below the text */
    pointer-events: none;
    opacity: 1;
}

.vhs-scotch::before,
.vhs-scotch::after {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    height: 4px;
    background: linear-gradient(180deg, rgba(0,0,0,0.06), rgba(255,255,255,0.02));
    border-radius: 2px;
    pointer-events: none;
}

.vhs-scotch::before { top: 3px; opacity: 0.85; }
.vhs-scotch::after { bottom: 3px; opacity: 0.5; }

/* Force visible color for VHS fallback text */
.vhs-fallback {
    color: #000 !important;
}



/* =========================================================
   VHS SÉLECTIONNÉE
========================================================= */

.vhs.selected {

    filter: none;

}


.vhs.selected:hover {

    filter: none;

}

/* Prefer glow around the PNG shape (drop-shadow) instead of rectangular pseudo-elements */
.vhs.selected::before,
.vhs.selected::after {
    opacity: 0;
    pointer-events: none;
}

/* Animated red glow applied to the PNG itself for .vhs.selected */
.vhs.selected img {
    z-index: 1;
    animation: red-png-glow 1.4s ease-in-out infinite;
    /* base glow to blend with animation */
    filter: drop-shadow(0 0 8px rgba(255,0,0,0.8)) drop-shadow(0 0 26px rgba(255,40,40,0.45));
}

@keyframes red-png-glow {
    0% {
        filter: drop-shadow(0 0 6px rgba(255,0,0,0.5)) drop-shadow(0 0 18px rgba(255,40,40,0.25));
    }
    40% {
        filter: drop-shadow(0 0 20px rgba(255,0,0,1)) drop-shadow(0 0 48px rgba(255,40,40,0.65));
    }
    80% {
        filter: drop-shadow(0 0 14px rgba(255,0,0,0.9)) drop-shadow(0 0 32px rgba(255,40,40,0.5));
    }
    100% {
        filter: drop-shadow(0 0 6px rgba(255,0,0,0.5)) drop-shadow(0 0 18px rgba(255,40,40,0.25));
    }
}


/* =========================================================
   ÉCRANS MOYENS
========================================================= */

@media (max-height: 800px) {

    .top-bar {

        height: 75px;

    }


    .top-bar h1 {

        font-size: 36px;

    }


    .interface {

        height:
            calc(100vh - 75px);

        grid-template-columns:
            minmax(0, 1fr)
            430px;

        gap: 25px;

        padding:
            0 25px;

    }


    .tv {

        max-height:
            calc(100vh - 230px);

    }


    .back {

        width: 90px;

        height: 90px;

    }


    .vhs-section {

        height:
            calc(100vh - 75px);

    }


    .vhs {

        width: 330px;

        height: 185px;

    }


    .current-info h2 {

        font-size: 24px;

    }


    .current-info p {

        font-size: 16px;

    }

}


/* =========================================================
   PETITS ÉCRANS
========================================================= */

@media (max-height: 650px) {

    .top-bar {

        height: 60px;

    }


    .top-bar h1 {

        font-size: 30px;

    }


    .interface {

        height:
            calc(100vh - 60px);

        grid-template-columns:
            minmax(0, 1fr)
            350px;

        gap: 15px;

        padding:
            0 15px;

    }


    .tv {

        max-height:
            calc(100vh - 190px);

    }


    .back {

        width: 70px;

        height: 70px;

    }


    .vhs-section {

        height:
            calc(100vh - 60px);

    }


    .vhs {

        width: 280px;

        height: 155px;

    }


    .current-info h2 {

        font-size: 16px;

    }


    .current-info p {

        font-size: 10px;

    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

    html,
    body {

        overflow: visible;

    }


    .top-bar {

        height: 75px;

    }


    .top-bar h1 {

        font-size: 34px;

    }


    .back {

        left: 20px;

        width: 80px;

        height: 80px;

    }


    .interface {

        height:
            calc(100vh - 75px);

        display: flex;

        flex-direction: column-reverse;

        align-items: stretch;

        justify-content: flex-start;

        padding: 0;

        gap: 0;

        overflow: hidden;

        background: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(20,0,0,0.9));

    }


    .tv-section {

        width: 100%;

        height: 52vh;

        max-width: none;

        display: flex;

        flex-direction: column;

        align-items: center;

        justify-content: center;

        padding: 15px 10px;

        flex-shrink: 0;

        border-top: 2px solid rgba(255, 0, 0, 0.2);

    }


    .tv {

        width: 100%;

        max-height: 40vh;

        max-width: 98vw;

        filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.7));

    }


    .video {

        width: 65%;

        aspect-ratio: 4 / 3;

        top: calc(16% - 50px) !important;

        left: 50% !important;

        transform: translateX(-50%) !important;

    }


    .cd-player {

        width: 100%;

        max-width: 98vw;

        margin: 10px auto 0;

        filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.6));

    }


    .current-info {

        left: 24%;

        top: calc(34% - 8px);

        width: 44%;

    }


    .current-info h2 {

        font-size: 22px;

    }


    .current-info p {

        font-size: 13px;

        margin-top: 4px;

    }


    .vhs-section {

        width: 100%;

        height: 48vh;

        flex: 1;

        display: flex;

        overflow-x: auto;

        overflow-y: hidden;

        overscroll-behavior: contain;

        -webkit-overflow-scrolling: touch;

        pointer-events: auto;

        touch-action: pan-x;

        background: linear-gradient(to right, rgba(0,0,0,0.7), rgba(0,0,0,0.5));

        align-items: center;

        padding: 15px 0;

    }


    .vhs-stack {

        position: static;

        width: auto;

        height: 100%;

        display: flex;

        flex-direction: row;

        align-items: center;

        padding: 0 15px;

        gap: 4px;

        transform: none;

    }


    .vhs {

        position: static;

        width: 200px;

        height: 115px;

        flex-shrink: 0;

        margin: 0;

        padding: 0;

        border: none;

        outline: none;

        background: transparent;

        cursor: pointer;

        transform-origin:
            center center;

        transition:
            transform 0.18s ease-out,
            opacity 0.18s ease-out,
            filter 0.18s ease-out;

        isolation: isolate;

        appearance: none;

        -webkit-appearance: none;

        pointer-events: auto;

        touch-action: manipulation;

        filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.8));

    }


    .vhs:hover {

        filter: drop-shadow(0 8px 16px rgba(255, 0, 0, 0.5));

        transform: scale(1.05);

    }


    .vhs-fallback {

        font-size: 14px;

    }

}

/* Small vibration for CD player on click */
/* small CD vibration removed per user request */