:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --panel-hover: #232730;
  --border: #2a2e38;
  --text: #e8e8ea;
  --muted: #8b8f99;
  --accent: #ffd166;
  --travels: #4cc9f0;
  --food: #f4845f;
  --culture: #c084fc;
  --relationships: #f472b6;
  --sports: #a3e635;
  --diy: #fb923c;
  --career: #60a5fa;
  --wellness: #5eead4;
  --nature: #34d399;
  --mishaps: #f87171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 800px;
  margin: 0 auto 12px;
  gap: 12px;
}

.brand {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 32px;
  height: 32px;
  color: var(--accent);
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(255, 209, 102, 0.25));
}
.brand-text { display: flex; flex-direction: column; }
.brand h1 { margin: 0; font-size: 26px; letter-spacing: 4px; color: var(--accent); line-height: 1; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; }

.search-bar {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}
#search-input {
  width: 100%;
  padding: 10px 38px 10px 38px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  outline: none;
}
#search-input:focus { border-color: var(--accent); }
.search-ai-hint {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 209, 102, 0.4));
}
.search-subtitle {
  max-width: 800px;
  margin: 6px auto 0;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.2px;
}

/* Quick navigation chips — two rows: personal nav on top, theme chips
   below. Each row scrolls horizontally on its own when needed. */
.quick-nav {
  max-width: 800px;
  margin: 10px auto 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 0 4px;
}
.qn-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.qn-row::-webkit-scrollbar { display: none; }
/* On mobile (≤ 600px wide) the themes row scrolls horizontally with a
   right-edge fade hinting at more content. On desktop, the row wraps
   to multiple lines so every theme is reachable without scrolling. */
@media (max-width: 600px) {
  .qn-row-themes {
    mask-image: linear-gradient(to right, black 0, black calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 0, black calc(100% - 24px), transparent 100%);
  }
}
@media (min-width: 601px) {
  .qn-row-themes {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}
.qn-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
  -webkit-tap-highlight-color: rgba(255, 209, 102, 0.2);
}
.qn-chip:hover {
  color: var(--text);
  border-color: var(--text);
}
.qn-chip.active {
  background: var(--accent);
  color: #0f1115;
  border-color: var(--accent);
}
.qn-chip[data-theme].active {
  background: var(--chip-color);
  border-color: var(--chip-color);
  color: white;
}
.qn-emoji { font-size: 14px; }
@media (max-width: 600px) {
  .search-subtitle { display: none; }
  .qn-chip { padding: 5px 10px; font-size: 11px; }
  .qn-emoji { font-size: 13px; }
}
#search-input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--panel-hover);
  color: var(--muted);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.search-clear:hover { background: var(--border); color: var(--text); }
#search-input:not(:placeholder-shown) ~ .search-clear { display: flex; }

.btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.15s;
}
.btn:hover { background: var(--panel-hover); }
.btn.primary { background: var(--accent); color: #0f1115; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.small { padding: 4px 10px; font-size: 12px; }

.user-chip-wrap { position: relative; }
.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); padding: 4px 10px 4px 4px; border-radius: 999px;
  border: 1px solid transparent;
  flex-shrink: 1; min-width: 0;
  cursor: pointer; font: inherit; color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.user-chip:hover { border-color: var(--border); }
