/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* Column width the application is designed against */
  --app-width: 430px;

  /* Phone frame shown on wide screens */
  --frame-radius: 44px;
  --frame-bezel: 12px;
  --frame-screen-radius: 33px;
  --frame-body: #0c1219;

  /* Provisional palette — visual design is not decided yet */
  --surround: #000;
  --surface: #fff;
  --text: #0f172a;
  --text-2: #64748b;

  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--surround);
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

button { font-family: inherit; outline: none; }
input, textarea { font-family: inherit; -webkit-user-select: text; user-select: text; }
a { color: inherit; text-decoration: none; }


/* ── The application column ────────────────────────────────────────────────── */
/* On a phone this fills the screen. Everywhere else it stays a phone-sized
   column, because that is the shape the application is designed for. */
#app {
  width: 100%;
  max-width: var(--app-width);
  height: 100%;
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  -webkit-user-select: none;
  user-select: none;
}


/* ── Phone frame on wide screens ───────────────────────────────────────────── */
/* On a phone the wrapper generates no box at all, so the layout is exactly as
   if it were not there. Above the column width it materialises into a phone
   frame and the application sits inside it.
   The frame is for BROWSERS ONLY: inside the native shell (html.native) the
   application owns the screen, so no frame is drawn — a tablet then shows the
   column centred on the surround. */
.device-shell { display: contents; }

@media (min-width: 431px) {
  html:not(.native) .device-shell {
    display: block;
    position: relative;
    height: min(92vh, 900px);
    aspect-ratio: 300 / 626;
    /* Never wider than the viewport on a tall, narrow window */
    max-width: calc(100vw - 32px);
    background: var(--frame-body);
    border-radius: var(--frame-radius);
    padding: var(--frame-bezel);
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .6);
    overflow: hidden;
    /* Own compositing layer: keeps the rounded clip smooth while scrolling */
    transform: translateZ(0);
  }

  html:not(.native) .device-shell > #app {
    max-width: none;
    width: 100%;
    height: 100%;
    border-radius: var(--frame-screen-radius);
    overflow: hidden;
  }
}


/* ── Orientation ───────────────────────────────────────────────────────────── */
/* The application is designed portrait. Any TOUCH device held in landscape is
   asked to rotate — phone and tablet, browser or native. Desktop is excluded
   (pointer: fine): there the upright frame is the design, not a mistake. */
.orient-lock {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 40px;
  background: var(--surface);
  color: var(--text);
}

.orient-lock svg { width: 52px; height: 52px; }
.orient-lock p { font-size: 20px; font-weight: 800; }
.orient-lock span { font-size: 14px; color: var(--text-2); max-width: 320px; line-height: 1.5; }

@media (orientation: landscape) and (pointer: coarse) {
  .orient-lock { display: flex; }
}


/* ── Placeholder content ───────────────────────────────────────────────────── */
/* Removed once real screens exist. */
.placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* Respect notches and home indicators on real devices */
  padding: calc(24px + env(safe-area-inset-top, 0)) 24px calc(24px + env(safe-area-inset-bottom, 0));
}

.placeholder h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.placeholder p { font-size: 14px; color: var(--text-2); }
