/* ============================================================
   KITSUNE — ANIME MUSIC BINGO
   Global stylesheet
============================================================ */


/* ============================================================
   01. FONTS
============================================================ */

@font-face {
    font-family: "IBMPlexSansKR";
    src: url("../assets/fonts/IBMPlexSansKR-ExtraLight.ttf")
        format("truetype");
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBMPlexSansKR";
    src: url("../assets/fonts/IBMPlexSansKR-Thin.ttf")
        format("truetype");
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBMPlexSansKR";
    src: url("../assets/fonts/IBMPlexSansKR-Medium.ttf")
        format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBMPlexSansKR";
    src: url("../assets/fonts/IBMPlexSansKR-SemiBold.ttf")
        format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}


/* ============================================================
   02. VARIABLES
============================================================ */

:root {

    --red: #ff0000;
    --white: #ffffff;
    --black: #000000;

    --deep-black: #030000;
    --deep-red: #180000;
    --wine: #270306;
    --burgundy: #35070a;
    --dark-red: #4b080d;

    --red-soft: rgba(255, 0, 0, 0.35);
    --red-glow: rgba(255, 0, 0, 0.18);
    --red-faint: rgba(255, 0, 0, 0.08);

    --white-soft: rgba(255, 255, 255, 0.72);
    --white-muted: rgba(255, 255, 255, 0.45);

    --border-dark: rgba(255, 255, 255, 0.08);
    --border-red: rgba(255, 0, 0, 0.28);

    --font-main: "IBMPlexSansKR", sans-serif;

    --ease-cinematic:
        cubic-bezier(0.16, 1, 0.3, 1);

    --ease-smooth:
        cubic-bezier(0.4, 0, 0.2, 1);

    --ease-sharp:
        cubic-bezier(0.7, 0, 0.3, 1);
}


/* ============================================================
   03. RESET
============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100%;

    background: #030000;

    overflow: hidden;
}

body {
    width: 100%;
    height: 100%;
    margin: 0;

    background: #030000;

    color: var(--white);

    font-family: var(--font-main);

    font-weight: 200;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    overflow: hidden;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: 0;
    background: none;
    color: inherit;
}

button:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.9);
    outline-offset: 5px;
}


/* ============================================================
   04. APP
============================================================ */

.app {
    position: relative;

    width: 100%;
    height: 100%;

    min-width: 320px;

    isolation: isolate;

    overflow: hidden;

    background: #030000;
}


/* ============================================================
   05. GLOBAL BACKGROUND
============================================================ */

.global-background {
    position: fixed;

    inset: 0;

    z-index: -10;

    pointer-events: none;

    overflow: hidden;

    background:
        radial-gradient(
            ellipse 80% 65% at 50% 48%,
            rgba(65, 7, 12, 0.92) 0%,
            rgba(38, 3, 7, 0.82) 32%,
            rgba(11, 1, 2, 0.96) 72%,
            #020000 100%
        );
}


/* ============================================================
   BASE ATMOSPHERE
============================================================ */

.background-base {
    position: absolute;

    inset: -20%;

    background:

        radial-gradient(
            ellipse 45% 55% at 50% 50%,
            rgba(112, 10, 18, 0.32),
            transparent 70%
        ),

        radial-gradient(
            ellipse 70% 35% at 50% 110%,
            rgba(79, 5, 12, 0.34),
            transparent 72%
        ),

        radial-gradient(
            ellipse 55% 40% at 10% 40%,
            rgba(60, 4, 9, 0.24),
            transparent 75%
        ),

        linear-gradient(
            115deg,
            #050000 0%,
            #160103 25%,
            #2a0408 50%,
            #160103 75%,
            #030000 100%
        );

    filter: saturate(0.9);

    transform: scale(1.08);

    animation:
        background-breathe 18s ease-in-out infinite alternate;
}


/* ============================================================
   DISTANT LIGHT SOURCES
============================================================ */

.background-light {
    position: absolute;

    width: 65vw;
    height: 65vw;

    max-width: 1000px;
    max-height: 1000px;

    border-radius: 50%;

    filter: blur(100px);

    opacity: 0.35;

    mix-blend-mode: screen;

    will-change: transform, opacity;
}


/* LEFT */

.background-light--one {
    left: -32vw;
    top: 5vh;

    background:
        radial-gradient(
            circle,
            rgba(255, 0, 0, 0.22) 0%,
            rgba(117, 5, 12, 0.14) 30%,
            transparent 70%
        );

    animation:
        light-drift-one 24s ease-in-out infinite alternate;
}


/* RIGHT */

.background-light--two {
    right: -30vw;
    top: 15vh;

    background:
        radial-gradient(
            circle,
            rgba(255, 0, 0, 0.16) 0%,
            rgba(95, 4, 10, 0.1) 34%,
            transparent 70%
        );

    animation:
        light-drift-two 29s ease-in-out infinite alternate;
}


/* CENTER / DISTANT */

.background-light--three {
    left: 50%;
    top: 35%;

    width: 55vw;
    height: 55vw;

    transform: translate(-50%, -50%);

    background:
        radial-gradient(
            circle,
            rgba(116, 7, 15, 0.22) 0%,
            rgba(65, 4, 9, 0.12) 38%,
            transparent 72%
        );

    animation:
        center-breathe 16s ease-in-out infinite alternate;
}


/* ============================================================
   ATMOSPHERE
============================================================ */

