.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }

.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 12px;
  background: var(--bg);
}
.header-name { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.header-username { font-size: 0.8rem; color: var(--ink-2); }
.header-icon {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow);
}

.view { flex: 1; padding: 6px 18px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px)); }
.full-screen-route .view { padding: 0 0 8px; }
.full-screen-route .app { max-width: 720px; }

.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 30;
  width: 100%; max-width: 640px; height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
}
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 0.72rem; color: var(--ink-2); }
.nav-item.active { color: var(--accent); font-weight: 700; }

.center-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 28px; text-align: center; }
.logo-mark { font-size: 56px; }

.hero { padding: 6px 0 14px; }
.brand { font-size: 0.85rem; color: var(--teal); font-weight: 700; margin-bottom: 4px; }
.hero-title { font-size: clamp(2rem, 9vw, 2.8rem); line-height: 1.05; }

.page-title { font-size: 1.7rem; margin: 4px 0 14px; }
.home-sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; margin-top: 16px; }
.section-title { font-size: 1.15rem; margin-bottom: 10px; }
.card-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 560px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.back-link { display: inline-block; margin: 4px 0 8px; color: var(--ink-2); font-weight: 600; }

/* room screen */
.room-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; }
.room-title { text-align: center; line-height: 1.15; }
.room-title small { display: block; color: var(--ink-2); font-size: 0.75rem; }
.players-strip { display: flex; gap: 8px; padding: 4px 12px 8px; overflow-x: auto; scrollbar-width: none; }
.stage { position: relative; padding: 0 12px; min-height: 300px; min-width: 0; }
.banner { background: var(--gold); color: #3a2a00; text-align: center; padding: 6px 12px; font-size: 0.85rem; font-weight: 600; }

/* Single-column grids must be allowed to shrink below their content width (prevents horizontal overflow on phones). */
.hub-card, .panel, .lobby, .profile-card, .history-main, .setting-text { grid-template-columns: minmax(0, 1fr); }
.join-row .btn { flex: none; }
