/* =============================================================================
   Żaba (Frog Crossing) — game-specific styles (canvas frame, timer bar,
   touch D-pad). Loaded together with games.css via $extraCss. Uses site
   design tokens; the in-canvas board colours are drawn in JS (canvas cannot
   read CSS vars), like the classic palettes in games-waz.css / games-2048.css.
   ============================================================================= */

/* ---------------- Canvas frame ---------------- */

.zaba-canvas-wrap {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

#zabaCanvas {
    display: inline-block;
    max-width: 100%;
    background: var(--color-gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* ---------------- Timer bar (time left in the current attempt) ------------ */

.zaba-timer {
    max-width: 480px;
    height: 10px;
    margin: 0 auto 0.6rem;
    background: var(--color-gray-200);
    border-radius: 5px;
    overflow: hidden;
}

.zaba-timer-fill {
    height: 100%;
    width: 100%;
    background: var(--color-primary);
    border-radius: 5px;
    transition: width 0.15s linear;
}

.zaba-timer-fill--low {
    background: #c0392b;
}

/* ---------------- HUD extras ---------------- */

.zaba-pause-hint {
    color: var(--color-gray-600);
    font-size: 0.85em;
}

.zaba-best-line {
    margin-top: 0.75rem;
    color: var(--color-gray-700);
}

/* ---------------- Touch D-pad ---------------- */

.zaba-dpad {
    display: grid;
    grid-template-columns: repeat(3, 64px);
    grid-template-rows: repeat(2, 56px);
    gap: 0.4rem;
    justify-content: center;
    margin: 0.9rem auto 0;
    user-select: none;
    -webkit-user-select: none;
}

.zaba-dpad-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
    background: var(--color-gray-200);
    color: var(--color-gray-800);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--border-radius);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.zaba-dpad-btn:active {
    background: var(--color-gray-300);
}

/* Cross layout: up on top-middle; left / down / right on the bottom row. */
.zaba-dpad-up    { grid-column: 2; grid-row: 1; }
.zaba-dpad-left  { grid-column: 1; grid-row: 2; }
.zaba-dpad-down  { grid-column: 2; grid-row: 2; }
.zaba-dpad-right { grid-column: 3; grid-row: 2; }

/* Wide screens have a keyboard — hide the touch D-pad. */
/* Hide the D-pad only on true desktops (fine pointer + hover) — tablets keep it. */
@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
    .zaba-dpad {
        display: none;
    }
}