.background-atmosphere {
    position: absolute;

    inset: -15%;

    background:

        radial-gradient(
            ellipse 38% 65% at 50% 20%,
            rgba(255, 255, 255, 0.018),
            transparent 70%
        ),

        radial-gradient(
            ellipse 65% 35% at 50% 80%,
            rgba(255, 0, 0, 0.07),
            transparent 70%
        );

    filter: blur(45px);

    opacity: 0.65;

    animation:
        atmosphere-breathe 20s ease-in-out infinite alternate;
}


/* ============================================================
   HAZE
============================================================ */

.background-haze {
    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            90deg,
            transparent 0%,
            rgba(255, 0, 0, 0.025) 35%,
            rgba(255, 255, 255, 0.018) 50%,
            rgba(255, 0, 0, 0.025) 65%,
            transparent 100%
        );

    filter: blur(25px);

    opacity: 0.5;

    animation:
        haze-move 26s ease-in-out infinite alternate;
}


/* ============================================================
   GRAIN
============================================================ */

.background-grain {
    position: absolute;

    inset: -50%;

    /*
        SVG-фильтр НЕ используется.
        Вместо этого создаём шум несколькими
        CSS-слоями с repeating-radial-gradient.
    */

    background:

        repeating-radial-gradient(
            circle at 0 0,
            rgba(255, 255, 255, 0.018) 0,
            rgba(255, 255, 255, 0.018) 1px,
            transparent 1px,
            transparent 3px
        ),

        repeating-radial-gradient(
            circle at 100% 100%,
            rgba(0, 0, 0, 0.025) 0,
            rgba(0, 0, 0, 0.025) 1px,
            transparent 1px,
            transparent 4px
        );

    opacity: 0.3;

    mix-blend-mode: soft-light;

    animation:
        grain-shift 0.45s steps(2) infinite;

    pointer-events: none;
}


/* ============================================================
   VIGNETTE
============================================================ */

.background-vignette {
    position: absolute;

    inset: 0;

    background:

        radial-gradient(
            ellipse at center,
            transparent 35%,
            rgba(0, 0, 0, 0.12) 62%,
            rgba(0, 0, 0, 0.58) 100%
        );

    box-shadow:
        inset 0 0 180px rgba(0, 0, 0, 0.45);

    pointer-events: none;
}


/* ============================================================
   06. SCENES
============================================================ */

.scene {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    overflow: hidden;
}

.scene[hidden] {
    display: none;
}

.scene--intro {
    perspective: 1400px;
    perspective-origin: 50% 50%;
}

.scene--board {
    background:
        radial-gradient(
            ellipse 60% 80% at 50% 45%,
            rgba(58, 5, 10, 0.28),
            transparent 70%
        );
}

.scene--track {
    background: #030000;
}


/* ============================================================
   07. INTRO STAGE
============================================================ */

.intro-stage {
    position: relative;

    width: 100%;
    height: 100%;

    perspective: 1400px;
    perspective-origin: 50% 50%;

    transform-style: preserve-3d;

    overflow: hidden;
}


/* ============================================================
   DEPTH LAYERS
============================================================ */

.depth-layer {
    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    transform-style: preserve-3d;

    will-change:
        transform,
        opacity,
        filter;
}


/* BACK */

.depth-layer--back {
    z-index: 10;

    transform:
        translateZ(-600px)
        scale(0.6);

    opacity: 0.22;

    filter: blur(2px);
}


/* MIDDLE */

.depth-layer--middle {
    z-index: 20;

    transform:
        translateZ(-250px)
        scale(0.82);

    opacity: 0.65;
}


/* FRONT */

.depth-layer--front {
    z-index: 30;

    transform:
        translateZ(0);

    pointer-events: none;
}


/* ============================================================
   08. NUMBER CLOUD
============================================================ */

.number-cloud {
    position: absolute;

    width: 150%;
    height: 130%;

    transform-style: preserve-3d;

    display: grid;

    grid-template-columns:
        repeat(6, minmax(80px, 1fr));

    gap: clamp(20px, 4vw, 80px);

    align-items: center;
    justify-items: center;

    transform:
        rotateX(8deg)
        rotateY(-4deg)
        rotateZ(-2deg);
}


.cloud-number {
    display: block;

    font-size: clamp(38px, 5vw, 100px);

    font-weight: 100;

    letter-spacing: -0.04em;

    color: rgba(255, 255, 255, 0.045);

    text-shadow:
        0 0 30px rgba(255, 0, 0, 0.08);

    user-select: none;

    transition:
        color 1s var(--ease-cinematic),
        transform 1s var(--ease-cinematic),
        opacity 1s var(--ease-cinematic);
}


/* ============================================================
   09. LOGO
============================================================ */

.logo-container {
    position: relative;

    width: min(48vw, 1200px);

    display: flex;

    align-items: center;
    justify-content: center;

    transform-style: preserve-3d;
}


/* SHADOW */

.logo-shadow {
    position: absolute;

    width: 75%;
    height: 50%;

    background: rgba(0, 0, 0, 0.8);

    filter: blur(60px);

    transform:
        translateZ(-60px)
        translateY(25px);

    opacity: 0.85;
}


/* GLOW */

.logo-glow {
    position: absolute;

    width: 120%;
    height: 120%;

    background:
        radial-gradient(
            ellipse at center,
            rgba(255, 0, 0, 0.18),
            rgba(255, 0, 0, 0.07) 30%,
            transparent 68%
        );

    filter: blur(45px);

    opacity: 0.65;

    transform: translateZ(-25px);

    animation:
        logo-glow-breathe 5s ease-in-out infinite alternate;
}


/* LOGO */

.logo-image {
    position: relative;

    width: 100%;

    transform:
        translateZ(20px);

    filter:
        brightness(0.55)
        contrast(1.08)
        drop-shadow(
            0 0 25px rgba(255, 0, 0, 0.15)
        );

    transition:
        filter 1.5s var(--ease-cinematic);
}

