:root {
  color-scheme: dark;
  --bg-top: #0b1220;
  --bg-bottom: #111827;
  --card: rgba(17, 24, 39, 0.82);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.14);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --radius-sm: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(37, 99, 235, 0.22), transparent 42%),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.12), transparent 35%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
}

.card {
  width: min(100%, 420px);
  padding: 28px 22px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  text-align: center;
}

.logo-image {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
}

.profile-avatar {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
  background: var(--card);
}

/* Club crest fallback (no personal photo) — contained with padding, not cropped, since a crest
   isn't meant to fill a square the way a face photo is. */
.profile-avatar-crest {
  object-fit: contain;
  padding: 12px;
}

.profile-meta {
  margin: -6px 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.panel {
  text-align: center;
}

.loading .status {
  margin: 0 0 18px;
  font-size: 1rem;
  color: var(--text);
}

.fallback[hidden],
.loading[hidden] {
  display: none !important;
}

.fallback h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 650;
}

.fallback .muted {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  color: white;
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #1e40af 100%);
}

.btn-store {
  color: white;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-store:hover {
  background: #1f2937;
}

.btn-secondary {
  margin-top: 14px;
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.04);
}

.footer {
  margin: 22px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

@media (min-width: 480px) {
  .card {
    padding: 32px 28px;
  }
}
