/* Explain: Styling for in-app game boards and controls. */
/* Oreo arcade game boards */

.game-snake,
.game-2048,
.game-ttt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.game-score {
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
}

.game-hint {
    max-width: 22rem;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
    text-align: center;
}

.game-canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    touch-action: none;
}

.game-hud,
.game-2048-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    max-width: 22rem;
}

.game-dpad {
    display: grid;
    grid-template-columns: repeat(3, 3.1rem);
    grid-template-rows: repeat(3, 3.1rem);
    gap: 0.35rem;
}

.game-dpad button {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    background: var(--background-color);
    color: var(--link-color);
    font-size: 1.1rem;
    transition: background 200ms ease, border-color 200ms ease;
}

.game-dpad button:hover {
    background: var(--surface-hover);
    border-color: var(--link-color);
}

.game-dpad .dpad-up {
    grid-column: 2;
    grid-row: 1;
}

.game-dpad .dpad-left {
    grid-column: 1;
    grid-row: 2;
}

.game-dpad .dpad-right {
    grid-column: 3;
    grid-row: 2;
}

.game-dpad .dpad-down {
    grid-column: 2;
    grid-row: 3;
}

.game-2048-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    width: 100%;
    max-width: 22rem;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    background: var(--background-color);
    touch-action: none;
}

.game-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border-radius: 0.4rem;
    background: var(--surface-color);
    color: var(--text-color);
    font-weight: 700;
    font-size: clamp(1rem, 5vw, 1.4rem);
}

.game-tile[data-val="2"] { background: #22262b; }
.game-tile[data-val="4"] { background: #2b3138; }
.game-tile[data-val="8"] { background: #3b4a63; }
.game-tile[data-val="16"] { background: #46587a; }
.game-tile[data-val="32"] { background: #5a6f9a; }
.game-tile[data-val="64"] { background: #6f87ba; }
.game-tile[data-val="128"] { background: #8ab4f8; color: #000000; }
.game-tile[data-val="256"] { background: #9cc0f9; color: #000000; }
.game-tile[data-val="512"] { background: #aecbfa; color: #000000; }
.game-tile[data-val="1024"] { background: #c58af9; color: #000000; }
.game-tile[data-val="2048"] { background: #d7a4ff; color: #000000; }

.game-ttt-status {
    min-height: 1.4rem;
    margin: 0;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
}

.game-ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    width: 100%;
    max-width: 20rem;
}

.game-ttt-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--background-color);
    color: var(--text-color);
    font-size: clamp(1.6rem, 9vw, 2.4rem);
    font-weight: 700;
    transition: background 200ms ease, border-color 200ms ease;
}

.game-ttt-cell:hover:not(:disabled) {
    background: var(--surface-hover);
    border-color: var(--link-color);
}

.game-ttt-cell.is-x {
    color: var(--link-color);
}

.game-ttt-cell.is-o {
    color: var(--link-visited);
}

.game-ttt-cell.is-win {
    border-color: var(--accent-color);
    background: var(--surface-hover);
}