/* ============================================================================
   Shared layout for game pages (new games)
   ----------------------------------------------------------------------------
   Only the page skeleton lives here: how-to panel, config panel, game card,
   HUD rows, feedback line and overlays. Each game's own game.css styles its
   board only, so a new game is ~80 lines of CSS instead of ~300.
   ========================================================================= */

.gui-main {
    margin-top: 1rem;
    display: grid;
    gap: 1.1rem;
    min-width: 0;
}

/* ── Panels (how-to / config) ────────────────────────────────────────────── */
.gui-panel {
    border: 1px solid rgba(111, 214, 196, 0.24);
    background: rgba(111, 214, 196, 0.04);
    padding: 1.1rem 1.2rem;
    border-radius: 2px;
}

.gui-panel h3 {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--game-accent);
    margin: 0 0 0.8rem 0;
    font-size: 1rem;
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 600;
}

.gui-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--game-text);
}

.gui-panel li {
    margin: 0.5rem 0;
    padding-left: 1.4rem;
    position: relative;
    line-height: 1.45;
}

.gui-panel li::before {
    content: "▪";
    position: absolute;
    left: 0;
    color: var(--game-accent);
}

.gui-panel li strong {
    color: var(--game-accent);
}

/* ── Config rows ─────────────────────────────────────────────────────────── */
.gui-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.9rem;
    flex-wrap: wrap;
}

.gui-row:last-child {
    margin-bottom: 0;
}

.gui-row > label,
.gui-row > span.gui-label {
    color: var(--game-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.85rem;
    min-width: 150px;
}

.gui-slider-wrap {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex: 1;
    min-width: 200px;
}

.gui-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    background: rgba(111, 214, 196, 0.2);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.gui-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--game-accent);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(111, 214, 196, 0.6);
    cursor: pointer;
}

.gui-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--game-accent);
    border: none;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(111, 214, 196, 0.6);
    cursor: pointer;
}

.gui-readout {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    white-space: nowrap;
    color: var(--game-accent);
    font-size: 0.95rem;
    min-width: 96px;
}

.gui-readout small {
    color: var(--game-muted);
    font-size: 0.75rem;
}

.gui-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gui-cfg-btn {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.88rem;
    padding: 0.35rem 0.75rem;
    background: rgba(111, 214, 196, 0.05);
    border: 1px solid rgba(111, 214, 196, 0.35);
    color: var(--game-muted);
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    border-radius: 2px;
    letter-spacing: 0.05em;
}

.gui-cfg-btn:hover {
    background: rgba(111, 214, 196, 0.12);
    color: var(--game-accent);
    border-color: rgba(111, 214, 196, 0.6);
}

.gui-cfg-btn.active {
    background: rgba(111, 214, 196, 0.16);
    border-color: var(--game-accent);
    color: var(--game-accent);
    box-shadow: 0 0 8px rgba(111, 214, 196, 0.2);
}

.gui-note {
    color: var(--game-muted);
    font-size: 0.78rem;
    margin: 0.7rem 0 0;
    opacity: 0.7;
}

/* ── Game card ───────────────────────────────────────────────────────────── */
.gui-card {
    border: 1px solid rgba(111, 214, 196, 0.28);
    background: rgba(3, 9, 9, 0.9);
    box-shadow: 0 0 30px rgba(111, 214, 196, 0.14);
    padding: 0.8rem;
}

.gui-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(111, 214, 196, 0.2);
    background: rgba(0, 0, 0, 0.35);
    padding: 0.65rem 0.8rem;
    flex-wrap: wrap;
}

.gui-title {
    font-family: "Barlow Condensed", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 1.8rem;
    color: var(--game-text);
    line-height: 1;
}

.gui-stats {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.gui-stats span {
    border: 1px solid rgba(111, 214, 196, 0.32);
    background: rgba(111, 214, 196, 0.05);
    padding: 0.45rem 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--game-muted);
}

.gui-stats strong {
    color: var(--game-accent);
}

.gui-instruction {
    margin-top: 0.7rem;
    border: 1px solid rgba(111, 214, 196, 0.2);
    background: rgba(0, 0, 0, 0.38);
    padding: 0.55rem;
    color: var(--game-muted);
    text-align: center;
    min-height: 1.4em;
}

