body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; background: #f5f7fa; color: #222; margin: 0; }

/* ── LOADING SCREEN (shown until Firebase auth state resolves) ── */
#loading-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.loading-logo { width: 640px; max-width: 85vw; height: auto; }

/* ── AUTH / PENDING SCREENS ── */
#auth-screen, #pending-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.auth-card {
  background: #fff; border-radius: 12px; padding: 40px 48px; width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.auth-logo { font-size: 28px; font-weight: 800; color: #1a1a2e; margin-bottom: 4px; }
.auth-sub  { font-size: 13px; color: #888; margin-bottom: 32px; }
.auth-card label { display: block; font-size: 12px; font-weight: 600; color: #555; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.auth-card input[type=email] {
  width: 100%; padding: 10px 14px; border: 1.5px solid #ddd; border-radius: 7px;
  font-size: 14px; outline: none; transition: border-color .2s;
}
.auth-card input[type=email]:focus { border-color: #4f46e5; }
.auth-btn {
  width: 100%; margin-top: 16px; padding: 11px; background: #4f46e5; color: #fff;
  border: none; border-radius: 7px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .2s;
}
.auth-btn:hover:not(:disabled) { background: #4338ca; }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; }
.auth-sent { text-align: center; display: none; }
.auth-sent .check { font-size: 40px; margin-bottom: 12px; }
.auth-sent p { color: #555; line-height: 1.6; }
#auth-error { display: none; margin-top: 12px; padding: 10px 14px; background: #fee2e2; border: 1px solid #fca5a5; border-radius: 6px; color: #991b1b; font-size: 13px; }

/* ── TILE SCREEN ── */
#tile-screen { display: none; min-height: 100vh; }
.mc-hdr {
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  color: #fff; padding: 14px 24px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.mc-hdr-title { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.mc-hdr-sub   { font-size: 11px; color: #94a3b8; }
.mc-hdr-spacer { flex: 1; }
.btn-signout { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #fff; padding: 6px 14px; font-size: 12px; border-radius: 6px; cursor: pointer; }
.btn-signout:hover { background: rgba(255,255,255,.2); }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; padding: 40px; max-width: 900px; margin: 0 auto; }
.mc-tile {
  display: block; background: #fff; border-radius: 12px; padding: 32px 20px; text-align: center;
  text-decoration: none; color: #1a1a2e; box-shadow: 0 4px 16px rgba(0,0,0,.08);
  transition: transform .15s, box-shadow .15s;
}
.mc-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.mc-tile-label { font-size: 16px; font-weight: 700; }
.mc-tile-disabled { opacity: .55; cursor: default; }
.mc-tile-disabled:hover { transform: none; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.mc-tile-badge { margin-top: 8px; font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; }

/* ── MEMBERS PANEL (backdrop + centered card, click backdrop or Esc to close) ── */
#members-panel {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(15,23,42,.55); align-items: center; justify-content: center; padding: 20px;
}
#members-panel .mp-card {
  background: #fff; border-radius: 12px; padding: 22px 26px; width: 100%; max-width: 820px;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

/* ── BUTTONS (shared with the Members panel's own markup) ── */
.btn { padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; transition: all .15s; }
.btn-p  { background: #4f46e5; color: #fff; }
.btn-p:hover { background: #4338ca; }
.btn-s  { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.btn-s:hover { background: #e2e8f0; }
.btn-d  { background: #fee2e2; color: #991b1b; padding: 4px 10px; font-size: 12px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
