/* ============================================================
   SHARED PRIMITIVES — onlinecardgames.org catalog
   ============================================================
   Every rule in this file passed one test before being added:
   "would every current AND future game need this exact rule,
   unchanged?" If a rule has any legitimate reason to vary by
   game (size, color, layout), it does NOT belong here — it stays
   in that game's own CSS file. This file only holds things with
   zero legitimate per-game variation: browser-compatibility
   resets and accessibility primitives.

   This file is meant to be linked, not copied. One copy, on one
   shared path, referenced by every game's <link> tag. A fix made
   here fixes every game that loads it — no per-game sync step,
   no risk of a game silently missing a fix that reached its
   siblings. See css-audit.py for the mechanical check that lists
   every game currently NOT yet linking this file.

   Where a rule needs a color, it reads a neutral, semantic
   variable (--accent, --accent-ink) with a safe fallback value —
   never a game-specific name like --gold or --copper, since
   different games use different theme variable names on purpose
   (e.g. UTH's copper/saloon theme vs the gold-felt games). Each
   game should map its own theme variable to the semantic one
   once, in its own :root block:
     --accent: var(--gold);      (gold-themed games)
     --accent: var(--copper);    (UTH)
   If a game never adds that line, the fallback value below is
   used instead — visually reasonable, never broken.
   ============================================================ */

/* Safari renders <button>-based chips as squares, ignoring their
   own border-radius, unless appearance is explicitly reset.
   Confirmed recurring bug — found unfixed in UTH, Klondike,
   Spider, FreeCell, and the standard Baccarat game's source
   project during a full-catalog audit, despite being fixed in
   other games months earlier. This is the exact bug class this
   file exists to prevent from recurring a sixth time. */
.chip{
  -webkit-appearance:none;
  appearance:none;
}

/* Removes the mobile tap-flash on buttons and chips. Purely a
   touch-interaction reset — no visual side effects, safe on any
   theme. */
button, .chip{
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}

/* Keyboard-focus and text-selection accent. Uses the neutral
   --accent variable so this renders correctly regardless of
   which theme-specific variable name a given game happens to
   use internally. */
:focus-visible{
  outline:2px solid var(--accent, #e0b95e);
  outline-offset:2px;
}
::selection{
  background:var(--accent, #e0b95e);
  color:var(--accent-ink, #1a1006);
}

/* Range sliders (bank/bet-sizing controls) render inconsistently
   across browsers when only accent-color is set — confirmed directly
   via a rendering test: Chrome shows a visible track/border by
   default, Safari (and this catalog's WebKit-based thumbnail
   renderer) does not, and a plain `border:` property has no effect
   on the native track either way. Same root cause as the .chip fix
   above: relying on each browser's own native rendering for a form
   control produces inconsistent results. The fix is the same shape
   too — reset appearance entirely and replace both the track and
   the thumb explicitly, so nothing is left to browser defaults. */
input[type="range"]{
  -webkit-appearance:none;
  appearance:none;
  height:6px;
  border-radius:3px;
  background:rgba(255,255,255,.25);
  border:1px solid rgba(255,255,255,.2);
  cursor:pointer;
}
input[type="range"]::-webkit-slider-runnable-track{
  height:6px;
  border-radius:3px;
  background:rgba(255,255,255,.25);
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width:18px;
  height:18px;
  border-radius:50%;
  background:var(--accent, #e0b95e);
  border:2px solid rgba(255,255,255,.6);
  margin-top:-6px;
  cursor:pointer;
}
