/* ============================================================
   CSS Variables — Zen Ethos
   ============================================================ */
:root {
  --primary: #12a159;
  --primary-5: rgba(18, 161, 89, 0.05);
  --primary-10: rgba(18, 161, 89, 0.10);
  --primary-20: rgba(18, 161, 89, 0.20);
  --background: #F4F4F2;
  --surface: #EAEAE8;
  --text-main: #1A1A1A;
  --text-muted: #8A8D8B;
  --accent: #5E6460;
  --outline-variant: #8A8D8B;
  --error: #ba1a1a;
  --font-display: 'Satoshi', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
  --background: #1A1A1A;
  --surface: #2C302E;
  --text-main: #F4F4F2;
  --text-muted: #8A8D8B;
  --accent: #8A8D8B;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--background);
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }
.msg { min-height: 1.25rem; font-size: 0.875rem; }
.error { color: var(--error); }


/* ============================================================
   Top Navigation (destination screens)
   ============================================================ */
.zen-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  max-width: 64rem;
  margin: 0 auto;
  background: rgba(244, 244, 242, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
  width: 100%;
}

[data-theme="dark"] .zen-nav {
  background: rgba(26, 26, 26, 0.9);
}

.zen-nav-inner {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-link {
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-main);
  transition: color 0.3s ease;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-display);
  padding: 0;
}

.nav-link:hover { color: var(--text-muted); }
.nav-link.muted { color: var(--text-muted); }
.nav-link.muted:hover { color: var(--text-main); }

.nav-theme {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  transition: color 0.3s ease;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
}

.nav-theme:hover { color: var(--text-main); }

/* ============================================================
   Focused Nav (auth flow — back button only)
   ============================================================ */
.focus-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: color 0.3s ease, background 0.3s ease;
}

.icon-btn:hover {
  color: var(--text-main);
  background: rgba(0,0,0,0.04);
}

[data-theme="dark"] .icon-btn:hover {
  background: rgba(255,255,255,0.06);
}

/* ============================================================
   Full-Screen Centered Layout
   ============================================================ */
.full-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ============================================================
   Landing / Main Screen
   ============================================================ */
.main-canvas {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  min-height: 100vh;
  position: relative;
}

.center-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.group-label {
  width: 100%;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 2rem;
  text-align: center;
}

/* Giant counter */
.counter {
  font-family: 'DM Mono', monospace;
  font-size: clamp(5rem, 20vw, 7.5rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-main);
  user-select: none;
  text-align: center;
  margin-bottom: 3rem;
  font-variant-numeric: tabular-nums;
  display: block;
  width: 100%;
  transition: color 0.3s ease;
}

.counter-bump {
  animation: bump 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes bump {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.12); }
  60%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}

/* ============================================================
   Ritual Button (active state)
   ============================================================ */
.btn-ritual {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: none;
  background-image: linear-gradient(145deg, #14b363, #109050);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 600ms cubic-bezier(0.23, 1, 0.32, 1);
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.08),
    inset 0 2px 4px rgba(255, 255, 255, 0.2),
    inset 0 -2px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .btn-ritual {
  box-shadow:
    0 15px 30px -10px rgba(0, 0, 0, 0.5),
    inset 0 2px 4px rgba(255, 255, 255, 0.1),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.btn-ritual:hover {
  transform: translateY(-2px);
  box-shadow:
    0 20px 30px -10px rgba(0, 0, 0, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.3),
    inset 0 -2px 4px rgba(0, 0, 0, 0.08);
}

.btn-ritual:active {
  transform: scale(0.97) translateY(1px);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    inset 0 4px 8px rgba(0, 0, 0, 0.18);
}

.btn-ritual:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 6px;
}

.btn-ritual-inner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(to bottom right, rgba(255,255,255,0.1), rgba(0,0,0,0.04));
  pointer-events: none;
}

/* ============================================================
   Recessed Button (completed state)
   ============================================================ */
.btn-recessed {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: var(--surface);
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 auto;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow:
    inset 8px 8px 16px rgba(0, 0, 0, 0.05),
    inset -8px -8px 16px rgba(255, 255, 255, 0.7);
  transition: all 0.6s ease;
}

