/* APA puzzle widget — Phase 1 styles */

.apa-puzzle {
  --apa-bg:       #15151c;
  --apa-disc:     #ffffff;
  --apa-tile:     #1d2e4a;
  --apa-edge:     #000000;
  --apa-fg:       #e8e8e8;
  --apa-accent:   #6ab0ff;
  --apa-panel:    rgba(20, 20, 28, 0.85);

  position: relative;
  display: block;
  width:  min(100%, 720px);
  height: min(80vh, 720px);
  margin: 1em auto;
  background: var(--apa-bg);
  color: var(--apa-fg);
  border-radius: 10px;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.apa-puzzle canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
.apa-puzzle canvas:active {
  cursor: grabbing;
}

.apa-puzzle__toolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--apa-panel);
  border-radius: 6px;
  backdrop-filter: blur(4px);
  font-size: 13px;
}
.apa-puzzle__toolbar button,
.apa-puzzle__toolbar select {
  appearance: none;
  background: transparent;
  color: var(--apa-fg);
  border: 1px solid #444;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font: inherit;
}
.apa-puzzle__toolbar button:hover,
.apa-puzzle__toolbar select:hover {
  border-color: var(--apa-accent);
}
.apa-puzzle__toolbar button:focus-visible,
.apa-puzzle__toolbar select:focus-visible {
  outline: 2px solid var(--apa-accent);
  outline-offset: 1px;
}

.apa-puzzle__status {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  padding: 6px 10px;
  background: var(--apa-panel);
  border-radius: 6px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 1em;
  pointer-events: none;
}
.apa-puzzle__status code {
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  color: var(--apa-accent);
}

.apa-puzzle:fullscreen,
.apa-puzzle:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  margin: 0;
  border-radius: 0;
}

/* Page-level styling.  Used by atlas pages and the local dev harness so the
 * surrounding HTML matches the embedded widget's dark theme.  Override per
 * site if you want a different page chrome. */
body {
  background: #0c0c12;
  color: #ddd;
  font-family: system-ui, sans-serif;
  margin: 0 auto;
  padding: 1.5em 2em;
  max-width: 1100px;
}
body h1     { font-weight: 300; margin: 0 0 0.4em; }
body h2     { font-weight: 400; margin: 1.5em 0 0.4em; }
body p      { line-height: 1.5; }
body code   { background: #222; padding: 1px 5px; border-radius: 3px; }
body b      { color: #f0f0f0; }
body hr     { border: 0; border-top: 1px solid #333; margin: 1.5em 0; }
body a      { color: #6ab0ff; text-decoration: none; }
body a:visited { color: #c08fff; }
body a:hover   { color: #9ecbff; text-decoration: underline; }
