/* ==========================================================================
   Aquilo customizer kit (styles) — shared UI for the overlay customize pages
   ==========================================================================
   What this is
     One stylesheet + one script (/assets/customizer-kit.js) shared by every
     product customizer (PunchCard, PowerDeck, Gift Jar, Hangman,
     Counters, MultiGoal, ...). It packages the suite's OBS-handoff UX in one
     place so future editors stop hand-rolling (and drifting on) the same
     patterns.

   Suite UX standards this kit encodes
     - "Use in OBS" modal with the canonical numbered handoff wording:
       "In OBS, under Sources click + and choose Browser." -> paste the
       overlay link -> "Set Width x Height to <size>". Full-canvas games are
       1920 x 1080; smaller widgets state their own canvas (Gift Jar
       600 x 950, Hangman 900 x 380, Counters 600 x 200, MultiGoal computes
       its size live from the current config).
     - Copy buttons flip to "Copied ✓" for ~1.4s.
     - Stale-guard pattern: pages that bake config into the URL show a
       "Settings changed since you last copied — copy the link again and
       update it in OBS." notice. A copy made INSIDE this modal must run the
       page's same mark-copied routine (wire it via obsModal's onCopy) so the
       notice clears no matter which Copy button was used.

   Rules
     - EVERY selector here is namespaced .aqk-*. The kit must never restyle
       the host page: no bare element selectors, no :root custom properties.
     - No fonts are loaded here. The modal inherits the host page's font
       (the suite standard is Inter, loaded by each page).
     - Dark theme only, matching the suite: near-black surfaces (#0f0f0f /
       #171717), #232323 / #303030 borders, #797979 / #959595 accent.

   Every new customizer must include this kit:
     <link rel="stylesheet" href="/assets/customizer-kit.css?v=1.1.0">
     <script src="/assets/customizer-kit.js?v=1.1.0"></script>
   ========================================================================== */

/* ---- modal backdrop + panel ------------------------------------------- */
.aqk-modal-back {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 6, 6, 0.66);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  padding: 16px;
}
.aqk-modal-back[hidden] { display: none; }

.aqk-modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px); overflow: auto;
  background: #171717; color: #f6f6f6;
  border: 1px solid #303030; border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  padding: 18px 20px 20px;
  font-family: inherit; font-size: 13.5px; line-height: 1.55;
  text-align: left;
}

.aqk-head { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; }
.aqk-title { margin: 0; flex: 1; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; color: #f6f6f6; }
.aqk-x {
  appearance: none; background: transparent; border: 1px solid transparent; cursor: pointer;
  color: #919191; font-family: inherit; font-size: 20px; line-height: 1;
  padding: 2px 8px 4px; border-radius: 8px; flex: 0 0 auto;
}
.aqk-x:hover { color: #f6f6f6; background: #1f1f1f; border-color: #303030; }
.aqk-x:focus-visible { outline: 2px solid #797979; outline-offset: 1px; }

/* ---- numbered steps ---------------------------------------------------- */
.aqk-steps { list-style: none; counter-reset: aqk-step; margin: 0; padding: 0; }
.aqk-step {
  position: relative; padding: 0 0 0 34px; margin: 0 0 12px;
  color: #cdcdcd; counter-increment: aqk-step;
}
.aqk-step:last-child { margin-bottom: 0; }
.aqk-step::before {
  content: counter(aqk-step);
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(149, 149, 149, 0.12); border: 1px solid rgba(149, 149, 149, 0.45);
  color: #aeaeae; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.aqk-step b, .aqk-em { color: #f6f6f6; font-weight: 700; }
.aqk-step code {
  background: #0f0f0f; border: 1px solid #303030; border-radius: 5px;
  padding: 1px 6px; font-size: 11.5px;
  font-family: ui-monospace, 'JetBrains Mono', Consolas, monospace;
}

/* ---- overlay-link row -------------------------------------------------- */
.aqk-urlrow { display: flex; gap: 8px; margin-top: 8px; }
.aqk-url {
  flex: 1; min-width: 0;
  background: #0f0f0f; border: 1px solid #303030; color: #919191;
  border-radius: 8px; padding: 9px 10px;
  font-family: ui-monospace, 'JetBrains Mono', Consolas, monospace;
  font-size: 11.5px; line-height: 1.2;
  outline: none;
}
.aqk-url:focus { border-color: rgba(149, 149, 149, 0.45); }
.aqk-copy {
  appearance: none; cursor: pointer; flex: 0 0 auto;
  background: #1f1f1f; border: 1px solid #303030; color: #f6f6f6;
  border-radius: 8px; padding: 9px 14px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.aqk-copy:hover { border-color: #3e3e3e; background: #282828; }
.aqk-copy:focus-visible { outline: 2px solid #797979; outline-offset: 1px; }
.aqk-copy.aqk-copied { border-color: rgba(226, 226, 226, 0.5); color: #e2e2e2; }

/* ---- muted note under the steps ---------------------------------------- */
.aqk-note { margin: 12px 0 0; font-size: 11.5px; color: #919191; }

/* ---- illustrated-guide link -------------------------------------------- */
.aqk-guide {
  display: inline-block; margin-top: 12px;
  font-size: 12.5px; font-weight: 600; color: #959595; text-decoration: none;
}
.aqk-guide:hover { color: #b1b1b1; text-decoration: underline; }
.aqk-guide:focus-visible { outline: 2px solid #797979; outline-offset: 2px; border-radius: 4px; }
.aqk-note b { color: #cdcdcd; }

/* ---- mobile ------------------------------------------------------------ */
@media (max-width: 480px) {
  .aqk-modal-back { padding: 8px; }
  .aqk-modal { width: 100%; max-height: calc(100vh - 16px); padding: 16px 14px; }
  .aqk-url { font-size: 16px; } /* 16px stops the iOS focus zoom */
  .aqk-urlrow { flex-wrap: wrap; }
  .aqk-copy { flex: 1; padding: 12px 14px; }
}
