/* ============================================================
   LOCKEDFANS APP — STYLES
   ============================================================ */

:root {
  --bg: #050505;
  --panel: #0d0d0d;
  --line: rgba(255,255,255,0.06);
  --text: #f9f9f9;
  --muted: #888;
  --gold: #d4af37;
  --gold-dim: rgba(212,175,55,0.15);
  --green: #49d17c;
  --red: #ff6b6b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app { height: 100%; position: relative; }

/* ---- SCREENS ---- */
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  padding-bottom: 100px;
  -webkit-overflow-scrolling: touch;
}
.screen.active { display: block; }
.screen::-webkit-scrollbar { display: none; }

/* ---- LOADING ---- */
.loading-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  transition: opacity 0.3s;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- INPUTS ---- */
.input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(13,13,13,0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  margin-bottom: 12px;
  transition: 0.2s;
}
.input:focus { border-color: var(--gold); }
.input::placeholder { color: #555; }
.input-hint {
  font-size: 11px;
  color: #555;
  margin: -8px 0 14px 2px;
  line-height: 1.4;
}
.dob-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.dob-select {
  flex: 1;
  padding: 14px 10px;
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23666' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
  cursor: pointer;
}
.legal-consent {
  font-size: 11px;
  color: #555;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 14px;
}
.legal-consent a {
  color: #d4af37;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- BUTTONS ---- */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: 0.2s;
}
.btn-primary:hover { background: #e6c243; }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-outline {
  padding: 14px;
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: 0.2s;
}
.btn-outline:hover { background: rgba(212,175,55,0.1); }
.btn-gold-outline {
  padding: 14px;
  background: rgba(212,175,55,0.06);
  color: var(--gold);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: 0.2s;
}
.btn-gold-outline:hover { background: rgba(212,175,55,0.12); }
.btn-gold-outline:disabled { opacity: 0.5; cursor: default; }

/* ---- AUTH ---- */
/* ---- AUTH & SPLASH ---- */
.auth-video-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.auth-video-wrap.hidden { display: none; }
.splash-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.splash-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(5,5,5,0.5) 0%,
    rgba(5,5,5,0.65) 30%,
    rgba(5,5,5,0.85) 60%,
    rgba(5,5,5,0.95) 100%
  );
}
.splash-container {
  max-width: 360px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.splash-top { text-align: center; margin-bottom: 40px; }
.splash-logo { height: 56px; width: auto; margin-bottom: 16px; }
.splash-tagline {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  font-style: italic;
}
.splash-features { margin-bottom: 40px; }
.splash-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}
.splash-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}
.splash-feature-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}
.splash-feature-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  line-height: 1.4;
}
.splash-buttons { margin-bottom: 24px; }
.splash-btn-outline {
  width: 100%;
  margin-top: 12px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(4px);
}
.splash-footer {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.5px;
}

.auth-container {
  max-width: 360px;
  margin: 0 auto;
  padding: 80px 24px 40px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.auth-logo { margin-bottom: 16px; }
.auth-logo-img { height: 48px; width: auto; }
.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--text);
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.auth-title span { color: var(--gold); }
.auth-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 36px;
}
.auth-switch {
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted);
}
.auth-switch a {
  color: var(--gold);
  cursor: pointer;
  text-decoration: none;
}
.auth-error {
  margin-top: 16px;
  font-size: 13px;
  color: var(--red);
  min-height: 20px;
}
.verify-intro {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.5;
}
.verify-success { color: var(--green); }
.verify-status {
  margin-top: 12px;
  font-size: 13px;
  min-height: 20px;
  text-align: center;
}
.verify-status.error { color: var(--red); }
.verify-status.success { color: var(--green); }

