/* Wordnest – shared screen skeleton. Tokens live in base.css.
   Every screen mounts into #app:
     start / settings:  header.topbar   + main.scroll
     find:              header.statusbar + main.play + section.info
     match:             header.statusbar + main.match (fills play + info height) */

html,
body {
  height: 100%;
  overflow: hidden;
}

/* Centered column; 100dvh with safe areas; no horizontal scroll. */
.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--max-w);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--c-bg);
  color: var(--c-text);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ---------- Top bar (start, settings) ---------- */
.topbar {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-1);
  min-height: 56px;
  padding: 0 var(--space-1) 0 var(--space-2);
}
.topbar h1 {
  flex: 1;
  font-size: var(--fs-xl);
}

/* Scrolling body (start, settings) */
.scroll {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-2);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 0 var(--space-2) var(--space-3);
}

/* ---------- Status bar (find, match) – 48px ---------- */
.statusbar {
  position: relative;
  z-index: 1;
  display: flex;
  flex: none;
  align-items: center;
  height: var(--statusbar-h);
  padding: 0 2px 0 6px;
  background: var(--c-surface);
  box-shadow: 0 1px 0 var(--c-border);
}
.statusbar .title {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 0 4px 0 10px;
  line-height: 1.2;
}
.statusbar .title h1 {
  overflow: hidden;
  font-size: var(--fs-md);
  font-weight: var(--fw-heavy);
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.statusbar .meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.statusbar .stat {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  color: var(--c-text-muted);
}

/* ---------- Play area (find) + info area ≈22% ---------- */
.play {
  position: relative;
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 0;
  padding: var(--space-1);
}
.info {
  display: flex;
  flex: 0 0 22%;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  margin: 0 var(--space-1) var(--space-1);
  padding: 12px var(--space-2);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--c-surface);
  box-shadow: var(--shadow);
}

/* ---------- Match columns (play + info height) ---------- */
.match {
  position: relative;
  display: grid;
  flex: 1;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: var(--gap-box);
  min-height: 0;
  padding: var(--space-1);
  overflow: hidden;
}

/* ---------- Shared controls used by the skeleton ---------- */
.icon-btn {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--c-text);
  text-decoration: none;
}
.done-pill {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  height: 44px;
  margin: 2px 0;
  padding: 0 10px 0 6px;
  border: 2px solid var(--c-found);
  border-radius: var(--radius-pill);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-heavy);
  text-decoration: none;
}
