/* The Game of Life keeps its original dark visual system, isolated from the site theme. */

.game-app {
    color-scheme: dark;
    min-height: 720px;
    padding: clamp(1.25rem, 4vw, 3rem);
    overflow: hidden;
    border: 1px solid #263241;
    border-radius: .75rem;
    background: radial-gradient(circle at top, #172130 0, #090d12 42rem);
    color: #d8e1eb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

.game-app .loading {
    min-height: 60vh;
    display: grid;
    place-items: center;
    color: #8da0b5;
}

.game-app .loading-ring {
    width: 2rem;
    height: 2rem;
    border: 2px solid #263241;
    border-top-color: #6ee7b7;
    border-radius: 50%;
    animation: game-spin .75s linear infinite;
}

@keyframes game-spin {
    to { transform: rotate(360deg); }
}

.game-app .app-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.game-app .app-header > * {
    min-width: 0;
}

.game-app .eyebrow {
    color: #6ee7b7;
    font-size: .75rem;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.game-app h2 {
    margin: .25rem 0;
    color: #d8e1eb;
    font-family: inherit;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -.06em;
}

.game-app .subtitle {
    margin: 0;
    color: #8da0b5;
}

.game-app .performance {
    width: min(100%, 23rem);
    max-width: 100%;
    padding: .9rem 1rem 1rem;
    border: 1px solid #2b3a4b;
    border-radius: .65rem;
    background: rgba(8, 13, 18, .78);
    box-shadow: inset 0 1px rgba(255, 255, 255, .025);
}

.game-app .performance-heading {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #8da0b5;
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.game-app .performance-heading i {
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: #6ee7b7;
    box-shadow: 0 0 .6rem rgba(110, 231, 183, .8);
}

.game-app .performance-warming {
    margin-top: .8rem;
    color: #8da0b5;
    font-size: .8rem;
}

.game-app .fps {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    margin: .25rem 0 .6rem;
}

.game-app .fps strong {
    color: #f3f7fb;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -.07em;
}

.game-app .fps span {
    color: #6ee7b7;
    font-size: .7rem;
    letter-spacing: .1em;
}

.game-app .stream-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin: .6rem 0 .75rem;
}

.game-app .frame-split {
    display: flex;
    height: .35rem;
    overflow: hidden;
    border-radius: 999px;
    background: #202c39;
}

.game-app .frame-split .compute { background: #f0b45b; }
.game-app .frame-split .delay { background: #6ee7b7; }

.game-app .performance-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin-top: .65rem;
}

.game-app .stream-metrics > span,
.game-app .performance-legend > span {
    display: grid;
    grid-template-columns: auto 1fr auto;
    min-width: 0;
    align-items: center;
    gap: .3rem;
    color: #8da0b5;
    font-size: .65rem;
}

.game-app .stream-metrics i,
.game-app .performance-legend i {
    width: .4rem;
    height: .4rem;
    border-radius: 50%;
}

.game-app .stream-metrics .stream-key { background: #617387; }
.game-app .performance-legend .compute-key { background: #f0b45b; }
.game-app .performance-legend .delay-key { background: #6ee7b7; }

.game-app .stream-metrics b,
.game-app .performance-legend b {
    color: #d8e1eb;
    font-weight: 600;
    white-space: nowrap;
}

.game-app .performance-legend small {
    grid-column: 2 / -1;
    color: #617387;
    font-size: .6rem;
}

.game-app .controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    padding: 1rem;
    border: 1px solid #263241;
    border-radius: .75rem;
    background: #101720;
    margin-bottom: 1rem;
}

.game-app .controls span {
    color: #8da0b5;
    font-size: .8rem;
}

.game-app .page-button {
    border: 1px solid #324154;
    background: #151f2b;
    color: #aebdcd;
    border-radius: .35rem;
    min-width: 2rem;
    height: 2rem;
    cursor: pointer;
}

.game-app .page-button:hover,
.game-app .page-button.active {
    border-color: #6ee7b7;
    color: #08100d;
    background: #6ee7b7;
}

.game-app .color-picker {
    width: 2.4rem;
    height: 2rem;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.game-app .board-frame {
    padding: .75rem;
    border: 1px solid #263241;
    border-radius: .75rem;
    background: #101720;
    overflow: auto;
}

.game-app .board {
    display: grid;
    grid-template-columns: repeat(32, 1fr);
    gap: 1px;
    width: min(100%, 68rem);
    min-width: 42rem;
    aspect-ratio: 1;
    margin-inline: auto;
    background: #1d2835;
}

.game-app .cell {
    appearance: none;
    border: 0;
    padding: 0;
    min-width: 0;
    background: #0b1118;
    cursor: crosshair;
}

.game-app .cell:hover {
    outline: 1px solid #f8fafc;
    z-index: 1;
}

@media (max-width: 700px) {
    .game-app .app-header {
        align-items: start;
        flex-direction: column;
    }

    .game-app .performance {
        width: 100%;
    }

}