/* ---- HEADER ---- */
.app-header {
  padding: 16px 24px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-logo {
  display: flex;
  align-items: center;
}
.app-logo span { color: var(--gold); }
.header-logo-img { height: 28px; width: auto; }
.app-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid rgba(212,175,55,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--gold);
  cursor: pointer;
}
.header-title {
  font-size: 14px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.back-btn { cursor: pointer; }

/* ---- COMMON ---- */
.section-pad { padding: 0 24px; }
.gold { color: var(--gold); }
.green { color: var(--green); }

/* ---- STATS GRID ---- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 0 24px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}
.stat-val { font-size: 22px; font-weight: 600; margin-bottom: 2px; }
.stat-lbl { font-size: 9px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 40px 32px; }
.empty-lock {
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.15);
  display: flex; align-items: center; justify-content: center;
}
.empty-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px; color: var(--text);
  margin-bottom: 8px;
}
.empty-sub { font-size: 13px; color: #666; line-height: 1.6; margin-bottom: 28px; }

/* ---- START SESSION ---- */
.start-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px; color: var(--text);
  text-align: center; margin-bottom: 8px;
}
.start-sub {
  font-size: 13px; color: #666;
  text-align: center; margin-bottom: 32px;
}
.duration-picker {
  display: flex; gap: 12px;
  justify-content: center; margin-bottom: 32px;
}
.dur-col { text-align: center; }
.dur-col label {
  font-size: 10px; color: #666;
  text-transform: uppercase; letter-spacing: 1px;
  display: block; margin-bottom: 6px;
}
.dur-input {
  width: 90px; height: 72px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: 32px; font-weight: 300;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  outline: none;
}
.dur-input:focus { border-color: var(--gold); }

.option-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.option-label {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 10px;
}
.freq-options { display: flex; gap: 8px; }
.freq-btn {
  flex: 1; padding: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted); font-size: 13px;
  font-weight: 500; text-align: center;
  cursor: pointer; transition: 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.freq-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212,175,55,0.08);
}
.lock-warning {
  font-size: 12px; color: #555;
  text-align: center; margin-top: 12px;
  line-height: 1.5;
}