[data-theme="dark"] .btn-recessed {
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow:
    inset 8px 8px 16px rgba(0, 0, 0, 0.4),
    inset -4px -4px 12px rgba(255, 255, 255, 0.02);
}

.btn-recessed-text {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  text-align: center;
  user-select: none;
  padding: 1rem;
}

/* ============================================================
   Bottom Link (landing / completed screen)
   ============================================================ */
.bottom-link-area {
  position: absolute;
  bottom: 2rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}

.bottom-link {
  font-size: 0.8125rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-display);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bottom-link:hover {
  color: var(--text-main);
  border-bottom-color: var(--text-main);
}

/* ============================================================
   Auth / Focused Screens
   ============================================================ */
.silent-bg {
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, var(--background) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .silent-bg {
  background: radial-gradient(circle at 50% 50%, #222222 0%, var(--background) 100%);
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-form-wrap {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* Email badge (username prompt) */
.email-badge {
  display: inline-block;
  padding: 0.25rem 1rem;
  border-radius: 9999px;
  background: var(--primary-5);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 300;
  letter-spacing: 0.02em;
}

.auth-heading {
  font-size: 2.5rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.2;
}

.auth-sub {
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1.6;
  margin-top: 1rem;
}

/* Minimal input */
.minimal-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--outline-variant);
  border-radius: 0;
  padding: 1rem 0;
  font-size: 1.5rem;
  font-weight: 300;
  font-family: var(--font-display);
  color: var(--text-main);
  letter-spacing: -0.01em;
  outline: none;
  transition: border-color 0.5s ease;
}

.minimal-input::placeholder {
  color: var(--surface);
  opacity: 1;
}

[data-theme="dark"] .minimal-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.minimal-input:focus {
  border-bottom-color: var(--primary);
}

/* Action row (right-aligned CONFIRM → button) */
.action-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.action-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 300;
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: opacity 0.3s ease;
  padding: 0;
}

.action-btn:hover { opacity: 0.6; }
.action-btn:active { transform: scale(0.95); }
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Aesthetic footer line */
.auth-footer-line {
  display: flex;
  justify-content: center;
  padding-top: 4rem;
}

.auth-footer-line::after {
  content: '';
  width: 1px;
  height: 3rem;
  background: rgba(138, 141, 139, 0.2);
  display: block;
}

/* ============================================================
   Magic Link Sent Screen
   ============================================================ */
.magic-link-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  background: var(--background);
}

.magic-link-text {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.resend-btn {
  margin-top: 2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color 0.5s ease;
  padding: 0.25rem 0.5rem;
  display: block;
}

.resend-btn:hover { color: var(--accent); }

/* ============================================================
   Verification Screen
   ============================================================ */
.verify-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
}

.verify-text {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  animation: pulse-slow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-slow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(244, 244, 242, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-main);
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-family: var(--font-display);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 320px;
  text-align: center;
  pointer-events: none;
  border-bottom: 1px solid var(--surface);
}