.logo-image img {
    display: block;

    width: 100%;
    height: auto;

    user-select: none;

    -webkit-user-drag: none;
}


/* ============================================================
   10. INTRO UI
============================================================ */

.intro-content {
    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 24px;

    pointer-events: auto;

    transform:
        translateY(400px);

    opacity: 0;
}


.intro-eyebrow {
    font-size: 12px;

    font-weight: 500;

    letter-spacing: 0.42em;

    color: rgba(255, 255, 255, 0.5);

    text-transform: uppercase;
}


.start-button {
    position: relative;

    display: flex;

    align-items: center;

    gap: 18px;

    padding: 15px 22px;

    cursor: pointer;

    color: rgba(255, 255, 255, 0.86);

    transition:
        color 0.5s var(--ease-cinematic),
        transform 0.5s var(--ease-cinematic);
}


.start-button__line {
    width: 35px;
    height: 1px;

    background: var(--red);

    box-shadow:
        0 0 12px rgba(255, 0, 0, 0.55);

    transition:
        width 0.6s var(--ease-cinematic);
}


.start-button__text {
    font-size: clamp(13px, 1vw, 17px);

    font-weight: 500;

    letter-spacing: 0.12em;

    text-transform: uppercase;
}


.start-button__arrow {
    font-size: 20px;

    color: var(--red);

    transition:
        transform 0.6s var(--ease-cinematic);
}


.start-button:hover {
    color: var(--white);

    transform: translateX(4px);
}


.start-button:hover .start-button__line {
    width: 55px;
}


.start-button:hover .start-button__arrow {
    transform: translateX(7px);
}


/* ============================================================
   11. BOARD
============================================================ */

.topbar {
    position: relative;

    z-index: 10;

    width: 100%;

    min-height: 100px;

    padding:
        28px
        clamp(28px, 4vw, 70px);

    display: grid;

    grid-template-columns: 1fr auto 1fr;

    align-items: center;

    border-bottom:
        1px solid rgba(255, 255, 255, 0.06);
}


.topbar__left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar__logo {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-drag: none;
}

.topbar__branding {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-small {
    font-size: 18px;

    font-weight: 600;

    letter-spacing: 0.18em;
}


.game-name {
    font-size: 9px;

    font-weight: 500;

    letter-spacing: 0.3em;

    color: var(--white-muted);
}


.topbar__center {
    justify-self: center;
}


.round-display {
    display: flex;

    align-items: baseline;

    gap: 10px;
}


.round-display__label {
    font-size: 9px;

    letter-spacing: 0.3em;

    color: var(--white-muted);
}


.round-display__number {
    font-size: 22px;

    font-weight: 600;

    color: var(--red);

    text-shadow:
        0 0 18px rgba(255, 0, 0, 0.3);
}


.topbar__right {
    justify-self: end;
}


.current-number {
    display: flex;

    align-items: center;

    gap: 14px;
}


.current-number__label {
    font-size: 8px;

    letter-spacing: 0.25em;

    color: var(--white-muted);
}


.current-number__value {
    min-width: 45px;

    font-size: 26px;

    font-weight: 500;

    text-align: right;
}


/* ============================================================
   BOARD SECTION
============================================================ */

.board-section {
    position: absolute;

    top: 50%;
    left: 50%;

    width: min(1500px, 88vw);

    transform: translate(-50%, -50%);

    display: flex;

    flex-direction: column;

    gap: 30px;
}


.board-heading {
    display: flex;

    align-items: center;

    gap: 20px;

    opacity: 0.6;
}


.board-heading h2 {
    margin: 0;

    font-size: 10px;

    font-weight: 500;

    letter-spacing: 0.34em;

    white-space: nowrap;
}


.board-heading__line {
    height: 1px;

    flex: 1;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.12)
        );
}


.board-heading__line:last-child {
    background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.12),
            transparent
        );
}


/* ============================================================
   NUMBER GRID
============================================================ */

.numbers-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.numbers-grid__row {
    display: grid;
    grid-template-columns: repeat(13, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin-inline: auto;
    box-sizing: border-box;
}

.number-button {
    position: relative;

    min-height: clamp(72px, 7vw, 110px);

    display: flex;

    align-items: center;
    justify-content: center;

    cursor: pointer;

    border:
        1px solid rgba(255, 255, 255, 0.09);

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.045),
            rgba(255, 255, 255, 0.012)
        );

    color: rgba(255, 255, 255, 0.78);

    font-size: clamp(21px, 2vw, 32px);

    font-weight: 200;

    transition:
        transform 0.5s var(--ease-cinematic),
        border-color 0.5s var(--ease-cinematic),
        background 0.5s var(--ease-cinematic),
        color 0.5s var(--ease-cinematic),
        box-shadow 0.5s var(--ease-cinematic);
}


.number-button::before {
    content: "";

    position: absolute;

    inset: 0;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(255, 0, 0, 0.13),
            transparent 65%
        );

    opacity: 0;

    transition:
        opacity 0.5s var(--ease-cinematic);
}


.number-button:hover {
    transform: translateY(-4px);

    color: var(--white);

    border-color:
        rgba(255, 0, 0, 0.5);

    background:
        linear-gradient(
            145deg,
            rgba(255, 0, 0, 0.12),
            rgba(255, 255, 255, 0.025)
        );

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.35),
        0 0 30px rgba(255, 0, 0, 0.08);
}


.number-button:hover::before {
    opacity: 1;
}


/* SELECTED */

