/*
 * Kiosk chrome: the fixed 1160×800 stage the design was drawn against, scaled
 * to whatever the iPad actually gives us, plus the handful of primitives every
 * screen shares. Screens themselves carry their own inline layout, matching the
 * design doc — this file is only what is genuinely common.
 */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-cards);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: manipulation;
}

/*
 * The stage fills the device.
 *
 * The design's "Live" revision is fluid — `clamp()` type, `auto-fit` grids,
 * scrollable panes — so it no longer needs the fixed 1160×800 canvas scaled to
 * fit. Letting it fill the viewport is better than scaling: type is rendered at
 * its true size rather than resampled, and a 10.2" iPad, an 11" Pro and a
 * desktop browser each get a layout that suits them instead of the same picture
 * shrunk.
 */
#stage-wrap {
  position: fixed;
  inset: 0;
  background: var(--bg-cards);
}

#stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-cards);
  color: var(--ink);
  /* Respect the notch/home indicator when installed to the home screen. */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop  { 0% { opacity: 0; transform: scale(.82); } 60% { transform: scale(1.04); } 100% { opacity: 1; transform: scale(1); } }
@keyframes wipe { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(9px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Touch feedback. The design's :hover styles are meaningless on a kiosk; these
   are the pressed states that replace them. */
[data-tap] { cursor: pointer; }
[data-tap]:active { transform: scale(.985); }

.k-spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* Full-screen states shared by every screen: loading and hard error. */
.k-fill {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  background: var(--bg-cards); color: var(--ink);
}
.k-fill .k-msg { font-size: 22px; color: var(--muted-text); max-width: 620px; text-align: center; line-height: 1.4; }
.k-fill .k-title { font-size: 40px; font-weight: 700; letter-spacing: -.025em; }

.k-btn {
  font-size: 20px; font-weight: 700;
  background: var(--btn-bg); color: var(--btn-fg);
  border: none; border-radius: var(--r-pill);
  padding: 16px 34px; cursor: pointer;
  font-family: var(--font);
}
.k-btn-ghost {
  background: transparent; color: var(--muted-text);
  border: 1px solid var(--line);
}

/* Offline banner — pinned above everything, since a kiosk that has silently
   lost the network looks identical to one that is working. */
#k-offline {
  position: absolute; left: 0; right: 0; top: 0;
  z-index: 90;
  display: none;
  padding: 10px;
  text-align: center;
  font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: #B4462F; color: #fff;
}
body[data-offline='1'] #k-offline { display: block; }
