/* base.css — reset + app frame */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

/* Scale-to-fit stage: the app is a FIXED-size device (390x844). The body fills
   the viewport and centers that stage; main.js sets --fit-scale = min(vw/390,
   vh/844) so the whole stage scales to fit any screen with no scroll/overlap.
   (Near-zero letterbox on modern ~19.5:9 phones; brand bands fill the rest.) */
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--ash);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  height: 100dvh;
  overflow: hidden; /* no page scroll — the stage is scaled to fit */
}

/* The device frame — fixed design size, scaled as one unit via --fit-scale. */
.screen-frame {
  position: relative;
  width: var(--screen-width);
  height: var(--screen-min-h);
  flex-shrink: 0;
  background: var(--white);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(26, 42, 94, 0.08);
  transform-origin: center center;
  transform: scale(var(--fit-scale, 1));
}

/* Every screen fills the fixed frame and lays out top -> bottom. */
.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: var(--screen-pad);
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

button:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

/* Tablet / desktop — the scaled stage is centered; round it like a device. */
@media (min-width: 768px) {
  .screen-frame {
    border-radius: 28px;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
