/* ─────────────────────────────────────────────────────────────────
   shared.css — common styles for all Brainsport puzzle pages.

   Each page defines its own CSS variables (--bg, --panel, --ink,
   --muted, --accent, --accent-soft, ...) so the look stays consistent
   while individual puzzles can pick their own accent palette.
   ───────────────────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

/* ── Site header (logo + tagline) ───────────────────────────────── */
header {
  background: var(--panel);
  border-bottom: 1px solid #e5e7eb;
  padding: 20px 40px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

header .tagline {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.auth-email {
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-button,
.auth-submit {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid #d1d5db;
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 7px 11px;
  cursor: pointer;
}

.auth-button:hover,
.auth-submit:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.auth-button.primary,
.auth-submit {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.auth-button.primary:hover,
.auth-submit:hover {
  filter: brightness(1.05);
  color: #fff;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal {
  width: min(100%, 360px);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 24px;
  position: relative;
  display: grid;
  gap: 14px;
}

.auth-modal h2 {
  margin: 0;
  font-size: 1.35rem;
}

.auth-modal label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.auth-modal input {
  font: inherit;
  color: var(--ink);
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 10px 12px;
}

.auth-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.auth-error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.86rem;
}

.auth-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.auth-link-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  padding: 0;
  justify-self: start;
}

.auth-link-button:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  header { padding: 16px 20px; }
  header .tagline { display: none; }
  .auth-box { margin-left: auto; }
  .auth-email { display: none; }
}
