* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;

    font-family:
        Tahoma,
        Arial,
        sans-serif;

    color: #fff;

    background:
        radial-gradient(
            circle at top,
            #681452 0%,
            #32102f 38%,
            #15091b 100%
        );

    overflow-x: hidden;
}

button,
input {
    font-family: inherit;
}

button {
    cursor: pointer;
}

.background-hearts {
    position: fixed;
    inset: 0;

    pointer-events: none;

    overflow: hidden;

    z-index: 0;
}

.floating-heart {
    position: absolute;

    bottom: -50px;

    opacity: .18;

    animation:
        floatHeart linear infinite;
}

@keyframes floatHeart {

    from {
        transform:
            translateY(0)
            rotate(0deg);
    }

    to {
        transform:
            translateY(-110vh)
            rotate(360deg);
    }
}

.app {
    position: relative;

    z-index: 1;

    width: min(1050px, 94%);

    margin: auto;

    padding:
        25px 0 60px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;

    animation:
        fadeIn .35s ease;
}

@keyframes fadeIn {

    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* HERO */

.hero {
    text-align: center;

    padding:
        35px 10px 20px;
}

.logo {
    font-size: 70px;

    filter:
        drop-shadow(
            0 10px 25px
            rgba(255, 0, 130, .25)
        );
}

.hero h1 {
    margin-top: 5px;

    font-size:
        clamp(35px, 7vw, 58px);

    font-weight: 900;
}

.hero p {
    margin-top: 10px;

    color: #efc9e3;

    font-size: 16px;
}


/* GLASS */

.glass-card {
    margin: 18px 0;

    padding: 24px;

    border-radius: 28px;

    background:
        rgba(255,255,255,.075);

    border:
        1px solid
        rgba(255,255,255,.13);

    box-shadow:
        0 20px 60px
        rgba(0,0,0,.25);

    backdrop-filter:
        blur(18px);
}

.home-card {
    width: min(580px, 100%);

    margin:
        20px auto;
}

.center {
    text-align: center;
}


/* INPUTS */

.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;

    margin-bottom: 8px;

    color: #ffd8ef;

    font-weight: bold;
}

.input-group input {
    width: 100%;

    border: 1px solid
        rgba(255,255,255,.14);

    outline: none;

    border-radius: 16px;

    padding: 15px 17px;

    color: #fff;

    background:
        rgba(0,0,0,.25);

    font-size: 17px;

    transition: .2s;
}

.input-group input:focus {
    border-color: #ff4e9b;

    box-shadow:
        0 0 0 3px
        rgba(255,78,155,.1);
}

.input-group input::placeholder {
    color: #a993a7;
}


/* BUTTONS */

.home-buttons {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 12px;

    margin-top: 22px;
}

.main-btn,
.secondary-btn,
.small-btn,
.text-btn,
.action {
    border: 0;

    transition:
        transform .2s,
        opacity .2s;
}

.main-btn {
    width: 100%;

    padding: 15px 20px;

    border-radius: 16px;

    color: white;

    font-weight: 900;

    background:
        linear-gradient(
            135deg,
            #ff3d91,
            #9c35ff
        );

    box-shadow:
        0 10px 25px
        rgba(255,50,145,.18);
}

.secondary-btn {
    width: 100%;

    padding: 15px 20px;

    border-radius: 16px;

    color: white;

    background:
        rgba(255,255,255,.08);

    border:
        1px solid
        rgba(255,255,255,.13);
}

.main-btn:hover,
.secondary-btn:hover,
.action:hover {
    transform:
        translateY(-2px);
}

.info-box {
    margin-top: 18px;

    padding: 15px;

    line-height: 1.9;

    border-radius: 16px;

    color: #d9c7d7;

    background:
        rgba(0,0,0,.16);

    font-size: 13px;
}


/* LOBBY */

.small-label {
    color: #cdb6ca;

    font-size: 13px;
}

.room-code {
    margin: 12px 0 22px;

    font-size:
        clamp(30px, 8vw, 50px);

    font-weight: 900;

    letter-spacing: 5px;

    color: #ffd2ed;
}

.waiting {
    margin-top: 18px;

    padding: 15px;

    border-radius: 15px;

    background:
        rgba(255,255,255,.06);

    color: #f2ddea;
}

