:root {
    --background: #0c1020;
    --background-soft: #12182d;
    --surface: rgba(255, 255, 255, 0.08);
    --surface-strong: rgba(255, 255, 255, 0.13);
    --border: rgba(255, 255, 255, 0.12);

    --text: #ffffff;
    --text-soft: #b9bfd2;
    --text-muted: #858da8;

    --primary: #ff9d2e;
    --primary-light: #ffd36a;

    --shadow:
        0 24px 60px rgba(0, 0, 0, 0.28);

    --radius-small: 14px;
    --radius-medium: 22px;
    --radius-large: 32px;

    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(255, 157, 46, 0.18),
            transparent 30%
        ),
        radial-gradient(
            circle at 90% 20%,
            rgba(111, 78, 255, 0.18),
            transparent 30%
        ),
        var(--background);

    color: var(--text);
}

button,
a {
    font: inherit;
}

button {
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    width: min(
        calc(100% - 40px),
        var(--container)
    );

    margin: 0 auto;
    min-height: 88px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    border-radius: 15px;

    background:
        linear-gradient(
            145deg,
            var(--primary-light),
            var(--primary)
        );

    box-shadow:
        0 12px 30px rgba(255, 157, 46, 0.28);

    font-size: 24px;
}

.brand-name {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.sound-toggle {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: 50%;

    background: var(--surface);
    color: var(--text);

    cursor: pointer;
    font-size: 19px;

    transition:
        transform 180ms ease,
        background 180ms ease;
}

.sound-toggle:hover {
    transform: translateY(-2px);
    background: var(--surface-strong);
}

.hero {
    width: min(
        calc(100% - 40px),
        var(--container)
    );

    min-height: 590px;
    margin: 0 auto;

    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 50px;
}

.hero-content {
    max-width: 720px;
}

.hero-eyebrow,
.section-eyebrow {
    display: inline-block;

    color: var(--primary-light);

    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 780px;
    margin: 18px 0 22px;

    font-size: clamp(
        46px,
        7vw,
        84px
    );

    line-height: 0.96;
    letter-spacing: -0.065em;
}

.hero h1 span {
    display: block;
    color: var(--primary);
}

.hero p {
    max-width: 600px;
    margin: 0;

    color: var(--text-soft);

    font-size: clamp(
        17px,
        2vw,
        21px
    );

    line-height: 1.65;
}

.hero-button {
    width: fit-content;
    margin-top: 34px;
    padding: 15px 22px;

    display: inline-flex;
    align-items: center;
    gap: 14px;

    border-radius: 999px;

    background: var(--text);
    color: var(--background);

    font-weight: 800;

    transition:
        transform 180ms ease,
        box-shadow 180ms ease;
}

.hero-button:hover {
    transform: translateY(-3px);

    box-shadow:
        0 16px 35px rgba(255, 255, 255, 0.14);
}

.hero-visual {
    position: relative;

    min-height: 440px;

    display: grid;
    place-items: center;
}

.hero-dice {
    position: relative;
    z-index: 2;

    width: 210px;
    height: 210px;

    display: grid;
    place-items: center;

    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 54px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.18),
            rgba(255, 255, 255, 0.06)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        var(--shadow);

    backdrop-filter: blur(18px);

    font-size: 100px;

    transform: rotate(-8deg);
    animation: diceFloat 4s ease-in-out infinite;
}

.floating-card {
    position: absolute;

    width: 92px;
    height: 110px;

    display: grid;
    place-items: center;

    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 24px;

    background: rgba(255, 255, 255, 0.09);

    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.22);

    backdrop-filter: blur(14px);

    font-size: 42px;
}

.floating-card-one {
    top: 20px;
    left: 5%;
    transform: rotate(-12deg);
}

.floating-card-two {
    top: 68px;
    right: 3%;
    transform: rotate(14deg);
}

.floating-card-three {
    bottom: 10px;
    left: 18%;
    transform: rotate(8deg);
}

@keyframes diceFloat {
    0%,
    100% {
        transform:
            rotate(-8deg)
            translateY(0);
    }

    50% {
        transform:
            rotate(-5deg)
            translateY(-14px);
    }
}

.games-section {
    width: min(
        calc(100% - 40px),
        var(--container)
    );

    margin: 0 auto;
    padding: 80px 0 120px;
}

.section-heading {
    margin-bottom: 40px;

    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
}

.section-heading h2 {
    margin: 8px 0 0;

    font-size: clamp(
        34px,
        5vw,
        56px
    );

    letter-spacing: -0.05em;
}

.section-heading p {
    max-width: 390px;
    margin: 0;

    color: var(--text-soft);
    line-height: 1.6;
}

.games-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.game-card {
    min-height: 380px;
    perspective: 1100px;
    cursor: pointer;
    outline: none;
}

.game-card:focus-visible {
    border-radius: var(--radius-large);

    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.45);
}

.game-card-inner {
    position: relative;

    width: 100%;
    height: 100%;
    min-height: 380px;

    transform-style: preserve-3d;

    transition:
        transform 650ms
        cubic-bezier(
            0.2,
            0.8,
            0.2,
            1
        );
}

.game-card:hover .game-card-inner,
.game-card:focus-within .game-card-inner,
.game-card.is-flipped .game-card-inner {
    transform: rotateY(180deg);
}

.game-card-face {
    position: absolute;
    inset: 0;

    min-height: 380px;
    padding: 26px;

    display: flex;
    flex-direction: column;

    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow);

    backface-visibility: hidden;
    overflow: hidden;
}

.game-card-front::before,
.game-card-back::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.18),
            transparent 45%
        );

    pointer-events: none;
}