.user-chip[aria-expanded="true"] { border-color: var(--accent); }
.user-chip img { width: 26px; height: 26px; border-radius: 50%; display: block; flex-shrink: 0; }
.user-chip-name { font-size: 12px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-caret { font-size: 10px; color: var(--muted); margin-left: 2px; }
#auth-area { display: flex; align-items: center; flex-wrap: nowrap; min-width: 0; }
@media (max-width: 480px) {
  .user-chip-name { display: none; }
  .user-chip img { width: 24px; height: 24px; }
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 200;
  animation: user-menu-pop 0.12s ease;
}
@keyframes user-menu-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.user-menu-item:hover { background: rgba(255, 255, 255, 0.06); }
.user-menu-count {
  margin-left: auto;
  background: rgba(255, 209, 102, 0.15);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}
.user-menu-pill {
  margin-left: auto;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.user-menu-pill.is-public {
  background: rgba(76, 175, 80, 0.18);
  color: #86efac;
  border: 1px solid rgba(76, 175, 80, 0.35);
}
.user-menu-pill.is-private {
  background: rgba(136, 136, 136, 0.18);
  color: var(--muted);
  border: 1px solid rgba(136, 136, 136, 0.35);
}
.user-menu-item--last {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  padding-top: 12px;
  color: var(--muted);
}
.user-menu-locale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}
.user-menu-locale-label {
  font-size: 13px;
  color: var(--text);
}

.locale-toggle {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  user-select: none;
  margin-right: 4px;
  flex-shrink: 0;
  gap: 1px;
}
.locale-toggle:hover { border-color: var(--accent); }
.locale-toggle .locale-label {
  padding: 3px 7px;
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  color: var(--muted);
  transition: color 0.18s, background 0.18s, transform 0.18s;
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: rgba(255, 209, 102, 0.3);
  touch-action: manipulation;
  min-height: 28px;
  filter: saturate(0.55) brightness(0.85);
}
.locale-toggle .locale-label[aria-pressed="true"] {
  filter: none;
  transform: scale(1.1);
}
.locale-toggle .locale-label[aria-pressed="true"] {
  color: #0f1115;
  background: var(--accent);
}
.locale-toggle .locale-label:hover { color: var(--text); }
.locale-toggle .locale-label[aria-pressed="true"]:hover { color: #0f1115; }

main { max-width: 800px; margin: 0 auto; padding: 20px 16px 60px; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* Hero */
.hero {
  text-align: center;
  padding: 24px 0 32px;
}
.hero-score {
  font-size: 64px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.hero-max {
  font-size: 28px;
  color: var(--muted);
  font-weight: 500;
}
.hero-label { color: var(--muted); font-size: 13px; margin-top: 8px; }
.hero-slogan {
  color: var(--text);
  opacity: 0.7;
  font-size: 14px;
  font-style: italic;
  margin-top: 18px;
  letter-spacing: 0.2px;
}
.hero-score { text-shadow: 0 2px 16px rgba(255, 209, 102, 0.18); }
.hero-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}
.share-btn {
  background: rgba(255, 209, 102, 0.12);
  border-color: rgba(255, 209, 102, 0.3);
  color: var(--accent);
  font-weight: 600;
}
.share-btn:hover {
  background: rgba(255, 209, 102, 0.2);
  border-color: var(--accent);
}

/* Theme grid */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.theme-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  background: var(--panel);
}
.theme-card:hover {
  border-color: var(--theme-color);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--theme-color);
}
.theme-card-image {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.05);
  transition: transform 0.5s ease;
}
.theme-card:hover .theme-card-image { transform: scale(1.04); }
.theme-card-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(15, 17, 21, 0.25) 0%, rgba(15, 17, 21, 0.55) 50%, rgba(15, 17, 21, 0.92) 100%);
}
.theme-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.theme-card-emoji {
  font-size: 28px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}
.theme-card-title {
  font-size: 20px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.3px;
}
.theme-card-bottom { display: flex; flex-direction: column; gap: 6px; }
.theme-card-stats {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.theme-card-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  overflow: hidden;
}
.theme-card-bar > div {
  height: 100%;
  background: var(--theme-color);
  transition: width 0.3s;
  box-shadow: 0 0 8px var(--theme-color);
}
.theme-card-score {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.2px;
}