.number-button[data-state="selected"] {
    color: var(--white);

    border-color:
        rgba(255, 0, 0, 0.8);

    background:
        linear-gradient(
            145deg,
            rgba(255, 0, 0, 0.24),
            rgba(80, 0, 0, 0.18)
        );

    box-shadow:
        0 0 40px rgba(255, 0, 0, 0.18);
}


/* PLAYED */

.number-button[data-state="played"] {
    cursor: default;

    color: rgba(255, 255, 255, 0.2);

    border-color:
        rgba(255, 255, 255, 0.035);

    background:
        rgba(0, 0, 0, 0.25);

    transform: scale(0.97);
}

.number-button[data-state="played"]:hover {
    transform: none !important;
    scale: none !important;
    background: inherit;
    border-color: rgba(255, 0, 0, 0.65);
    filter: none;
}

/* DISABLED */

.number-button[data-state="disabled"] {
    cursor: not-allowed;

    opacity: 0.2;
}


/* ============================================================
   BOARD FOOTER
============================================================ */

.board-footer {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    padding:
        22px
        clamp(28px, 4vw, 70px);

    display: flex;

    align-items: center;
    justify-content: space-between;

    color: var(--white-muted);

    font-size: 9px;

    letter-spacing: 0.22em;
}

.restart-button {
    position: absolute;

    left: 50%;
    bottom: 60px;

    transform: translateX(-50%);

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 7px 14px;

    border: 1px solid rgba(255, 255, 255, 0.07);

    background: rgba(0, 0, 0, 0.18);

    color: rgba(255, 255, 255, 0.28);

    font-family: inherit;

    font-size: 8px;

    font-weight: 400;

    letter-spacing: 0.18em;

    text-transform: uppercase;

    cursor: pointer;

    opacity: 0.65;

    transition:
        color 0.4s var(--ease-cinematic),
        border-color 0.4s var(--ease-cinematic),
        background 0.4s var(--ease-cinematic),
        opacity 0.4s var(--ease-cinematic),
        box-shadow 0.4s var(--ease-cinematic);
}


.restart-button__icon {
    font-size: 13px;

    line-height: 1;

    opacity: 0.65;

    transition:
        transform 0.6s var(--ease-cinematic),
        opacity 0.4s var(--ease-cinematic);
}


.restart-button:hover {
    color: rgba(255, 255, 255, 0.72);

    border-color:
        rgba(255, 0, 0, 0.28);

    background:
        rgba(255, 0, 0, 0.045);

    opacity: 1;

    box-shadow:
        0 0 25px rgba(255, 0, 0, 0.05);
}


.restart-button:hover .restart-button__icon {
    transform: rotate(-180deg);

    opacity: 1;
}


.restart-button:active {
    transform:
        translateX(-50%)
        translateY(1px);
}


.board-status {
    display: flex;

    align-items: center;

    gap: 9px;
}


.status-dot {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: var(--red);

    box-shadow:
        0 0 12px rgba(255, 0, 0, 0.7);
}


.played-counter {
    font-weight: 500;
}


/* ============================================================
   12. VIDEO SCENE
============================================================ */

.video-stage {
    position: absolute;

    inset: 0;

    overflow: hidden;

    background: #000;
}


.opening-video {
    position: absolute;

    top: 50%;
    left: 50%;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transform:
        translate(-50%, -50%)
        scale(1.02);

    background: #000;

    opacity: 0;

    transition:
        opacity 1.2s var(--ease-cinematic),
        transform 1.8s var(--ease-cinematic);
}


.opening-video.is-ready {
    opacity: 1;
}


.opening-video.is-playing {
    transform:
        translate(-50%, -50%)
        scale(1);
}


/* ============================================================
   CSS VIDEO PLACEHOLDER
============================================================ */

.video-background-placeholder {
    position: absolute;

    inset: 0;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    background:

        radial-gradient(
            ellipse at center,
            rgba(67, 5, 10, 0.55),
            transparent 65%
        ),

        linear-gradient(
            135deg,
            #080000,
            #210206 48%,
            #050000
        );

    transition:
        opacity 1s var(--ease-cinematic);
}


.video-background-placeholder::before {
    content: "";

    position: absolute;

    width: 55vw;
    height: 55vw;

    max-width: 900px;
    max-height: 900px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(255, 0, 0, 0.12),
            transparent 68%
        );

    filter: blur(80px);
}


.placeholder-symbol {
    position: relative;

    font-size: clamp(90px, 16vw, 260px);

    font-weight: 100;

    line-height: 1;

    color: rgba(255, 255, 255, 0.035);

    text-shadow:
        0 0 60px rgba(255, 0, 0, 0.1);
}


.placeholder-text {
    position: relative;

    margin-top: 15px;

    font-size: 9px;

    letter-spacing: 0.5em;

    color: rgba(255, 255, 255, 0.18);
}


/* =========================================
   VIDEO DIMMER
   ========================================= */

.video-dimmer {
    position: absolute;
    inset: 0;
    z-index: 8;

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.94) 0%,
            rgba(0, 0, 0, 0.9) 45%,
            rgba(0, 0, 0, 0.94) 100%
        );

    opacity: 1;
    visibility: visible;
    pointer-events: none;

    transition:
        opacity 1.1s var(--ease-cinematic),
        visibility 1.1s var(--ease-cinematic);
}

/* Пока информация об опенинге показана */
#track-scene[data-video-visible="false"] .video-dimmer {
    opacity: 1;
    visibility: visible;
}

/* После нажатия «Показать видео» */
#track-scene[data-video-visible="true"] .video-dimmer {
    opacity: 0;
    visibility: hidden;
}

