/*
 * Dink & Rally — logged-in app styles. Scoped under .app-shell.
 * Tokens come from tokens.css; do not redeclare here.
 */

body.app-shell {
  margin: 0;
  background: var(--ink);
  color: #fff;
  font-family: 'Archivo', 'Space Grotesk', system-ui, sans-serif;
}

.app-shell a { color: inherit; }
.app-shell button { font-family: inherit; }

.app-shell .display {
  font-family: 'Archivo Black', 'Archivo', system-ui, sans-serif;
  letter-spacing: -0.04em;
  line-height: 0.9;
  text-transform: uppercase;
}
.app-shell .mono {
  font-family: 'DM Mono', ui-monospace, monospace;
}

/* ===== Top nav (desktop) ===== */
.app-shell .app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid #1a1a1a;
  background: var(--ink);
  color: #fff;
}
.app-shell .app-nav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}
.app-shell .app-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.app-shell .app-nav-wordmark {
  font-family: 'Archivo Black', sans-serif;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.app-shell .app-nav-links {
  display: flex;
  gap: 24px;
  font-size: 13px;
  font-weight: 600;
}
.app-shell .app-nav-link {
  color: var(--gray-soft);
  text-decoration: none;
  position: relative;
  padding-bottom: 6px;
}
.app-shell .app-nav-link.is-active {
  color: #fff;
}
.app-shell .app-nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--accent);
}
.app-shell .app-nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-shell .app-nav-cta {
  background: var(--accent);
  color: var(--ink);
  padding: 9px 16px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.app-shell .app-nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--hot));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
}

/* ===== Mobile per-screen header (dashboard variant) ===== */
.app-shell .app-header-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #1a1a1a;
}
.app-shell .app-header-mobile-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
}
.app-shell .app-header-mobile-wordmark {
  font-family: 'Archivo Black', sans-serif;
  font-size: 14px;
}
.app-shell .app-header-mobile-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--hot));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
}

/* ===== Main app surface ===== */
.app-shell .app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 48px;
}

/* ===== Dashboard: greeting / hero ===== */
.app-shell .dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 24px;
  flex-wrap: wrap;
}
.app-shell .dash-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.app-shell .dash-h1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 64px;
  margin: 0;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.app-shell .dash-h1 .accent { color: var(--accent); }
.app-shell .dash-cta {
  background: var(--accent);
  color: var(--ink);
  padding: 18px 32px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
}