/* Theme view */
.theme-view-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.theme-view-header h2 { margin: 0; font-size: 22px; flex: 1; }
.theme-view-score { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.chip {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { background: var(--panel-hover); }
.chip.active { background: var(--accent); color: #0f1115; border-color: var(--accent); }
.chip-count { font-size: 11px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.chip.active .chip-count { opacity: 0.85; }

.subcat-heading {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 24px 0 8px;
  display: flex; align-items: baseline; gap: 8px;
}
.subcat-heading:first-child { margin-top: 8px; }
.subcat-heading span {
  font-size: 11px; background: var(--panel); padding: 2px 8px;
  border-radius: 999px; color: var(--muted);
  text-transform: none; letter-spacing: normal;
}

/* Activity */
.activity-list { display: flex; flex-direction: column; gap: 4px; }

.activity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--panel);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}
.activity:hover { background: var(--panel-hover); }
.activity.checked { opacity: 0.55; }
.activity.checked .title { text-decoration: line-through; }

.checkbox {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid var(--muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 13px; font-weight: 700;
}
.activity.checked .checkbox {
  background: var(--accent); border-color: var(--accent); color: #0f1115;
}

.emoji { flex-shrink: 0; opacity: 0.7; }
.title { flex: 1; font-size: 14px; }

.points {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}
.points .tier-name {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}
.points .tier-pts { font-weight: 600; }

.points.tier-banal      { background: rgba(148, 163, 184, 0.14); color: #94a3b8; }
.points.tier-common     { background: rgba(74, 222, 128, 0.18); color: #86efac; }
.points.tier-notable    { background: rgba(96, 165, 250, 0.18); color: #93c5fd; }
.points.tier-rare       { background: rgba(192, 132, 252, 0.22); color: #d8b4fe; }
.points.tier-legendary  {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.28), rgba(244, 132, 95, 0.2));
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 480px) {
  /* Hide the tier name on narrow screens; keep just the points pill colored */
  .points .tier-name { display: none; }
}

.gen-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.7;
}

/* Ghost activity row — used to propose generating a missing activity */
.activity.ghost {
  margin-top: 8px;
  background: transparent;
  border: 1px dashed var(--border);
  opacity: 0.85;
}
.activity.ghost:hover {
  background: rgba(255, 209, 102, 0.05);
  border-color: var(--accent);
  opacity: 1;
}
.activity.ghost .ghost-mark {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--accent);
  flex-shrink: 0;
}
.activity.ghost .title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.activity.ghost .title small {
  color: var(--muted);
  font-size: 11px;
}
.activity.ghost.loading {
  cursor: wait;
  opacity: 0.7;
}
.activity.ghost.loading:hover {
  background: transparent;
  border-color: var(--border);
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 209, 102, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: lxp-spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes lxp-spin { to { transform: rotate(360deg); } }

/* Toast — used for "tap back again" prompt and other transient feedback */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  background: rgba(15, 17, 21, 0.96);
  color: #f3f4f6;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  z-index: 200;
  pointer-events: none;
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateX(-50%) translateY(16px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Check flash — pulse on the checkbox + floating LXP gain */
.checkbox.flash {
  animation: cb-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes cb-pop {
  0%   { transform: scale(1); box-shadow: 0 0 0 rgba(255, 209, 102, 0); }
  30%  { transform: scale(1.6); box-shadow: 0 0 22px rgba(255, 209, 102, 0.85); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(255, 209, 102, 0); }
}
.lxp-float {
  position: fixed;
  color: var(--accent);
  font-weight: 800;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 150;
  text-shadow: 0 0 12px rgba(255, 209, 102, 0.7);
  animation: lxp-rise 1.2s ease-out forwards;
  transform: translate(-50%, -50%);
}
@keyframes lxp-rise {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  20%  { opacity: 1; transform: translate(-50%, calc(-50% - 16px)) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 70px)) scale(0.95); }
}

/* Trophy unlock — full-screen modal with dim backdrop, tap to dismiss */
.trophy-unlock {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  cursor: pointer;
  padding: 20px;
  transition: background 0.32s ease;
}
.trophy-unlock.show {
  background: rgba(0, 0, 0, 0.7);
  pointer-events: auto;
}
.trophy-unlock-card {
  position: relative;
  background: linear-gradient(135deg, #ffd166 0%, #f4845f 100%);
  color: #0f1115;
  padding: 28px 32px 30px;
  border-radius: 20px;
  text-align: center;
  min-width: 260px;
  max-width: 380px;
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.65),
    0 0 80px rgba(255, 209, 102, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform: translateY(40px) scale(0.7);
  opacity: 0;
  transition: opacity 0.32s ease, transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: visible;
}
.trophy-unlock.show .trophy-unlock-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Sparkle particles around the trophy icon */
.trophy-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.trophy-sparkles span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff7d8;
  box-shadow: 0 0 12px rgba(255, 247, 216, 0.9);
  opacity: 0;
}
.trophy-unlock.show .trophy-sparkles span {
  animation: sparkle 1.4s ease-out forwards;
}
.trophy-sparkles span:nth-child(1) { left: 12%;  top: 22%; animation-delay: 0.05s; }
.trophy-sparkles span:nth-child(2) { left: 88%;  top: 18%; animation-delay: 0.18s; }
.trophy-sparkles span:nth-child(3) { left: 8%;   top: 65%; animation-delay: 0.32s; }
.trophy-sparkles span:nth-child(4) { left: 92%;  top: 62%; animation-delay: 0.10s; }
.trophy-sparkles span:nth-child(5) { left: 30%;  top: 8%;  animation-delay: 0.24s; }
.trophy-sparkles span:nth-child(6) { left: 70%;  top: 6%;  animation-delay: 0.40s; }
.trophy-sparkles span:nth-child(7) { left: 22%;  top: 90%; animation-delay: 0.16s; }
.trophy-sparkles span:nth-child(8) { left: 78%;  top: 92%; animation-delay: 0.30s; }
@keyframes sparkle {
  0%   { opacity: 0; transform: scale(0); }
  30%  { opacity: 1; transform: scale(1.4); }
  100% { opacity: 0; transform: scale(0.6) translate(0, -20px); }
}
.trophy-unlock-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-weight: 700;
  margin-bottom: 8px;
  opacity: 0.8;
}
.trophy-unlock-icon {
  font-size: 56px;
  margin: 4px 0 8px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
  animation: trophy-bounce 0.8s ease;
}
@keyframes trophy-bounce {
  0%   { transform: scale(0.4) rotate(-15deg); }
  60%  { transform: scale(1.2) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}
.trophy-unlock-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.trophy-unlock-desc {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 6px;
  line-height: 1.4;
}

/* Onboarding modal */
.onb-overlay { background: rgba(0, 0, 0, 0.85); }
.onb-modal { max-width: 460px; }
.onb-visual {
  padding: 36px 24px 16px;
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.05) 0%, transparent 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 220px;
  position: relative;
}
.onb-logo { width: 96px; height: 96px; color: var(--accent); }
.onb-themes {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 16px;
}
.onb-theme-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid; font-size: 12px; font-weight: 600;
}
.onb-tiers {
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 380px;
}
.onb-search-mock {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px 10px 38px; position: relative;
  font-size: 14px; color: var(--text); margin-bottom: 14px; width: 100%; max-width: 280px;
}
.onb-mock-text { color: var(--muted); font-style: italic; }
.onb-arrow { color: var(--muted); font-size: 22px; margin-bottom: 10px; }
.onb-modal .activity.ghost { width: 100%; max-width: 280px; }

.onb-body { padding: 18px 24px 24px; text-align: center; }
.onb-title { margin: 0 0 10px; font-size: 22px; font-weight: 700; }
.onb-text { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.onb-dots {
  display: flex; justify-content: center; gap: 6px; margin-bottom: 18px;
}
.onb-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border); transition: background 0.2s;
}
.onb-dot.active { background: var(--accent); }
.onb-actions {
  display: flex; justify-content: space-between; gap: 10px;
}
.onb-actions .btn { flex: 1; }
.onb-actions .btn.primary { flex: 2; }

@media (max-width: 480px) {
  .onb-visual { min-height: 180px; padding: 28px 18px 14px; }
  .onb-logo { width: 72px; height: 72px; }
  .onb-title { font-size: 20px; }
  .onb-text { font-size: 13px; }
}

/* Info button on each activity row */
.info-btn,
.fav-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  -webkit-tap-highlight-color: rgba(244, 132, 95, 0.3);
}
@media (hover: hover) {
  .info-btn:hover {
    background: var(--panel-hover);
    color: var(--text);
    border-color: var(--text);
  }
  .fav-btn:hover { color: #f472b6; border-color: #f472b6; }
}
.fav-btn { font-size: 16px; }
.fav-btn:focus { outline: none; }
.fav-btn.on {
  color: #f472b6;
  border-color: #f472b6;
  background: rgba(244, 114, 182, 0.12);
}
.btn.fav-on {
  background: rgba(244, 114, 182, 0.12);
  border-color: rgba(244, 114, 182, 0.45);
  color: #f9a8d4;
}

/* Detail modal */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fade-in 0.15s ease;
}
.modal {
  background: var(--panel);
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
  animation: pop-in 0.2s ease;
}
.modal-hero {
  height: 200px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.modal-emoji { font-size: 80px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3)); }