/* =========================================
   VIDEO STACKING ORDER
   ========================================= */

.video-background-placeholder {
    z-index: 0;
}

.opening-video {
    z-index: 1;
}

.video-dimmer {
    z-index: 8;
}

.video-grain {
    z-index: 9;
}

.video-state {
    z-index: 10;
}

.track-banner {
    z-index: 20;
}

.track-info {
    z-index: 30;
}


/* ============================================================
   VIDEO GRAIN
============================================================ */

.video-grain {
    position: absolute;

    inset: -50%;

    background:
        repeating-radial-gradient(
            circle at 0 0,
            rgba(255, 255, 255, 0.02) 0,
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 4px
        );

    opacity: 0.2;

    mix-blend-mode: overlay;

    animation:
        grain-shift 0.5s steps(2) infinite;

    pointer-events: none;
}


/* ============================================================
   VIDEO STATES
============================================================ */

.video-state {
    position: absolute;

    inset: 0;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    text-align: center;

    background:
        rgba(0, 0, 0, 0.5);

    z-index: 5;
}


.loading-symbol {
    margin-bottom: 20px;

    font-size: 55px;

    font-weight: 100;

    color: var(--red);

    text-shadow:
        0 0 30px rgba(255, 0, 0, 0.4);

    animation:
        loading-pulse 1.8s ease-in-out infinite;
}


.video-state span {
    font-size: 9px;

    letter-spacing: 0.32em;

    color: var(--white-muted);
}





/* ============================================================
   13. TRACK BANNER
============================================================ */

.track-banner {
    position: absolute;

    inset: 0;

    z-index: 10;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 30px;


    transition:
        opacity 1s var(--ease-cinematic),
        transform 1.2s var(--ease-cinematic),
        visibility 1s;
}


.track-banner[data-state="hidden"] {
    opacity: 0;

    visibility: hidden;

    transform:
        scale(1.06)
        translateZ(0);
}


.track-banner[data-state="visible"] {
    opacity: 1;

    visibility: visible;

    transform:
        scale(1);
}


.track-banner[data-state="leaving"] {
    opacity: 0;

    transform:
        scale(0.92)
        translateY(-40px);
}

.track-banner[data-state="visible"] .track-banner__content {
    pointer-events: auto;
}

.track-banner[data-state="visible"] .video-button {
    pointer-events: auto;
    cursor: pointer;
}


/* BANNER ATMOSPHERE */

.track-banner__background {
    position: absolute;

    width: min(900px, 90vw);
    height: min(600px, 70vh);

    background:
        radial-gradient(
            ellipse at center,
            rgba(39, 2, 7, 0.93),
            rgba(10, 0, 2, 0.84) 65%,
            transparent 100%
        );

    filter: blur(0);

    box-shadow:
        0 0 120px rgba(0, 0, 0, 0.65);
}


.track-banner__background::before {
    content: "";

    position: absolute;

    inset: 10%;

    border:
        1px solid rgba(255, 0, 0, 0.18);

    box-shadow:
        inset 0 0 60px rgba(255, 0, 0, 0.035);
}


/* CONTENT */

.track-banner__content {
    position: relative;

    width: min(780px, 90vw);

    display: flex;

    flex-direction: column;

    align-items: center;

    text-align: center;
}


/* NUMBER */

.track-banner__number {
    margin-bottom: 24px;

    font-size: 10px;

    font-weight: 500;

    letter-spacing: 0.35em;

    color: var(--red);

    text-transform: uppercase;

    text-shadow:
        0 0 20px rgba(255, 0, 0, 0.3);
}


/* TITLE */

.track-banner__title {
    max-width: 800px;

    margin: 0;

    font-size: clamp(35px, 5vw, 78px);

    font-weight: 500;

    line-height: 1.04;

    letter-spacing: -0.035em;

    color: var(--white);

    text-shadow:
        0 5px 40px rgba(0, 0, 0, 0.7);
}


/* ANIME */

.track-banner__anime {
    margin:
        18px
        0
        0;

    font-size: clamp(17px, 2vw, 26px);

    font-weight: 200;

    letter-spacing: 0.08em;

    color: rgba(255, 255, 255, 0.68);
}


/* ARTIST */

.track-banner__artist {
    margin:
        12px
        0
        38px;

    font-size: 11px;

    font-weight: 500;

    letter-spacing: 0.2em;

    color: rgba(255, 255, 255, 0.38);
}


/* ============================================================
   VIDEO BUTTON
============================================================ */

.video-button {
    position: relative;

    min-width: 230px;

    padding: 17px 28px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 13px;

    cursor: pointer;

    border:
        1px solid rgba(255, 255, 255, 0.18);

    background:
        rgba(0, 0, 0, 0.32);

    color: var(--white);

    font-size: 11px;

    font-weight: 500;

    letter-spacing: 0.12em;

    transition:
        background 0.5s var(--ease-cinematic),
        border-color 0.5s var(--ease-cinematic),
        transform 0.5s var(--ease-cinematic),
        box-shadow 0.5s var(--ease-cinematic);
}


.video-button::before {
    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 0, 0, 0.14),
            transparent
        );

    opacity: 0;

    transition:
        opacity 0.5s var(--ease-cinematic);
}


.video-button:hover {
    transform: translateY(-3px);

    border-color:
        rgba(255, 0, 0, 0.65);

    background:
        rgba(255, 0, 0, 0.08);

    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 0, 0, 0.12);
}


.video-button:hover::before {
    opacity: 1;
}


.video-button__icon {
    position: relative;

    color: var(--red);

    font-size: 11px;
}


