/* Find the Orli · styles
   ---------------------------------------------------------------------------
   Scoped to .fto. Uses the v2 system as it is (tokens, type, the approved
   printed-sticker buttons in ../../../v2/interactions/lib/buttons.css). Two
   context changes for black ground, the same kind .o-on-dark makes:
     - the sticker's lift shadow is Neutral 4, because ink vanishes on black;
     - the 3px #1F3D32 focus ring keeps a cream edge either side, so it shows.
   Words sit on flat black: the field keeps every doodle out of the panel
   and the HUD (data-fto-mask). */

.fto {
  --fto-bg: #080808;
  --fto-cream: #f3f0e9;   /* Neutral 1 */
  --fto-soft: #dcd8ce;    /* Neutral 2 */
  --fto-quiet: #b1aa9a;   /* Neutral 3: 8:1 on this black, used for one hint line */
  --fto-ring: #1f3d32;
  --o-pop: 4px 5px 0 0 #797468;
  position: absolute; inset: 0; overflow: hidden; border-radius: inherit;
  background: var(--fto-bg); color: var(--fto-cream);
  font-family: var(--o-font-body, "Nunito Sans", system-ui, sans-serif);
  isolation: isolate;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.fto *, .fto *::before, .fto *::after { box-sizing: border-box; }
.fto [hidden] { display: none !important; }

.fto__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* The field: the whole dark area. It takes the pointer and, focused, the arrow keys. */
.fto__field { position: absolute; inset: 0; z-index: 1; touch-action: none; cursor: default; outline: none; border-radius: inherit; }
.fto__field.is-on-orli { cursor: pointer; }
.fto[data-input="key"] .fto__field:focus {
  box-shadow: inset 0 0 0 3px var(--fto-cream), inset 0 0 0 6px var(--fto-ring), inset 0 0 0 8px var(--fto-cream);
}

/* Focus on black: 3px brand ring, cream either side. */
.fto.fto .o-btn:focus-visible {
  outline: 3px solid var(--fto-ring); outline-offset: 3px;
  box-shadow: var(--o-pop), 0 0 0 8px var(--fto-cream);
}
html[data-motion="reduced"] .fto.fto .o-btn:focus-visible,
html[data-motion="still"] .fto.fto .o-btn:focus-visible { box-shadow: 0 0 0 8px var(--fto-cream); }

/* ------------------------------------------------------------------ HUD */
.fto__hud {
  position: absolute; inset: 0 0 auto 0; z-index: 2;
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 16px;
  padding: 16px; pointer-events: none;
}
.fto__hud > * { pointer-events: auto; }
.fto__tally { justify-self: start; display: flex; align-items: center; gap: 8px; min-height: 44px; pointer-events: none; }
.fto__slots { display: flex; gap: 4px; }
.fto__slot { display: block; width: 30px; height: 30px; }
.fto__slot.is-next {
  background: rgb(243 240 233 / .3);
  -webkit-mask: url(../assets/icons/star-outline.svg) center / 22px no-repeat;
  mask: url(../assets/icons/star-outline.svg) center / 22px no-repeat;
}
.fto__count {
  min-width: 2ch;
  font: 700 1.25rem/1 var(--o-font-ui, "Albert Sans", system-ui, sans-serif);
  font-variant-numeric: tabular-nums; color: var(--fto-cream);
}

/* ---------------------------------------------------------------- panel */
.fto__panel {
  position: absolute; left: 50%; top: 50%; z-index: 2; translate: -50% -50%;
  width: min(600px, calc(100% - 32px));
  display: grid; justify-items: center; text-align: center;
}
.fto__panel:not([hidden]) { animation: fto-in 280ms var(--o-ease, ease) both; }
@keyframes fto-in { from { opacity: 0; } }
.fto__title { margin: 0; line-height: 0; }
/* Figma Hand Bold, outlined in the Orli-Website Figma file: prototypes/v3/hand-labels/find-the-orli.svg,
   copied so the module travels on its own. The file's 121-unit band leaves room for ascenders. */
.fto__wordmark {
  display: block; width: min(480px, 82vw); aspect-ratio: 751.24 / 121; margin-block: -2% -1%;
  background: var(--fto-cream);
  -webkit-mask: var(--wordmark) center / contain no-repeat;
  mask: var(--wordmark) center / contain no-repeat;
}
.fto__line {
  margin: 24px 0 0; max-width: 30em;
  font: 400 var(--o-text-lead, 1.125rem)/1.5 var(--o-font-body, "Nunito Sans", system-ui, sans-serif);
  color: var(--fto-soft); text-wrap: balance;
}
.fto__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }
.fto__hint {
  margin: 24px 0 0;
  font: 400 var(--o-text-small, .875rem)/1.45 var(--o-font-body, "Nunito Sans", system-ui, sans-serif);
  color: var(--fto-quiet);
}
@media (hover: none) and (pointer: coarse) { .fto__hint { display: none; } }


.fto-vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------- motion */
html[data-motion="reduced"] .fto__panel, html[data-motion="still"] .fto__panel { animation: none; }
@media (prefers-reduced-motion: reduce) { html:not([data-motion]) .fto__panel { animation: none; } }

@media (forced-colors: active) {
  .fto__wordmark, .fto__slot.is-next { background: CanvasText; }
  .fto[data-input="key"] .fto__field:focus { outline: 3px solid Highlight; outline-offset: -6px; box-shadow: none; }
}