/* ---- SOCIAL LINKS ---- */
.edit-social-section {
  padding: 0 24px 12px;
}
.social-input-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.social-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.social-input-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: 18px;
  background-position: center;
  background-repeat: no-repeat;
}
.social-icon-onlyfans { background-color: #00AFF0; border-color: #00AFF0 !important; background-image: url("data:image/svg+xml,%3Csvg viewBox='2 2 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='11' fill='%2300AFF0'/%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%23fff' stroke-width='1.2'/%3E%3Crect x='8.5' y='12' width='7' height='5.5' rx='1.2' fill='%23fff'/%3E%3Cpath d='M10 12V10a2 2 0 014 0v2' fill='none' stroke='%23fff' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-size: 22px; }
.social-icon-twitter { background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E"); }
.social-icon-reddit { background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%23FF4500' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='10' stroke='%23FF4500' fill='none' stroke-width='2'/%3E%3Ccircle cx='9' cy='11' r='1.5' fill='%23FF4500'/%3E%3Ccircle cx='15' cy='11' r='1.5' fill='%23FF4500'/%3E%3Cpath d='M9 15c1.5 1 4.5 1 6 0' stroke='%23FF4500' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); }
.social-icon-tiktok { background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 3h4v12a4 4 0 11-3-3.87V8.13A7 7 0 006 15a6 6 0 006 6 6 6 0 006-6V7a7.5 7.5 0 004 1.5V5.5A4.5 4.5 0 0118 3h-2' fill='none' stroke='%23fff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.social-icon-instagram { background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23E1306C' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='2' y='2' width='20' height='20' rx='5'/%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Ccircle cx='17.5' cy='6.5' r='1.5' fill='%23E1306C' stroke='none'/%3E%3C/svg%3E"); }
.social-icon-fansly { background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='%2300BFFF' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z' stroke='%2300BFFF' fill='none' stroke-width='2'/%3E%3C/svg%3E"); }
.social-icon-snapchat { background-image: url("data:image/svg+xml,%3Csvg viewBox='3.3 0.5 14 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 2c-2.5 0-4.2 1.8-4.2 4.6v1.4c-.7.2-1.3.5-1.3 1s.6.8 1.3.9c-.1.9-.5 1.7-1.2 2.2.5.2 1.1.3 1.7.5.1.3.2.6.3.8.4 0 .8-.2 1.3-.2.6 0 1.1.4 1.7.7.5.2.9.4 1.3.4s.8-.2 1.3-.4c.6-.3 1.1-.7 1.7-.7.5 0 .9.2 1.3.2.1-.2.2-.5.3-.8.6-.2 1.2-.3 1.7-.5-.7-.5-1.1-1.3-1.2-2.2.7-.1 1.3-.4 1.3-.9s-.6-.8-1.3-1V6.6C14.2 3.8 12.5 2 10 2z' fill='%23FFFC00'/%3E%3Ccircle cx='8.5' cy='8.8' r='1' fill='%23333'/%3E%3Ccircle cx='11.5' cy='8.8' r='1' fill='%23333'/%3E%3C/svg%3E"); background-size: 22px; background-position: center; border-color: rgba(255,252,0,0.3) !important; }
.social-icon-link { background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71'/%3E%3C/svg%3E"); }

/* ---- FEED ---- */
.feed-section {
  padding: 0 24px;
  margin-top: 20px;
  margin-bottom: 20px;
}
.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.feed-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.feed-count {
  font-size: 12px;
  color: var(--muted);
}
.feed-empty {
  text-align: center;
  padding: 24px 0;
}
.feed-empty p {
  font-size: 13px;
  color: #555;
}

/* Feed post card */
.feed-post {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
}
.feed-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.feed-post-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.2);
  overflow: hidden;
}
.feed-post-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feed-post-user {
  flex: 1;
  min-width: 0;
}
.feed-post-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.feed-post-time {
  font-size: 11px;
  color: #555;
}
.feed-post-img {
  width: 100%;
  display: block;
}
.feed-img-blur-wrap {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.feed-img-blur-wrap img {
  filter: blur(20px);
  transform: scale(1.1);
  transition: filter 0.4s ease, transform 0.4s ease;
}
.feed-img-blur-wrap.revealed img {
  filter: none;
  transform: scale(1);
}
.feed-blur-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0,0,0,0.3);
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.feed-blur-label span {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.feed-img-blur-wrap.revealed .feed-blur-label {
  opacity: 0;
}
.feed-post-caption {
  padding: 10px 14px 4px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}
.feed-post-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px 12px;
}
.feed-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  border-radius: 8px;
  transition: 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.feed-action-btn:active {
  transform: scale(0.95);
}
.feed-action-btn.liked {
  color: #ff6b8a;
}
.feed-action-btn.liked svg {
  fill: #ff6b8a;
  stroke: #ff6b8a;
}
.feed-post-delete {
  margin-left: auto;
  padding: 6px 8px;
  border: none;
  background: none;
  color: #555;
  cursor: pointer;
  border-radius: 8px;
  font-size: 11px;
}
.feed-view-all {
  width: 100%;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: 0.2s;
  text-align: center;
  margin-bottom: 8px;
}
.feed-view-all:hover {
  border-color: rgba(212,175,55,0.3);
  background: rgba(212,175,55,0.04);
}

/* ---- LOCK-IN MODES ---- */
.modes-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 24px;
}
.mode-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 18px;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mode-card:active {
  transform: scale(0.985);
}
.mode-card:hover,
.mode-card:focus {
  border-color: rgba(212,175,55,0.35);
  background: rgba(212,175,55,0.03);
}
.mode-icon-wrap {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 14px;
  background: rgba(212,175,55,0.06);
  border: 1px solid rgba(212,175,55,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mode-content {
  flex: 1;
  min-width: 0;
}
.mode-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.mode-desc {
  font-size: 12px;
  color: #666;
  line-height: 1.45;
}
.mode-arrow {
  opacity: 0.3;
  flex-shrink: 0;
}

/* ---- MYSTERY MODE ---- */
.mystery-hero {
  text-align: center;
  padding: 32px 32px 28px;
}
.mystery-glyph {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mystery-glyph-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(212,175,55,0.15);
  animation: mystery-pulse 3s ease-in-out infinite;
}
@keyframes mystery-pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.12); opacity: 0.08; }
}
.mystery-explainer {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  max-width: 280px;
  margin: 12px auto 0;
}
.mystery-explainer strong {
  color: var(--gold);
  font-weight: 600;
}

/* ---- CHALLENGES ---- */
.challenges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 24px;
}
.challenge-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 14px 16px;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.challenge-card:active {
  transform: scale(0.97);
}
.challenge-card.selected {
  border-color: rgba(212,175,55,0.5);
  background: rgba(212,175,55,0.04);
}
.challenge-card.selected::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.challenge-emoji {
  font-size: 30px;
  margin-bottom: 10px;
  display: block;
}
.challenge-name {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.challenge-duration {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.challenge-desc {
  font-size: 10px;
  color: #555;
  line-height: 1.45;
  font-style: italic;
}
.challenge-seasonal {
  border-color: rgba(212,175,55,0.15);
}
.challenge-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #d4af37;
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.2);
  padding: 2px 7px;
  border-radius: 6px;
}

/* challenge confirm panel */
.challenge-confirm {
  display: none;
  padding-top: 8px;
}
.challenge-confirm.visible {
  display: block;
  animation: confirmSlide 0.3s ease-out;
}
@keyframes confirmSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- ACTIVE SESSION ---- */
.session-hero { text-align: center; padding: 24px 24px 20px; }
.session-status { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 20px; }
.s-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(73,209,124,0.5);
}
.s-text {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 2px; color: var(--green); font-weight: 600;
}
/* ---- CIRCULAR PROGRESS RING ---- */
.ring-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 12px;
}
.progress-ring {
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
}
.ring-fill {
  transition: stroke-dashoffset 1s ease;
}
.ring-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.timer-display {
  font-size: 32px; font-weight: 300;
  color: var(--text); letter-spacing: 1px; margin-bottom: 2px;
}
.timer-sub {
  font-size: 8px; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 14px; font-weight: 500;
}
.ring-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ring-stat { text-align: center; }
.ring-stat-val { display: block; font-size: 18px; font-weight: 600; }
.ring-stat-lbl { display: block; font-size: 7px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 1px; }
.ring-stat-divider { width: 1px; height: 28px; background: rgba(255,255,255,0.08); }