[data-theme="dark"] .toast {
  background: rgba(44, 48, 46, 0.9);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   Loading
   ============================================================ */
.loading-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-text {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  animation: pulse-slow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================================
   Banners
   ============================================================ */
.verify-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  background: var(--surface);
  border-bottom: 1px solid rgba(138, 141, 139, 0.2);
  padding: 0.6rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* When verify banner is showing, push nav down below it */
body.has-verify-banner .zen-nav {
  top: 40px;
}

.banner-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.25rem;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.banner-dismiss:hover { color: var(--text-main); }

.destruction-msg {
  background: rgba(186, 26, 26, 0.06);
  border-bottom: 1px solid rgba(186, 26, 26, 0.2);
  padding: 0.75rem 2rem;
  font-size: 0.875rem;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.inline-dismiss {
  background: none;
  border: none;
  color: var(--error);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.8125rem;
  font-family: inherit;
  padding: 0;
  margin-left: auto;
}

/* ============================================================
   Signup Overlay (after anon press)
   ============================================================ */
.signup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.signup-overlay.show { opacity: 1; }

.signup-overlay-card {
  background: rgba(244, 244, 242, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 3rem 2.5rem 3.5rem;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  transform: translateY(40px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-top: 1px solid rgba(138, 141, 139, 0.15);
}

[data-theme="dark"] .signup-overlay-card {
  background: rgba(44, 48, 46, 0.95);
}

.signup-overlay.show .signup-overlay-card {
  transform: translateY(0);
}

.signup-overlay-title {
  font-size: 2rem;
  font-weight: 300;
  color: var(--text-main);
  letter-spacing: -0.02em;
  text-align: center;
}

.signup-overlay-sub {
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 300;
  line-height: 1.6;
}

.signup-overlay-btn {
  margin-top: 0.5rem;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 300;
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: opacity 0.3s ease;
}

.signup-overlay-btn:hover { opacity: 0.6; }

.signup-overlay-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s ease;
  padding: 0.25rem;
}

.signup-overlay-dismiss:hover { color: var(--text-main); }

/* ============================================================
   Leaderboard
   ============================================================ */
.lb-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8rem;
}

.lb-content {
  width: 100%;
  max-width: 48rem;
  padding: 0 2rem 8rem;
}

.lb-heading {
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 4rem;
  line-height: 1.1;
}

.lb-table {
  width: 100%;
  border-top: 1px solid var(--surface);
}

.lb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--surface);
  transition: background 0.3s ease, padding-left 0.3s ease;
  cursor: default;
}


.lb-row.lb-me .lb-name {
  color: var(--primary);
}

.lb-name {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-main);
  transition: padding-left 0.3s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.lb-row-group:hover .lb-name {
  padding-left: 0.5rem;
}

.lb-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.lb-number {
  font-size: 1rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  min-width: 3.5rem;
  text-align: right;
}

.lb-type {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  min-width: 3rem;
  text-align: right;
}

.lb-type-group {
  color: var(--primary);
}

.lb-row-group {
  cursor: pointer;
}

.lb-row-group:hover {
  background: var(--primary-5);
}

[data-theme="dark"] .lb-row-group:hover {
  background: var(--primary-5);
}

.roster-copy-feedback {
  font-size: 0.75rem;
  color: var(--primary);
  margin-left: 0.75rem;
  animation: fadeOut 2s forwards;
}

@keyframes fadeOut {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 4rem 0;
  font-size: 0.875rem;
  font-weight: 300;
  letter-spacing: 0.05em;
}

/* ============================================================
   Create Group
   ============================================================ */
.create-group-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem;
}

.back-corner {
  position: absolute;
  top: 3rem;
  left: 3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  background: none;
  border: none;
  font-family: var(--font-display);
  cursor: pointer;
  transition: color 0.3s ease;
}

.back-corner:hover { color: var(--primary); }

.create-group-form {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 4rem;
  animation: fadeInUp 1.5s ease-in-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-fade-in {
  animation: pageFadeIn 250ms ease-out;
}

.create-group-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.create-group-title {
  font-size: 2.25rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.create-group-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.create-group-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--surface);
  border-radius: 0;
  padding: 1rem 0;
  font-size: 1.5rem;
  font-weight: 400;
  font-family: var(--font-display);
  color: var(--text-main);
  text-align: center;
  outline: none;
  transition: border-color 0.7s ease;
}

[data-theme="dark"] .create-group-input {
  border-bottom-color: var(--surface);
}

.create-group-input::placeholder {
  color: var(--text-muted);
  opacity: 0.4;
}

.create-group-input:focus {
  border-bottom-color: var(--primary);
}

.establish-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  transition: color 0.5s ease;
  padding: 0;
}

.establish-btn:hover { color: var(--primary); }
.establish-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.group-msg {
  text-align: center;
  font-size: 0.875rem;
  min-height: 1.25rem;
}

/* Toggle */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border-radius: 9999px;
  transition: background 0.2s ease;
  cursor: pointer;
}

.toggle-track::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--background);
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-track {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
}

/* ============================================================
   Join Group
   ============================================================ */
.join-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.join-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 420px;
  width: 100%;
  gap: 3rem;
}

.join-title {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-main);
  letter-spacing: -0.02em;
  text-align: center;
}

.join-info {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.7;
}

.join-merge-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  max-width: 320px;
}

.join-contribution {
  font-size: 0.875rem;
  color: var(--primary);
  text-align: center;
}

