* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;

    --bg: #060910;

    --panel:
        rgba(18, 26, 42, 0.84);

    --border:
        rgba(255, 255, 255, 0.09);

    --border-strong:
        rgba(255, 255, 255, 0.17);

    --text:
        #f8fafc;

    --muted:
        #94a3b8;

    --gold:
        #dcb65e;

    --gold-soft:
        rgba(220, 182, 94, 0.14);

    --success:
        #4ade80;

    --fire:
        #ef704c;

    --ice:
        #7dd3fc;

    --water:
        #60a5fa;
}


html,
body {
    margin: 0;
    min-height: 100%;
}


body {
    min-height: 100vh;

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color:
        var(--text);

    background:
        radial-gradient(
            circle at 50% 25%,
            #18253d 0%,
            #0a0f19 38%,
            var(--bg) 78%
        );
}


button {
    font: inherit;
}


.hidden {
    display: none !important;
}


.game-shell {
    width:
        min(1280px, 100%);

    margin:
        0 auto;

    padding:
        20px;
}


/* =========================================================
   TOPO
   ========================================================= */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding:
        17px 20px;

    border:
        1px solid var(--border);

    border-radius:
        18px;

    background:
        rgba(9, 14, 24, 0.84);
}


.brand-main {
    font-size:
        clamp(20px, 3vw, 30px);

    font-weight: 900;

    letter-spacing:
        0.15em;
}


.brand-subtitle {
    margin-top: 3px;

    color:
        var(--muted);

    font-size: 10px;

    letter-spacing:
        0.18em;
}


.restart-button {
    min-height: 42px;

    padding:
        0 17px;

    border:
        1px solid var(--border-strong);

    border-radius:
        999px;

    background:
        transparent;

    color:
        var(--text);

    cursor:
        pointer;
}


.restart-button:hover {
    background:
        rgba(255,255,255,0.06);
}


/* =========================================================
   STATUS
   ========================================================= */

.status-strip {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 10px;

    margin-top: 12px;
}


.status-item {
    padding:
        12px 14px;

    border:
        1px solid var(--border);

    border-radius:
        13px;

    background:
        var(--panel);
}


.status-item span {
    display: block;

    margin-bottom: 4px;

    color:
        var(--muted);

    font-size: 9px;

    font-weight: 700;

    letter-spacing:
        0.09em;

    text-transform:
        uppercase;
}


.status-item strong {
    font-size: 15px;
}


/* =========================================================
   INTRO
   ========================================================= */

.intro-panel,
.titan-intro {
    padding:
        42px 20px 28px;

    text-align:
        center;
}


.eyebrow {
    margin-bottom: 7px;

    color:
        var(--gold);

    font-size: 10px;

    font-weight: 900;

    letter-spacing:
        0.20em;
}


.intro-panel h1,
.titan-intro h1 {
    margin: 0;

    font-size:
        clamp(27px, 5vw, 44px);
}


.intro-panel p,
.titan-intro p {
    max-width: 650px;

    margin:
        12px auto 0;

    color:
        var(--muted);

    line-height:
        1.6;
}


/* =========================================================
   CARTA REVELADA
   ========================================================= */

.reveal-panel {
    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 10px;

    margin-bottom: 26px;
}


.reveal-label {
    color:
        var(--gold);

    font-size: 9px;

    font-weight: 900;

    letter-spacing:
        0.18em;
}


.revealed-card {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 126px;

    min-height: 172px;

    padding: 14px;

    border:
        1px solid rgba(
            220,
            182,
            94,
            0.45
        );

    border-radius: 15px;

    background:
        radial-gradient(
            circle at 50% 20%,
            #32415d,
            #172033 55%,
            #0b1019
        );

    color:
        var(--gold);

    text-align: center;

    font-size: 17px;

    font-weight: 900;
}


/* =========================================================
   BARALHO
   ========================================================= */