/* ============================================================
   14. TRACK INFO
============================================================ */

.track-info {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    z-index: 20;

    min-height: 105px;

    padding:
        20px
        clamp(25px, 4vw, 65px);

    display: flex;

    align-items: center;
    justify-content: space-between;

    border-top:
        1px solid rgba(255, 255, 255, 0.08);

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0),
            rgba(0, 0, 0, 0.55)
        );

    backdrop-filter: blur(12px);

    transform:
        translateY(100%);

    opacity: 0;

    transition:
        transform 1s var(--ease-cinematic),
        opacity 1s var(--ease-cinematic);
}


.track-info[data-state="visible"] {
    transform: translateY(0);

    opacity: 1;
}


.track-info__meta {
    display: flex;

    align-items: center;

    gap: 22px;
}


.track-info__number {
    display: flex;

    align-items: baseline;

    gap: 3px;

    color: var(--red);
}


.track-info__number span {
    font-size: 10px;
}


.track-info__number strong {
    font-size: 32px;

    font-weight: 500;
}


.track-info__text {
    display: flex;

    flex-direction: column;

    gap: 3px;
}


.track-info__text h3 {
    margin: 0;

    font-size: 15px;

    font-weight: 500;
}


.track-info__text p {
    margin: 0;

    font-size: 10px;

    letter-spacing: 0.06em;

    color: var(--white-muted);
}


/* ============================================================
   BACK BUTTON
============================================================ */

.back-button {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 12px 0;

    cursor: pointer;

    color: rgba(255, 255, 255, 0.55);

    font-size: 9px;

    font-weight: 500;

    letter-spacing: 0.15em;

    transition:
        color 0.4s var(--ease-cinematic),
        transform 0.4s var(--ease-cinematic);
}


.back-button:hover {
    color: var(--white);

    transform: translateX(-4px);
}


.back-button__arrow {
    color: var(--red);

    font-size: 17px;
}


/* ============================================================
   15. TOAST
============================================================ */

.toast-container {
    position: fixed;

    right: 25px;
    bottom: 25px;

    z-index: 1000;

    display: flex;

    flex-direction: column;

    gap: 10px;

    pointer-events: none;
}


.toast {
    padding: 13px 18px;

    border:
        1px solid rgba(255, 255, 255, 0.1);

    background:
        rgba(10, 0, 1, 0.86);

    backdrop-filter: blur(15px);

    color: rgba(255, 255, 255, 0.8);

    font-size: 10px;

    letter-spacing: 0.05em;
}


/* ============================================================
   16. ANIMATIONS
============================================================ */

@keyframes background-breathe {

    from {
        transform:
            scale(1.08)
            translate3d(-0.5%, -0.5%, 0);
    }

    to {
        transform:
            scale(1.12)
            translate3d(0.5%, 0.4%, 0);
    }
}


@keyframes light-drift-one {

    from {
        transform:
            translate3d(-5vw, 2vh, 0)
            scale(0.92);
    }

    to {
        transform:
            translate3d(5vw, -4vh, 0)
            scale(1.08);
    }
}


@keyframes light-drift-two {

    from {
        transform:
            translate3d(4vw, -3vh, 0)
            scale(1);
    }

    to {
        transform:
            translate3d(-5vw, 5vh, 0)
            scale(0.9);
    }
}


@keyframes center-breathe {

    from {
        opacity: 0.25;

        transform:
            translate(-50%, -50%)
            scale(0.95);
    }

    to {
        opacity: 0.42;

        transform:
            translate(-50%, -50%)
            scale(1.05);
    }
}


@keyframes atmosphere-breathe {

    from {
        opacity: 0.42;

        transform:
            scale(0.98)
            translateX(-1%);
    }

    to {
        opacity: 0.68;

        transform:
            scale(1.04)
            translateX(1%);
    }
}


@keyframes haze-move {

    from {
        transform:
            translateX(-2%)
            scale(1.02);
    }

    to {
        transform:
            translateX(2%)
            scale(1.06);
    }
}


@keyframes grain-shift {

    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-1%, 1%);
    }

    50% {
        transform: translate(1%, -1%);
    }

    75% {
        transform: translate(1%, 1%);
    }

    100% {
        transform: translate(-1%, -1%);
    }
}


@keyframes logo-glow-breathe {

    from {
        opacity: 0.45;

        transform:
            translateZ(-25px)
            scale(0.96);
    }

    to {
        opacity: 0.78;

        transform:
            translateZ(-25px)
            scale(1.04);
    }
}


@keyframes loading-pulse {

    0%,
    100% {
        opacity: 0.35;

        transform: scale(0.96);
    }

    50% {
        opacity: 1;

        transform: scale(1);
    }
}


/* ============================================================
   17. RESPONSIVE
============================================================ */

@media (max-width: 1100px) {

    .numbers-grid {
        grid-template-columns:
            repeat(6, 1fr);
    }

    .number-button {
        min-height: 70px;
    }

    .board-section {
        width: 90vw;
    }
}


@media (max-width: 800px) {

    .topbar {
        min-height: 80px;

        padding:
            18px
            25px;
    }

    .game-name {
        display: none;
    }

    .brand-small {
        font-size: 15px;
    }

    .numbers-grid {
        grid-template-columns:
            repeat(5, 1fr);

        gap: 7px;
    }

    .number-button {
        min-height: 62px;

        font-size: 20px;
    }

    .board-section {
        gap: 20px;
    }

    .track-info {
        min-height: 85px;
    }
}


