/* The picture behind the page, and the Background picker (js/games/arcade/scenery.js).
   Its own file so a game page can link it whether or not it uses arcade.css. */

/* -------------------------------------------------- the picture behind the page

   js/games/arcade/scenery.js paints one fixed canvas behind everything and puts
   ar-has-backdrop on <body>. The shell, which used to be an opaque white wall
   either side of the board, then lets it through, and the parts people read
   (the numbers, the board's column, the side boxes) keep a calm panel of their
   own so nothing gets harder to see. Real full screen is left alone. */
.ar-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ar-has-backdrop { background: transparent; }

.ar-has-backdrop .hh-app.is-focus:not(:fullscreen) { background: transparent; }

/* The site's own bars sit behind the shell in focus mode; with the shell see-through they step aside. */
html.pcs-focus .ar-has-backdrop .Master > :not(.hh-app) { visibility: hidden; }

/* The board's own column is often wider than the board (the stage fills the window, the canvas sits in
   the middle of it), so the panel goes on the things themselves: the board, the dock, the number bar,
   the side boxes and the menu pages, and the stage between them is see-through. */
.ar-has-backdrop .hh-app.is-focus:not(:fullscreen) :is(.hh-main, .ar-stage) { background: transparent; }

.ar-has-backdrop .hh-app.is-focus:not(:fullscreen) .ar-stage canvas {
  border-radius: 14px;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
}

.ar-has-backdrop .hh-app.is-focus:not(:fullscreen) .hh-dock {
  align-self: center;
  padding: 6px 12px;
  border-radius: 14px;
  background: var(--ground);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.28);
}

/* A menu page covers the whole stage; with a picture behind, it becomes a calm card down the middle. */
.ar-has-backdrop .hh-app.is-focus:not(:fullscreen) .ar-screen.is-page {
  left: 50%;
  right: auto;
  width: min(100%, 44rem);
  transform: translateX(-50%);
  border-radius: 18px;
  background: var(--ground);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
}

.ar-has-backdrop .hh-app.is-focus:not(:fullscreen) .ar-readout {
  border-radius: 12px;
  background: var(--ground);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.28);
}

.ar-has-backdrop .hh-app.is-focus:not(:fullscreen) aside {
  padding: 8px;
  border-radius: 14px;
  background: var(--ground);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.28);
}

/* ---------------------------------------------------- the settings pickers

   A row of swatches rather than a <select>: a look is something to SEE. Each
   swatch is a canvas the game paints with the real painter. */
.ar-setting--stack { display: grid; }

.ar-setting[hidden] { display: none; }

.ar-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ar-pick {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 4.6rem;
  padding: 8px 8px 6px;
  border: 2px solid var(--rule-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.ar-pick canvas {
  display: block;
  width: 56px;
  height: 56px;
}

.ar-pick[aria-checked="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.ar-pick:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}


/* ---------------------------------------------------- dark glass for everything that sits on the picture

   The menu card, the number bar, the dock and the side boxes were pale walls in front of a painted
   scene. They are dark, slightly see-through glass with a gold edge now; the colour tokens turn to a dark
   set inside them, so buttons, tiles and text follow without a rule each. */
.ar-has-backdrop .hh-app.is-focus:not(:fullscreen) :is(.ar-screen.is-page, .hh-dock, .ar-readout, aside) {
  color-scheme: dark;
  --ground: #141a2c;
  --surface: #1b2340;
  --surface-alt: #232d52;
  --raised: #1b2340;
  --ink: #f2f4fb;
  --ink-muted: #b4bdd8;
  --ink-faint: #97a2c4;
  --rule: rgba(255, 255, 255, 0.14);
  --rule-strong: rgba(255, 255, 255, 0.28);
  --accent: #ffd27a;
  --accent-strong: #ffe3a6;
  --accent-soft: rgba(255, 210, 122, 0.16);
  --accent-line: rgba(255, 210, 122, 0.45);
  --button-bg: rgba(255, 255, 255, 0.07);
  --button-ink: #f2f4fb;
  --button-hover-bg: rgba(255, 210, 122, 0.18);
  color: var(--ink);
  background: linear-gradient(180deg, rgba(32, 43, 82, 0.9), rgba(14, 20, 42, 0.93));
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 210, 122, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
