/* Star Soft — Games arcade */

:root {
    --gg-ink: #0b0b0d;
    --gg-ink-2: #141418;
    --gg-panel: #1a1a20;
    --gg-mist: #f3eee6;
    --gg-muted: rgba(243, 238, 230, 0.62);
    --gg-accent: #c2185b;
    --gg-champagne: #b79b6c;
    --gg-line: rgba(243, 238, 230, 0.12);
    --gg-ok: #3d9b7a;
    --gg-warn: #d4a017;
    --gg-font: "Manrope", system-ui, sans-serif;
    --gg-display: "Syne", sans-serif;
    --gg-gutter: max(1rem, calc((100% - 64rem) / 2));
    --gg-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

.gg-body {
    font-family: var(--gg-font);
    color: var(--gg-mist);
    background:
        radial-gradient(90% 60% at 10% -10%, rgba(194, 24, 91, 0.18), transparent 50%),
        radial-gradient(70% 50% at 100% 0%, rgba(183, 155, 108, 0.12), transparent 45%),
        var(--gg-ink);
    -webkit-font-smoothing: antialiased;
}

.gg-shell {
    min-height: 100vh;
    min-height: 100svh;
    padding: 0 0 2.5rem;
}

.gg-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem var(--gg-gutter);
    border-bottom: 1px solid var(--gg-line);
    background: rgba(11, 11, 13, 0.72);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.gg-top__back,
.gg-top__brand {
    color: var(--gg-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
}

.gg-top__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--gg-mist);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--gg-display);
    font-size: 0.78rem;
}

.gg-top__brand img {
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 50%;
    object-fit: cover;
}

.gg-top__badge {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.55rem;
    border: 1px solid rgba(61, 155, 122, 0.45);
    color: #8fd6b8;
    border-radius: 999px;
}

.gg-top__badge.is-offline {
    border-color: rgba(183, 155, 108, 0.5);
    color: var(--gg-champagne);
}

/* Lobby */
.gg-hero {
    padding: 2.75rem var(--gg-gutter) 1.5rem;
}

.gg-hero h1 {
    margin: 0 0 0.55rem;
    font-family: var(--gg-display);
    font-size: clamp(2rem, 5vw, 3.1rem);
    letter-spacing: -0.02em;
}

.gg-hero p {
    margin: 0;
    max-width: 38ch;
    color: var(--gg-muted);
    line-height: 1.55;
}

.gg-grid {
    display: grid;
    gap: 1rem;
    padding: 1.25rem var(--gg-gutter) 0;
}

@media (min-width: 720px) {
    .gg-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.15rem;
    }
}

.gg-card {
    display: grid;
    gap: 0.65rem;
    padding: 1.35rem 1.25rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--gg-line);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), transparent 55%), var(--gg-panel);
    border-radius: 4px;
    transition: transform 0.25s var(--gg-ease), border-color 0.25s ease;
}

.gg-card:hover {
    transform: translateY(-2px);
    border-color: rgba(194, 24, 91, 0.45);
}

.gg-card__tag {
    width: fit-content;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gg-champagne);
}

.gg-card h2 {
    margin: 0;
    font-family: var(--gg-display);
    font-size: 1.45rem;
}

.gg-card p {
    margin: 0;
    color: var(--gg-muted);
    line-height: 1.5;
    font-size: 0.95rem;
}

.gg-card__cta {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #f3a0c0;
}

.gg-note {
    padding: 1.5rem var(--gg-gutter) 0;
    color: var(--gg-muted);
    font-size: 0.85rem;
}

/* Game chrome */
.gg-play {
    padding: 1.25rem var(--gg-gutter) 0;
    display: grid;
    gap: 1rem;
    justify-items: center;
}

.gg-play__bar {
    width: min(100%, 28rem);
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    justify-content: space-between;
}

.gg-play__title {
    margin: 0;
    font-family: var(--gg-display);
    font-size: 1.35rem;
}

.gg-play__meta {
    color: var(--gg-muted);
    font-size: 0.85rem;
}

.gg-btn {
    appearance: none;
    border: 1px solid var(--gg-line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--gg-mist);
    min-height: 2.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 3px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.gg-btn:hover {
    border-color: rgba(243, 238, 230, 0.28);
}

.gg-btn--accent {
    background: var(--gg-accent);
    border-color: var(--gg-accent);
}

.gg-btn--accent:hover {
    filter: brightness(1.08);
}

.gg-controls {
    width: min(100%, 28rem);
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.85rem;
    align-items: center;
}

.gg-controls label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: var(--gg-muted);
}

.gg-controls select {
    appearance: none;
    min-height: 2.3rem;
    padding: 0.35rem 1.8rem 0.35rem 0.7rem;
    border: 1px solid var(--gg-line);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23b79b6c' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 0.55rem center;
    color: var(--gg-mist);
    font: inherit;
    font-size: 0.85rem;
}

.gg-board-wrap {
    width: min(100%, 28rem);
    touch-action: manipulation;
}

