/* ─── Auth tabs (combined login + signup) ────────────────────────────────── */
.auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 1.25rem;
  gap: 3px;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 9px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.auth-tab.active {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 2px 10px rgba(124,58,237,0.45);
}
.auth-tab:not(.active):hover {
  color: var(--text);
  background: rgba(255,255,255,0.07);
}

/* ─── Cleaning Cannonball nav button ─────────────────────────────────────── */
.cannon-cleaner-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.cannon-cleaner-btn:hover {
  background: var(--card);
  color: var(--yellow);
}
@keyframes cleaner-spin {
  0%   { transform: rotate(0deg)   scale(1);   }
  40%  { transform: rotate(200deg) scale(1.35); }
  100% { transform: rotate(360deg) scale(1);   }
}
.cannon-cleaner-btn.cleaning svg {
  animation: cleaner-spin 0.55s cubic-bezier(.36,.07,.19,.97);
}

/* First-use tooltip callout */
.cannon-cleaner-tip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 230px;
  background: var(--card);
  border: 1px solid var(--yellow);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 300;
  animation: tip-drop 0.25s ease;
}
@keyframes tip-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Arrow pointing up at the button */
.cannon-cleaner-tip::before {
  content: '';
  position: absolute;
  top: -7px;
  right: 16px;
  width: 12px;
  height: 12px;
  background: var(--card);
  border-top: 1px solid var(--yellow);
  border-left: 1px solid var(--yellow);
  transform: rotate(45deg);
}
.cannon-cleaner-tip strong {
  display: block;
  color: var(--yellow);
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
}
.cannon-cleaner-tip p {
  margin: 0 0 0.6rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.cannon-cleaner-tip button {
  background: var(--yellow);
  color: #000;
  border: none;
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.15s;
}
.cannon-cleaner-tip button:hover { opacity: 0.85; }

/* Small toast after cleaning */
.cannon-cleaner-toast {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  z-index: 300;
  pointer-events: none;
  transition: opacity 0.35s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

/* ─── Cannon-error shake ────────────────────────────────────────────────────── */
@keyframes cannon-shake {
  0%   { transform: translate(0,0) rotate(0deg); }
  10%  { transform: translate(-10px, 5px) rotate(-1.2deg); }
  22%  { transform: translate(10px, -6px) rotate(1.4deg); }
  34%  { transform: translate(-7px, 7px) rotate(-0.8deg); }
  46%  { transform: translate(8px, -3px) rotate(0.9deg); }
  58%  { transform: translate(-5px, 5px) rotate(-0.5deg); }
  70%  { transform: translate(5px, -2px) rotate(0.4deg); }
  82%  { transform: translate(-3px, 3px) rotate(-0.2deg); }
  92%  { transform: translate(2px, -1px) rotate(0.1deg); }
  100% { transform: translate(0,0) rotate(0deg); }
}

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

:root {
  --purple:      #7c3aed;
  --purple-dark: #5b21b6;
  --purple-light:#ede9fe;
  --yellow:      #fbbf24;
  --yellow-dark: #d97706;
  --bg:          #0f0a1e;
  --bg2:         #1a1035;
  --card:        #221a40;
  --text:        #f3f0ff;
  --text-muted:  #a89fc0;
  --border:      #3d2f6e;
  --success:     #10b981;
  --danger:      #ef4444;
  --info:        #3b82f6;
  --radius:      12px;
  --shadow:      0 4px 24px rgba(124,58,237,0.18);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  /* Cannon-firing SVG tiled pattern */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3C!-- cannon body --%3E%3Crect x='38' y='95' width='88' height='30' rx='8' fill='%23ffffff08'/%3E%3C!-- cannon barrel --%3E%3Crect x='110' y='100' width='52' height='20' rx='6' fill='%23ffffff0b'/%3E%3C!-- barrel opening --%3E%3Ccircle cx='162' cy='110' r='9' fill='%23ffffff06'/%3E%3C!-- wheels --%3E%3Ccircle cx='55' cy='128' r='14' fill='none' stroke='%23ffffff0a' stroke-width='3'/%3E%3Ccircle cx='55' cy='128' r='5' fill='%23ffffff08'/%3E%3Ccircle cx='95' cy='128' r='14' fill='none' stroke='%23ffffff0a' stroke-width='3'/%3E%3Ccircle cx='95' cy='128' r='5' fill='%23ffffff08'/%3E%3C!-- wheel spokes --%3E%3Cline x1='55' y1='114' x2='55' y2='142' stroke='%23ffffff07' stroke-width='2'/%3E%3Cline x1='41' y1='128' x2='69' y2='128' stroke='%23ffffff07' stroke-width='2'/%3E%3Cline x1='95' y1='114' x2='95' y2='142' stroke='%23ffffff07' stroke-width='2'/%3E%3Cline x1='81' y1='128' x2='109' y2='128' stroke='%23ffffff07' stroke-width='2'/%3E%3C!-- cannonball in flight --%3E%3Ccircle cx='185' cy='82' r='9' fill='%23ffffff09'/%3E%3C!-- motion trail --%3E%3Ccircle cx='175' cy='90' r='5' fill='%23ffffff05'/%3E%3Ccircle cx='167' cy='97' r='3' fill='%23ffffff03'/%3E%3C!-- smoke puff --%3E%3Ccircle cx='165' cy='108' r='10' fill='%23ffffff04'/%3E%3Ccircle cx='175' cy='103' r='7' fill='%23ffffff03'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a { color: var(--yellow); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.navbar-brand:hover { text-decoration: none; color: var(--yellow); }
.navbar-brand img { height: 36px; width: auto; }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.navbar-nav a {
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}
.navbar-nav a:hover {
  background: var(--card);
  color: var(--text);
  text-decoration: none;
}
.navbar-nav .btn-nav {
  background: var(--purple);
  color: #fff;
  padding: 6px 16px;
}
.navbar-nav .btn-nav:hover { background: var(--purple-dark); }
.navbar-nav .feedback-nav-btn {
  color: var(--yellow, #fbbf24) !important;
  font-weight: 600;
  border: 1.5px solid rgba(251,191,36,0.35);
  border-radius: 7px;
  padding: 5px 11px !important;
  font-size: 0.85rem;
  white-space: nowrap;
}
.navbar-nav .feedback-nav-btn:hover {
  background: rgba(251,191,36,0.12) !important;
  border-color: rgba(251,191,36,0.65) !important;
  color: var(--yellow, #fbbf24) !important;
}

/* ─── Main ──────────────────────────────────────────────────────────────────── */
main { flex: 1; }

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 3rem;
  background: radial-gradient(ellipse at 50% 0%, #3b1f7a 0%, var(--bg) 70%);
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #fff 30%, var(--yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* ─── Joke Card ─────────────────────────────────────────────────────────────── */
.joke-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem auto;
  max-width: 620px;
  position: relative;
  box-shadow: var(--shadow);
}
.joke-card .quote-icon {
  font-size: 4rem;
  line-height: 1;
  color: var(--purple);
  opacity: 0.4;
  position: absolute;
  top: 0.5rem;
  left: 1rem;
}
.joke-card .joke-text {
  font-size: 1.2rem;
  font-style: italic;
  margin-top: 1rem;
  line-height: 1.7;
}
.joke-card .joke-author {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: right;
}
.joke-card .joke-author::before { content: "— "; }

/* ─── Star Ratings ──────────────────────────────────────────────────────────── */
.joke-rating-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.stars-interactive {
  display: flex;
  gap: 2px;
}

.star-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--border);
  padding: 0 1px;
  line-height: 1;
  transition: color 0.1s, transform 0.1s;
}
.star-btn:disabled { cursor: default; }
.star-btn.star-filled  { color: var(--yellow); }
.star-btn.star-user    { color: #f59e0b; }
.star-btn.star-hover   { color: var(--yellow); transform: scale(1.2); }
.star-btn.star-empty   { color: var(--border); }

.rating-summary {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.rating-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.rating-hint a { color: var(--yellow); }

/* Static star display (jokes index) */
.stars-display { display: inline-flex; gap: 1px; line-height: 1; }
.stars-display .star         { font-size: 0.9rem; color: var(--border); }
.stars-display .star-filled  { color: var(--yellow); }
.stars-display .star-half    { color: var(--yellow); opacity: 0.5; }
.stars-display .star-empty   { color: var(--border); }

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.btn:hover { text-decoration: none; filter: brightness(1.1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary   { background: var(--purple); color: #fff; }
.btn-yellow    { background: var(--yellow); color: #1a1035; }
.btn-outline   { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--purple); color: var(--purple); filter: none; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-sm        { padding: 6px 14px; font-size: 0.8rem; }
.btn-google    {
  background: #fff;
  color: #1f1f1f;
  border: 1.5px solid #dadce0;
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 0.95rem;
}
.btn-google:hover { background: #f8f9fa; filter: none; box-shadow: 0 1px 6px rgba(0,0,0,0.2); }
.btn-google img { height: 20px; width: 20px; }

/* ─── Cards / Panels ────────────────────────────────────────────────────────── */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.panel h2 { font-size: 1.4rem; margin-bottom: 1.25rem; font-weight: 700; }

/* ─── Forms ─────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.15s;
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}
textarea.form-control { resize: vertical; min-height: 120px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0.75rem 0;
}
.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--purple);
  cursor: pointer;
}
.checkbox-row label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Alerts / Flash ────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border-left: 4px solid;
}
.alert-success { background: rgba(16,185,129,0.12); border-color: var(--success); color: #6ee7b7; }
.alert-danger  { background: rgba(239,68,68,0.12);  border-color: var(--danger);  color: #fca5a5; }
.alert-info    { background: rgba(59,130,246,0.12); border-color: var(--info);    color: #93c5fd; }
.alert-warning { background: rgba(251,191,36,0.12); border-color: var(--yellow);  color: var(--yellow); }

/* ─── Jokes Table ───────────────────────────────────────────────────────────── */
.jokes-grid { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }

.joke-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.joke-row-body { flex: 1; font-size: 0.95rem; line-height: 1.6; }
.joke-row-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }
.joke-row-actions { display: flex; gap: 0.5rem; flex-shrink: 0; align-items: flex-start; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-public  { background: rgba(124,58,237,0.2); color: #c4b5fd; border: 1px solid #7c3aed; }
.badge-private { background: rgba(100,100,120,0.2); color: var(--text-muted); border: 1px solid var(--border); }
.badge-stolen  {
  background: linear-gradient(135deg, rgba(15,10,30,0.9), rgba(40,20,60,0.8));
  color: #e2e8f0;
  border: 1px solid rgba(200,160,255,0.25);
  letter-spacing: 0.02em;
}

/* ─── Public comments ────────────────────────────────────────────────────── */
.public-comment {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  padding: 0.25rem 0;
  font-size: 0.84rem;
  line-height: 1.4;
}
.public-comment + .public-comment {
  border-top: 1px solid rgba(255,255,255,0.04);
}
.public-comment-author {
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
  font-size: 0.8rem;
}
.public-comment-body {
  color: var(--text);
}

/* ─── Joke Carousel ─────────────────────────────────────────────────────────── */
.joke-carousel {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 720px;
  margin: 0 auto;
}
.joke-carousel .joke-card {
  flex: 1;
  margin: 0;
  transition: opacity 0.18s ease;
  min-height: 160px;
}
.joke-card.fade-out { opacity: 0; }

.carousel-arrow {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.carousel-arrow:hover {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  transform: scale(1.08);
}

.joke-counter {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

@media (max-width: 600px) {
  .carousel-arrow { width: 36px; height: 36px; font-size: 0.95rem; }
}

/* ─── Page Header ───────────────────────────────────────────────────────────── */
.page-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.page-header h1 { font-size: 1.75rem; font-weight: 800; }
.page-header p  { color: var(--text-muted); margin-top: 0.25rem; }
.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ─── Welcome Page ──────────────────────────────────────────────────────────── */
.welcome-hero {
  text-align: center;
  padding: 4rem 1.5rem;
}
.welcome-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  background: linear-gradient(135deg, #fff 30%, var(--yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.welcome-hero p { color: var(--text-muted); font-size: 1.1rem; margin: 0.75rem 0 2rem; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.quick-action-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.quick-action-card:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text);
}
.quick-action-card .icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.quick-action-card strong { display: block; font-size: 1rem; margin-bottom: 0.25rem; }
.quick-action-card span   { color: var(--text-muted); font-size: 0.85rem; }

/* ─── Auth Pages ────────────────────────────────────────────────────────────── */
.auth-wrapper {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(ellipse at 50% 0%, #2d1a5e 0%, var(--bg) 70%);
}
.auth-box {
  width: 100%;
  max-width: 420px;
}
.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-logo img { height: 56px; }
.auth-logo h1 {
  font-size: 1.6rem;
  font-weight: 900;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #fff 30%, var(--yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Avatars ───────────────────────────────────────────────────────────────── */
.nav-avatar-link { display: flex; align-items: center; gap: 6px; }
.nav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

.joke-author-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 1rem;
}
.joke-author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
/* Remove the old joke-author margin since it's now in a flex row */
.joke-card .joke-author { margin-top: 0; }

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.profile-avatar-hidden { opacity: 0.35; filter: grayscale(1); }
.profile-avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  flex-shrink: 0;
}

/* ─── Star Filter ───────────────────────────────────────────────────────────── */
.star-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.star-filter-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 0.25rem;
}
.star-filter-btn {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 1px;
}
.star-filter-btn:hover { border-color: var(--yellow); color: var(--yellow); text-decoration: none; }
.star-filter-btn.active { background: var(--purple); border-color: var(--purple); color: #fff; }

/* ─── Score Card ─────────────────────────────────────────────────────────────── */
.score-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin: 1.25rem auto;
  max-width: 520px;
  flex-wrap: wrap;
}
.score-card-number {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--yellow);
  min-width: 60px;
  line-height: 1;
}
.score-card-tier { font-weight: 700; font-size: 1rem; }
.score-card-desc { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.2rem; }

/* ─── Leaderboard ────────────────────────────────────────────────────────────── */
.my-score-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: linear-gradient(135deg, #2d1a5e, #1a1035);
  border: 1px solid var(--purple);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.my-score-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.my-score-value { font-size: 2rem; font-weight: 900; color: var(--yellow); }
.my-score-tier  .tier-name    { font-weight: 700; font-size: 1rem; }
.my-score-tier  .tier-formula { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }

.leaderboard-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.lb-header, .lb-row {
  display: grid;
  grid-template-columns: 48px 1fr 160px 64px 80px;
  align-items: center;
  padding: 0.75rem 1.25rem;
  gap: 0.5rem;
}
.lb-header {
  background: var(--bg2);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.lb-row { border-bottom: 1px solid var(--border); transition: background 0.12s; }
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: rgba(124,58,237,0.07); }
.lb-row-me { background: rgba(124,58,237,0.13) !important; }
.lb-row-podium-1 .lb-rank { font-size: 1.3rem; }
.lb-row-podium-2 .lb-rank { font-size: 1.15rem; }
.lb-row-podium-3 .lb-rank { font-size: 1.05rem; }

.lb-rank  { text-align: center; font-weight: 700; color: var(--text-muted); }
.lb-user  { font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.lb-tier  { font-size: 0.8rem; color: var(--text-muted); }
.lb-jokes { text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.lb-score { text-align: right; font-weight: 700; color: var(--yellow); font-size: 1rem; }

.lb-you-badge {
  font-size: 0.65rem;
  background: var(--purple);
  color: #fff;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.star-user-filled { color: #a78bfa; }

@media (max-width: 600px) {
  .lb-header, .lb-row { grid-template-columns: 40px 1fr 80px; }
  .lb-tier, .lb-jokes { display: none; }
}

/* ─── Footer ────────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

/* ─── Utility ───────────────────────────────────────────────────────────────── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-muted   { color: var(--text-muted); font-size: 0.85rem; }
.empty-state  {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; display: block; margin-bottom: 0.75rem; }

@media (max-width: 600px) {
  .navbar { padding: 0 1rem; }
  .joke-row { flex-direction: column; }
  .joke-row-actions { flex-direction: row; }
}

/* ─── Avatar Upload ──────────────────────────────────────────────────────────── */
.avatar-upload-form { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.avatar-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg2);
  transition: border-color 0.15s;
}
.avatar-upload-label:hover { border-color: var(--purple); color: var(--purple); }
.avatar-upload-label input[type="file"] { display: none; }

/* ─── File Upload (Joke Image) ───────────────────────────────────────────────── */
.file-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px dashed var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg2);
  transition: border-color 0.15s, color 0.15s;
  width: 100%;
  justify-content: center;
  margin-bottom: 0.4rem;
}
.file-upload-label:hover { border-color: var(--purple); color: var(--purple); }
.file-upload-label input[type="file"] { display: none; }

/* ─── Joke Attached Image ────────────────────────────────────────────────────── */
.joke-attached-image {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--border);
}
.joke-row-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  align-self: flex-start;
}
.joke-edit-preview {
  max-width: 200px;
  max-height: 140px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--border);
  display: block;
  margin-bottom: 0.5rem;
}

/* ─── Language Checkboxes ────────────────────────────────────────────────────── */
.lang-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.lang-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg2);
  transition: border-color 0.15s;
}
.lang-checkbox-item:has(input:checked) {
  border-color: var(--purple);
  background: rgba(124,58,237,0.15);
  color: #c4b5fd;
}
.lang-checkbox-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--purple);
}

/* ─── Badge Lang ─────────────────────────────────────────────────────────────── */
.badge-lang {
  background: rgba(59,130,246,0.15);
  color: #93c5fd;
  border: 1px solid #3b82f6;
}

/* ─── Nav Unverified Dot ─────────────────────────────────────────────────────── */
.nav-unverified-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  margin-left: 2px;
  vertical-align: middle;
}

/* ─── Top Jokes ──────────────────────────────────────────────────────────────── */
.top-joke-rank {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.top-joke-stars {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  align-self: center;
}
.star-btn-inline {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--border);
  padding: 0 1px;
  line-height: 1;
  transition: color 0.1s;
}
.star-btn-inline:hover { color: var(--yellow); }
.star-btn-inline.star-filled { color: var(--yellow); }

/* ─── Admin ──────────────────────────────────────────────────────────────────── */
.admin-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  min-height: 140px;
}
.admin-nav-card:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--text);
}

.admin-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.admin-table-header {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--bg2);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}
.admin-table-row {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
  font-size: 0.88rem;
  transition: background 0.12s;
}
.admin-table-row:last-child { border-bottom: none; }
.admin-table-row:hover { background: rgba(124,58,237,0.06); }

/* ─── lb snarky tier ─────────────────────────────────────────────────────────── */
.lb-tier-snarky { font-size: 0.78rem; color: #a78bfa; font-style: italic; }

/* ─── Google Drive picker button ────────────────────────────────────────────── */
.btn-drive {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.btn-drive:hover { border-color: #4285f4; color: #4285f4; }
