/* =============================================================================
   Pinball — game-specific styles (portrait table frame, controls, touch
   flipper-zone hints). Loaded together with games.css via $extraCss. The
   table itself (walls, bumpers, flippers, ball) is drawn on the canvas by
   game-pinball.js; JS also sizes the canvas to fit the viewport height.
   ============================================================================= */

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

#pinCanvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 82vh;           /* portrait table: never taller than the view */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#pinCanvas:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Touch flipper-zone hints: subtle arrows over the bottom halves of the
   table. Pointer-events off — touches go straight to the canvas. Shown
   only on coarse-pointer (touch) devices. */
.pin-zone {
    display: none;
    position: absolute;
    bottom: 6%;
    width: 2.2rem;
    height: 2.2rem;
    line-height: 2.2rem;
    font-size: 1.3rem;
    text-align: center;
    color: #e8ecf5;
    background: rgba(74, 95, 138, 0.35);
    border: 1px solid rgba(232, 236, 245, 0.35);
    border-radius: 50%;
    opacity: 0.55;
    pointer-events: none;
}

.pin-zone--l { left: 8%; }
.pin-zone--r { right: 8%; }

@media (pointer: coarse) {
    .pin-zone { display: block; }
}

/* Launch (hold) + nudge buttons under the table. */
.pin-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    max-width: 480px;
    margin: 0.5rem auto 0;
}

.pin-controls .game-btn {
    flex: 1 1 auto;
    max-width: 240px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Plunger hint line under the controls. */
.pin-hint {
    max-width: 480px;
    margin: 0.5rem auto 0;
    min-height: 1.4em;
    text-align: center;
    color: var(--color-gray-700);
    font-size: 0.9rem;
}

/* ---------------- Stats modal extra ---------------- */

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