/* ===== Dashboard: stat strip ===== */
.app-shell .stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 36px;
}
.app-shell .stat-tile {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 14px;
  padding: 18px 20px;
}
.app-shell .stat-tile-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.app-shell .stat-tile-value {
  font-family: 'Archivo Black', sans-serif;
  font-size: 44px;
  line-height: 1;
  margin-top: 6px;
  letter-spacing: -0.03em;
}
.app-shell .stat-tile.tone-accent .stat-tile-value { color: var(--accent); }
.app-shell .stat-tile.tone-hot    .stat-tile-value { color: var(--hot); }
.app-shell .stat-tile.tone-cobalt .stat-tile-value { color: var(--cobalt); }
.app-shell .stat-tile.tone-paper  .stat-tile-value { color: #fff; }

/* ===== Dashboard: connections nudge ===== */
.app-shell .dash-nudge {
  background: var(--hot);
  color: #fff;
  border-radius: 16px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.app-shell .dash-nudge-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.app-shell .dash-nudge-sub {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 2px;
}
.app-shell .dash-nudge-cta {
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

/* ===== Dashboard: section headers ===== */
.app-shell .dash-section { margin-bottom: 40px; }
.app-shell .dash-section:last-child { margin-bottom: 0; }
.app-shell .dash-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.app-shell .dash-section-h2 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 28px;
  margin: 0;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.app-shell .dash-section-meta {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.app-shell .dash-empty {
  background: var(--gray-card);
  border: 1px dashed var(--gray-border-2);
  border-radius: 14px;
  padding: 32px 22px;
  text-align: center;
  color: var(--gray-soft);
  font-size: 14px;
}

/* ===== Game row (desktop) ===== */
.app-shell .game-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.app-shell .game-row {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
.app-shell .game-row:hover { border-color: var(--gray-border-2); }
.app-shell .game-row.is-cancelled { opacity: 0.55; }

.app-shell .game-row-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-shell .game-row-icon--pickleball { background: var(--accent); }
.app-shell .game-row-icon--tennis     { background: var(--cobalt); }

.app-shell .game-row-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.app-shell .game-row-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 16px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.app-shell .game-row-mine {
  background: var(--ink);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--accent);
  letter-spacing: 0.06em;
}
.app-shell .game-row-meta {
  font-size: 13px;
  color: var(--gray-soft);
}
.app-shell .game-row-when { color: #fff; }

.app-shell .game-row-slots {
  display: flex;
  align-items: center;
  gap: 6px;
}
.app-shell .game-row-slot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gray-border-2);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #444;
}
.app-shell .game-row-slot.is-accepted {
  background: var(--green);
  border: none;
}
.app-shell .game-row-slot-count {
  margin-left: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--gray-mid);
}
.app-shell .game-row-slot-count.is-full { color: var(--accent); }

.app-shell .game-row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-shell .game-row-open {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid #333;
  border-radius: 8px;
  white-space: nowrap;
}

/* ===== Status pill (used in row + mobile card) ===== */
.app-shell .status-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 99px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.app-shell .status-pill.is-open,
.app-shell .status-pill.is-filling {
  background: var(--gray-border);
  color: #fff;
}
.app-shell .status-pill.is-full {
  background: var(--accent);
  color: var(--ink);
}
.app-shell .status-pill.is-needs-response {
  background: var(--hot);
  color: #fff;
}
.app-shell .status-pill.is-cancelled {
  background: var(--gray-border-2);
  color: var(--red);
}

/* ===== Mobile game card ===== */
.app-shell .mobile-game-card {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.app-shell .mobile-game-card.is-cancelled { opacity: 0.55; }
.app-shell .mobile-game-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-shell .mobile-game-card-icon--pickleball { background: var(--accent); }
.app-shell .mobile-game-card-icon--tennis     { background: var(--cobalt); }
.app-shell .mobile-game-card-body {
  flex: 1;
  min-width: 0;
}
.app-shell .mobile-game-card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.app-shell .mobile-game-card-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 13px;
  color: #fff;
  text-transform: uppercase;
}
.app-shell .mobile-game-card-mine {
  background: var(--ink);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 99px;
  border: 1px solid var(--accent);
}
.app-shell .mobile-game-card-meta {
  font-size: 11px;
  color: var(--gray-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-shell .mobile-game-card-when { color: #fff; }
.app-shell .mobile-game-card-status {
  margin-top: 6px;
}
.app-shell .mobile-game-card-fill {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--gray-mid);
}
.app-shell .mobile-game-card-fill.is-full { color: var(--accent); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .app-shell .app-nav {
    display: flex;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    z-index: 60;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    background: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(10px);
  }
  .app-shell .app-nav-left {
    width: 100%;
    gap: 0;
  }
  .app-shell .app-nav-brand,
  .app-shell .app-nav-right {
    display: none;
  }
  .app-shell .app-nav-links {
    width: 100%;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .app-shell .app-nav-link {
    flex: 0 0 auto;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid #2a2a2a;
    background: #151515;
    white-space: nowrap;
  }
  .app-shell .app-nav-link.is-active {
    background: rgba(196, 255, 77, 0.12);
    border-color: var(--accent);
    color: var(--accent);
  }
  .app-shell .app-nav-link.is-active::after {
    content: none;
  }
  .app-shell .app-header-mobile { display: flex; }
  .app-shell .app-main { padding: 20px 18px 140px; max-width: none; }

  .app-shell .dash-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 22px;
  }
  .app-shell .dash-h1 { font-size: 36px; }
  .app-shell .dash-cta {
    display: block;
    text-align: center;
    padding: 14px 20px;
    font-size: 15px;
  }

  .app-shell .stat-strip {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 22px;
  }
  .app-shell .stat-tile { padding: 12px 14px; border-radius: 12px; }
  .app-shell .stat-tile-value { font-size: 30px; }
  .app-shell .stat-tile-label { font-size: 10px; }

  .app-shell .dash-nudge {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 22px;
  }
  .app-shell .dash-nudge-title { font-size: 16px; }

  .app-shell .dash-section { margin-bottom: 22px; }
  .app-shell .dash-section-head { margin-bottom: 10px; }
  .app-shell .dash-section-h2 { font-size: 18px; }

  .app-shell .game-list { gap: 8px; }

  /* Hide desktop GameRow markup; mobile cards take over. */
  .app-shell .game-list--desktop { display: none; }
  .app-shell .game-list--mobile  { display: flex; flex-direction: column; gap: 8px; }
}

@media (min-width: 901px) {
  .app-shell .game-list--mobile { display: none; }
}

@media (max-width: 480px) {
  .app-shell .dash-h1 { font-size: 30px; }
  .app-shell .stat-tile-value { font-size: 26px; }
}

/* ========================================================================
 * Auth screens (login + register)
 * Two layouts: split poster on desktop, full poster + dark form-card on mobile.
 * Form-panel inverts color via CSS custom props instead of duplicate markup.
 * ====================================================================== */

.app-shell .auth-bg {
  min-height: 100vh;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  position: relative;
  overflow: hidden;
}

.app-shell .auth-mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
}
.app-shell .auth-mini-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.app-shell .auth-mini-header-wordmark {
  font-family: 'Archivo Black', sans-serif;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.app-shell .auth-mini-header-back {
  color: var(--gray-soft);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.app-shell .auth-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: calc(100vh - 64px);
}

/* ----- Left poster ----- */
.app-shell .auth-poster {
  padding: 40px 56px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  gap: 40px;
}
.app-shell .auth-poster-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.app-shell .auth-poster-h1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 120px;
  line-height: 0.85;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin: 18px 0 0;
}
.app-shell .auth-poster-h1 .accent { color: var(--accent); }
.app-shell .auth-poster-captions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--gray-mid);
  position: relative;
  z-index: 1;
}
.app-shell .auth-poster-decor {
  position: absolute;
  bottom: -80px;
  right: -60px;
  transform: rotate(-20deg);
  opacity: 0.7;
  pointer-events: none;
}
.app-shell .auth-poster-stamp {
  position: absolute;
  top: 220px;
  right: 56px;
  transform: rotate(8deg);
  border: 3px solid var(--hot);
  color: var(--hot);
  padding: 8px 14px;
  border-radius: 4px;
  font-family: 'Archivo Black', sans-serif;
  font-size: 13px;
  letter-spacing: 0.05em;
}

/* ----- Right form panel — color contract via CSS custom props ----- */
.app-shell .auth-form-panel {
  --form-bg: #fff;
  --form-color: var(--ink);
  --form-meta: #555;
  --form-input-bg: #fafafa;
  --form-input-border: #ddd;
  --form-input-color: var(--ink);
  --form-divider: #eee;
  --form-strong: var(--ink);

  background: var(--form-bg);
  color: var(--form-color);
  padding: 56px;
  display: flex;
  align-items: center;
}
.app-shell .auth-form-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}
.app-shell .auth-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--form-meta);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.app-shell .auth-h2 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 44px;
  margin: 8px 0;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--form-color);
}
.app-shell .auth-sub {
  font-size: 15px;
  color: var(--form-meta);
  margin: 0 0 32px;
}
.app-shell .auth-sub strong {
  color: var(--form-strong);
  font-weight: 700;
}
.app-shell .auth-error {
  background: var(--hot);
  color: #fff;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
}
.app-shell .auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.app-shell .auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-shell .auth-field-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--form-meta);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.app-shell .auth-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--form-input-bg);
  border: 1px solid var(--form-input-border);
  border-radius: 12px;
  padding: 16px;
  color: var(--form-input-color);
  font-size: 17px;
  font-family: inherit;
  outline: none;
}
.app-shell .auth-input:focus {
  border-color: var(--accent);
}
.app-shell .auth-phone-row {
  display: flex;
  align-items: center;
  border: 1px solid var(--form-input-border);
  border-radius: 12px;
  background: var(--form-input-bg);
  overflow: hidden;
}
.app-shell .auth-phone-prefix {
  padding: 16px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  color: var(--form-meta);
  border-right: 1px solid var(--form-input-border);
  white-space: nowrap;
}
.app-shell .auth-phone-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 16px 14px;
  font-size: 17px;
  color: var(--form-input-color);
  outline: none;
  font-family: inherit;
  width: 100%;
}
.app-shell .auth-code-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--form-input-bg);
  border: 2px solid var(--form-input-border);
  border-radius: 12px;
  padding: 16px;
  color: var(--form-input-color);
  font-family: 'Archivo Black', sans-serif;
  font-size: 28px;
  letter-spacing: 0.4em;
  text-align: center;
  outline: none;
}
.app-shell .auth-code-input:focus {
  border-color: var(--accent);
}
/* TODO: replace with 6 separate digit tiles + auto-advance JS on mobile.
   Current single input mirrors the desktop pattern at all sizes. */