.deck-section,
.titan-zone,
.battlefield {
    padding: 18px;

    border:
        1px solid rgba(
            220,
            182,
            94,
            0.20
        );

    border-radius: 20px;

    background:
        rgba(9, 14, 24, 0.76);
}


.section-heading,
.hand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 16px;
}


.section-heading h2,
.hand-header h2 {
    margin: 3px 0 0;

    font-size: 18px;
}


.section-label {
    color:
        var(--muted);

    font-size: 9px;

    font-weight: 800;

    letter-spacing:
        0.13em;
}


.remaining-label,
.hand-count {
    padding:
        7px 11px;

    border:
        1px solid var(--border);

    border-radius:
        999px;

    color:
        var(--muted);

    font-size:
        11px;
}


/* =========================================================
   CARTAS OCULTAS
   ========================================================= */

.hidden-deck {
    display: grid;

    grid-template-columns:
        repeat(9, minmax(0, 1fr));

    gap: 9px;
}


.hidden-card {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;

    aspect-ratio: 0.72;

    min-height: 86px;

    border:
        1px solid rgba(
            220,
            182,
            94,
            0.34
        );

    border-radius: 10px;

    background:
        radial-gradient(
            circle at 50% 42%,
            #34435e 0%,
            #172035 52%,
            #0c111c 100%
        );

    color:
        var(--gold);

    cursor: pointer;

    transition:
        transform 0.14s ease,
        border-color 0.14s ease;
}


.hidden-card::before {
    content: "";

    position: absolute;

    inset: 6px;

    border:
        1px solid rgba(
            220,
            182,
            94,
            0.18
        );

    border-radius: 7px;
}


.hidden-card span {
    position: relative;

    z-index: 1;

    font-size: 14px;

    font-weight: 900;
}


.hidden-card:hover {
    transform:
        translateY(-7px)
        scale(1.045);

    border-color:
        var(--gold);
}


.hidden-card:disabled {
    cursor: default;

    opacity: 0.45;

    transform: none;
}


/* =========================================================
   MÃOS
   ========================================================= */

.hands-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;

    margin-top: 14px;
}


.hand-panel {
    min-width: 0;

    padding: 17px;

    border:
        1px solid var(--border);

    border-radius: 18px;

    background:
        var(--panel);
}


.human-panel {
    border-color:
        rgba(
            220,
            182,
            94,
            0.20
        );
}


.hand-row,
.titan-row {
    display: flex;

    gap: 10px;

    min-height: 140px;

    overflow-x: auto;
}


.hand-card {
    flex:
        0 0 94px;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 132px;

    padding: 9px;

    border:
        1px solid var(--border-strong);

    border-radius: 11px;

    background:
        linear-gradient(
            145deg,
            #26334c,
            #101725
        );

    text-align: center;

    font-size: 12px;

    font-weight: 800;
}


.cpu-card-back {
    color:
        var(--gold);

    border-color:
        rgba(
            220,
            182,
            94,
            0.28
        );
}


.empty-state {
    display: flex;

    align-items: center;

    color:
        var(--muted);

    font-size: 12px;
}


/* =========================================================
   DISTRIBUIÇÃO CONCLUÍDA
   ========================================================= */

.setup-complete,
.reveal-result {
    display: flex;

    align-items: center;

    gap: 14px;

    margin-top: 14px;

    padding: 17px;

    border:
        1px solid rgba(
            74,
            222,
            128,
            0.26
        );

    border-radius: 15px;

    background:
        rgba(
            74,
            222,
            128,
            0.07
        );
}


.complete-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    border-radius: 50%;

    background:
        rgba(
            74,
            222,
            128,
            0.13
        );

    color:
        var(--success);

    font-weight: 900;
}


.complete-title {
    color:
        var(--success);

    font-weight: 800;
}


.complete-text {
    margin-top: 3px;

    color:
        var(--muted);

    font-size: 12px;
}


/* =========================================================
   TITÃS
   ========================================================= */

.titan-selection-section {
    margin-top: 10px;
}


