/* ============================================================================
   Dama Pa More — web app shell (layered on top of the mockup design system in
   app.css). Turns the fixed 390×844 mockup ".phone" into a real responsive app:
   full-viewport on phones, a centered device frame on desktop.
   ========================================================================== */

html, body { height: 100%; }
body {
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(40,49,90,.55), transparent 55%),
    var(--night-950);
}

#app { position: fixed; inset: 0; display: grid; place-items: center; }

/* The device: fills the screen on mobile, a framed "phone" on desktop. */
.app-shell {
  position: relative;
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, var(--night-900), var(--night-950));
}
@media (min-width: 540px) {
  #app { padding: 24px; }
  .app-shell {
    width: min(430px, 100%);
    height: min(920px, calc(100vh - 48px));
    border-radius: 40px;
    box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255,255,255,.05);
  }
  .app-shell::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 30;
    background-image: var(--banig); opacity: .5; mix-blend-mode: overlay;
    border-radius: inherit;
  }
}

/* Screen mount — one screen lives here at a time. */
#stage { position: relative; z-index: 1; flex: 1; display: flex; min-height: 0; }
#stage > .screen { flex: 1; }

/* Screen enter transition. */
.screen.fade-in { animation: screenIn var(--dur) var(--ease-out) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Persistent bottom tab bar (hidden on "bare" routes: board, splash, etc.). */
#tabbar { position: relative; z-index: 20; }
#tabbar.is-hidden { display: none; }

/* Boot splash — covers the shell until the first screen paints. */
#boot { position: absolute; inset: 0; z-index: 100; display: grid; place-items: center;
  background: radial-gradient(120% 80% at 50% 30%, var(--night-800), var(--night-950));
  transition: opacity var(--dur-slow) var(--ease); }
#boot.is-gone { opacity: 0; pointer-events: none; }
#boot .boot__logo { display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
  animation: floatIn var(--dur-slow) var(--ease-out) both; }
#boot .boot__mark { width: 88px; height: 88px; }
#boot .boot__word { font-family: var(--font-display); font-weight: 800; font-size: 24px;
  color: var(--text-strong); letter-spacing: -.02em; }
#boot .boot__word small { display: block; font-size: 12px; font-weight: 700; color: var(--brass-bright);
  letter-spacing: .18em; text-transform: uppercase; text-align: center; margin-top: 2px; }

/* Toast. */
#toast { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(12px);
  z-index: 60; max-width: 84%; padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--surface-3); border: 1px solid var(--hairline); box-shadow: var(--shadow-lg);
  color: var(--text-strong); font-size: 13px; font-weight: 700; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
#toast.is-shown { opacity: 1; transform: translateX(-50%) translateY(0); }

/* App bar without the fake notch inset (real app, not a mockup frame). */
.appbar { padding-top: calc(env(safe-area-inset-top, 0px) + var(--s-4)); }
.appbar .back { margin-left: -6px; }

/* Full-bleed desktop web landing (screen 15) escapes the phone frame. */
body.route-landing #app { padding: 0; display: block; }
body.route-landing .app-shell { width: 100%; height: 100%; max-width: none; border-radius: 0; box-shadow: none; }
body.route-landing #stage > .screen { overflow-y: auto; }