.app-shell .auth-cta {
  width: 100%;
  background: var(--accent);
  color: var(--ink);
  padding: 16px 24px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 16px;
  border: 0;
  cursor: pointer;
  font-family: 'Archivo', sans-serif;
  letter-spacing: -0.01em;
  margin-top: 6px;
}
.app-shell .auth-meta {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--form-meta);
  text-align: center;
}
.app-shell .auth-secondary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-top: 4px;
}
.app-shell .auth-secondary-row a,
.app-shell .auth-secondary-row button {
  color: var(--form-meta);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.app-shell .auth-secondary-row .auth-secondary-strong {
  color: var(--form-strong);
  font-weight: 700;
}
.app-shell .auth-divider {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--form-divider);
  text-align: center;
  font-size: 14px;
  color: var(--form-meta);
}
.app-shell .auth-divider a {
  color: var(--form-strong);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

/* ----- Mobile: collapse split, swap form-panel to dark translucent card ----- */
@media (max-width: 900px) {
  .app-shell .auth-mini-header { padding: 14px 18px; }
  .app-shell .auth-mini-header-wordmark { font-size: 14px; }
  .app-shell .auth-split {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .app-shell .auth-poster {
    padding: 24px 22px 0;
    gap: 18px;
  }
  .app-shell .auth-poster-decor,
  .app-shell .auth-poster-stamp,
  .app-shell .auth-poster-captions { display: none; }
  .app-shell .auth-poster-h1 { font-size: 56px; }

  .app-shell .auth-form-panel {
    --form-bg: rgba(20, 20, 20, 0.55);
    --form-color: #fff;
    --form-meta: var(--gray-soft);
    --form-input-bg: var(--ink);
    --form-input-border: var(--gray-border-2);
    --form-input-color: #fff;
    --form-divider: var(--gray-border);
    --form-strong: #fff;

    padding: 22px;
    margin: 18px 18px 24px;
    border-radius: 16px;
    border: 1px solid var(--gray-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: stretch;
  }
  .app-shell .auth-h2 { font-size: 30px; }
  .app-shell .auth-sub { margin-bottom: 22px; }
}

@media (max-width: 480px) {
  .app-shell .auth-poster-h1 { font-size: 44px; }
  .app-shell .auth-h2 { font-size: 26px; }
  .app-shell .auth-code-input { font-size: 22px; letter-spacing: 0.3em; }
}

/* ----- Register poster modifier — hot-pink eyebrow + decor, smaller H1 ----- */
.app-shell .auth-poster--register .auth-poster-eyebrow { color: var(--hot); }
.app-shell .auth-poster--register .auth-poster-h1 { font-size: 100px; }
.app-shell .auth-poster--register .auth-poster-decor {
  bottom: -90px;
  right: -70px;
  transform: rotate(15deg);
  opacity: 0.5;
}

.app-shell .auth-poster-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--gray-mid);
  position: relative;
  z-index: 1;
}
.app-shell .auth-poster-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-shell .auth-poster-check::before {
  content: '✓';
  color: var(--accent);
}

.app-shell .auth-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--form-meta);
  cursor: pointer;
  margin-top: 4px;
  line-height: 1.5;
}
.app-shell .auth-checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  margin-top: 2px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .app-shell .auth-poster--register .auth-poster-h1 { font-size: 44px; }
  .app-shell .auth-checkbox-row { font-size: 13px; }
  .app-shell .auth-checkbox-row input[type="checkbox"] { width: 18px; height: 18px; }
}

@media (max-width: 480px) {
  .app-shell .auth-poster--register .auth-poster-h1 { font-size: 36px; }
}

/* ========================================================================
 * Create Game — 2-column desktop (form + live preview), single-column
 * mobile with sticky bottom CTA.
 * ====================================================================== */

.app-shell .create-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 48px;
}
.app-shell .create-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.app-shell .create-h1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 72px;
  margin: 0 0 8px;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.app-shell .create-h1 .accent { color: var(--accent); }
.app-shell .create-sub {
  font-size: 16px;
  color: var(--gray-soft);
  max-width: 580px;
  margin: 0 0 36px;
}

.app-shell .create-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: start;
}

.app-shell .create-card {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 18px;
  padding: 28px;
}
.app-shell .create-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.app-shell .create-field { display: flex; flex-direction: column; gap: 8px; }
.app-shell .create-field-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.app-shell .create-field-hint {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}