.image-credit {
  position: absolute;
  bottom: 8px;
  left: 12px;
  font-size: 10px;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  background: rgba(0,0,0,0.35);
  padding: 3px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}
.image-credit a {
  color: rgba(255,255,255,0.95);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.4);
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(0, 0, 0, 0.6); }
.modal-body {
  padding: 24px;
  overflow-y: auto;
}
.modal-tier-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.modal-count {
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.modal-title {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.3;
}
.modal-description {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 24px;
}
.modal-description .muted { font-style: italic; opacity: 0.7; }
.modal-actions {
  display: flex; flex-direction: column; gap: 10px;
}
.modal-actions .btn { text-align: center; text-decoration: none; }
/* Sponsored / ad-style card inside the detail modal */
.sponsored-card {
  display: block;
  padding: 14px 16px;
  background: rgba(76, 201, 240, 0.05);
  border: 1px solid rgba(76, 201, 240, 0.25);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 18px;
  transition: background 0.15s, border-color 0.15s;
}
.sponsored-card:hover {
  background: rgba(76, 201, 240, 0.1);
  border-color: rgba(76, 201, 240, 0.5);
}
.sponsored-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-weight: 600;
}
.sponsored-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fbbc05; /* google yellow */
  display: inline-block;
}
.sponsored-headline {
  font-size: 15px;
  font-weight: 600;
  color: #8ab4f8; /* google blue used in ads */
  margin-bottom: 4px;
  line-height: 1.3;
}
.sponsored-cta {
  font-size: 12px;
  color: var(--muted);
}