.gg-time {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.gg-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.gg-stage {
    position: relative;
    width: min(100%, 28rem);
    display: grid;
    gap: 1rem;
    justify-items: center;
}

.gg-pause-veil {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    border-radius: 4px;
    background: rgba(11, 11, 13, 0.88);
    backdrop-filter: blur(6px);
    color: var(--gg-mist);
    text-align: center;
}

.gg-pause-veil[hidden] {
    display: none !important;
}

.gg-pause-veil strong {
    display: block;
    font-family: var(--gg-display);
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.gg-pause-veil p {
    margin: 0;
    color: var(--gg-muted);
    font-size: 0.9rem;
}

.gg-play.is-paused .dm-board,
.gg-play.is-paused .mm-grid,
.gg-play.is-paused .sn-wrap,
.gg-play.is-paused .dd-stage {
    pointer-events: none;
    filter: grayscale(0.35) brightness(0.72);
}

/* Sudoku */
.sdk-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background: rgba(243, 238, 230, 0.18);
    border: 2px solid rgba(183, 155, 108, 0.55);
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 1;
}

.sdk-cell {
    border: 0;
    margin: 0;
    padding: 0;
    background: var(--gg-ink-2);
    color: var(--gg-mist);
    font: inherit;
    font-size: clamp(0.95rem, 3.8vw, 1.25rem);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

.sdk-cell:nth-child(9n + 1),
.sdk-cell:nth-child(9n + 4),
.sdk-cell:nth-child(9n + 7) {
    box-shadow: inset 2px 0 0 rgba(183, 155, 108, 0.35);
}

.sdk-cell:nth-child(-n + 9),
.sdk-cell:nth-child(n + 28):nth-child(-n + 36),
.sdk-cell:nth-child(n + 55):nth-child(-n + 63) {
    box-shadow: inset 0 2px 0 rgba(183, 155, 108, 0.35);
}

.sdk-cell.is-fixed {
    color: var(--gg-champagne);
    background: #121218;
}

.sdk-cell.is-selected {
    outline: 2px solid var(--gg-accent);
    outline-offset: -2px;
    z-index: 1;
}

.sdk-cell.is-same {
    background: rgba(194, 24, 91, 0.16);
}

.sdk-cell.is-error {
    color: #ff8aa0;
}

.sdk-pad {
    width: min(100%, 28rem);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
}

.sdk-pad button {
    min-height: 2.75rem;
}

/* Damas */
.dm-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    aspect-ratio: 1;
    width: min(100%, 28rem);
    border: 3px solid rgba(183, 155, 108, 0.5);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.dm-sq {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.dm-sq.is-light {
    background: #d9cfc0;
}

.dm-sq.is-dark {
    background: #3a3340;
}

.dm-sq.is-hi {
    box-shadow: inset 0 0 0 3px #f3a0c0;
}

.dm-sq.is-move {
    box-shadow: inset 0 0 0 3px #8fd6b8;
}

.dm-piece {
    width: 72%;
    height: 72%;
    border-radius: 50%;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25), 0 4px 10px rgba(0, 0, 0, 0.25);
}

.dm-piece.is-red {
    background: radial-gradient(circle at 35% 30%, #ff8aa8, #c2185b 60%, #7a1848);
}

.dm-piece.is-black {
    background: radial-gradient(circle at 35% 30%, #5a6270, #1f2430 62%, #0b0b0d);
}

.dm-piece.is-king::after {
    content: "★";
    display: grid;
    place-items: center;
    height: 100%;
    color: #f6e7b2;
    font-size: 0.95rem;
}

/* Snake */
.sn-wrap {
    width: min(100%, 28rem);
    display: grid;
    gap: 0.75rem;
}

.sn-canvas {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    border: 2px solid rgba(183, 155, 108, 0.45);
    background: #0e1016;
    display: block;
    touch-action: none;
}

.sn-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    max-width: 12rem;
    margin-inline: auto;
}

.sn-pad .gg-btn:nth-child(1) { grid-column: 2; }
.sn-pad .gg-btn:nth-child(2) { grid-column: 1; }
.sn-pad .gg-btn:nth-child(3) { grid-column: 2; }
.sn-pad .gg-btn:nth-child(4) { grid-column: 3; grid-row: 2; }

/* Memory */
.mm-grid {
    width: min(100%, 28rem);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.55rem;
}

.mm-card {
    aspect-ratio: 1;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    perspective: 700px;
    background: transparent;
    padding: 0;
}

.mm-card__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.45s var(--gg-ease);
}

.mm-card.is-flipped .mm-card__inner,
.mm-card.is-matched .mm-card__inner {
    transform: rotateY(180deg);
}

.mm-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 6px;
    display: grid;
    place-items: center;
    font-size: clamp(1.2rem, 5vw, 1.8rem);
}

.mm-face--back {
    background: linear-gradient(145deg, #2a2430, #15151c);
    border: 1px solid rgba(183, 155, 108, 0.35);
}

.mm-face--back::after {
    content: "";
    width: 28%;
    height: 28%;
    border-radius: 50%;
    border: 2px solid rgba(194, 24, 91, 0.7);
    box-shadow: 0 0 0 4px rgba(183, 155, 108, 0.15);
}

.mm-face--front {
    transform: rotateY(180deg);
    background: linear-gradient(160deg, #2b2030, #1a1520);
    border: 1px solid rgba(243, 160, 192, 0.35);
}

.mm-card.is-matched .mm-face--front {
    border-color: rgba(61, 155, 122, 0.55);
    box-shadow: 0 0 0 1px rgba(61, 155, 122, 0.35);
}

.mm-grid.is-easy {
    grid-template-columns: repeat(3, 1fr);
    max-width: 20rem;
}

.mm-grid.is-hard {
    grid-template-columns: repeat(5, 1fr);
    max-width: 32rem;
}

/* Dados */
.dd-stage {
    width: min(100%, 28rem);
    display: grid;
    gap: 1.1rem;
    justify-items: center;
}

.dd-tray {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: center;
    min-height: 6.5rem;
    align-items: center;
}

.dd-die {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 0.7rem;
    background: linear-gradient(145deg, #f7f1e8, #e7dfd2);
    color: #1f1b17;
    display: grid;
    place-items: center;
    font-family: var(--gg-display);
    font-size: 1.85rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.dd-die.is-rolling {
    animation: dd-roll 0.45s var(--gg-ease);
}

@keyframes dd-roll {
    0% { transform: rotate(-12deg) scale(0.92); }
    40% { transform: rotate(10deg) scale(1.06); }
    100% { transform: rotate(0) scale(1); }
}

.dd-score {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

.dd-score:has(article:not([hidden]):nth-child(2)) {
    grid-template-columns: 1fr 1fr;
}

.dd-score article {
    border: 1px solid var(--gg-line);
    border-radius: 4px;
    padding: 0.85rem 0.9rem;
    background: rgba(255, 255, 255, 0.03);
}

.dd-score strong {
    display: block;
    font-family: var(--gg-display);
    font-size: 1.5rem;
    margin-top: 0.2rem;
}

.dd-score article.is-turn {
    border-color: rgba(194, 24, 91, 0.5);
    box-shadow: inset 0 0 0 1px rgba(194, 24, 91, 0.2);
}

@media (prefers-reduced-motion: reduce) {
    .gg-card,
    .mm-card__inner {
        transition: none;
    }
}


/* Tres en raya */
.ttt-board {
    width: min(100%, 18rem);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
}
.ttt-cell {
    aspect-ratio: 1;
    border: 1px solid var(--gg-line);
    border-radius: 4px;
    background: rgba(255,255,255,0.04);
    color: var(--gg-mist);
    font-family: var(--gg-display);
    font-size: 2rem;
    font-weight: 700;
    cursor: pointer;
}
.ttt-cell:hover { border-color: rgba(183,155,108,0.55); }

/* Buscaminas */
.ms-board {
    --ms-cols: 10;
    width: min(100%, 28rem);
    display: grid;
    grid-template-columns: repeat(var(--ms-cols), 1fr);
    gap: 2px;
}
.ms-cell {
    aspect-ratio: 1;
    border: 0;
    border-radius: 2px;
    background: #2a2430;
    color: #f3eee6;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}
.ms-cell.is-open { background: #15151c; }
.ms-cell.is-mine { background: #c2185b; }
.ms-cell.is-flag { color: #b79b6c; }

/* Arcade canvas */
.ar-canvas {
    width: min(100%, 22.5rem);
    max-width: 100%;
    border-radius: 4px;
    border: 2px solid rgba(183, 155, 108, 0.45);
    background: #0e1016;
    display: block;
    touch-action: none;
}


/* Mobile control pads */
.ar-stage {
    width: min(100%, 22.5rem);
    display: grid;
    gap: 0.75rem;
    justify-items: center;
}

.ar-pad {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
    max-width: 16rem;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.ar-pad--wide {
    max-width: 20rem;
    grid-template-columns: repeat(4, 1fr);
}

.ar-pad .gg-btn {
    min-height: 3rem;
    font-size: 1rem;
    touch-action: manipulation;
}

.ar-pad .gg-btn.is-span3 {
    grid-column: 1 / -1;
}

.ms-tools {
    width: min(100%, 28rem);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.ms-tools .gg-btn.is-active {
    background: var(--gg-accent);
    border-color: var(--gg-accent);
}

.ms-cell {
    min-height: 2rem;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    user-select: none;
}

.ttt-cell {
    min-height: 4.5rem;
    touch-action: manipulation;
}

.sdk-cell,
.dm-sq,
.mm-card {
    touch-action: manipulation;
}

@media (max-width: 520px) {
    .gg-play__bar {
        flex-direction: column;
        align-items: stretch;
    }

    .gg-actions {
        width: 100%;
    }

    .gg-actions .gg-btn {
        flex: 1;
        min-height: 2.75rem;
    }

    .gg-play__title {
        font-size: 1.2rem;
    }

    .ar-canvas,
    .sn-canvas {
        width: min(100%, calc(100vw - 2rem));
    }

    .ms-board {
        width: min(100%, calc(100vw - 1.5rem));
    }

    .sn-pad .gg-btn {
        min-height: 3rem;
    }
}