.text-btn {
    margin-top: 18px;

    background: transparent;

    color: #d8c0d4;
}


/* GAME HEADER */

.game-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    padding: 12px 0 20px;

    color: #d6c3d4;
}

.mini-title {
    color: #fff;

    font-weight: 900;

    font-size: 20px;

    margin-bottom: 4px;
}

.small-btn {
    padding: 9px 14px;

    border-radius: 12px;

    color: #fff;

    background:
        rgba(255,255,255,.08);

    border:
        1px solid
        rgba(255,255,255,.12);
}


/* PLAYERS */

.players {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 12px;
}

.player-card {
    padding: 18px;

    border-radius: 20px;

    text-align: center;

    background:
        rgba(255,255,255,.07);

    border:
        1px solid
        rgba(255,255,255,.1);

    transition: .3s;
}

.player-card.active {
    border-color: #ff4b99;

    box-shadow:
        0 0 30px
        rgba(255,65,150,.18);
}

.player-avatar {
    font-size: 27px;
}

.player-name {
    margin-top: 7px;

    font-size: 20px;

    font-weight: 900;
}

.player-status {
    margin-top: 5px;

    font-size: 12px;

    color: #96f3b4;
}

.player-status.waiting {
    margin-top: 5px;

    padding: 0;

    background: transparent;

    color: #d6bfd2;
}


/* TURN */

.turn-box {
    margin: 18px 0;

    padding: 18px;

    text-align: center;

    border-radius: 20px;

    background:
        linear-gradient(
            135deg,
            rgba(255,55,145,.15),
            rgba(155,50,255,.15)
        );

    border:
        1px solid
        rgba(255,255,255,.1);

    font-size: 20px;

    font-weight: 900;
}


/* LEVELS */

.glass-card h2 {
    margin-bottom: 17px;

    font-size: 21px;
}

.levels {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 12px;
}

.level-card {
    padding: 17px;

    border-radius: 19px;

    background:
        rgba(255,255,255,.055);

    border:
        1px solid
        rgba(255,255,255,.09);

    transition: .3s;
}

.level-card.locked {
    opacity: .38;
}

.level-header {
    display: flex;

    justify-content: space-between;

    gap: 8px;

    margin-bottom: 10px;

    font-size: 13px;
}

.level-header span {
    color: #d6bfd2;
}

.progress {
    height: 8px;

    overflow: hidden;

    border-radius: 20px;

    background:
        rgba(255,255,255,.08);
}

.progress div {
    width: 0;

    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #ff3e91,
            #9c3cff
        );

    transition: width .3s;
}


/* SECTION */

.section-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;
}

.section-header h2 {
    margin-bottom: 3px;
}

.section-header p {
    color: #bca7b9;

    font-size: 13px;
}

.current-level-badge {
    padding: 8px 12px;

    border-radius: 12px;

    color: #ffd3eb;

    background:
        rgba(255,60,145,.12);

    border:
        1px solid
        rgba(255,60,145,.2);

    white-space: nowrap;
}


/* QUESTIONS */

.question-grid {
    display: grid;

    grid-template-columns:
        repeat(6, 1fr);

    gap: 9px;

    margin-top: 18px;
}

.question-number {
    aspect-ratio: 1;

    border-radius: 13px;

    color: white;

    font-weight: 900;

    background:
        rgba(255,255,255,.08);

    border:
        1px solid
        rgba(255,255,255,.08);

    transition: .2s;
}

.question-number:not(:disabled):hover {
    transform: scale(1.04);

    background:
        rgba(255,55,145,.2);
}

.question-number.used {
    opacity: .25;

    cursor: not-allowed;

    background:
        rgba(255,255,255,.025);
}

.question-number:disabled {
    cursor: not-allowed;
}


/* EVENTS */

.events {
    max-height: 310px;

    overflow-y: auto;

    padding-right: 3px;
}

.event {
    margin-bottom: 8px;

    padding: 13px 15px;

    border-radius: 14px;

    background:
        rgba(255,255,255,.055);

    color: #f1e1ed;

    line-height: 1.6;
}

.event-time {
    display: block;

    margin-top: 3px;

    color: #9c8999;

    font-size: 11px;
}


/* STATS */

