/* =============================================================================
   Duszki (Ghost Maze) — game-specific styles (canvas frame, HUD extras,
   ghost legend dots, touch D-pad). Loaded together with games.css via
   $extraCss. Uses site design tokens; the in-canvas maze colours are drawn
   in JS (canvas cannot read CSS vars), like game-waz.js.
   ============================================================================= */

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

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

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

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

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

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

/* ---------------- Ghost legend dots (help section) ---------------- */

.duszki-dot {
    display: inline-block;
    width: 0.75em;
    height: 0.75em;
    border-radius: 50% 50% 35% 35%;
    vertical-align: baseline;
}

.duszki-dot--red    { background: #e84545; }
.duszki-dot--pink   { background: #f28ecf; }
.duszki-dot--cyan   { background: #4fd6e0; }
.duszki-dot--orange { background: #f2a64a; }

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

.duszki-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;
}

.duszki-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;
}

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

/* Cross layout: up on top-middle; left / down / right on the bottom row. */
.duszki-dpad-up    { grid-column: 2; grid-row: 1; }
.duszki-dpad-left  { grid-column: 1; grid-row: 2; }
.duszki-dpad-down  { grid-column: 2; grid-row: 2; }
.duszki-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) {
    .duszki-dpad {
        display: none;
    }
}