@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

@media (max-width: 480px) {
  .modal { max-height: 95vh; }
  .modal-hero { height: 170px; }
  .modal-emoji { font-size: 64px; }
  .modal-body { padding: 18px; }
  .modal-title { font-size: 19px; }
}

/* Tier breakdown chips (rarity stats) */
.tier-stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 8px 0 28px;
}
.tier-stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 4px;
  text-align: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.tier-stat:hover {
  background: var(--panel-hover);
  border-color: currentColor;
  transform: translateY(-2px);
}
.tier-stat-total {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}
.tier-stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: currentColor;
  opacity: 0.5;
}
.tier-stat-count {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.tier-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 4px;
  color: var(--muted);
}
.tier-stat.tier-banal { color: #94a3b8; }
.tier-stat.tier-common { color: #86efac; }
.tier-stat.tier-notable { color: #93c5fd; }
.tier-stat.tier-rare { color: #d8b4fe; }
.tier-stat.tier-legendary { color: var(--accent); }

@media (max-width: 480px) {
  .tier-stat { padding: 8px 2px; }
  .tier-stat-count { font-size: 18px; }
  .tier-stat-label { font-size: 8px; }
}

/* Suggestions section uses the standard activity-list under the hood */
.suggestions-section { margin-bottom: 32px; }

/* Trophies */
.trophies-section { margin-top: 40px; }
.section-title {
  font-size: 18px;
  margin: 0 0 16px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-count {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.trophies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.trophy {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  opacity: 0.55;
  transition: opacity 0.25s, border-color 0.25s, transform 0.15s;
  cursor: default;
}
.trophy.earned {
  opacity: 1;
  border-color: rgba(255, 209, 102, 0.45);
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.1) 0%, var(--panel) 60%);
}
.trophy:hover { transform: translateY(-2px); }
.trophy-icon { font-size: 26px; margin-bottom: 6px; line-height: 1; }
.trophy-name { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.trophy-desc {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  margin-bottom: 10px;
  min-height: 28px;
}
.trophy-progress {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}
.trophy.earned .trophy-progress { color: var(--accent); font-weight: 700; }
.trophy-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}
.trophy-bar > div {
  height: 100%;
  background: var(--muted);
  transition: width 0.4s ease;
}
.trophy.earned .trophy-bar > div { background: var(--accent); }

/* Auth modal */
.auth-modal {
  padding: 28px 28px 22px;
  max-width: 420px;
  position: relative;
  /* Allow content to scroll when it overflows the 90vh modal cap.
     The parent .modal has overflow:hidden to clip rounded corners; we
     scroll the inner content area instead. */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.auth-modal h2 {
  margin: 0 0 18px;
  font-size: 20px;
}
.auth-modal .modal-close {
  position: absolute;
  top: 10px; right: 14px;
  width: 32px; height: 32px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  border-radius: 50%;
}
.auth-modal .modal-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.auth-fields {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 16px;
}
.auth-field {
  display: flex; flex-direction: column; gap: 4px;
}
.auth-field span {
  font-size: 12px; color: var(--muted);
}
.auth-field input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}
.auth-field input:focus {
  border-color: var(--accent); outline: none;
}
.auth-cta {
  width: 100%;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
}
.modal-cta-row {
  display: flex;
  gap: 8px;
}
.modal-cta-row > .auth-cta {
  flex: 1;
}
.auth-cta-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.auth-cta-secondary:hover {
  border-color: var(--accent);
}
.auth-magic {
  width: 100%;
  margin-top: 10px;
  padding: 11px;
  background: transparent;
  font-size: 13px;
}
.auth-secondary {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 14px 0 8px;
}
.auth-link {
  background: transparent; border: 0;
  color: var(--accent);
  font: inherit; font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 12px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-google {
  width: 100%;
  padding: 11px;
  font-size: 13px;
  background: var(--panel-hover);
}
.auth-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 12px;
}
.auth-info {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 16px;
}
.auth-help {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.auth-help.is-error { color: #fca5a5; }
.auth-help.is-ok { color: #86efac; }

.profile-url {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 209, 102, 0.06);
  border: 1px solid rgba(255, 209, 102, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.profile-url-code {
  flex: 1;
  min-width: 0;
  background: transparent;
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
}
.profile-url-copy {
  background: var(--panel-hover);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.profile-url-copy:hover {
  border-color: var(--accent);
}
.profile-url--muted {
  background: transparent;
  border: 1px dashed var(--border);
}
.profile-url-label {
  color: var(--muted);
  margin-right: 4px;
}
.profile-url code {
  background: transparent;
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
}

/* Avatar fallback (initial in coloured circle) */
.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  color: #0f1115;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}
.profile-avatar--fallback {
  border: 0 !important;
  background: transparent !important;
  display: flex;
  justify-content: center;
  margin: 0 auto 12px;
  width: 80px; height: 80px;
}
.profile-avatar--fallback .avatar-fallback {
  border: 3px solid var(--accent);
}

/* Friendly hint after AI generation, suggesting the user rephrase if
   the result wasn't quite what they were looking for. */
.rephrase-hint {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Wider profile-edit modal so the share section fits comfortably */
.modal-wide { max-width: 560px; }

/* Public/Private toggle at the top of the profile-share modal */
.visibility-toggle {
  display: flex;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 6px;
}
.vis-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.vis-opt.is-active {
  background: var(--panel-hover);
  color: var(--text);
  font-weight: 600;
}
.vis-opt-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4caf50;
}
.vis-opt-dot.is-private { background: #888; }
.visibility-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 16px;
  text-align: center;
}

/* Sharing controls section in the profile edit modal */
.share-section {
  margin: 18px 0 6px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: opacity 0.15s ease;
}
.share-section.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}
.share-section-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.share-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.share-toggle input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.share-hide-details {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.share-hide-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  user-select: none;
}
.share-hide-summary::-webkit-details-marker { display: none; }
.share-hide-summary::before {
  content: '▸';
  display: inline-block;
  color: var(--muted);
  transition: transform 0.15s ease;
  font-size: 10px;
  width: 10px;
}
.share-hide-details[open] > .share-hide-summary::before {
  transform: rotate(90deg);
}
.share-hide-count {
  margin-left: auto;
  background: rgba(244, 114, 182, 0.18);
  color: #fca5a5;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
}
.share-hide-hint {
  margin: 8px 0 12px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
.hide-theme-row {
  margin-bottom: 10px;
}
.hide-theme-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.hide-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.hide-chip {
  background: var(--panel-hover);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}
.hide-chip:hover { border-color: var(--accent); }
.hide-chip.is-hidden {
  background: rgba(244, 114, 182, 0.18);
  border-color: rgba(244, 114, 182, 0.45);
  color: #fca5a5;
}

/* "New since last visit" section on the home */
.news-section {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.06), rgba(96, 165, 250, 0.04));
  border: 1px solid rgba(255, 209, 102, 0.25);
  border-radius: 12px;
  padding: 18px 18px 14px;
  margin-bottom: 24px;
  position: relative;
}
.news-section .section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  margin-bottom: 14px;
}
.news-dismiss {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}
.news-dismiss:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.news-theme-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: rgba(255, 209, 102, 0.10);
  border: 1px solid rgba(255, 209, 102, 0.30);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.news-theme-banner:hover {
  background: rgba(255, 209, 102, 0.18);
  border-color: rgba(255, 209, 102, 0.45);
}
.news-theme-emoji { font-size: 22px; }
.news-theme-label { flex: 1; font-size: 14px; }
.news-theme-arrow { color: var(--muted); font-size: 20px; }

/* Friends list */
.friend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.friend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.friend-row.is-me {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.10), rgba(244, 132, 95, 0.05));
  border-color: rgba(255, 209, 102, 0.35);
}
.friend-rank {
  flex-shrink: 0;
  width: 32px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.friend-row.is-me .friend-rank { color: var(--accent); }
.friend-card, .friend-card-self {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
}
.friend-card-self { cursor: default; }
.friend-card img, .friend-card-self img,
.friend-card .avatar-fallback, .friend-card-self .avatar-fallback {
  width: 36px; height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}
.friend-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}
.friend-card:hover .friend-name { color: var(--accent); }
.friend-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.friend-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.friend-score.is-private {
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
}
.friend-diff {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.friend-diff.is-ahead { color: #a3e635; }
.friend-diff.is-behind { color: #f472b6; }
.friend-diff.is-tied { color: var(--muted); }
.friend-remove {
  flex-shrink: 0;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 18px;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
}
.friend-remove:hover { background: rgba(244, 114, 182, 0.18); color: #fca5a5; }

.profile-friend-btn { margin-top: 10px; }
.friend-toggle { font-size: 12px; }

/* Make trophy cards clickable: button reset + cursor */
.trophy {
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
}
.trophy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Trophy detail view */
.trophy-detail-hero {
  text-align: center;
  padding: 28px 16px 24px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.05), rgba(244, 132, 95, 0.04));
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 20px;
}
.trophy-detail-hero.is-unlocked {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.15), rgba(244, 132, 95, 0.10));
  border-color: rgba(255, 209, 102, 0.45);
}
.trophy-detail-icon {
  font-size: 64px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
  margin-bottom: 8px;
}
.trophy-detail-name {
  margin: 0 0 6px;
  font-size: 22px;
}
.trophy-detail-desc {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}
.trophy-detail-progress {
  font-size: 13px;
  color: var(--muted);
}
.trophy-detail-unlocked {
  display: inline-block;
  background: var(--accent);
  color: #0f1115;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
}
.trophy-detail-bar {
  display: block;
  height: 6px;
  background: rgba(255, 209, 102, 0.15);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
  max-width: 220px;
  margin-left: auto;
  margin-right: auto;
}
.trophy-detail-bar > div {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}
.trophy-intro {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
}
.trophy-add-hint {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Inline spinner shown while the activity is being translated */
.trans-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  border: 2px solid rgba(255, 209, 102, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: trans-spin 0.7s linear infinite;
}
@keyframes trans-spin { to { transform: rotate(360deg); } }

/* Public/private status dot inside the user menu */
.profile-toggle-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4caf50;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.profile-toggle-dot.is-private {
  background: #888;
}

/* Profile view */
.profile-hero {
  text-align: center;
  padding: 24px 0 16px;
}
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  display: block;
  margin: 0 auto 12px;
  object-fit: cover;
}
.profile-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}
.profile-score {
  font-size: 56px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.profile-label {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}
.profile-compare {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.08), rgba(244, 132, 95, 0.05));
  border: 1px solid rgba(255, 209, 102, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  text-align: center;
}
.profile-compare.is-ahead {
  background: linear-gradient(135deg, rgba(163, 230, 53, 0.10), rgba(76, 201, 240, 0.05));
  border-color: rgba(163, 230, 53, 0.35);
}
.profile-compare.is-behind {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.08), rgba(244, 132, 95, 0.05));
  border-color: rgba(244, 114, 182, 0.30);
}
.profile-compare-headline {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.profile-compare.is-ahead .profile-compare-headline { color: #a3e635; }
.profile-compare.is-behind .profile-compare-headline { color: #f472b6; }
.profile-compare-scores {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* Legacy single-row layout — kept for the 'sign in to compare' state */
.profile-compare-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  gap: 10px;
  flex-wrap: wrap;
}
.profile-compare-row strong {
  color: var(--accent);
  font-size: 14px;
  white-space: nowrap;
}

.profile-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.profile-tabs::-webkit-scrollbar { display: none; }
.profile-tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.profile-tab:hover { color: var(--text); }
.profile-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.profile-tab-count {
  background: rgba(255, 209, 102, 0.15);
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
}
.profile-tab.is-active .profile-tab-count {
  background: var(--accent);
  color: #0f1115;
}
.diff-intro {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 14px;
}

/* Footer */
.site-footer {
  margin-top: 64px;
  padding: 36px 24px 28px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.01) 0%, rgba(255,255,255,0.03) 100%);
}
.footer-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.footer-logo {
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.footer-brand strong {
  font-size: 15px;
  letter-spacing: 3px;
  color: var(--accent);
}
.footer-slogan {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  width: 100%;
  margin-top: 4px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  align-items: center;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text); }
.footer-meta {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  .brand h1 { font-size: 22px; }
  .brand-logo { width: 26px; height: 26px; }
  .hero-score { font-size: 48px; }
  .hero-max { font-size: 22px; }
  main { padding: 16px 12px 40px; }
  .theme-grid { grid-template-columns: 1fr; }
}