.titan-zone + .titan-zone {
    margin-top: 14px;
}


.human-titan-zone {
    border-color:
        rgba(
            220,
            182,
            94,
            0.28
        );
}


.titan-card {
    flex:
        0 0 150px;

    min-height: 200px;

    padding: 0;

    border:
        1px solid var(--border-strong);

    border-radius: 15px;

    background:
        linear-gradient(
            145deg,
            #28364f,
            #101725
        );

    color:
        var(--text);

    cursor: default;

    overflow: hidden;
}


.titan-card.selectable {
    cursor: pointer;

    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}


.titan-card.selectable:hover {
    transform:
        translateY(-6px);

    border-color:
        var(--gold);

    box-shadow:
        0 12px 30px
        rgba(0,0,0,0.35);
}


.titan-card:disabled {
    cursor: default;
}


.titan-card-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    height: 100%;

    min-height: 198px;

    padding: 13px;
}


.titan-type {
    color:
        var(--muted);

    font-size: 9px;

    font-weight: 800;

    letter-spacing:
        0.12em;
}


.titan-name {
    text-align: center;

    font-size: 19px;

    font-weight: 900;
}


.titan-element {
    text-align: center;

    font-size: 11px;

    font-weight: 800;
}


.titan-fire {
    border-color:
        rgba(239, 112, 76, 0.42);
}


.titan-fire .titan-element {
    color:
        var(--fire);
}


.titan-ice {
    border-color:
        rgba(125, 211, 252, 0.42);
}


.titan-ice .titan-element {
    color:
        var(--ice);
}


.titan-water {
    border-color:
        rgba(96, 165, 250, 0.42);
}


.titan-water .titan-element {
    color:
        var(--water);
}


/* =========================================================
   CAMPO DE BATALHA
   ========================================================= */

.battlefield {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr);

    align-items: center;

    gap: 20px;

    max-width: 760px;

    margin:
        0 auto 18px;
}


.battle-side {
    text-align: center;
}


.battle-slot {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 180px;

    margin-top: 8px;

    padding: 12px;

    border:
        1px dashed var(--border-strong);

    border-radius: 15px;

    background:
        rgba(0,0,0,0.18);

    color:
        var(--muted);
}


.battle-titan {
    display: flex;
    flex-direction: column;
    justify-content: center;

    gap: 7px;

    width: 100%;

    min-height: 150px;

    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            #26344c,
            #111827
        );
}


.battle-titan strong {
    font-size: 20px;
}


.face-down-titan {
    color:
        var(--gold);

    font-weight: 900;

    letter-spacing:
        0.08em;
}


.versus {
    color:
        var(--gold);

    font-size: 22px;

    font-weight: 900;
}


/* =========================================================
   MENSAGEM
   ========================================================= */

.game-message {
    margin:
        14px 0 5px;

    padding:
        13px 15px;

    border:
        1px solid var(--border);

    border-radius: 13px;

    background:
        var(--gold-soft);

    color:
        #f1d598;

    text-align: center;

    font-size: 13px;
}


/* =========================================================
   RESPONSIVO
   ========================================================= */

@media (max-width: 800px) {

    .game-shell {
        padding: 10px;
    }


    .status-strip {
        grid-template-columns:
            repeat(2, 1fr);
    }


    .hidden-deck {
        grid-template-columns:
            repeat(6, minmax(0, 1fr));
    }


    .hands-grid {
        grid-template-columns:
            1fr;
    }


    .battlefield {
        gap: 8px;
    }


    .titan-card {
        flex-basis: 120px;

        min-height: 170px;
    }


    .titan-card-inner {
        min-height: 168px;
    }
}


@media (max-width: 480px) {

    .hidden-deck {
        grid-template-columns:
            repeat(5, minmax(0, 1fr));
    }


    .deck-section,
    .hand-panel,
    .titan-zone {
        padding: 13px;
    }


    .battle-slot {
        min-height: 135px;
    }


    .versus {
        font-size: 15px;
    }
}