.join-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.join-confirm {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1rem;
  font-family: var(--font-display);
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.join-confirm:hover { opacity: 0.7; }
.join-confirm:disabled { opacity: 0.4; cursor: not-allowed; }

.join-decline {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  font-family: var(--font-display);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.3s ease;
}

.join-decline:hover { color: var(--text-main); }

.join-warning {
  font-size: 0.8125rem;
  color: #C4654A;
  text-align: center;
  line-height: 1.6;
  letter-spacing: 0.01em;
  max-width: 320px;
}

/* ============================================================
   Group Info
   ============================================================ */
.group-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.group-page-header {
  width: 100%;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: absolute;
  top: 0;
  left: 0;
}

.group-content {
  flex: 1;
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 8rem 2rem 8rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.group-title {
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.group-meta-text {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 4rem;
}

.group-counter {
  font-family: 'DM Mono', monospace;
  font-size: clamp(5rem, 20vw, 7.5rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4rem;
}

.roster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--surface);
  width: 100%;
  margin-bottom: 1.5rem;
}

.roster-title {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-main);
}

.roster-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.roster-add-btn:hover {
  background: var(--surface);
  color: var(--text-main);
}

.member-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 40rem;
}

.member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  cursor: default;
}

.member-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.member-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

.member-name {
  font-size: 1rem;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.member-item:hover .member-name {
  color: var(--text-main);
}

.member-score {
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Invite section */
.invite-section {
  margin-top: 3rem;
  width: 100%;
  max-width: 40rem;
}

.invite-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.invite-link-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--surface);
  padding-bottom: 0.75rem;
}

.invite-link-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8125rem;
  font-family: var(--font-display);
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.copy-btn:hover { opacity: 0.6; }

.gen-invite-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: var(--font-display);
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s ease;
  padding: 0;
}

.gen-invite-btn:hover { color: var(--primary); }

.invite-perms-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Settings section */
.settings-section {
  margin-top: 2rem;
  width: 100%;
  max-width: 40rem;
}

.settings-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: var(--font-display);
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s ease;
  padding: 0;
}

.settings-toggle-btn:hover { color: var(--text-main); }

.settings-panel {
  margin-top: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--surface);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-panel p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.settings-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: var(--font-display);
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0;
  transition: color 0.3s ease;
  text-align: left;
}

.settings-action-btn:hover { color: var(--text-main); }

.warning-note {
  font-size: 0.8125rem;
  color: #C4654A;
  line-height: 1.7;
}

/* ============================================================
   Error screen
   ============================================================ */
.error-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
  text-align: center;
}

.error-screen p {
  color: var(--error);
  font-size: 0.9375rem;
  font-weight: 300;
}

.back-text-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.3s ease;
  display: inline-block;
}

.back-text-btn:hover { color: var(--text-main); }

/* ============================================================
   Decorative background circles (auth screens)
   ============================================================ */
.bg-circles {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.2;
}

.bg-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(18, 161, 89, 0.1);
}

.bg-circle-1 { width: 800px; height: 800px; }
.bg-circle-2 { width: 1200px; height: 1200px; border-color: rgba(18, 161, 89, 0.05); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
  .btn-ritual,
  .btn-recessed {
    width: 200px;
    height: 200px;
  }

  .center-stack {
    max-width: 200px;
  }

  .counter {
    font-size: clamp(4rem, 22vw, 6rem);
    margin-bottom: 2.5rem;
  }

  .focus-nav {
    padding: 1.5rem;
  }

  .back-corner {
    top: 1.5rem;
    left: 1.5rem;
  }

  .lb-heading {
    font-size: 2.25rem;
    margin-bottom: 2rem;
  }

  .group-title {
    font-size: 2rem;
  }

  .auth-heading {
    font-size: 2rem;
  }
}

@media (max-width: 400px) {
  .btn-ritual,
  .btn-recessed {
    width: 170px;
    height: 170px;
  }

  .center-stack {
    max-width: 170px;
  }

  .zen-nav {
    padding: 1.5rem;
  }
}

.center-stack > .btn-recessed,
.center-stack > .btn-ritual {
  margin-left: auto !important;
  margin-right: auto !important;
  flex-shrink: 0;
}