.stats-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 12px;
}

.stat {
    padding: 18px;

    border-radius: 18px;

    text-align: center;

    background:
        rgba(255,255,255,.055);
}

.stat span {
    display: block;

    margin-bottom: 8px;

    color: #f3ddeb;

    font-weight: bold;
}

.stat strong {
    display: block;

    font-size: 35px;

    color: #ff9dca;
}

.stat small {
    color: #ad99aa;
}


/* MODAL */

.modal-overlay {
    position: fixed;

    inset: 0;

    z-index: 50;

    display: none;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        rgba(0,0,0,.75);
}

.modal-overlay.show {
    display: flex;
}

.question-modal {
    width: min(650px, 100%);

    padding: 26px;

    border-radius: 28px;

    background:
        linear-gradient(
            145deg,
            #35143c,
            #190b20
        );

    border:
        1px solid
        rgba(255,255,255,.14);

    box-shadow:
        0 30px 100px
        rgba(0,0,0,.55);

    text-align: center;

    animation:
        modalIn .25s ease;
}

@keyframes modalIn {

    from {
        opacity: 0;
        transform: scale(.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-top {
    display: flex;

    align-items: center;

    justify-content: space-between;

    color: #cdb9ca;
}

.close-btn {
    width: 35px;

    height: 35px;

    border-radius: 50%;

    color: white;

    background:
        rgba(255,255,255,.08);

    font-size: 25px;
}

.modal-player {
    margin-top: 18px;

    color: #ff94c6;

    font-weight: bold;
}

.modal-question {
    margin: 23px 0;

    font-size:
        clamp(22px, 5vw, 32px);

    line-height: 1.75;

    font-weight: 900;
}

.action-buttons {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;
}

.action {
    padding: 15px;

    border-radius: 15px;

    color: white;

    font-weight: 900;
}

.answer {
    background:
        linear-gradient(
            135deg,
            #ff3d91,
            #ff4d68
        );
}

.escape {
    background:
        linear-gradient(
            135deg,
            #762dff,
            #4c40b7
        );
}

.later {
    background:
        rgba(255,255,255,.09);

    border:
        1px solid
        rgba(255,255,255,.12);
}


/* RESULTS */

.winner {
    margin-bottom: 25px;

    padding: 18px;

    border-radius: 18px;

    text-align: center;

    color: #ffd0eb;

    background:
        rgba(255,55,145,.1);

    font-size: 22px;

    font-weight: 900;
}

.results-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 15px;

    margin-bottom: 20px;
}

.result-card {
    padding: 22px;

    border-radius: 22px;

    text-align: center;

    background:
        rgba(255,255,255,.06);

    border:
        1px solid
        rgba(255,255,255,.1);
}

.result-name {
    font-size: 21px;

    font-weight: 900;
}

.result-percent {
    margin: 12px 0;

    font-size: 48px;

    font-weight: 900;

    color: #ff9ac8;
}

.result-line {
    margin-top: 8px;

    color: #cdbaca;
}

.result-title {
    margin-top: 16px;

    color: #ffd2eb;

    font-weight: bold;
}


/* TOAST */

.toast {
    position: fixed;

    left: 50%;

    bottom: 25px;

    z-index: 100;

    transform:
        translate(-50%, 120px);

    opacity: 0;

    padding: 13px 20px;

    border-radius: 14px;

    color: white;

    background:
        rgba(35,10,35,.95);

    border:
        1px solid
        rgba(255,255,255,.13);

    box-shadow:
        0 10px 40px
        rgba(0,0,0,.3);

    transition: .3s;

    white-space: nowrap;
}

.toast.show {
    transform:
        translate(-50%, 0);

    opacity: 1;
}


/* MOBILE */

@media(max-width:700px) {

    .app {
        width: 94%;
    }

    .home-buttons,
    .players,
    .stats-grid,
    .results-grid {
        grid-template-columns: 1fr;
    }

    .levels {
        grid-template-columns: 1fr;
    }

    .question-grid {
        grid-template-columns:
            repeat(5, 1fr);
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .glass-card {
        padding: 18px;
        border-radius: 22px;
    }

    .game-header {
        align-items: flex-start;
    }

    .room-code {
        letter-spacing: 3px;
    }
}