@media (max-width: 600px) {

    .topbar {
        grid-template-columns: 1fr auto;

        min-height: 70px;
    }

    .topbar__center {
        display: none;
    }

    .numbers-grid {
        grid-template-columns:
            repeat(4, 1fr);
    }

    .number-button {
        min-height: 58px;
    }

    .board-footer {
        padding:
            15px
            22px;
    }

    .track-info__text {
        max-width: 45vw;
    }

    .track-info__actions {
        flex-shrink: 0;
    }

    .back-button span:last-child {
        display: none;
    }
}


/* ============================================================
   18. REDUCED MOTION
============================================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;

        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   JS APPLICATION STATES
============================================================ */

#intro-scene.intro-camera-moving
.depth-layer--back {
    transform:
        translateZ(-350px)
        scale(0.78);
    opacity: 0.42;
    filter: blur(1px);
}

#intro-scene.intro-camera-moving
.depth-layer--middle {
    transform:
        translateZ(-120px)
        scale(0.94);
    opacity: 0.88;
}

#intro-scene.intro-camera-moving
.logo-image {
    filter:
        brightness(0.9)
        contrast(1.08)
        drop-shadow(
            0 0 35px rgba(255, 0, 0, 0.24)
        );
}

#intro-scene.intro-camera-rush {
    perspective:
        900px;
}

#intro-scene.intro-camera-rush
.depth-layer--middle {
    transition:
        transform 1.4s
        cubic-bezier(0.7, 0, 0.3, 1);
}

#intro-scene.intro-through-logo {
    background: #000;
}

#intro-scene.intro-through-logo
.depth-layer--back {
    opacity: 0;
}

#intro-scene.intro-through-logo
.depth-layer--front {
    opacity: 0;
}


/* Board / track scene */

#game-board.is-active,
#track-scene.is-active {
    animation:
        scene-enter
        0.9s
        cubic-bezier(0.16, 1, 0.3, 1)
        both;
}


@keyframes scene-enter {

    from {
        opacity: 0;
        transform:
            scale(1.025);
    }

    to {
        opacity: 1;
        transform:
            scale(1);
    }

}


/* Track video state */

#track-scene[data-video-visible="true"]
.video-background-placeholder {
    opacity: 0;
}

#track-scene[data-video-visible="true"]
.opening-video {
    opacity: 1;
}


/* Number transition */


.number-button[data-state="disabled"] {
    animation:
        number-error
        0.35s
        ease-in-out;
}


@keyframes number-error {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }

}


/* =========================================
   VIDEO ERROR STATE
   ========================================= */

#track-scene[data-video-error="false"] #video-error {
    display: none !important;
}

#track-scene[data-video-error="true"] #video-error {
    display: flex;
}

/* =========================================
   VIDEO LOADING / ERROR VISIBILITY
   ========================================= */

#video-loading[hidden],
#video-error[hidden] {
    display: none !important;
}

#video-loading[style*="display: none"],
#video-error[style*="display: none"] {
    display: none !important;
}

/* ============================================================
   GAME COMPLETE MODAL
============================================================ */

.game-complete-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    opacity: 1;

    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.game-complete-modal[hidden] {
    display: none;
}

.game-complete-modal__backdrop {
    position: absolute;
    inset: 0;

    background: transparent;

    pointer-events: none;
}
.game-complete-modal__content {
    position: relative;
    z-index: 1;

    width: min(560px, 90vw);

    padding: 64px 60px 58px;

    text-align: center;

    border:
        1px solid rgba(255, 255, 255, 0.1);

    background:
        linear-gradient(
            145deg,
            rgba(35, 3, 7, 0.96),
            rgba(8, 1, 2, 0.98)
        );

    box-shadow:
        0 40px 120px rgba(0, 0, 0, 0.75),
        0 0 80px rgba(255, 0, 0, 0.08);

    transform:
        translateY(20px)
        scale(0.96);

    animation:
        gameCompleteModalIn
        0.8s
        cubic-bezier(0.16, 1, 0.3, 1)
        forwards;
}

.game-complete-modal__line {
    width: 48px;
    height: 2px;

    margin: 0 auto 28px;

    background: #ff0000;

    box-shadow:
        0 0 20px rgba(255, 0, 0, 0.45);
}

.game-complete-modal__content h2 {
    margin: 0 0 42px;

    color: #ffffff;

    font-size: clamp(32px, 4vw, 52px);

    font-weight: 300;

    letter-spacing: -0.03em;

    text-shadow:
        0 0 40px rgba(255, 255, 255, 0.08);
}

.game-complete-modal__button {
    min-width: 220px;
    height: 58px;

    padding: 0 34px;

    border:
        1px solid rgba(255, 0, 0, 0.5);

    background:
        linear-gradient(
            135deg,
            rgba(255, 0, 0, 0.16),
            rgba(255, 0, 0, 0.05)
        );

    color: #ffffff;

    font-family: inherit;
    font-size: 15px;
    font-weight: 400;

    letter-spacing: 0.04em;

    cursor: pointer;

    transition:
        background 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease,
        transform 0.35s ease;
}

.game-complete-modal__button:hover {
    border-color: rgba(255, 0, 0, 0.85);

    background:
        linear-gradient(
            135deg,
            rgba(255, 0, 0, 0.28),
            rgba(255, 0, 0, 0.09)
        );

    box-shadow:
        0 0 35px rgba(255, 0, 0, 0.14);

    transform:
        translateY(-2px);
}

.game-complete-modal__button:active {
    transform:
        translateY(0);
}

.game-complete-modal__button:focus-visible {
    outline:
        1px solid rgba(255, 0, 0, 0.9);

    outline-offset: 5px;
}


