/* Layout: app shell, page, grids. Mobile first from 360 px; from 1024 px
   everything stands side by side like in the original. */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--gap);
  min-height: 56px;
  padding: 6px var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .02em;
}
.topbar__brand .icon { width: 30px; height: 30px; }
.topbar__title { font-size: 1rem; }
.topbar__home { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.topbar__home:not([hidden]) + .topbar__slot { margin-left: 0; }
.topbar__slot { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }

.view {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--gutter) var(--gutter) calc(var(--gutter) + max(120px, var(--roundbar-h, 0px))); /* room for the round bar: at least the old 120px, more when the bar is taller (height from shell.js) */
}
.view:focus { outline: none; }

/* round bar: bottom on the phone, top on the desktop (Task 4 fills it) */
.roundbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px var(--gutter) calc(6px + env(safe-area-inset-bottom));
}
.roundbar:empty { display: none; }

.page-head {
  display: flex;
  flex-wrap: wrap; /* the actions move below the title on a narrow phone */
  align-items: center;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.page-head h1 { margin: 0; }

.stack { display: grid; gap: var(--gap); }
.row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.split { display: grid; gap: var(--gap); }
.cluster { display: flex; flex-wrap: wrap; gap: 8px; }

@media (min-width: 1024px) {
  .view { padding-bottom: var(--gutter); }
  .roundbar {
    position: sticky;
    top: 56px;
    bottom: auto;
    border-top: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
  }
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* the profile bar needs the room of the title on the phone */
.page-head__action { margin-left: auto; }
.page-head__actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 599px) {
  .topbar:has(.profilebar) .topbar__title { display: none; }
  .topbar__home-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---- top bar round group (play-test round 3 A3): the ready button
   ("Spiel starten" / "Woche fortsetzen") stays reachable; on the phone icon plus short label, the profile list scrolls ---- */
.topbar__brand { margin-right: auto; }
.topbar > .topbar__home, .topbar > .topbar__slot { margin-left: 0; }
.topbar__round { display: flex; gap: 6px; flex: none; }
.topbar__round:empty { display: none; }
.topbar__round .btn { white-space: nowrap; }
.topbar__short { display: none; }
@media (max-width: 599px) {
  .topbar__round .topbar__long { display: none; }
  .topbar__round .topbar__short { display: inline; }
}
