/* ===========================================================================
   GreenCity Padel — app shell & navigation
   =========================================================================== */

.app { min-height: 100dvh; }

/* --- sidebar (desktop) ---------------------------------------------------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--sidebar-w);
  display: none;
  flex-direction: column;
  padding: var(--s-5) var(--s-4);
  background: rgba(8, 13, 11, 0.72);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--s-3) var(--s-6);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--brand-grad);
  font-size: 19px;
  box-shadow: var(--sh-brand);
}
.brand-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }

.nav-group-label {
  padding: var(--s-4) var(--s-3) 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px var(--s-3);
  border-radius: var(--r-sm);
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--brand-a08); color: var(--brand); font-weight: 600; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
  transform: translateY(-50%);
}
.nav-icon { font-size: 17px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--r-full);
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.nav-badge.live { background: var(--danger); color: #fff; animation: breathe 1.6s ease-in-out infinite; }

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: var(--s-4);
  padding: 10px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
}
.sidebar-foot .who { min-width: 0; flex: 1; }
.sidebar-foot .who-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-sm);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-foot .who-meta { font-size: var(--fs-xs); color: var(--text-3); }

/* --- mobile top bar ------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  height: 56px;
  padding: 0 var(--s-4);
  padding-top: var(--safe-t);
  background: rgba(6, 10, 8, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.topbar .brand { padding: 0; }
.topbar .brand-mark { width: 30px; height: 30px; font-size: 16px; border-radius: 9px; }
.topbar .brand-text { font-size: 1.05rem; }

/* --- main ----------------------------------------------------------------- */
.main {
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-b) + var(--s-6));
}
.page {
  display: none;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--s-5) var(--s-4) 0;
}
.page.active { display: block; animation: rise var(--dur-3) var(--ease-out) both; }
.page.full { max-width: none; padding: 0; }

.page-head { margin-bottom: var(--s-5); }
.page-title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.page-sub { color: var(--text-2); font-size: var(--fs-sm); margin-top: 4px; }
.page-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }

.head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}

/* --- bottom nav (mobile) -------------------------------------------------- */
.bottom-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: calc(var(--bottom-nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(8, 13, 11, 0.9);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.bn-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease);
}
.bn-item .bn-icon { font-size: 20px; line-height: 1; transition: transform var(--dur-2) var(--ease-spring); }
.bn-item.active { color: var(--brand); }
.bn-item.active .bn-icon { transform: translateY(-2px) scale(1.12); }
.bn-item.active::after {
  content: '';
  position: absolute;
  top: 6px;
  width: 22px; height: 3px;
  border-radius: var(--r-full);
  background: var(--brand);
}

/* Elevated centre action — the thing you press most on a Saturday. */
.bn-item.bn-action {
  flex: 0 0 auto;
  width: 62px;
}
.bn-action .bn-icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  margin-top: -22px;
  border-radius: var(--r-full);
  background: var(--brand-grad);
  color: var(--brand-ink);
  font-size: 24px;
  box-shadow: var(--sh-brand), 0 0 0 5px var(--bg);
}
.bn-action.active::after { display: none; }
.bn-action.active .bn-icon { transform: scale(1.06); }
.bn-action.pulsing .bn-icon { animation: pulse-ring 2s ease-out infinite; }

.bn-dot {
  position: absolute;
  top: 8px;
  right: 50%;
  margin-right: -18px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--bg);
}

/* --- more sheet (mobile overflow nav) ------------------------------------- */
.more-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
}
.more-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: var(--s-4) var(--s-2);
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  transition: all var(--dur-1) var(--ease);
}
.more-tile:hover, .more-tile:active { background: var(--surface-2); color: var(--text); }
.more-tile .more-icon { font-size: 24px; }

/* --- desktop breakpoint --------------------------------------------------- */
@media (min-width: 900px) {
  .sidebar { display: flex; }
  .topbar  { display: none; }
  .bottom-nav { display: none; }
  .main {
    margin-left: var(--sidebar-w);
    padding-bottom: var(--s-10);
  }
  .page { padding: var(--s-8) var(--s-8) 0; }
  .toast-host { left: calc(50% + var(--sidebar-w) / 2); }
}

@media (min-width: 1400px) {
  :root { --content-max: 1280px; }
}

/* --- install prompt ------------------------------------------------------- */
.install-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-h) + var(--safe-b) + 14px);
  transform: translateX(-50%);
  z-index: 70;
  display: none;
  align-items: center;
  gap: var(--s-3);
  width: min(430px, calc(100vw - 28px));
  padding: 12px 14px;
  border-radius: var(--r);
  background: rgba(14, 22, 19, 0.97);
  border: 1px solid var(--brand-a30);
  box-shadow: var(--sh-3);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: rise var(--dur-3) var(--ease-out) both;
}
.install-bar.show { display: flex; }
@media (min-width: 900px) { .install-bar { left: calc(50% + var(--sidebar-w) / 2); bottom: 24px; } }

/* --- offline banner ------------------------------------------------------- */
.offline-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 7px var(--s-4);
  padding-top: calc(7px + var(--safe-t));
  background: var(--warn);
  color: #241800;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.offline-bar.show { display: flex; }
body.is-offline .topbar { top: 30px; }