@keyframes gameCompleteModalIn {

    from {
        opacity: 0;

        transform:
            translateY(30px)
            scale(0.94);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }

}

/* Подпись автора */
.made-by {
    position: absolute;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);

    margin: 0;
    padding: 0;

    color: rgba(255, 255, 255, 0.35);
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.4px;
    line-height: 1.5;
    text-align: center;

    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

/* ============================================================
   PLAYED TRACKS HISTORY — боковая панель
============================================================ */

.played-history {
    position: absolute;
    z-index: 30;
    top: 20%;
    right: clamp(22px, 2.5vw, 48px);
    width: min(330px, calc(100vw - 32px));
    transform: translateY(-50%);
    font-family: inherit;
}

.played-history__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 58px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 80, 80, 0.38);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.92);
    background:
        linear-gradient(115deg, rgba(76, 10, 19, 0.96), rgba(18, 8, 12, 0.97));
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.055em;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.played-history__toggle:hover {
    border-color: rgba(255, 80, 80, 0.75);
    background:
        linear-gradient(115deg, rgba(100, 12, 23, 0.98), rgba(25, 8, 13, 0.98));
}

.played-history__toggle:focus-visible {
    outline: 2px solid rgba(255, 80, 80, 0.9);
    outline-offset: 3px;
}

.played-history__toggle-icon {
    display: grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid rgba(255, 80, 80, 0.34);
    border-radius: 6px;
    color: #ff6464;
    background: rgba(255, 0, 0, 0.08);
    font-size: 18px;
}

.played-history__toggle-label {
    flex: 1;
    line-height: 1.45;
}

.played-history__count {
    display: inline-grid;
    flex: 0 0 26px;
    min-width: 26px;
    height: 26px;
    padding-inline: 4px;
    place-items: center;
    border-radius: 5px;
    color: #fff;
    background: rgba(255, 0, 0, 0.18);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.played-history__chevron {
    color: rgba(255, 255, 255, 0.62);
    font-size: 18px;
    transition: transform 180ms ease;
}

.played-history.is-open .played-history__chevron {
    transform: rotate(180deg);
}

.played-history__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(68vh, 690px);
    overflow: hidden;
    border: 1px solid rgba(255, 80, 80, 0.28);
    border-radius: 9px;
    background:
        linear-gradient(150deg, rgba(35, 11, 17, 0.985), rgba(11, 9, 12, 0.99));
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(18px);
}

.played-history__panel[hidden] {
    display: none;
}

.played-history__header {
    flex: 0 0 auto;
    padding: 19px 19px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.played-history__eyebrow {
    color: rgba(255, 90, 90, 0.8);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.17em;
}

.played-history__header h2 {
    margin: 8px 0 5px;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.played-history__header p {
    margin: 0;
    color: rgba(255, 255, 255, 0.48);
    font-size: 11px;
    line-height: 1.5;
}

.played-history__list {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 70px;
    margin: 0;
    padding: 4px 10px 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 75, 75, 0.55) rgba(255, 255, 255, 0.045);
    list-style: none;
}

.played-history__list::-webkit-scrollbar {
    width: 6px;
}

.played-history__list::-webkit-scrollbar-track {
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.played-history__list::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: rgba(255, 75, 75, 0.5);
}

.played-history__item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.played-history__item:last-child {
    border-bottom: 0;
}

.played-history__number {
    display: grid;
    align-self: start;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(255, 70, 70, 0.24);
    border-radius: 5px;
    color: #ff7777;
    background: rgba(255, 0, 0, 0.075);
    font-size: 10px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.played-history__song {
    margin: 0;
    color: rgba(255, 255, 255, 0.94);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.played-history__anime {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.52);
    font-size: 11px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.played-history__empty {
    padding: 24px 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

@media (max-width: 1200px) {
    .played-history {
        top: auto;
        right: 20px;
        bottom: 92px;
        width: min(300px, calc(100vw - 40px));
        transform: none;
    }

    .played-history__panel {
        top: auto;
        bottom: calc(100% + 10px);
        max-height: min(62vh, 560px);
    }
}

@media (max-width: 600px) {
    .played-history {
        right: 12px;
        bottom: 76px;
        width: min(280px, calc(100vw - 24px));
    }

    .played-history__toggle {
        min-height: 48px;
        padding: 10px 12px;
        gap: 8px;
        font-size: 10px;
    }

    .played-history__header {
        padding: 15px 15px 12px;
    }

    .played-history__header h2 {
        font-size: 15px;
    }

    .played-history__list {
        max-height: 45vh;
    }
}

/* ============================================================
   GAME RULES BUTTON
============================================================ */

.rules-button {
    position: absolute;
    left: 50px !important;
    right: auto;
    bottom: 70px !important;
    transform: translateY(-2px) !important;
}

.rules-button:hover {
    transform: translateY(-2px) !important;
}

.rules-button:active {
    transform: translateY(0) !important;
}

/* ============================================================
   GAME RULES VIDEO OVERLAY
============================================================ */

.rules-video-overlay {
    position: fixed;

    inset: 0;

    z-index: 10000;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 30px;

    background: rgba(0, 0, 0, 0.94);

    opacity: 0;

    transition: opacity 0.45s ease;

    cursor: pointer;
}

.rules-video-overlay[hidden] {
    display: none;
}

.rules-video-overlay.is-open {
    opacity: 1;
}

.rules-video-overlay.is-closing {
    opacity: 0;
}


.rules-video {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: contain;
    object-position: center;

    border: none;
    display: block;
}

.rules-video-overlay.is-open .rules-video {
    opacity: 1;

    transform: scale(1);
}