.progress-labels {
  display: flex; justify-content: space-between;
  padding: 0 60px; margin-bottom: 20px;
}
.progress-labels span { font-size: 10px; color: #555; }

/* ---- LEADERBOARD ---- */
.leaderboard-item {
  margin: 0 24px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.leaderboard-item:active { background: rgba(255,255,255,0.03); }
.leaderboard-item--top3 { border-color: rgba(212,175,55,0.15); }
.leaderboard-item--self { background: rgba(212,175,55,0.04); border-color: rgba(212,175,55,0.15); }
.lb-rank {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}
.lb-rank--1 { background: rgba(212,175,55,0.15); color: #d4af37; }
.lb-rank--2 { background: rgba(192,192,192,0.12); color: #c0c0c0; }
.lb-rank--3 { background: rgba(205,127,50,0.12); color: #cd7f32; }
.lb-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: var(--gold);
  flex-shrink: 0;
  overflow: hidden;
}
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-handle { font-size: 11px; color: #666; }
.lb-stat { text-align: right; flex-shrink: 0; }
.lb-stat-val { font-size: 16px; font-weight: 600; color: var(--gold); }
.lb-stat-lbl { font-size: 8px; color: #666; text-transform: uppercase; letter-spacing: 0.3px; }

.lb-msg-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #d4af37;
  cursor: pointer;
}

.leaderboard-self-row {
  position: sticky;
  bottom: 70px;
  margin: 12px 24px 0;
  background: rgba(212,175,55,0.06);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- TIP SETTINGS ---- */
.edit-tip-section {
  margin: 0 24px 12px;
}
.tip-platform-options {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.tip-platform-btn {
  flex: 1;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.tip-platform-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212,175,55,0.08);
}

/* ---- CHECK-IN ---- */
.checkin-card {
  margin: 0 24px 16px;
  background: var(--panel);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 14px;
  padding: 18px;
}
.checkin-top {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 14px;
}
.checkin-title {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); font-weight: 500;
}
.checkin-due { font-size: 12px; color: var(--gold); font-weight: 600; }
.checkin-btn {
  width: 100%; padding: 14px;
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 10px;
  color: var(--gold); font-size: 14px;
  font-weight: 600; text-align: center;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: 0.2s;
}
.checkin-btn:hover { background: rgba(212,175,55,0.2); }
.checkin-btn--urgent {
  background: rgba(255,107,107,0.15) !important;
  border-color: rgba(255,107,107,0.3) !important;
  color: #ff6b6b !important;
  animation: pulseUrgent 1.5s infinite;
}
@keyframes pulseUrgent {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,107,0.3); }
  50% { box-shadow: 0 0 16px 4px rgba(255,107,107,0.15); }
}
.overdue-warning {
  font-size: 11px; color: rgba(255,107,107,0.7); line-height: 1.4;
  margin-bottom: 10px; text-align: center;
}
.checkin-card--overdue {
  border-color: rgba(255,107,107,0.2) !important;
  background: rgba(255,107,107,0.03) !important;
}
.missed-checkin-banner {
  margin: 0 24px 16px; padding: 16px;
  background: rgba(255,107,107,0.05);
  border: 1px solid rgba(255,107,107,0.15);
  border-radius: 12px;
  display: flex; gap: 12px; align-items: flex-start;
}
.missed-icon { flex-shrink: 0; padding-top: 2px; }
.missed-title { font-size: 14px; font-weight: 600; color: #ff6b6b; margin-bottom: 4px; }
.missed-desc { font-size: 12px; color: rgba(255,107,107,0.6); line-height: 1.5; }
.freq-warning {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 12px; padding: 10px 12px;
  background: rgba(255,107,107,0.04);
  border: 1px solid rgba(255,107,107,0.1);
  border-radius: 8px;
}
.freq-warning span { font-size: 11px; color: rgba(255,107,107,0.6); line-height: 1.4; }
.freq-warning svg { flex-shrink: 0; margin-top: 1px; }
.card-format-toggle {
  display: flex; gap: 8px; margin-top: 14px;
}
.card-format-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px; border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: #666; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.card-format-btn.active {
  background: rgba(212,175,55,0.08);
  border-color: rgba(212,175,55,0.25);
  color: #d4af37;
}

.checkin-screen-content { text-align: center; padding: 40px 24px; }

.share-btn-wrap { padding: 0 24px; margin-bottom: 16px; }
.share-btn {
  width: 100%; padding: 14px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted); font-size: 13px;
  font-weight: 500; text-align: center;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  display: flex; align-items: center;
  justify-content: center; gap: 8px;
}
.end-session-link { text-align: center; padding: 12px; }
.end-session-link a {
  font-size: 12px; color: #444;
  text-decoration: none; cursor: pointer;
}

/* ---- CAGE CHECK CARD ---- */
.card-preview {
  position: relative; width: 100%;
  aspect-ratio: 9/16;
  background: #0a0a0a;
  overflow: hidden;
}
.card-preview--square { aspect-ratio: 4/5; }

/* Card screen layout */
.card-screen-body {
  flex: 1;
  overflow: hidden;
  padding: 4px 0;
}
.card-preview-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-preview-container .card-preview {
  height: 100%;
  width: auto;
  max-width: 100%;
  border-radius: 0;
}
#screen-card.active {
  display: flex !important;
  flex-direction: column;
  padding-bottom: 0;
  overflow: hidden;
}
.card-controls {
  padding: 10px 16px;
  padding-bottom: 80px;
  background: var(--bg);
  flex-shrink: 0;
}
.card-photo {
  position: absolute; inset: 0;
  background: #111;
  overflow: hidden;
}
.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}
.card-photo-placeholder { text-align: center; color: #444; cursor: pointer; }
.card-photo-placeholder svg { margin-bottom: 8px; opacity: 0.4; }
.card-photo-placeholder p { font-size: 12px; }

/* Reposition hint */
.card-reposition-hint {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  padding: 8px 16px; border-radius: 20px;
  font-size: 11px; color: rgba(255,255,255,0.7);
  display: flex; align-items: center; gap: 6px;
  pointer-events: none; z-index: 5;
  opacity: 1; transition: opacity 0.5s;
}
.card-reposition-hint--hidden { opacity: 0; }

.card-watermark {
  position: absolute; top: 16px; right: 16px;
  display: flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);
  padding: 5px 10px 5px 8px; border-radius: 20px; z-index: 5;
}
.card-watermark span { font-size: 11px; color: #fff; font-weight: 500; letter-spacing: 0.3px; }

.card-gradient {
  position: absolute; bottom: 0; left: 0; right: 0; height: 55%;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.5) 45%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}