.app-shell .create-input {
  background: var(--ink);
  border: 1px solid var(--gray-border-2);
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.app-shell .create-input:focus { border-color: var(--accent); }
.app-shell .create-input::placeholder {
  color: #555;
  font-family: 'DM Mono', monospace;
}
.app-shell .create-datetime {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.app-shell .create-seg {
  display: grid;
  gap: 8px;
}
.app-shell .create-seg-2 { grid-template-columns: 1fr 1fr; }
.app-shell .create-seg-btn {
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--gray-border-2);
  border-radius: 12px;
  padding: 14px 12px;
  font-family: 'Archivo Black', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}
.app-shell .create-seg-btn:hover { border-color: #444; }
.app-shell .create-seg-btn.is-on {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
}
.app-shell .create-seg-btn-sub {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.7;
  margin-left: 4px;
}

.app-shell .create-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #ddd;
  cursor: pointer;
}
.app-shell .create-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.app-shell .create-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.app-shell .create-submit {
  background: var(--accent);
  color: var(--ink);
  padding: 14px 28px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 15px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.app-shell .create-cancel {
  background: transparent;
  color: #fff;
  padding: 14px 24px;
  border-radius: 99px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid #333;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* ----- Live preview (desktop right column) ----- */
.app-shell .create-preview-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--gray-mid);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.app-shell .create-preview-card {
  background: var(--accent);
  color: var(--ink);
  border-radius: 18px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  min-height: 280px;
}
.app-shell .create-preview-card.is-tennis {
  background: var(--cobalt);
  color: var(--ink);
}
.app-shell .create-preview-decor {
  position: absolute;
  top: -30px;
  right: -30px;
  opacity: 0.55;
  pointer-events: none;
}
.app-shell .create-preview-tag {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  position: relative;
}
.app-shell .create-preview-h {
  font-family: 'Archivo Black', sans-serif;
  font-size: 32px;
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  position: relative;
}
.app-shell .create-preview-meta {
  font-size: 14px;
  margin-bottom: 4px;
  position: relative;
}
.app-shell .create-preview-foot {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 14px;
  position: relative;
}
.app-shell .create-preview-aside-foot {
  margin-top: 14px;
  font-size: 12px;
  color: var(--gray-mid);
  line-height: 1.5;
  font-family: 'DM Mono', monospace;
}

/* ----- Success state (after POST) ----- */
.app-shell .create-success {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 18px;
  padding: 40px 32px;
  text-align: center;
  max-width: 640px;
  margin: 32px auto 0;
}
.app-shell .create-success-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.app-shell .create-success-h {
  font-family: 'Archivo Black', sans-serif;
  font-size: 40px;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.app-shell .create-success-h .accent { color: var(--accent); }
.app-shell .create-success-sub {
  font-size: 15px;
  color: var(--gray-soft);
  margin: 0 0 24px;
}
.app-shell .create-success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.app-shell .create-success-cta {
  background: var(--accent);
  color: var(--ink);
  padding: 14px 28px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
}
.app-shell .create-success-secondary {
  color: #fff;
  padding: 14px 24px;
  border-radius: 99px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid #333;
  text-decoration: none;
}

/* ----- Inline error banner (validation failure) ----- */
.app-shell .create-error {
  background: var(--hot);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
}

/* ----- Sticky mobile CTA ----- */
.app-shell .create-sticky {
  display: none;
  position: sticky;
  bottom: 0;
  padding: 14px 18px 22px;
  background: linear-gradient(to top, var(--ink) 60%, rgba(10, 10, 10, 0.85));
  border-top: 1px solid #1a1a1a;
}
.app-shell .create-sticky-btn {
  width: 100%;
  background: var(--accent);
  color: var(--ink);
  padding: 16px 20px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 16px;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

/* ----- Mobile back-only header for /create-game ----- */
.app-shell .create-mobile-header {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #1a1a1a;
}
.app-shell .create-mobile-header-back {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  text-decoration: none;
  line-height: 1;
}
.app-shell .create-mobile-header-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .app-shell .create-main {
    padding: 18px 18px 24px;
    max-width: none;
  }
  .app-shell .create-mobile-header { display: flex; }
  .app-shell .create-h1 { font-size: 32px; }
  .app-shell .create-sub { font-size: 14px; margin-bottom: 22px; }
  .app-shell .create-grid { grid-template-columns: 1fr; gap: 18px; }
  .app-shell .create-card { padding: 20px; border-radius: 16px; }
  .app-shell .create-preview { display: none; }
  .app-shell .create-actions { display: none; }
  .app-shell .create-sticky { display: block; }
  .app-shell .create-success { margin: 20px 0 0; padding: 28px 22px; }
  .app-shell .create-success-h { font-size: 28px; }
}

@media (max-width: 480px) {
  .app-shell .create-h1 { font-size: 28px; }
}

/* ========================================================================
 * Roster / Connections page
 * Reuses .app-nav, .app-main, .stat-tile primitives.
 * ====================================================================== */

.app-shell .app-main--roster { max-width: 1200px; }

.app-shell .roster-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 32px;
}
.app-shell .roster-hero-h1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 76px;
  margin: 0;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.app-shell .roster-hero-h1 .accent { color: var(--accent); }
.app-shell .roster-hero-cta {
  background: var(--accent);
  color: var(--ink);
  padding: 14px 22px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.app-shell .roster-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-shell .roster-search {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 12px;
  padding: 4px 4px 4px 18px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-shell .roster-search-icon {
  color: #666;
  font-size: 16px;
  flex-shrink: 0;
}
.app-shell .roster-search-input {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 14px 0;
  color: #fff;
  font-size: 15px;
  outline: none;
  font-family: inherit;
  min-width: 0;
}

.app-shell .roster-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}
.app-shell .roster-card {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-shell .roster-card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--hot));
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}
.app-shell .roster-card-body {
  flex: 1;
  min-width: 0;
}
.app-shell .roster-card-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.app-shell .roster-card-name {
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-shell .roster-card-rating {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--ink);
  background: var(--accent);
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 700;
  flex-shrink: 0;
}
.app-shell .roster-card-meta {
  font-size: 12px;
  color: var(--gray-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-shell .roster-card-action {
  background: transparent;
  color: #fff;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid var(--gray-border-2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.app-shell .roster-card-action:hover { border-color: #444; }

.app-shell .roster-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.app-shell .roster-section-h2 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 28px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.app-shell .roster-section-meta {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--gray-mid);
  letter-spacing: 0.06em;
}

.app-shell .roster-suggested-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.app-shell .roster-suggested-card {
  background: var(--hot);
  color: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.app-shell .roster-suggested-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-shell .roster-suggested-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ink), #333);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.app-shell .roster-suggested-name {
  font-weight: 800;
  font-size: 15px;
}
.app-shell .roster-suggested-rating {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  opacity: 0.85;
}
.app-shell .roster-suggested-why {
  font-size: 13px;
  opacity: 0.92;
  line-height: 1.4;
  flex: 1;
}
.app-shell .roster-suggested-cta {
  width: 100%;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 13px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}

.app-shell .roster-empty {
  background: var(--gray-card);
  border: 1px dashed var(--gray-border-2);
  border-radius: 14px;
  padding: 28px 22px;
  text-align: center;
  color: var(--gray-soft);
  font-size: 14px;
  margin-bottom: 40px;
}

/* Inline invite-by-phone panel (shown after clicking the hero CTA) */
.app-shell .roster-invite-form {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 28px;
  display: none;
  flex-direction: column;
  gap: 12px;
}
.app-shell .roster-invite-form.is-open { display: flex; }
.app-shell .roster-invite-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
}
.app-shell .roster-invite-input {
  background: var(--ink);
  border: 1px solid var(--gray-border-2);
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}
.app-shell .roster-invite-input:focus { border-color: var(--accent); }
.app-shell .roster-invite-submit {
  background: var(--accent);
  color: var(--ink);
  padding: 12px 22px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 13px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.app-shell .roster-invite-hint {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--gray-mid);
  letter-spacing: 0.06em;
}

/* Mobile per-screen header — generalized title + action variant */
.app-shell .app-header-mobile--titled { justify-content: space-between; }
.app-shell .app-header-mobile-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.app-shell .app-header-mobile-action {
  background: var(--accent);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 12px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

@media (max-width: 900px) {
  .app-shell .app-main--roster { padding: 18px 18px 80px; }
  .app-shell .roster-hero { display: none; }
  .app-shell .roster-eyebrow { font-size: 11px; }
  .app-shell .roster-search { margin-bottom: 18px; padding-left: 14px; }
  .app-shell .roster-search-input { padding: 12px 0; font-size: 14px; }
  .app-shell .roster-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 22px;
  }
  .app-shell .roster-card { padding: 12px 14px; gap: 12px; border-radius: 12px; }
  .app-shell .roster-card-avatar { width: 38px; height: 38px; font-size: 14px; }
  .app-shell .roster-card-name { font-size: 14px; font-weight: 700; }
  .app-shell .roster-card-meta { font-size: 11px; }
  .app-shell .roster-card-action { padding: 6px 12px; font-size: 11px; }
  .app-shell .roster-section-h2 { font-size: 20px; }
  .app-shell .roster-suggested-grid { grid-template-columns: 1fr; gap: 10px; }
  .app-shell .roster-suggested-card { padding: 14px 16px; }
  .app-shell .roster-invite-form-row { grid-template-columns: 1fr; }
}

/* ========================================================================
 * Shared narrow-page primitives — used by History + Profile (and any
 * future 1200px-wide app screen). The .page-* prefix is intentional: these
 * are generic enough to reuse across screens, unlike the per-page prefixes
 * on the dashboard / roster.
 * ====================================================================== */

.app-shell .app-main--narrow { max-width: 1200px; }

.app-shell .page-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.app-shell .page-h1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 76px;
  margin: 0 0 24px;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.app-shell .page-h1 .accent { color: var(--accent); }

.app-shell .page-section { margin-bottom: 36px; }
.app-shell .page-section:last-child { margin-bottom: 0; }
.app-shell .page-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.app-shell .page-section-h2 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 28px;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.app-shell .page-section-meta {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.app-shell .page-empty {
  background: var(--gray-card);
  border: 1px dashed var(--gray-border-2);
  border-radius: 14px;
  padding: 28px 22px;
  text-align: center;
  color: var(--gray-soft);
  font-size: 14px;
}
.app-shell .page-empty-link {
  color: var(--accent);
  text-decoration: underline;
}

/* Stats strip — 4-tile grid shared between History + Profile.
   Tone modifiers (.tone-accent, .tone-hot, .tone-cobalt, .tone-paper) are
   already defined in the dashboard section above; .tone-green is new. */
.app-shell .stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 36px;
}
.app-shell .stat-tile.tone-green .stat-tile-value { color: var(--green); }

/* ========================================================================
 * History — filter chips
 * ====================================================================== */

.app-shell .filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.app-shell .filter-chip {
  background: transparent;
  color: #fff;
  padding: 10px 16px;
  border-radius: 99px;
  border: 1px solid var(--gray-border-2);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.app-shell .filter-chip:hover { border-color: var(--gray-soft); }
.app-shell .filter-chip.is-active {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
}

/* ========================================================================
 * Profile
 * ====================================================================== */

.app-shell .profile-toast {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.app-shell .profile-toast.is-ok {
  background: rgba(31, 183, 107, 0.12);
  border: 1px solid var(--green);
  color: var(--green);
}
.app-shell .profile-toast.is-err {
  background: rgba(255, 59, 48, 0.12);
  border: 1px solid var(--red);
  color: var(--red);
}

.app-shell .identity-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent) 0%, var(--hot) 100%);
  color: var(--ink);
  border-radius: 18px;
  padding: 28px 32px;
  margin-bottom: 28px;
}
.app-shell .identity-card-decor {
  position: absolute;
  top: -30px;
  right: -30px;
  opacity: 0.3;
  pointer-events: none;
}
.app-shell .identity-card-body {
  display: flex;
  align-items: center;
  gap: 22px;
  position: relative;
}
.app-shell .identity-avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Archivo Black', sans-serif;
  font-size: 36px;
  letter-spacing: -0.03em;
  border: 3px solid var(--ink);
  flex-shrink: 0;
}
.app-shell .identity-name {
  font-family: 'Archivo Black', sans-serif;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.app-shell .identity-line {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  margin-top: 6px;
  letter-spacing: 0.04em;
}
.app-shell .identity-badges {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.app-shell .identity-badge {
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: 0.06em;
}
.app-shell .identity-badge.is-accent { color: var(--accent); }

.app-shell .profile-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  margin-top: 8px;
}

/* Account form */
.app-shell .profile-form {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.app-shell .profile-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-shell .profile-field-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.app-shell .profile-field-hint {
  font-size: 11px;
  color: var(--gray-mid);
  margin-top: 2px;
}
.app-shell .profile-input {
  background: var(--ink);
  border: 1px solid var(--gray-border-2);
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.app-shell .profile-input:focus { border-color: var(--accent); }

.app-shell .seg-pick {
  display: flex;
  gap: 8px;
}
.app-shell .seg-pick-btn {
  flex: 1;
  background: var(--ink);
  color: #fff;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--gray-border-2);
  font-family: 'Archivo Black', sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  cursor: pointer;
}
.app-shell .seg-pick-btn.is-active {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
}

.app-shell .profile-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #bbb;
  line-height: 1.45;
}
.app-shell .profile-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  margin-top: 2px;
  flex-shrink: 0;
}
.app-shell .profile-check-hint {
  color: var(--gray-mid);
  font-style: normal;
  font-size: 11px;
}
.app-shell .profile-save {
  align-self: flex-start;
  background: var(--accent);
  color: var(--ink);
  padding: 12px 26px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 14px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

/* Top dink partners */
.app-shell .partners-card {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.app-shell .partners-empty {
  font-size: 13px;
  color: var(--gray-soft);
  line-height: 1.5;
}
.app-shell .partner-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-shell .partner-rank {
  width: 22px;
  font-family: 'Archivo Black', sans-serif;
  color: #666;
  font-size: 13px;
  flex-shrink: 0;
}
.app-shell .partner-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--hot));
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}
.app-shell .partner-meta { flex: 1; min-width: 0; }
.app-shell .partner-name {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-shell .partner-sub {
  font-size: 12px;
  color: var(--gray-mid);
}
.app-shell .partner-bars {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.app-shell .partner-bar {
  width: 8px;
  height: 18px;
  border-radius: 2px;
  background: #222;
}
.app-shell .partner-bar.is-on { background: var(--accent); }

.app-shell .partners-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--gray-mid);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid #333;
  padding-bottom: 2px;
}
.app-shell .partners-link:hover { color: #fff; border-color: var(--accent); }

.app-shell .danger-zone {
  margin-top: 28px;
  padding: 18px 20px;
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 12px;
}
.app-shell .danger-zone-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--gray-mid);
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.06em;
}
.app-shell .danger-zone-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-shell .danger-zone-sep { color: #444; }
.app-shell .danger-link {
  background: transparent;
  color: var(--red);
  padding: 10px 0;
  border: 0;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.app-shell .danger-link[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ========================================================================
 * Responsive — narrow pages collapse to single column
 * ====================================================================== */
@media (max-width: 900px) {
  .app-shell .page-h1 { font-size: 36px; margin-bottom: 18px; }
  .app-shell .page-section-h2 { font-size: 18px; }
  .app-shell .page-section { margin-bottom: 24px; }

  .app-shell .filter-chips {
    margin-bottom: 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .app-shell .filter-chip {
    padding: 8px 14px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .app-shell .stats-strip {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 22px;
  }

  .app-shell .identity-card {
    padding: 18px;
    border-radius: 16px;
    margin-bottom: 18px;
  }
  .app-shell .identity-card-body { gap: 14px; }
  .app-shell .identity-avatar {
    width: 64px;
    height: 64px;
    font-size: 24px;
    border-width: 2px;
  }
  .app-shell .identity-name { font-size: 22px; }
  .app-shell .identity-line { font-size: 11px; margin-top: 4px; }
  .app-shell .identity-badge { font-size: 10px; padding: 3px 8px; }

  .app-shell .profile-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .app-shell .profile-form { padding: 18px; gap: 14px; }
  .app-shell .profile-input { font-size: 16px; padding: 12px; }
  .app-shell .seg-pick-btn { padding: 10px; font-size: 12px; }

  .app-shell .partners-card { padding: 14px; }
  .app-shell .partner-name { font-size: 13px; }
  .app-shell .partner-sub { font-size: 11px; }

  .app-shell .danger-zone { padding: 14px 16px; margin-top: 18px; }

  .app-shell .profile-toast { font-size: 11px; padding: 8px 12px; }
}

@media (max-width: 480px) {
  .app-shell .page-h1 { font-size: 30px; }
  .app-shell .identity-line { font-size: 10px; }
}

/* ========================================================================
 * Game Detail / RSVP — invitee, host (creator), finalized states.
 * Single template; sections show/hide based on viewer + game status.
 * ====================================================================== */

.app-shell .game-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 48px;
}

/* Mobile per-screen header (back arrow) */
.app-shell .game-mobile-header {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #1a1a1a;
}
.app-shell .game-mobile-header-back {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  text-decoration: none;
  line-height: 1;
}
.app-shell .game-mobile-header-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
}

/* Eyebrow + title */
.app-shell .game-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.app-shell .game-eyebrow-host {
  background: var(--ink);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.app-shell .game-h1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 84px;
  margin: 0 0 24px;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.app-shell .game-h1 .accent { color: var(--accent); }
.app-shell .game-h1.is-finalized { font-size: 96px; line-height: 0.85; margin-bottom: 12px; }
.app-shell .game-finalized-sub {
  font-size: 16px;
  color: var(--gray-soft);
  max-width: 540px;
  margin: 0 0 28px;
}

/* 2-col layout */
.app-shell .game-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  align-items: start;
}

/* Where/When details strip */
.app-shell .game-details {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 20px;
}
.app-shell .game-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.app-shell .game-details-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.app-shell .game-details-value {
  font-family: 'Archivo Black', sans-serif;
  font-size: 22px;
  margin-top: 4px;
  letter-spacing: -0.02em;
}
.app-shell .game-details-sub {
  font-size: 14px;
  color: var(--gray-soft);
}
.app-shell .game-details-foot {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.app-shell .game-details-host {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--gray-mid);
}

/* Lime "YOU IN?" RSVP card */
.app-shell .rsvp-card {
  background: var(--accent);
  color: var(--ink);
  border-radius: 18px;
  padding: 24px 26px;
  margin-bottom: 24px;
}
.app-shell .rsvp-card-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.06em;
}
.app-shell .rsvp-card-h {
  font-family: 'Archivo Black', sans-serif;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.app-shell .rsvp-card-actions {
  display: flex;
  gap: 12px;
}
.app-shell .rsvp-accept {
  flex: 1;
  background: var(--ink);
  color: var(--accent);
  padding: 18px 24px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 17px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.app-shell .rsvp-decline {
  flex: 1;
  background: transparent;
  color: var(--ink);
  padding: 18px 24px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 17px;
  border: 2px solid var(--ink);
  cursor: pointer;
  font-family: inherit;
}
.app-shell .rsvp-card-foot {
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink);
  opacity: 0.7;
}

/* RSVP confirmed states (after accept/decline) */
.app-shell .rsvp-state {
  border-radius: 18px;
  padding: 22px 26px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.app-shell .rsvp-state.is-accepted {
  background: var(--green);
  color: #fff;
}
.app-shell .rsvp-state.is-declined {
  background: var(--gray-card);
  color: var(--gray-soft);
  border: 1px solid var(--gray-border);
}
.app-shell .rsvp-state-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.app-shell .rsvp-state-h {
  font-family: 'Archivo Black', sans-serif;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.app-shell .rsvp-state-sub {
  font-size: 13px;
  opacity: 0.85;
}
.app-shell .rsvp-undo-btn {
  margin-left: auto;
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  padding: 8px 14px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 12px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

/* Host action bar */
.app-shell .host-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.app-shell .host-btn {
  background: transparent;
  color: #fff;
  padding: 12px 18px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--gray-border-2);
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.app-shell .host-btn:hover { border-color: #444; }
.app-shell .host-btn.is-primary {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
}
.app-shell .host-btn.is-danger {
  color: var(--red);
  border-color: var(--red);
  margin-left: auto;
}

/* Host progress strip ("X more yeses…") */
.app-shell .host-progress {
  background: var(--hot);
  color: #fff;
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.app-shell .host-progress.is-locked {
  background: var(--accent);
  color: var(--ink);
}
.app-shell .host-progress-h {
  font-family: 'Archivo Black', sans-serif;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.app-shell .host-progress-sub {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 2px;
}
.app-shell .host-progress-btn {
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 14px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

/* Finalized hero card (lime, big) */
.app-shell .game-finalized-card {
  background: var(--accent);
  color: var(--ink);
  border-radius: 18px;
  padding: 28px 30px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.app-shell .game-finalized-card.is-tennis { background: var(--cobalt); }
.app-shell .game-finalized-card-decor {
  position: absolute;
  top: -30px;
  right: -30px;
  opacity: 0.3;
  pointer-events: none;
}
.app-shell .game-finalized-tag {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  position: relative;
}
.app-shell .game-finalized-h {
  font-family: 'Archivo Black', sans-serif;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 0 0 16px;
  position: relative;
}
.app-shell .game-finalized-meta {
  font-size: 16px;
  margin-bottom: 4px;
  font-weight: 600;
  position: relative;
}
.app-shell .game-finalized-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  position: relative;
}
.app-shell .game-finalized-btn {
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 14px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.app-shell .game-finalized-btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}

/* Comments thread */
.app-shell .comments-h2 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 22px;
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.app-shell .comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.app-shell .comment {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 12px;
  padding: 12px 16px;
}
.app-shell .comment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
  gap: 8px;
}
.app-shell .comment-author {
  font-weight: 800;
  font-size: 13px;
  color: #fff;
}
.app-shell .comment-time {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #666;
}
.app-shell .comment-text {
  font-size: 14px;
  color: #ddd;
  line-height: 1.45;
  word-wrap: break-word;
}
.app-shell .comments-empty {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--gray-mid);
  margin-bottom: 14px;
}
.app-shell .comment-form {
  display: flex;
  gap: 8px;
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 12px;
  padding: 6px;
}
.app-shell .comment-input {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 10px 12px;
  color: #fff;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.app-shell .comment-post {
  background: var(--accent);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

/* Roster panel (right column) */
.app-shell .game-roster-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}
.app-shell .game-roster-h2 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 22px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.app-shell .game-roster-meta {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
}
.app-shell .game-roster-meta.is-accent { color: var(--accent); }
.app-shell .game-roster-meta.is-hot    { color: var(--hot); }
.app-shell .game-roster-card {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.app-shell .roster-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-shell .roster-row-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #222;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}
.app-shell .roster-row-avatar.is-host {
  background: linear-gradient(135deg, var(--accent), var(--hot));
  color: var(--ink);
}
.app-shell .roster-row-body {
  flex: 1;
  min-width: 0;
}
.app-shell .roster-row-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.app-shell .roster-row-you {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.app-shell .roster-row-sub {
  font-size: 12px;
  color: var(--gray-mid);
}
.app-shell .roster-row-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.app-shell .roster-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-mid);
}
.app-shell .roster-row-dot.is-accepted { background: var(--green); }
.app-shell .roster-row-dot.is-declined { background: var(--red); }
.app-shell .roster-row-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Stat trio (Accepted/Pending/Declined) */
.app-shell .game-stat-trio {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.app-shell .game-stat-box {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 14px;
  padding: 14px 18px;
  flex: 1;
}
.app-shell .game-stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.app-shell .game-stat-value {
  font-family: 'Archivo Black', sans-serif;
  font-size: 36px;
  line-height: 1;
  margin-top: 4px;
}
.app-shell .game-stat-value.is-accent { color: var(--accent); }
.app-shell .game-stat-value.is-hot    { color: var(--hot); }
.app-shell .game-stat-value.is-red    { color: var(--red); }

/* Sticky mobile RSVP bar */
.app-shell .rsvp-sticky {
  display: none;
  position: sticky;
  bottom: 0;
  padding: 14px 18px 22px;
  background: linear-gradient(to top, var(--ink) 60%, rgba(10, 10, 10, 0.92));
  border-top: 1px solid #1a1a1a;
  gap: 10px;
}
.app-shell .rsvp-sticky-accept {
  flex: 1;
  background: var(--accent);
  color: var(--ink);
  padding: 15px 0;
  border-radius: 99px;
  font-weight: 800;
  font-size: 15px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.app-shell .rsvp-sticky-decline {
  flex: 1;
  background: transparent;
  color: #fff;
  padding: 15px 0;
  border-radius: 99px;
  font-weight: 700;
  font-size: 15px;
  border: 1.5px solid #444;
  cursor: pointer;
  font-family: inherit;
}

/* Game detail flash message — restyle the legacy Bootstrap alert. */
.app-shell #page-message {
  background: var(--gray-card);
  border: 1px solid var(--accent);
  border-radius: 12px;
  color: #fff;
  padding: 14px 18px;
  font-size: 14px;
  margin: 14px auto;
  max-width: 1100px;
}

@media (max-width: 900px) {
  .app-shell .game-main {
    padding: 18px 18px 100px;
    max-width: none;
  }
  .app-shell .game-mobile-header { display: flex; }
  .app-shell .game-h1 { font-size: 44px; margin-bottom: 16px; }
  .app-shell .game-h1.is-finalized { font-size: 56px; }
  .app-shell .game-finalized-sub { font-size: 14px; margin-bottom: 18px; }
  .app-shell .game-grid { grid-template-columns: 1fr; gap: 0; }
  .app-shell .game-details { padding: 16px 18px; border-radius: 14px; }
  .app-shell .game-details-grid { grid-template-columns: 1fr; gap: 14px; }
  .app-shell .game-details-value { font-size: 18px; }
  .app-shell .rsvp-card { padding: 20px 22px; border-radius: 16px; }
  .app-shell .rsvp-card-h { font-size: 26px; }
  .app-shell .host-progress { padding: 14px 16px; border-radius: 14px; }
  .app-shell .host-progress-h { font-size: 18px; }
  .app-shell .game-finalized-card { padding: 22px 22px; border-radius: 16px; }
  .app-shell .game-finalized-h { font-size: 28px; }
  .app-shell .game-roster-card { padding: 14px; border-radius: 14px; }
  .app-shell .game-roster-h2 { font-size: 18px; }
  .app-shell .comments-h2 { font-size: 18px; }
  .app-shell .comment-text { font-size: 13px; }
  .app-shell .game-stat-box { padding: 10px 14px; border-radius: 12px; }
  .app-shell .game-stat-value { font-size: 28px; }
  .app-shell .host-actions { gap: 6px; }
  .app-shell .host-btn { padding: 10px 14px; font-size: 13px; }
  .app-shell .host-btn.is-danger { margin-left: 0; }

  /* On mobile, show sticky RSVP bar for invitees w/ open game; hide inline card. */
  .app-shell .rsvp-card.has-mobile-sticky { display: none; }
  .app-shell .rsvp-sticky.is-active { display: flex; }

  .app-shell #page-message { margin: 10px 18px; }
}

@media (max-width: 480px) {
  .app-shell .game-h1 { font-size: 36px; }
  .app-shell .game-h1.is-finalized { font-size: 44px; }
}

/* ========================================================================
 * Invite Players (host-only screen). Lime game-card hero, stat strip,
 * status-coloured invited chips, suggested/other/default add-chips with
 * inline + buttons that hit invite-player-ajax.php.
 * ====================================================================== */

.app-shell .invite-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 48px;
}

.app-shell .invite-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-mid);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 16px;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.app-shell .invite-back:hover { color: #fff; }

.app-shell .invite-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.app-shell .invite-h1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 76px;
  margin: 0 0 28px;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.app-shell .invite-h1 .accent { color: var(--accent); }

/* ----- Game card hero ----- */
.app-shell .invite-game-card {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent) 60%, #d4e000 100%);
  color: var(--ink);
  border-radius: 18px;
  padding: 24px 28px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.app-shell .invite-game-card.is-finalized { background: var(--accent); }
.app-shell .invite-game-card-decor {
  position: absolute;
  top: -40px;
  right: -30px;
  opacity: 0.25;
  pointer-events: none;
}
.app-shell .invite-game-card-row {
  display: flex;
  align-items: center;
  gap: 22px;
  position: relative;
}
.app-shell .invite-game-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-shell .invite-game-card-body { flex: 1; min-width: 0; }
.app-shell .invite-game-card-meta {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.app-shell .invite-game-card-loc {
  font-family: 'Archivo Black', sans-serif;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-top: 4px;
}
.app-shell .invite-game-card-stamp {
  background: var(--ink);
  color: var(--accent);
  font-family: 'Archivo Black', sans-serif;
  padding: 10px 18px;
  border-radius: 6px;
  transform: rotate(-2deg);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  flex-shrink: 0;
}

/* ----- Stat strip ----- */
.app-shell .invite-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 36px;
}
.app-shell .invite-stat {
  background: var(--gray-card);
  border: 1px solid var(--gray-border);
  border-radius: 14px;
  padding: 14px 18px;
}
.app-shell .invite-stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.app-shell .invite-stat-value {
  font-family: 'Archivo Black', sans-serif;
  font-size: 38px;
  line-height: 1;
  margin-top: 4px;
  letter-spacing: -0.03em;
  color: #fff;
}
.app-shell .invite-stat-value.is-accent { color: var(--accent); }
.app-shell .invite-stat-value.is-green  { color: var(--green); }
.app-shell .invite-stat-value.is-red    { color: var(--red); }

/* ----- Finalized lock banner ----- */
.app-shell .invite-finalized-banner {
  background: rgba(229, 245, 0, 0.08);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-shell .invite-finalized-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.app-shell .invite-finalized-h {
  font-family: 'Archivo Black', sans-serif;
  font-size: 18px;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: -0.01em;
}
.app-shell .invite-finalized-sub {
  font-size: 13px;
  color: var(--gray-mid);
  margin-top: 2px;
}

/* ----- Section heading ----- */
.app-shell .invite-section { margin-bottom: 32px; }
.app-shell .invite-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.app-shell .invite-section-tag {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.app-shell .invite-section-tag.is-hot { color: var(--hot); }
.app-shell .invite-section-tag.is-mid { color: var(--gray-mid); }
.app-shell .invite-section-h2 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 28px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: #fff;
}
.app-shell .invite-section-count {
  color: var(--gray-mid);
  margin-left: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 400;
}
.app-shell .invite-section-hint {
  font-size: 12px;
  color: var(--gray-mid);
  margin-top: 6px;
}
.app-shell .invite-section-hint .invite-hint-em {
  color: var(--hot);
  font-weight: 700;
}

/* ----- Chip container ----- */
.app-shell .invite-chips {
  background: #0e0e0e;
  border: 1px solid var(--gray-border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.app-shell .invite-chips.is-suggested {
  background: linear-gradient(135deg, rgba(229, 245, 0, 0.08), rgba(229, 245, 0, 0.02));
  border-color: var(--accent);
  gap: 10px;
}
.app-shell .invite-chips.is-other {
  background: linear-gradient(135deg, rgba(255, 45, 135, 0.08), rgba(255, 45, 135, 0.02));
  border-color: var(--hot);
  gap: 10px;
}
.app-shell .invite-chips.is-default { gap: 10px; }
.app-shell .invite-chips-empty {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--gray-mid);
  letter-spacing: 0.04em;
}

/* ----- Already-invited chip (display only) ----- */
.app-shell .invited-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 8px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid transparent;
}
.app-shell .invited-chip-mark {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.app-shell .invited-chip-name {
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-shell .invited-chip-status {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  opacity: 0.7;
  letter-spacing: 0.06em;
}
.app-shell .invited-chip.is-accepted {
  background: var(--green);
  color: #fff;
}
.app-shell .invited-chip.is-pending {
  background: var(--gray-border);
  color: #fff;
}
.app-shell .invited-chip.is-declined {
  background: var(--gray-border-2);
  color: var(--red);
  border-color: var(--red);
}
.app-shell .invited-chip.is-declined .invited-chip-name {
  text-decoration: line-through;
}

/* ----- Add-chip (clickable button) ----- */
.app-shell .add-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #0e0e0e;
  border: 1px solid var(--gray-border-2);
  border-radius: 99px;
  padding: 6px 6px 6px 14px;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  text-align: left;
  max-width: 100%;
  transition: transform 0.1s ease;
}
.app-shell .add-chip:hover { transform: translateY(-1px); }
.app-shell .add-chip:active { transform: translateY(0); }
.app-shell .add-chip.is-suggested { border-color: var(--accent); }
.app-shell .add-chip.is-other     { border-color: var(--hot); }
.app-shell .add-chip.is-default   { background: var(--gray-card); border-color: var(--gray-border-2); }

.app-shell .add-chip-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--hot));
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}
.app-shell .add-chip-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.app-shell .add-chip-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.app-shell .add-chip-why {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--gray-mid);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.app-shell .add-chip-add {
  margin-left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  font-size: 16px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  pointer-events: none;
}
.app-shell .add-chip.is-suggested .add-chip-add { background: var(--accent); color: var(--ink); }
.app-shell .add-chip.is-other     .add-chip-add { background: var(--hot);    color: #fff; }
.app-shell .add-chip.is-default   .add-chip-add { background: #fff;          color: var(--ink); }

/* ----- Search input ----- */
.app-shell .invite-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--gray-card);
  border: 1px solid var(--gray-border-2);
  border-radius: 99px;
  padding: 6px 6px 6px 14px;
}
.app-shell .invite-search-icon { color: #666; font-size: 13px; }
.app-shell .invite-search-input {
  background: transparent;
  border: 0;
  color: #fff;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  width: 180px;
}
.app-shell .invite-search-input::placeholder { color: var(--gray-mid); }

/* ----- Footer note ----- */
.app-shell .invite-foot-note {
  border-top: 1px solid #1a1a1a;
  padding-top: 18px;
  margin-top: 32px;
  color: var(--gray-mid);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ----- Mobile back-only header (reuses pattern from create/game) ----- */
.app-shell .invite-mobile-header {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #1a1a1a;
}
.app-shell .invite-mobile-header-back {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  text-decoration: none;
  line-height: 1;
}
.app-shell .invite-mobile-header-title {
  font-family: 'Archivo Black', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .app-shell .invite-main {
    padding: 18px 18px 24px;
    max-width: none;
  }
  .app-shell .invite-mobile-header { display: flex; }
  .app-shell .invite-back { display: none; }

  .app-shell .invite-h1 { font-size: 36px; margin-bottom: 16px; }

  .app-shell .invite-game-card {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
  }
  .app-shell .invite-game-card-row { gap: 12px; }
  .app-shell .invite-game-card-icon { width: 44px; height: 44px; border-radius: 10px; }
  .app-shell .invite-game-card-meta { font-size: 10px; }
  .app-shell .invite-game-card-loc { font-size: 16px; line-height: 1.05; }
  .app-shell .invite-game-card-stamp { font-size: 11px; padding: 6px 10px; }

  .app-shell .invite-stats { gap: 6px; margin-bottom: 18px; }
  .app-shell .invite-stat {
    padding: 8px 6px;
    border-radius: 10px;
    text-align: center;
  }
  .app-shell .invite-stat-label { font-size: 9px; }
  .app-shell .invite-stat-value { font-size: 22px; }

  .app-shell .invite-finalized-banner { padding: 12px 14px; border-radius: 12px; margin-bottom: 18px; }
  .app-shell .invite-finalized-mark { width: 28px; height: 28px; }
  .app-shell .invite-finalized-h { font-size: 13px; }

  .app-shell .invite-section { margin-bottom: 22px; }
  .app-shell .invite-section-head { margin-bottom: 8px; }
  .app-shell .invite-section-h2 { font-size: 18px; }
  .app-shell .invite-section-count { font-size: 12px; }
  .app-shell .invite-section-hint { font-size: 11px; }

  /* On mobile, "add" chips become full-width rows for easier tapping */
  .app-shell .invite-chips,
  .app-shell .invite-chips.is-suggested,
  .app-shell .invite-chips.is-other,
  .app-shell .invite-chips.is-default {
    background: transparent;
    border: 0;
    padding: 0;
    flex-direction: column;
    gap: 6px;
  }
  .app-shell .invite-chips:has(.invited-chip) {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .app-shell .add-chip {
    width: 100%;
    border-radius: 12px;
    padding: 8px 8px 8px 12px;
    background: #0e0e0e;
  }
  .app-shell .add-chip.is-default { background: var(--gray-card); }
  .app-shell .add-chip-name { max-width: none; flex: 1; }
  .app-shell .add-chip-why { max-width: none; }
  .app-shell .add-chip-body { flex: 1; }
  .app-shell .add-chip-add { width: 36px; height: 36px; font-size: 20px; }

  .app-shell .invited-chip {
    padding: 6px 10px 6px 6px;
    font-size: 12px;
  }
  .app-shell .invited-chip-mark { width: 18px; height: 18px; font-size: 10px; }
  .app-shell .invited-chip-status { display: none; }

  .app-shell .invite-search { padding: 4px 4px 4px 12px; }
  .app-shell .invite-search-input { width: 100%; font-size: 12px; }

  .app-shell .invite-foot-note { font-size: 10px; padding-top: 14px; margin-top: 22px; }
}

@media (max-width: 480px) {
  .app-shell .invite-h1 { font-size: 30px; }
  .app-shell .invite-game-card-loc { font-size: 14px; }
}