.game-card-front {
    justify-content: space-between;
}

.game-card-back {
    justify-content: space-between;
    transform: rotateY(180deg);
}

.game-card-laranja .game-card-face {
    background:
        linear-gradient(
            145deg,
            #ffb02e,
            #f06b28
        );
}

.game-card-azul .game-card-face {
    background:
        linear-gradient(
            145deg,
            #3dbcf5,
            #3457db
        );
}

.game-card-roxo .game-card-face {
    background:
        linear-gradient(
            145deg,
            #9c65ff,
            #6230c9
        );
}

.game-card-vermelho .game-card-face {
    background:
        linear-gradient(
            145deg,
            #ff6577,
            #c82c46
        );
}

.game-card-amarelo .game-card-face {
    background:
        linear-gradient(
            145deg,
            #ffd84d,
            #e99a15
        );
}

.game-card-verde .game-card-face {
    background:
        linear-gradient(
            145deg,
            #49dc9b,
            #16876d
        );
}

.game-card-top {
    position: relative;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.game-status {
    padding: 7px 11px;

    border-radius: 999px;

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

    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.flip-hint {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.16);

    font-size: 18px;
}

.game-icon-wrapper {
    position: relative;
    z-index: 1;

    display: grid;
    place-items: center;
    flex: 1;
}

.game-icon {
    font-size: 92px;

    filter:
        drop-shadow(
            0 16px 20px
            rgba(0, 0, 0, 0.18)
        );
}

.game-card-title {
    position: relative;
    z-index: 1;
}

.game-card-title h3,
.game-card-back h3 {
    margin: 0;

    font-size: 34px;
    letter-spacing: -0.045em;
}

.game-card-title p {
    margin: 8px 0 0;

    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    font-weight: 650;
}

.game-card-instruction {
    position: absolute;
    right: 26px;
    bottom: 28px;

    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

.game-card-back > div,
.game-card-back .game-button {
    position: relative;
    z-index: 1;
}

.game-back-label {
    display: inline-block;
    margin-bottom: 14px;

    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-transform: uppercase;

    opacity: 0.78;
}

.game-card-back p {
    margin: 18px 0 0;

    color: rgba(255, 255, 255, 0.9);

    font-size: 17px;
    line-height: 1.6;
}

.game-button {
    width: 100%;
    padding: 15px 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-radius: 16px;

    background: #ffffff;
    color: #171b2d;

    cursor: pointer;

    font-weight: 850;

    transition:
        transform 180ms ease,
        box-shadow 180ms ease;
}

.game-button:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 25px
        rgba(0, 0, 0, 0.16);
}

.game-button-disabled {
    justify-content: center;

    background: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.78);

    cursor: not-allowed;
}

.site-footer {
    width: min(
        calc(100% - 40px),
        var(--container)
    );

    margin: 0 auto;
    padding: 30px 0 50px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    border-top: 1px solid var(--border);

    color: var(--text-muted);
}

.site-footer span {
    color: var(--text);
    font-weight: 900;
}

.site-footer p {
    margin: 0;
    text-align: right;
}

.empty-message {
    color: var(--text-soft);
}

@media (max-width: 960px) {
    .hero {
        min-height: auto;
        padding: 70px 0 90px;

        grid-template-columns: 1fr;
    }

    .hero-content {
        max-width: none;
    }

    .hero-visual {
        min-height: 340px;
    }

    .hero-dice {
        width: 170px;
        height: 170px;

        font-size: 80px;
    }

    .games-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .site-header {
        width: min(
            calc(100% - 28px),
            var(--container)
        );

        min-height: 74px;
    }

    .brand-icon {
        width: 40px;
        height: 40px;

        border-radius: 13px;
    }

    .brand-name {
        font-size: 21px;
    }

    .sound-toggle {
        width: 40px;
        height: 40px;
    }

    .hero,
    .games-section,
    .site-footer {
        width: min(
            calc(100% - 28px),
            var(--container)
        );
    }

    .hero {
        padding: 52px 0 70px;
    }

    .hero h1 {
        font-size: clamp(
            44px,
            14vw,
            65px
        );
    }

    .hero-visual {
        min-height: 285px;
    }

    .hero-dice {
        width: 145px;
        height: 145px;

        border-radius: 40px;
        font-size: 68px;
    }

    .floating-card {
        width: 70px;
        height: 86px;

        border-radius: 19px;
        font-size: 32px;
    }

    .games-section {
        padding: 55px 0 80px;
    }

    .section-heading {
        align-items: start;
        flex-direction: column;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .game-card,
    .game-card-inner,
    .game-card-face {
        min-height: 350px;
    }

    .game-card:hover .game-card-inner {
        transform: none;
    }

    .game-card.is-flipped .game-card-inner,
    .game-card:focus-within .game-card-inner {
        transform: rotateY(180deg);
    }

    .site-footer {
        align-items: start;
        flex-direction: column;
    }

    .site-footer p {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

a.game-button {
    text-decoration: none;
}

a.game-button:visited {
    color: #171b2d;
}

/* Corrige o clique nos cards com efeito flip */
.game-card-front {
    pointer-events: auto;
    z-index: 2;
}

.game-card-back {
    pointer-events: none;
    z-index: 1;
}

.game-card:hover .game-card-front,
.game-card:focus-within .game-card-front,
.game-card.is-flipped .game-card-front {
    pointer-events: none;
    z-index: 1;
}

.game-card:hover .game-card-back,
.game-card:focus-within .game-card-back,
.game-card.is-flipped .game-card-back {
    pointer-events: auto;
    z-index: 2;
}

.game-button {
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

a.game-button {
    text-decoration: none;
}