.gui-board {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0.4rem;
}

.gui-feedback {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    min-height: 2.3rem;
    text-align: center;
    color: var(--game-muted);
    transition: color 0.15s;
}

.gui-feedback.good { color: #4ade80; }
.gui-feedback.bad  { color: #ff5a5a; }
.gui-feedback.info { color: var(--game-accent); }

.gui-action {
    font-family: "Barlow Condensed", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 1.35rem;
    font-weight: 700;
    padding: 0.85rem 2.6rem;
    background: rgba(111, 214, 196, 0.06);
    border: 2px solid rgba(111, 214, 196, 0.5);
    color: var(--game-accent);
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    user-select: none;
}

.gui-action:hover {
    background: rgba(111, 214, 196, 0.14);
    box-shadow: 0 0 18px rgba(111, 214, 196, 0.22);
}

.gui-action:active {
    background: rgba(111, 214, 196, 0.22);
    box-shadow: 0 0 28px rgba(111, 214, 196, 0.4);
}

.gui-action:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Generic timer bar ───────────────────────────────────────────────────── */
.gui-timer {
    width: 100%;
    max-width: 420px;
    height: 8px;
    border: 1px solid rgba(111, 214, 196, 0.3);
    background: rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.gui-timer i {
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, rgba(111, 214, 196, 0.55), var(--game-accent));
    transition: width 0.1s linear;
}

.gui-timer.low i {
    background: linear-gradient(90deg, rgba(255, 90, 90, 0.6), #ff5a5a);
}

@media (max-width: 560px) {
    .gui-title { font-size: 1.4rem; }
    .gui-row > label,
    .gui-row > span.gui-label { min-width: 100%; }
    .gui-action { width: 100%; padding: 0.8rem 1rem; }
}

/* ============================================================================
   UNIFIED GAME SKIN (2026-11-13)
   ----------------------------------------------------------------------------
   The rules above were written for a single scrolling column, in a teal-on-black
   palette that no longer matches the site. This layer restyles every shared
   game component onto the theme tokens in theme.css, so a game page and the rest
   of the site read as one product:

     · surfaces  = --ink-1 over --ink-0, 1px --line-1 hairline, r-3 radius
     · chips     = pill, hairline, 11px uppercase micro type
     · buttons   = the site's ivory primary (.shell-button look)
     · accent    only for state (active / matched / low), never as decoration

   A game's own game.css keeps styling only its board. It is loaded after this
   file, so anything narrower it does still wins.
   ========================================================================= */

.gui-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 14px 16px 16px;
    border: 1px solid var(--line-1, rgba(255, 255, 255, 0.065));
    border-radius: var(--r-3, 12px);
    background: linear-gradient(180deg, var(--ink-1, #0a0b0f) 0%, var(--ink-0, #06070a) 100%);
    box-shadow: 0 24px 60px -40px rgba(0, 0, 0, 0.95);
}

.gui-panel {
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--line-1, rgba(255, 255, 255, 0.065));
    border-radius: var(--r-3, 12px);
    background: rgba(255, 255, 255, 0.015);
}

.gui-panel h3 {
    margin: 0 0 10px;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    font-weight: 600;
    color: var(--fg-3, #7d8794);
}

.gui-panel li {
    margin: 0.45rem 0;
    padding-left: 1.1rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--fg-2, #a6afbb);
}

.gui-panel li::before {
    color: var(--accent, #6fd6c4);
}

.gui-panel li strong {
    color: var(--fg-1, #eceef2);
    font-weight: 600;
}

/* ── In-panel header ─────────────────────────────────────────────────────── */

.gui-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 0 2px 12px;
    border: 0;
    border-bottom: 1px solid var(--line-1, rgba(255, 255, 255, 0.065));
    background: none;
}

.gui-title {
    min-width: 0;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1;
    color: var(--fg-2, #a6afbb);
}

.gui-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.gui-stats span,
.gui-stats > span {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--line-1, rgba(255, 255, 255, 0.065));
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-3, #7d8794);
    white-space: nowrap;
}

.gui-stats strong {
    color: var(--fg-1, #eceef2);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
}

/* ── Instruction line ────────────────────────────────────────────────────── */

.gui-instruction {
    margin-top: 0;
    padding: 9px 2px 0;
    border: 0;
    background: none;
    color: var(--fg-3, #7d8794);
    font-size: 0.78rem;
    line-height: 1.4;
    text-align: left;
    min-height: 1.4em;
}

/* ── Board area ──────────────────────────────────────────────────────────── */

.gui-board {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    min-height: 0;
    margin-top: 10px;
    padding: 4px 0 0;
}

/* A wrapper should hug its canvas, so the controls below it line up with the
   board itself rather than with the whole panel. */
.gui-board > *:has(canvas) {
    width: max-content;
    max-width: 100%;
}

.gui-board canvas {
    display: block;
    margin-inline: auto;
}

/* ── Timer ───────────────────────────────────────────────────────────────── */

.gui-timer {
    width: 100%;
    max-width: 320px;
    height: 4px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.gui-timer i {
    height: 100%;
    width: 100%;
    border-radius: inherit;
    background: var(--accent, #6fd6c4);
    transition: width 0.1s linear;
}

.gui-timer.low i {
    background: var(--bad, #e8837d);
}

/* ── Feedback ────────────────────────────────────────────────────────────── */

.gui-feedback {
    min-height: 1.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--fg-3, #7d8794);
}

.gui-feedback.good { color: var(--good, #7fd8a4); }
.gui-feedback.bad { color: var(--bad, #e8837d); }
.gui-feedback.info { color: var(--accent, #6fd6c4); }

/* ── Action button: the site's ivory primary ─────────────────────────────── */

.gui-action {
    align-self: center;
    padding: 0.68rem 1.7rem;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--r-2, 8px);
    background: linear-gradient(180deg, #f4f6f9 0%, #d9dfe6 100%);
    color: #0a0c10;
    font-family: var(--font-ui, system-ui, sans-serif);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 1px 2px rgba(0, 0, 0, 0.55),
        0 10px 24px -14px rgba(0, 0, 0, 0.9);
    transition: transform 0.18s ease, filter 0.16s ease, box-shadow 0.18s ease;
}

.gui-action:hover,
.gui-action:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.03);
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 18px 34px -16px rgba(0, 0, 0, 0.95);
}

.gui-action:active {
    transform: translateY(0);
}

.gui-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ── Config controls ─────────────────────────────────────────────────────── */

.gui-row {
    display: grid;
    gap: 7px;
    margin-bottom: 15px;
    flex-wrap: nowrap;
}

.gui-row > label,
.gui-row > span.gui-label {
    min-width: 0;
    width: 100%;
    color: var(--fg-3, #7d8794);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.gui-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gui-cfg-btn {
    padding: 0.34rem 0.72rem;
    border: 1px solid var(--line-2, rgba(255, 255, 255, 0.11));
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--fg-3, #7d8794);
    font-family: var(--font-ui, system-ui, sans-serif);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    transition: color 0.14s, border-color 0.14s, background 0.14s;
}

.gui-cfg-btn:hover {
    color: var(--fg-1, #eceef2);
    border-color: var(--line-3, rgba(255, 255, 255, 0.18));
    background: rgba(255, 255, 255, 0.05);
}

.gui-cfg-btn.active {
    border-color: rgba(111, 214, 196, 0.55);
    background: rgba(111, 214, 196, 0.14);
    color: var(--accent, #6fd6c4);
    box-shadow: none;
}

.gui-slider-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.gui-slider {
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.gui-slider::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    background: var(--fg-1, #eceef2);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.gui-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--fg-1, #eceef2);
}

.gui-readout {
    min-width: 58px;
    color: var(--fg-1, #eceef2);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.gui-readout small {
    color: var(--fg-3, #7d8794);
    font-size: 0.68rem;
}

.gui-note {
    margin: 14px 0 0;
    color: var(--fg-4, #5f6875);
    font-size: 0.72rem;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .gui-card { padding: 12px 12px 14px; }
    .gui-title { font-size: 1rem; }
    .gui-stats span,
    .gui-stats > span { padding: 0.26rem 0.6rem; }
}
