/* Phase 3 — per-game UX chrome, themed states, 404 */

/* Mode chooser (Fever) */
.sk-mode-chooser {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12,10,16,.82);
  padding: 1rem;
}
.sk-mode-chooser[hidden] { display: none !important; }
.sk-mode-card {
  width: min(22rem, 100%);
  border: 1px solid #4A4136;
  background: #1b1712;
  color: #EDE3D0;
  padding: 1.2rem 1.15rem;
  font-family: Spectral, Georgia, serif;
}
.sk-mode-card h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
  color: #C9A876;
}
.sk-mode-card .lede { color: #c9c0ad; font-size: 0.95rem; margin: 0 0 1rem; }
.sk-mode-card .mode-btn {
  display: block; width: 100%;
  text-align: left;
  border: 1px solid #4A4136;
  background: #14110F;
  color: #EDE3D0;
  padding: 0.75rem 0.85rem;
  margin: 0 0 0.55rem;
  cursor: pointer;
  font-family: inherit;
}
.sk-mode-card .mode-btn:hover { border-color: #C9A876; }
.sk-mode-card .mode-btn b {
  display: block;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #C9A876;
  margin-bottom: 0.25rem;
}
.sk-mode-card .mode-btn span { font-size: 0.9rem; color: #c9c0ad; }

/* Objective / chapter strip */
.sk-obj-strip {
  position: absolute;
  top: 8px; left: 50%; transform: translateX(-50%);
  z-index: 45;
  max-width: min(92%, 28rem);
  text-align: center;
  pointer-events: none;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #C9A876;
  background: rgba(20,17,15,.75);
  border: 1px solid #4A4136;
  padding: 0.35rem 0.7rem;
}
.sk-obj-strip .sub { display: block; color: #8a7f6d; letter-spacing: 0.06em; margin-top: 0.2rem; text-transform: none; font-family: Spectral, Georgia, serif; font-size: 12px; }

/*  Both stages that carry a strip already own the top of their frame — the
 *  Climb has its medal slate there and Alley Cat has the start card — so the
 *  strip is laid in the flow above the picture rather than floated over it.
 *  The absolute rule above is kept for any stage that has the room. */
.sk-obj-strip.is-inline {
  position: static;
  transform: none;
  max-width: none;
  border-left: 0; border-right: 0; border-top: 0;
  background: #1b1712;
  padding: 0.45rem 0.75rem;
}

/*  …except on a play frame, where that row is a row off the picture. There
 *  the strip is pinned over the top of the stage by sk-phase3-games.js, which
 *  supplies `top` and `left` because only it can measure where the picture
 *  starts inside the shell. It then fades the way .gr-obj does on every stage
 *  that carries one of those instead, and stops taking pointer events so the
 *  first tap of the run lands on the game. */
.sk-obj-strip.is-pinned {
  position: absolute;
  transform: none;
  z-index: 45;
  width: fit-content;
  max-width: min(92%, 30rem);
  margin-inline: auto;
  margin-top: max(8px, env(safe-area-inset-top, 0px));
  border: 1px solid #4A4136;
  border-radius: 2px;
  background: rgba(20, 17, 15, 0.86);
  padding: 0.35rem 0.7rem;
  pointer-events: none;
  animation: sk-obj-in 0.5s ease 0.3s both, sk-obj-out 0.8s ease 7s forwards;
}
@keyframes sk-obj-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes sk-obj-out { to { opacity: 0; visibility: hidden; } }

/*  Reduced motion gets no fade — but it must not be left with a card sitting
 *  on the picture for the whole run either, so it is placed and held at the
 *  low contrast the faded state would have reached. */
@media (prefers-reduced-motion: reduce) {
  .sk-obj-strip.is-pinned { animation: none; opacity: 1; }
}

/* Chapter flash */
.sk-chapter-flash {
  position: absolute; inset: 0; z-index: 55;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,8,6,.72);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.sk-chapter-flash.show { opacity: 1; }
.sk-chapter-flash .inner {
  text-align: center;
  color: #EDE3D0;
  font-family: Fraunces, Georgia, serif;
}
.sk-chapter-flash .k {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #C9A876;
  margin-bottom: 0.5rem;
}
.sk-chapter-flash h2 { margin: 0; font-size: 1.6rem; }
.sk-chapter-flash p { margin: 0.4rem 0 0; color: #c9c0ad; font-family: Spectral, Georgia, serif; font-size: 0.95rem; }

/* Transfer confirm */
.sk-confirm {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(10,8,6,.85);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.sk-confirm[hidden] { display: none !important; }
.sk-confirm .box {
  width: min(22rem, 100%);
  border: 1px solid #4A4136;
  background: #1b1712;
  padding: 1.1rem;
  color: #EDE3D0;
}
.sk-confirm .box h3 { margin: 0 0 0.5rem; font-family: Fraunces, Georgia, serif; color: #C9A876; }
.sk-confirm .box p { margin: 0 0 1rem; color: #c9c0ad; font-size: 0.95rem; }
.sk-confirm .row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.sk-confirm button {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid #4A4136;
  background: #14110F;
  color: #C9A876;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}
.sk-confirm button.danger { border-color: #c47a6a; color: #c47a6a; }
.sk-confirm button.primary { background: #C9A876; color: #14110F; border-color: #C9A876; }

/* Themed empty / loading / error */
.sk-state {
  border: 1px solid #4A4136;
  background: #1b1712;
  padding: 1rem 1.1rem;
  color: #c9c0ad;
  font-family: Spectral, Georgia, serif;
}
.sk-state .k {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #C9A876;
  margin-bottom: 0.4rem;
}
.sk-state.error .k { color: #c47a6a; }

/* Nursery critical pulse */
.sk-need-critical {
  box-shadow: 0 0 0 1px #c47a6a, 0 0 12px rgba(196,122,106,.35);
  animation: skPulse 1.4s ease-in-out infinite;
}
@keyframes skPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}
/* sk-a11y.js writes .sk-rm on <html> for the Reduce motion switch, and the
   media query covers a visitor who set it in the OS and never opened Access.
   The colour ring stays either way — it is the part that carries the meaning;
   only the pulse is dropped. */
html.sk-rm .sk-need-critical { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .sk-need-critical { animation: none; }
}

/* Camera assist note */
.sk-assist-chip {
  position: absolute;
  bottom: 12px; left: 12px;
  z-index: 40;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7A8B54;
  background: rgba(20,17,15,.7);
  border: 1px solid #4A4136;
  padding: 0.25rem 0.45rem;
  pointer-events: none;
}

/* 404 page extras (also works standalone) */
.sk-404-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; }