.card-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px 22px 22px; pointer-events: none;
}
.card-status-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.card-stats-row { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.card-timer { font-size: 30px; font-weight: 300; color: #fff; letter-spacing: 1px; line-height: 1; }
.card-timer-units { font-size: 7px; color: rgba(255,255,255,0.3); letter-spacing: 2px; margin-top: 2px; font-weight: 500; }
.card-timer-label { font-size: 9px; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 2px; margin-top: 6px; font-weight: 500; }
.card-streak { text-align: right; }
.card-streak-val { font-size: 24px; font-weight: 600; color: var(--gold); line-height: 1; }
.card-streak-label { font-size: 9px; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 2px; margin-top: 4px; font-weight: 500; }
.card-progress { width: 100%; height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.card-progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #d4af37, #e6c243); border-radius: 2px; }

/* ---- HISTORY ---- */
.history-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px; color: var(--text);
  padding: 16px 24px;
}
.history-item {
  margin: 0 24px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex; align-items: center;
  justify-content: space-between;
}
.hi-left { flex: 1; }
.hi-duration { font-size: 16px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.hi-date { font-size: 11px; color: #666; }
.hi-right { text-align: right; }
.hi-status {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.5px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  display: inline-block; margin-bottom: 4px;
}
.hi-status.completed { background: rgba(73,209,124,0.1); color: var(--green); }
.hi-status.early { background: rgba(255,107,107,0.1); color: var(--red); }
.hi-checkins { font-size: 10px; color: #555; }

/* ---- PROFILE ---- */
.profile-header { text-align: center; padding: 24px 24px 20px; }
.profile-avatar-wrap {
  position: relative;
  width: 80px; height: 80px;
  margin: 0 auto 12px;
  cursor: pointer;
}
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(212,175,55,0.12);
  border: 2px solid rgba(212,175,55,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 600; color: var(--gold);
}
.profile-avatar-img {
  position: absolute; inset: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(212,175,55,0.3);
}
.avatar-edit-badge {
  position: absolute;
  bottom: 0; right: 0;
  width: 28px; height: 28px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.profile-name {
  font-family: 'Playfair Display', serif;
  font-size: 22px; color: var(--text); margin-bottom: 4px;
}
.profile-handle { font-size: 13px; color: #666; margin-bottom: 8px; }

/* ---- Rank Cards ---- */
.rank-cards {
  display: flex;
  gap: 8px;
  padding: 0 24px;
  margin-bottom: 16px;
}
.rank-card {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}
.rank-card-icon { font-size: 16px; margin-bottom: 4px; }
.rank-card-num { font-size: 20px; font-weight: 700; color: var(--gold); margin-bottom: 2px; }
.rank-card-lbl { font-size: 8px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }

/* ---- Leaderboard Tabs ---- */
.lb-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.lb-tabs::-webkit-scrollbar { display: none; }
.lb-tab {
  flex: 0 0 auto;
  padding: 8px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}
.lb-tab.active {
  background: rgba(212,175,55,0.1);
  border-color: rgba(212,175,55,0.3);
  color: var(--gold);
}
.profile-url {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 20px;
  font-size: 11px; color: var(--gold);
}

.profile-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 1px; background: var(--line);
  border-radius: 12px; overflow: hidden;
  margin: 0 24px 24px;
}
.ps-item { background: var(--panel); padding: 16px 8px; text-align: center; }
.ps-val { font-size: 24px; font-weight: 600; color: var(--gold); margin-bottom: 2px; }
.ps-lbl { font-size: 9px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }

.profile-link {
  margin: 0 24px 12px;
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text); font-size: 14px;
  cursor: pointer;
}
.profile-link .arrow { color: #444; font-size: 16px; }

.edit-name-row {
  margin: 0 24px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ---- Share Actions ---- */
.share-actions {
  display: flex;
  gap: 10px;
  padding: 0 24px;
  margin-bottom: 12px;
}
.share-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 12px;
  background: rgba(212,175,55,0.06);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 10px;
  color: #d4af37;
  font-size: 12px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: 0.2s;
}
.share-action-btn:hover {
  background: rgba(212,175,55,0.12);
}
.share-copied {
  text-align: center;
  font-size: 12px;
  color: var(--green);
  padding: 8px 24px;
  animation: fadeInOut 2s ease forwards;
}
@keyframes fadeInOut {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; display: none; }
}

/* ---- NAV BAR ---- */
.nav-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex; align-items: center;
  justify-content: space-around;
  padding: 0 20px;
  z-index: 50;
}
.nav-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  cursor: pointer; opacity: 0.4; transition: 0.2s;
}
.nav-item.active { opacity: 1; }
.nav-unread-dot {
  position: absolute;
  top: 2px; right: 50%;
  transform: translateX(12px);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #d4af37;
  box-shadow: 0 0 6px rgba(212,175,55,0.5);
}
.nav-item svg { width: 22px; height: 22px; }
.nav-label { font-size: 9px; color: var(--muted); letter-spacing: 0.3px; }
.nav-item.active .nav-label { color: var(--gold); }

/* ---- SAFE AREA (iOS) ---- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .nav-bar { padding-bottom: env(safe-area-inset-bottom); height: calc(64px + env(safe-area-inset-bottom)); }
  .screen { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ---- INBOX ---- */
.inbox-item {
  margin: 0 24px 8px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.inbox-item:active { background: rgba(255,255,255,0.03); }
.inbox-item--unread { border-color: rgba(212,175,55,0.25); background: rgba(212,175,55,0.04); }
.inbox-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(212,175,55,0.1); border: 1px solid rgba(212,175,55,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; color: #d4af37;
  flex-shrink: 0; overflow: hidden;
}
.inbox-avatar img { width: 100%; height: 100%; object-fit: cover; }
.inbox-info { flex: 1; min-width: 0; }
.inbox-name { font-size: 14px; font-weight: 500; color: #f9f9f9; }
.inbox-item--unread .inbox-name { font-weight: 700; color: #fff; }
.inbox-preview { font-size: 12px; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.inbox-item--unread .inbox-preview { color: #bbb; font-weight: 500; }
.inbox-time { font-size: 10px; color: #444; flex-shrink: 0; }
.inbox-item--unread .inbox-time { color: #d4af37; }
.inbox-unread-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #d4af37; flex-shrink: 0;
  box-shadow: 0 0 6px rgba(212,175,55,0.4);
}

/* ---- CHAT ---- */
#screen-chat.active {
  display: flex !important;
  flex-direction: column;
  padding-bottom: 0;
  overflow: hidden;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 12px 16px;
  display: flex; flex-direction: column; gap: 6px;
  -webkit-overflow-scrolling: touch;
}
.chat-messages::-webkit-scrollbar { display: none; }
.chat-msg {
  max-width: 80%; padding: 10px 14px;
  border-radius: 16px; font-size: 14px; line-height: 1.5;
  word-wrap: break-word;
}
.chat-msg--sent {
  align-self: flex-end;
  background: rgba(212,175,55,0.12);
  border: 1px solid rgba(212,175,55,0.15);
  color: #f0e6c8;
  border-bottom-right-radius: 4px;
}
.chat-msg--received {
  align-self: flex-start;
  background: #0d0d0d;
  border: 1px solid rgba(255,255,255,0.06);
  color: #ccc;
  border-bottom-left-radius: 4px;
}
.chat-msg-time {
  font-size: 9px; color: #444; margin-top: 4px;
}
.chat-msg--sent .chat-msg-time { text-align: right; }
.chat-input-bar {
  display: flex; gap: 8px;
  padding: 12px 16px;
  padding-bottom: 80px;
  background: var(--bg);
  border-top: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}
.chat-input {
  flex: 1; padding: 12px 16px;
  background: #0d0d0d;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 24px;
  color: #f9f9f9; font-size: 16px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
}
.chat-input:focus { border-color: rgba(212,175,55,0.3); }
.chat-input::placeholder { color: #444; }
.chat-send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #d4af37;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #000;
}

/* ---- ACHIEVEMENTS ---- */
.ach-summary {
  text-align: center;
  padding: 20px 24px 24px;
}
.ach-summary-ring {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 10px;
}
.ach-summary-ring svg { width: 100%; height: 100%; }
.ach-summary-count {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}
.ach-summary-slash { color: #444; font-weight: 400; margin: 0 1px; font-size: 14px; }
.ach-summary-text { font-size: 12px; color: var(--muted); letter-spacing: 0.5px; }

.ach-category {
  padding: 0 24px;
  margin-bottom: 24px;
}
.ach-category-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 12px;
  padding-left: 4px;
}
.ach-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ach-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 14px;
  position: relative;
  overflow: hidden;
  transition: 0.3s;
}
.ach-item--locked {
  opacity: 0.45;
}
.ach-item--unlocked {
  border-color: rgba(212,175,55,0.2);
  background: rgba(212,175,55,0.03);
}
.ach-item-icon {
  font-size: 28px;
  margin-bottom: 8px;
}
.ach-item--locked .ach-item-icon {
  filter: grayscale(1);
}
.ach-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.ach-item-desc {
  font-size: 10px;
  color: #666;
  line-height: 1.4;
  margin-bottom: 8px;
}
.ach-item-progress {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.ach-item-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4af37, #e6c243);
  border-radius: 2px;
  transition: width 0.5s;
}
.ach-item-progress-text {
  font-size: 9px;
  color: #555;
  margin-top: 4px;
  text-align: right;
}
.ach-item--unlocked .ach-item-progress-fill {
  width: 100% !important;
}
.ach-item-unlocked-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  color: var(--green);
}
.ach-item-date {
  font-size: 8px;
  color: #555;
  margin-top: 4px;
}

/* Achievement badge on profile link */
.profile-link--achievements {
  border-color: rgba(212,175,55,0.12);
}
.ach-badge {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  background: rgba(212,175,55,0.08);
  padding: 3px 10px;
  border-radius: 12px;
}

/* Achievement toast */
.ach-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13,13,13,0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 300;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 20px rgba(212,175,55,0.1);
  animation: toastIn 0.4s ease, toastOut 0.4s ease 3s forwards;
}
.ach-toast-icon { font-size: 28px; }
.ach-toast-title { font-size: 10px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.ach-toast-name { font-size: 15px; color: var(--text); font-weight: 600; margin-top: 2px; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); display: none; }
}

/* ---- NOTIFICATION PROMPT ---- */
.notification-prompt {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}
.notif-prompt-card {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 32px 24px 24px;
  text-align: center;
  max-width: 320px;
  width: 100%;
}
.notif-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.notif-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px;
}
.notif-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 24px;
}
.notif-dismiss {
  background: none;
  border: none;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  padding: 8px;
}

/* ---- ADD TO HOME SCREEN BANNER ---- */
.a2hs-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(13,13,13,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(212,175,55,0.2);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 150;
}
.a2hs-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  line-height: 1.4;
}
.a2hs-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.a2hs-link {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.a2hs-close {
  color: #555;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ---- ADD TO HOME SCREEN TUTORIAL ---- */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  overflow-y: auto;
}
.tutorial-card {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 28px 24px 24px;
  max-width: 340px;
  width: 100%;
  position: relative;
}
.tutorial-header {
  text-align: center;
  margin-bottom: 8px;
}
.tutorial-section {
  margin-bottom: 20px;
}
.tutorial-step-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 12px;
}
.tutorial-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
}
.tutorial-step strong { color: var(--text); }
.tutorial-step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(212,175,55,0.12);
  border: 1px solid rgba(212,175,55,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  flex-shrink: 0;
}
.tutorial-icon-inline {
  display: inline-flex;
  vertical-align: middle;
}

/* ---- ADMIN BROADCAST ---- */
.admin-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
}
.admin-user-item:last-child { border-bottom: none; }
.admin-user-check {
  width: 18px;
  height: 18px;
  accent-color: #d4af37;
  cursor: pointer;
  flex-shrink: 0;
}
.admin-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  overflow: hidden;
  flex-shrink: 0;
}
.admin-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-user-name { font-size: 13px; }
.admin-user-handle { font-size: 11px; color: #666; }
