:root {
  --blue: #5BC4E8;
  --blue-mid: #2A9DC5;
  --blue-deep: #1A7A9E;
  --red: #E63946;
  --red-deep: #C22831;
  --bg: #EDF6FB;
  --surface: #FFFFFF;
  --ink: #1C2B3A;
  --ink-soft: #5A7285;
  --border: #C8E4F2;
  --radius: 14px;
  --shadow-sm: 0 2px 10px rgba(26, 122, 158, 0.1);
  --shadow-md: 0 6px 24px rgba(26, 122, 158, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
}

h1, h2 { font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; margin: 0 0 8px; }

/* === LOGO SVG === */
.logo-svg { display: block; }

/* === LANDING PAGE === */
body.landing { background: #0d1b2a; color: white; overflow-x: hidden; }

.land-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 27, 42, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(91, 196, 232, 0.15);
}
.land-nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 16px 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.land-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-weight: 900; font-size: 1.3rem; color: white;
  letter-spacing: -0.03em;
}
.land-nav-btns { display: flex; gap: 10px; align-items: center; justify-self: end; }
.land-nav-ghost {
  text-decoration: none; color: rgba(255,255,255,0.7);
  padding: 8px 18px; border-radius: 8px; font-weight: 600;
  border: 1.5px solid rgba(255,255,255,0.2);
  transition: border-color 0.15s, color 0.15s;
}
.land-nav-ghost:hover { color: white; border-color: rgba(255,255,255,0.5); }
.land-nav-cta {
  text-decoration: none; background: var(--red); color: white;
  padding: 8px 20px; border-radius: 8px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(230,57,70,0.4);
  transition: background 0.15s, transform 0.1s;
}
.land-nav-cta:hover { background: var(--red-deep); transform: translateY(-1px); }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  min-height: 86vh;
  display: flex; align-items: center;
  padding: 80px 28px;
  background: radial-gradient(ellipse at 60% 40%, rgba(91,196,232,0.12) 0%, transparent 70%),
              linear-gradient(160deg, #0d1b2a 0%, #0f2a40 50%, #0d1b2a 100%);
}
.hero-inner {
  max-width: 680px; margin: 0 auto;
  text-align: center; position: relative; z-index: 1;
}
.hero-glow {
  position: absolute; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(91,196,232,0.08) 0%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  pointer-events: none;
}
.hero-pill {
  display: inline-block;
  background: rgba(91,196,232,0.12);
  border: 1px solid rgba(91,196,232,0.3);
  color: var(--blue); padding: 6px 16px;
  border-radius: 20px; font-size: 0.9rem; font-weight: 600;
  margin-bottom: 28px;
}
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 900; line-height: 1.1;
  letter-spacing: -0.04em; margin: 0 0 20px; color: white;
}
.hero-accent {
  background: linear-gradient(135deg, var(--blue), #a8e6f5);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.1rem; color: rgba(255,255,255,0.65);
  line-height: 1.7; max-width: 540px; margin: 0 auto 36px;
}
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-btn-primary {
  text-decoration: none; background: var(--red); color: white;
  padding: 15px 32px; border-radius: 12px; font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 6px 20px rgba(230,57,70,0.45);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.hero-btn-primary:hover { background: var(--red-deep); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(230,57,70,0.5); }
.hero-btn-ghost {
  text-decoration: none; color: rgba(255,255,255,0.8);
  padding: 15px 28px; border-radius: 12px; font-weight: 700; font-size: 1.05rem;
  border: 1.5px solid rgba(255,255,255,0.25);
  transition: border-color 0.15s, color 0.15s;
}
.hero-btn-ghost:hover { color: white; border-color: rgba(255,255,255,0.6); }
.hero-features {
  display: flex; gap: 24px; justify-content: center; flex-wrap: wrap;
  margin-top: 28px;
}
.hero-feature {
  font-size: 0.875rem; font-weight: 600;
  color: rgba(255,255,255,0.5);
  display: flex; align-items: center; gap: 6px;
}

/* Steps */
.steps-section {
  background: #f0f8fc; padding: 90px 28px;
}
.steps-inner { max-width: 1000px; margin: 0 auto; text-align: center; }
.steps-label {
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--blue-mid); margin-bottom: 10px;
}
.steps-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 900; color: var(--ink);
  letter-spacing: -0.03em; margin: 0 0 50px;
}
.steps-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.step-card {
  background: white; border: 1.5px solid var(--border);
  border-radius: 16px; padding: 32px 24px;
  box-shadow: var(--shadow-sm); text-align: left;
  position: relative; transition: box-shadow 0.2s, transform 0.2s;
}
.step-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.step-num {
  position: absolute; top: 20px; right: 20px;
  font-size: 0.8rem; font-weight: 800;
  color: var(--border); letter-spacing: 0.02em;
}
.step-icon { font-size: 2.2rem; margin-bottom: 14px; }
.step-card h3 { margin: 0 0 10px; font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.step-card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.6; }

/* Public stats */
.pub-stats-section {
  background: linear-gradient(135deg, #0f2a40, #1A7A9E);
  padding: 70px 28px;
}
.pub-stats-inner {
  max-width: 600px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 0;
}
.pub-stat { text-align: center; flex: 1; }
.pub-stat-value {
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  font-weight: 900; color: white; line-height: 1;
  letter-spacing: -0.04em; margin-bottom: 8px;
}
.pub-stat-label { font-size: 0.95rem; color: rgba(255,255,255,0.6); font-weight: 600; }
.pub-stat-divider {
  width: 1px; height: 80px;
  background: rgba(255,255,255,0.2); margin: 0 40px;
  flex-shrink: 0;
}

/* CTA section */
.land-cta-section {
  background: #f0f8fc; padding: 90px 28px; text-align: center;
}
.land-cta-inner { max-width: 540px; margin: 0 auto; }
.land-cta-inner h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 900; color: var(--ink);
  letter-spacing: -0.03em; margin: 0 0 12px;
}
.land-cta-inner p { color: var(--ink-soft); font-size: 1.05rem; margin: 0 0 32px; }

/* Footer */
.land-footer {
  background: #0d1b2a;
  padding: 24px 28px;
  color: rgba(255,255,255,0.35); font-size: 0.875rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}

/* === COOKIE BANNER === */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: #0d1b2a;
  border-top: 1px solid rgba(91,196,232,0.2);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
  animation: cb-slide-up 0.35s ease;
}
#cookie-banner.cb-hidden {
  animation: cb-slide-down 0.35s ease forwards;
}
@keyframes cb-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes cb-slide-down {
  from { transform: translateY(0);    opacity: 1; }
  to   { transform: translateY(100%); opacity: 0; }
}
.cb-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 18px 28px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.cb-text { flex: 1; min-width: 200px; }
.cb-text strong {
  display: block; color: white; font-size: 0.95rem; margin-bottom: 4px;
}
.cb-text p {
  margin: 0; color: rgba(255,255,255,0.55); font-size: 0.85rem; line-height: 1.5;
}
.cb-text a { color: var(--blue); text-decoration: none; }
.cb-text a:hover { text-decoration: underline; }
.cb-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cb-deny {
  padding: 9px 20px; border-radius: 8px; font-weight: 600; font-size: 0.9rem;
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
  background: transparent; color: rgba(255,255,255,0.6);
  border: 1.5px solid rgba(255,255,255,0.2);
}
.cb-deny:hover { color: white; border-color: rgba(255,255,255,0.5); }
.cb-accept {
  padding: 9px 22px; border-radius: 8px; font-weight: 700; font-size: 0.9rem;
  cursor: pointer; transition: background 0.15s, transform 0.1s;
  background: var(--blue-mid); color: white; border: none;
  box-shadow: 0 4px 14px rgba(42,157,197,0.4);
}
.cb-accept:hover { background: var(--blue-deep); transform: translateY(-1px); }

/* Cookie policy page */
.cookie-table-wrap { border-radius: 10px; overflow: hidden; border: 1.5px solid var(--border); }
.cookie-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.cookie-table th {
  background: var(--bg); padding: 12px 16px; text-align: left;
  font-weight: 700; color: var(--ink); border-bottom: 1.5px solid var(--border);
}
.cookie-table td {
  padding: 12px 16px; color: var(--ink-soft); vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.cookie-table tr:last-child td { border-bottom: none; }
.cookie-table code {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px; font-size: 0.85em; color: var(--blue-deep);
}
.cookie-reopen-btn {
  display: inline-flex; align-items: center;
  padding: 10px 22px; border-radius: 9px; font-weight: 700; font-size: 0.9rem;
  background: var(--blue-mid); color: white; border: none; cursor: pointer;
  margin-bottom: 40px; transition: background 0.15s, transform 0.1s;
  box-shadow: 0 4px 14px rgba(42,157,197,0.3);
}
.cookie-reopen-btn:hover { background: var(--blue-deep); transform: translateY(-1px); }

/* Login page back link */
.auth-back {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; margin-bottom: 24px;
  width: fit-content;
}
.auth-back-name {
  font-weight: 900; font-size: 1.2rem;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; letter-spacing: -0.03em;
}

/* Nav links (Over Zuipr etc) */
.land-nav-links { display: flex; gap: 4px; align-items: center; }
.land-nav-link {
  color: rgba(255,255,255,0.65); text-decoration: none;
  padding: 7px 14px; border-radius: 7px; font-weight: 600; font-size: 0.95rem;
  transition: color 0.15s, background 0.15s;
}
.land-nav-link:hover, .land-nav-link.active { color: white; background: rgba(255,255,255,0.1); }

/* === LOGIN SPLIT PAGE === */
.login-page {
  min-height: calc(100vh - 65px);
  background: #0d1b2a;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
}
.login-split {
  display: flex; width: 100%; max-width: 960px;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.login-left {
  flex: 1; min-width: 0;
  background: linear-gradient(160deg, #0f2a40 0%, #1A7A9E 100%);
  padding: 56px 44px;
  display: flex; flex-direction: column; justify-content: center;
  color: white; position: relative; overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(91,196,232,0.15) 0%, transparent 70%);
  top: -60px; right: -60px; pointer-events: none;
}
.login-logo { width: 72px; height: 72px; margin-bottom: 20px; }
.login-brand-name {
  font-size: 2.8rem; font-weight: 900; letter-spacing: -0.05em;
  margin: 0 0 10px; color: white; line-height: 1;
}
.login-brand-sub { color: rgba(255,255,255,0.65); font-size: 1.05rem; margin: 0 0 36px; }
.login-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.login-features li {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,0.8); font-size: 0.95rem; font-weight: 500;
}
.lf-icon { font-size: 1.1rem; flex-shrink: 0; }

.login-right {
  flex: 1; min-width: 0;
  background: #ffffff;
  padding: 48px 44px;
  display: flex; flex-direction: column; justify-content: center;
}
.login-right .tabs {
  background: var(--bg);
}
.login-right .tab-panel { gap: 12px; }
.login-right button[type="submit"] { margin-top: 4px; }
.login-right .verify-sent { text-align: center; padding: 20px 0; }

/* === OVER PAGE === */
.over-hero {
  padding: 100px 28px 80px;
  background: radial-gradient(ellipse at 50% 60%, rgba(91,196,232,0.1) 0%, transparent 60%),
              linear-gradient(160deg, #0d1b2a, #0f2a40);
  text-align: center;
}
.over-hero-inner { max-width: 680px; margin: 0 auto; }

.over-section { padding: 80px 28px; }
.over-section.light { background: #f0f8fc; }
.over-section.dark {
  background: linear-gradient(160deg, #0d1b2a, #0f2a40);
}
.over-inner { max-width: 1000px; margin: 0 auto; }
.over-section.light h2 {
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  font-weight: 900; color: var(--ink);
  letter-spacing: -0.03em; margin: 0 0 16px;
}
.over-intro { color: var(--ink-soft); font-size: 1.05rem; max-width: 600px; margin: 0 0 48px; line-height: 1.7; }

/* Over block (text + visual) */
.over-block {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}
.over-text p { color: var(--ink-soft); line-height: 1.75; margin: 0 0 14px; }
.over-text h2 { margin-bottom: 18px; }

/* Mockup ranglijst */
.mockup-card {
  background: white; border: 1.5px solid var(--border);
  border-radius: 16px; padding: 8px; box-shadow: var(--shadow-md);
}
.mockup-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px;
}
.mockup-row:first-child { background: linear-gradient(135deg, rgba(230,57,70,0.08), rgba(230,57,70,0.03)); }
.mockup-row.dim { opacity: 0.5; }
.mockup-rank { font-weight: 800; color: var(--red); width: 24px; font-size: 0.9rem; }
.mockup-name { font-weight: 700; color: var(--ink); flex: 1; }
.mockup-pts { font-weight: 700; color: var(--blue-mid); font-size: 0.9rem; }

/* Rules */
.rules-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px;
}
.rule-card {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 32px 24px;
  transition: background 0.2s;
}
.rule-card:hover { background: rgba(255,255,255,0.09); }
.rule-num {
  font-size: 2rem; font-weight: 900; color: var(--blue);
  opacity: 0.5; margin-bottom: 14px; line-height: 1;
}
.rule-card h3 { color: white; font-size: 1.05rem; font-weight: 800; margin: 0 0 10px; }
.rule-card p { color: rgba(255,255,255,0.6); font-size: 0.92rem; line-height: 1.65; margin: 0; }

/* Points system */
.points-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.points-example h3 { font-size: 1rem; font-weight: 800; color: var(--ink); margin: 0 0 16px; }
.points-table { border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.pt-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.pt-row:last-child { border-bottom: none; }
.pt-row.header { background: var(--bg); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.pt-row.divider-row { border-top: 2px solid var(--blue); }
.pt-friend { font-weight: 600; color: var(--ink); }
.pt-friend.accent { color: var(--blue-mid); }
.pt-nth { color: var(--ink-soft); }
.pt-val { font-weight: 800; }
.pt-val.high { color: #16a34a; }
.pt-val.mid  { color: #d97706; }
.pt-val.low  { color: var(--ink-soft); }

.points-tip {
  background: linear-gradient(135deg, rgba(91,196,232,0.08), rgba(91,196,232,0.03));
  border: 1.5px solid var(--blue);
  border-radius: 16px; padding: 32px 28px;
}
.tip-icon { font-size: 2rem; margin-bottom: 14px; }
.points-tip h3 { font-size: 1rem; font-weight: 800; color: var(--ink); margin: 0 0 12px; }
.points-tip p { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.65; margin: 0 0 12px; }
.points-tip strong { color: var(--ink); }
.tip-formula {
  display: flex; align-items: center; gap: 10px;
  background: white; border: 1.5px solid var(--border);
  border-radius: 10px; padding: 12px 16px; margin-top: 16px;
  font-size: 0.88rem; font-weight: 700; color: var(--ink-soft);
  flex-wrap: wrap;
}
.tip-formula span:last-child { color: var(--blue-mid); }

/* === CONTACT PAGE === */
.contact-layout {
  display: grid; grid-template-columns: 1fr 1.3fr; gap: 60px; align-items: start;
}
.contact-info h2 {
  font-size: 1.6rem; font-weight: 900; color: var(--ink);
  letter-spacing: -0.03em; margin: 0 0 12px;
}
.contact-info > p { color: var(--ink-soft); margin: 0 0 20px; }
.contact-email-link {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(91,196,232,0.1), rgba(91,196,232,0.04));
  border: 1.5px solid var(--blue); border-radius: 12px;
  padding: 14px 20px; text-decoration: none;
  font-weight: 800; font-size: 1.05rem; color: var(--blue-deep);
  margin-bottom: 32px; transition: box-shadow 0.15s;
}
.contact-email-link:hover { box-shadow: var(--shadow-md); }
.contact-email-icon { font-size: 1.3rem; }
.contact-details { display: flex; flex-direction: column; gap: 20px; }
.contact-detail {
  display: flex; gap: 14px; align-items: flex-start;
}
.cd-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
.contact-detail strong { display: block; color: var(--ink); font-weight: 700; margin-bottom: 4px; }
.contact-detail p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.6; }

.contact-form-wrap {
  background: white; border: 1.5px solid var(--border);
  border-radius: 16px; padding: 36px 32px;
  box-shadow: var(--shadow-md);
}
.contact-form { display: flex; flex-direction: column; gap: 14px; }
.contact-form textarea {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 1rem; font-family: inherit;
  background: var(--surface); color: var(--ink); resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.contact-form textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(91,196,232,0.2);
}
.contact-success {
  text-align: center; padding: 20px 0;
}
.contact-success-icon { font-size: 3rem; margin-bottom: 16px; }
.contact-success h3 { font-size: 1.4rem; font-weight: 800; color: var(--ink); margin: 0 0 10px; }
.contact-success p { color: var(--ink-soft); margin: 0 0 24px; }

/* Landing mobile */
@media (max-width: 700px) {
  .steps-grid { grid-template-columns: 1fr; }
  .hero { min-height: 70vh; padding: 60px 20px; }
  .steps-section, .land-cta-section { padding: 60px 20px; }
  .pub-stats-section { padding: 50px 20px; }
  .pub-stat-divider { margin: 0 24px; height: 60px; }
  .land-nav-inner { padding: 12px 14px; gap: 8px; }
  .land-nav-links { gap: 0; }
  .land-nav-link { padding: 6px 8px; font-size: 0.78rem; }
  .land-nav-link:first-child { display: none; }
  .land-nav-ghost { padding: 6px 10px; font-size: 0.78rem; }
  .land-nav-cta { padding: 6px 10px; font-size: 0.78rem; }

  /* Login split — stack vertically */
  .login-page { padding: 0; align-items: stretch; }
  .login-split { flex-direction: column; border-radius: 0; box-shadow: none; }
  .login-left { padding: 40px 28px 32px; flex-direction: column; }
  .login-logo { width: 52px; height: 52px; margin-bottom: 14px; }
  .login-brand-name { font-size: 2.2rem; }
  .login-features { display: none; }
  .login-right { padding: 32px 24px 48px; }

  /* Over page */
  .over-hero { padding: 70px 20px 50px; }
  .over-section { padding: 50px 20px; }
  .over-block { grid-template-columns: 1fr; gap: 32px; }
  .rules-grid { grid-template-columns: 1fr; gap: 16px; }
  .points-layout { grid-template-columns: 1fr; gap: 24px; }

  /* Contact page */
  .contact-layout { grid-template-columns: 1fr; gap: 36px; }
  .contact-form-wrap { padding: 24px 20px; }

}

@media (max-width: 480px) {
  .land-nav-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0;
  }
  .land-nav-links {
    display: flex;
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 8px;
    margin-top: 4px;
  }
  .land-nav-link:first-child { display: flex; }
  .land-nav-btns { order: 2; }
}

/* === AUTH PAGE === */
.auth-wrap {
  max-width: 480px;
  margin: 6vh auto;
  padding: 0 24px;
}

.brand {
  text-align: center;
  margin-bottom: 36px;
}
.brand .logo-svg {
  width: 72px; height: 72px;
  margin: 0 auto 14px;
}
.brand h1 {
  margin: 0;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.05em;
}
.tagline {
  color: var(--ink-soft);
  margin: 8px 0 0;
  font-size: 1.05rem;
}

.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.tabs {
  display: flex; gap: 6px; margin-bottom: 26px;
  background: var(--bg); border-radius: 10px; padding: 5px;
}
.tab-btn {
  flex: 1; padding: 11px; border: none; background: none; cursor: pointer;
  border-radius: 8px; font-weight: 700; color: var(--ink-soft); font-size: 1rem;
  transition: all 0.15s;
}
.tab-btn.active {
  background: var(--surface);
  color: var(--red);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tab-panel { display: none; flex-direction: column; gap: 14px; }
.tab-panel.active { display: flex; }

label { font-size: 0.9rem; color: var(--ink-soft); font-weight: 600; }
input, select {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 1rem; margin-top: 5px;
  background: var(--surface); color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
select option {
  background-color: #ffffff;
  color: #1C2B3A;
}
body.app select option {
  background-color: #0f2a40;
  color: rgba(255,255,255,0.9);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(91, 196, 232, 0.2);
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

button[type="submit"], #initiate-btn, .primary-btn {
  background: var(--red); color: white; border: none; padding: 14px 22px;
  border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 1.05rem;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(230, 57, 70, 0.35);
}
button[type="submit"]:hover, #initiate-btn:hover:not(:disabled) {
  background: var(--red-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(230, 57, 70, 0.4);
}
button[type="submit"]:active, #initiate-btn:active:not(:disabled) { transform: translateY(0); }
#initiate-btn:disabled { background: #c8d8e0; box-shadow: none; cursor: not-allowed; }

.error { color: var(--red); font-size: 0.9rem; min-height: 1.2em; margin: 0; }

.hidden { display: none !important; }

.legal-check {
  display: flex; align-items: flex-start; gap: 10px;
}
.legal-check input[type="checkbox"] {
  width: 17px; height: 17px; margin: 2px 0 0; flex-shrink: 0;
  accent-color: var(--red); cursor: pointer;
}
.legal-check label {
  font-size: 0.87rem; color: var(--ink-soft); cursor: pointer;
  font-weight: 500; line-height: 1.45; margin: 0;
}
.legal-check a { color: var(--blue-deep); text-decoration: underline; }
.legal-check a:hover { color: var(--blue-mid); }

.verify-sent {
  text-align: center;
  padding: 40px 32px;
}
.verify-icon { font-size: 3.5rem; margin-bottom: 16px; }
.verify-sent h2 { font-size: 1.6rem; margin: 0 0 12px; color: var(--ink); }
.verify-sent p { color: var(--ink-soft); margin: 0 0 10px; line-height: 1.6; }
.verify-sent strong { color: var(--ink); }
.back-btn {
  margin-top: 20px; background: none; border: 1.5px solid var(--border);
  padding: 10px 24px; border-radius: 10px; cursor: pointer;
  color: var(--ink-soft); font-weight: 600; font-size: 0.95rem;
  transition: border-color 0.15s, color 0.15s;
}
.back-btn:hover { border-color: var(--blue); color: var(--blue-deep); }
.forgot-link { font-size: 0.88rem; color: var(--ink-soft); text-decoration: none; }
.forgot-link:hover { color: var(--blue); }

/* === APP SHELL === */
.topbar {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 16px;
  padding: 14px 28px; background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.topbar-left {
  justify-self: start;
  display: flex; align-items: center; gap: 8px;
}
.topbar .logo-svg { width: 32px; height: 32px; }
.topbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
.topbar-brand:hover .app-name { opacity: 0.8; }
.topbar-links {
  display: flex; gap: 4px; justify-content: center; align-items: center;
}
.topbar-link {
  color: var(--ink-soft); text-decoration: none;
  padding: 6px 14px; border-radius: 7px;
  font-weight: 600; font-size: 0.9rem;
  transition: color 0.15s, background 0.15s;
}
.topbar-link:hover { color: var(--ink); background: var(--bg); }
.topbar-right {
  display: flex; gap: 10px; align-items: center; justify-self: end;
}
.app-name {
  font-weight: 800; font-size: 1.25rem;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}
.spacer { flex: 1; }
.whoami { color: var(--ink-soft); font-size: 0.95rem; }
.ghost-btn {
  background: none; border: 1.5px solid var(--border); padding: 8px 18px;
  border-radius: 8px; cursor: pointer; color: var(--ink-soft); font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}
.ghost-btn:hover { border-color: var(--red); color: var(--red); }

.nav {
  display: flex; gap: 8px; padding: 14px 28px;
  background: var(--surface); border-bottom: 1.5px solid var(--border);
  justify-content: center;
}
.nav-btn {
  border: none; background: var(--bg); padding: 10px 22px; border-radius: 24px;
  cursor: pointer; font-weight: 700; color: var(--ink-soft); font-size: 0.95rem;
  transition: all 0.15s;
}
.nav-btn.active {
  background: var(--red); color: white;
  box-shadow: 0 3px 12px rgba(230, 57, 70, 0.35);
}
.nav-btn:hover:not(.active) { background: var(--border); color: var(--ink); }

.content { max-width: 800px; margin: 0 auto; padding: 28px; padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 90px); }
.section { display: none; }
.section.active { display: block; }
.section-gap { margin-top: 42px; }

.hint { color: var(--ink-soft); font-size: 0.95rem; margin: 6px 0 14px; }

.inline-form {
  display: flex; gap: 12px; margin: 14px 0; align-items: flex-start;
}
.inline-form select, .inline-form input { margin-top: 0; }

/* === FRIEND SEARCH (log section) === */
.friend-search-wrap { position: relative; flex: 1; }
.friend-search-wrap input { margin-top: 0; }

.friend-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-md); z-index: 100;
  max-height: 230px; overflow-y: auto;
}
.friend-dropdown.hidden { display: none; }

.dd-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid var(--bg);
  transition: background 0.1s;
}
.dd-item:last-child { border-bottom: none; }
.dd-item:hover { background: var(--bg); }
.dd-name { font-weight: 700; color: var(--ink); }
.dd-user { color: var(--ink-soft); font-size: 0.88rem; margin-left: auto; }
.dd-empty { padding: 16px; color: var(--ink-soft); font-style: italic; text-align: center; }

.selected-friend {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, rgba(91, 196, 232, 0.12), rgba(91, 196, 232, 0.05));
  border: 1.5px solid var(--blue);
  border-radius: 10px; padding: 10px 16px; margin-bottom: 4px;
}
.selected-friend.hidden { display: none; }
.sf-name { font-weight: 700; color: var(--blue-deep); flex: 1; }
.sf-clear {
  background: none; border: none; color: var(--ink-soft); cursor: pointer;
  font-size: 1.4rem; line-height: 1; padding: 0 4px;
  transition: color 0.15s;
}
.sf-clear:hover { color: var(--red); }

/* === QR FULLSCREEN === */
.qr-fullscreen {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
}
.qr-fullscreen.hidden { display: none; }
.qr-fullscreen-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 20px; padding: 32px 24px;
}
.qr-fs-label {
  color: rgba(255,255,255,0.85); font-size: 1.05rem; font-weight: 600; margin: 0;
}
.qr-canvas {
  display: inline-block; padding: 14px; background: #fff;
  border-radius: 14px; box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.qr-canvas img, .qr-canvas canvas { display: block; }
.qr-fs-timer { color: rgba(255,255,255,0.45); font-size: 0.9rem; margin: 0; }
.code-timer { color: var(--ink-soft); font-size: 0.9rem; margin-top: 12px; }

/* === SCAN BUTTON === */
.btn-scan {
  display: flex; align-items: center; gap: 8px; margin-top: 14px;
  padding: 10px 20px; background: var(--red); color: white;
  border: none; border-radius: 10px; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; transition: opacity 0.15s;
}
.btn-scan.hidden { display: none; }
.btn-scan:hover { opacity: 0.88; }

/* === QR SCANNER OVERLAY === */
.qr-scanner-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
}
.qr-scanner-overlay.hidden { display: none; }
.qr-scanner-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 24px; width: 100%; max-width: 420px;
}
.qr-scanner-hint { color: rgba(255,255,255,0.85); font-size: 1rem; font-weight: 600; margin: 0; }
.qr-video-wrap {
  width: 100%; max-width: 320px; aspect-ratio: 1/1;
  border-radius: 16px; overflow: hidden;
  border: 2px solid rgba(255,255,255,0.2);
}
.qr-video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.qr-scan-status { color: rgba(255,255,255,0.5); font-size: 0.88rem; margin: 0; }
.btn-secondary {
  padding: 10px 24px; background: transparent; color: rgba(255,255,255,0.7);
  border: 1.5px solid rgba(255,255,255,0.25); border-radius: 10px;
  font-weight: 600; cursor: pointer; transition: border-color 0.15s;
}
.btn-secondary:hover { border-color: rgba(255,255,255,0.5); }

/* === LISTS & CARDS === */
.pending-list, .list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.item-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}
.item-card:hover { box-shadow: var(--shadow-md); }
.item-card .name { font-weight: 700; flex: 1; }
.item-card .muted { color: var(--ink-soft); font-size: 0.9rem; }
.item-card input[type="text"] { width: 110px; margin: 0; text-align: center; letter-spacing: 0.12em; }
.item-card button {
  border: none; background: var(--blue-mid); color: white;
  padding: 9px 16px; border-radius: 8px; cursor: pointer; font-weight: 700;
  transition: background 0.15s;
}
.item-card button:hover { background: var(--blue-deep); }
.item-card button.secondary {
  background: var(--bg); color: var(--ink-soft);
  border: 1.5px solid var(--border);
}
.item-card button.danger { background: var(--red); }
.item-card button.danger:hover { background: var(--red-deep); }

/* === TABLE === */
.table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.table th, .table td { text-align: left; padding: 13px 16px; border-bottom: 1.5px solid var(--border); }
.table th {
  color: var(--ink-soft); font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.06em; background: var(--bg);
}
.table tbody tr:first-child td { font-weight: 700; }
.table tbody tr:hover td { background: rgba(91, 196, 232, 0.05); }

#history-table th:nth-child(2), #history-table td:nth-child(2),
#history-table th:nth-child(3), #history-table td:nth-child(3),
#history-table th:nth-child(4), #history-table td:nth-child(4) { text-align: center; }

.empty { color: var(--ink-soft); font-style: italic; padding: 16px 0; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }

/* === PROFILE === */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.profile-form { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.card-title { margin: 0 0 18px; font-size: 1.1rem; font-weight: 800; color: var(--ink); }
.field-note { font-size: 0.8rem; color: var(--ink-soft); font-weight: 400; }
.success { color: #16a34a; font-size: 0.9rem; font-weight: 600; margin: 0; }

@media (max-width: 700px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* === ADMIN PANEL === */
.admin-content { max-width: 1400px; }

.admin-table-card { padding: 0; overflow: hidden; margin-top: 8px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.admin-table { white-space: nowrap; font-size: 0.95rem; }
.admin-table th, .admin-table td { padding: 12px 16px; }
.admin-table .cell-id { color: var(--ink-soft); width: 40px; }
.admin-table .cell-nowrap { white-space: nowrap; }
.admin-table .cell-email { color: var(--ink-soft); }
.admin-table .cell-center { text-align: center; }


.admin-badge {
  background: var(--red); color: white;
  font-size: 0.75rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.admin-link { color: var(--blue-deep) !important; border-color: var(--blue) !important; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.stat-value { font-size: 2.2rem; font-weight: 900; color: var(--red); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 0.8rem; color: var(--ink-soft); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 0.8rem; font-weight: 700;
}
.badge-green { background: rgba(34,197,94,0.15); color: #16a34a; }
.badge-gray  { background: var(--bg); color: var(--ink-soft); }
.badge-red   { background: rgba(230,57,70,0.12); color: var(--red); }

.action-cell { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toggle-admin-btn {
  border: 1.5px solid var(--blue); background: none; color: var(--blue-deep);
  padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
}
.toggle-admin-btn:hover { background: var(--blue); color: white; }
.delete-btn {
  border: none; background: var(--red); color: white;
  padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 0.85rem;
  transition: background 0.15s;
}
.delete-btn:hover { background: var(--red-deep); }

/* === ADMIN TABS === */
.admin-tabs {
  display: flex; gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.admin-tab {
  padding: 10px 22px; border: none; background: none;
  font-size: 1rem; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: color 0.15s, border-color 0.15s;
  display: flex; align-items: center; gap: 8px;
}
.admin-tab.active { color: var(--blue-deep); border-bottom-color: var(--blue); }
.admin-tab:hover:not(.active) { color: var(--ink); }

.msg-badge {
  background: var(--red); color: white;
  font-size: 0.75rem; font-weight: 800;
  border-radius: 20px; padding: 1px 7px; min-width: 20px; text-align: center;
}

/* === MESSAGE TOOLBAR === */
.msg-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.history-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; font-weight: 600; color: var(--ink-soft);
  cursor: pointer;
}
.history-toggle input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--blue); }

/* === MESSAGE CARDS === */
.msg-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  margin-bottom: 14px; transition: box-shadow 0.15s;
}
.msg-card:hover { box-shadow: var(--shadow-sm); }
.msg-card.msg-processed { opacity: 0.6; }

.msg-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.msg-header-right {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex-shrink: 0;
}
.msg-name { font-weight: 700; font-size: 1rem; margin-right: 10px; }
.msg-email { color: var(--blue-deep); font-size: 0.9rem; text-decoration: none; }
.msg-email:hover { text-decoration: underline; }
.msg-date { font-size: 0.82rem; color: var(--ink-soft); }
.msg-meta { font-size: 0.82rem; color: var(--ink-soft); }

.msg-body {
  white-space: pre-wrap; font-size: 0.95rem;
  color: var(--ink); line-height: 1.6;
  border-top: 1px solid var(--border); padding-top: 12px;
}

.process-btn {
  border: 1.5px solid var(--blue); background: none; color: var(--blue-deep);
  padding: 5px 14px; border-radius: 7px; cursor: pointer;
  font-weight: 600; font-size: 0.85rem; transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.process-btn:hover { background: var(--blue); color: white; }

.empty-msg { color: var(--ink-soft); text-align: center; padding: 40px 0; }

/* === LEADERBOARD TABS === */
.lb-tabs {
  display: flex; gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto; scrollbar-width: none;
}
.lb-tabs::-webkit-scrollbar { display: none; }
.lb-tab {
  padding: 9px 20px; border: none; background: none;
  font-size: 0.95rem; font-weight: 700; color: var(--ink-soft);
  cursor: pointer; border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: color 0.15s, border-color 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.lb-tab.active { color: var(--red); border-bottom-color: var(--red); }
.lb-tab:hover:not(.active) { color: var(--ink); }

table[id^="leaderboard"] th:nth-child(5),
table[id^="leaderboard"] td:nth-child(5) { text-align: center; }

.lb-me td { background: rgba(230,57,70,0.06) !important; font-weight: 700; }
.lb-you {
  display: inline-block; background: var(--red); color: white;
  font-size: 0.72rem; font-weight: 800; border-radius: 20px;
  padding: 1px 7px; margin-left: 6px; vertical-align: middle;
}

.btn-friend-add {
  padding: 3px 10px; font-size: 0.78rem; font-weight: 700;
  background: var(--red); color: white; border: none; border-radius: 20px;
  cursor: pointer; white-space: nowrap; transition: opacity 0.15s;
}
.btn-friend-add:disabled { opacity: 0.5; cursor: default; }
.lb-pending { font-size: 0.78rem; color: var(--ink-soft); white-space: nowrap; }
.lb-friend-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  background: rgba(46,204,113,0.15); color: #27ae60;
  border: 1.5px solid rgba(46,204,113,0.35);
  border-radius: 20px; padding: 2px 10px; white-space: nowrap;
}

body.app .lb-tabs { border-bottom-color: rgba(91,196,232,0.2); }
body.app .lb-tab { color: rgba(255,255,255,0.45); }
body.app .lb-tab.active { color: var(--red); border-bottom-color: var(--red); }
body.app .lb-tab:hover:not(.active) { color: rgba(255,255,255,0.8); }
body.app .lb-me td { background: rgba(230,57,70,0.1) !important; }
body.app .lb-pending { color: rgba(255,255,255,0.4); }
body.app .lb-friend-badge { background: rgba(46,204,113,0.12); color: #2ecc71; border-color: rgba(46,204,113,0.25); }

/* === DARK APP THEME === */
body.app {
  background: #0d1b2a;
  color: rgba(255,255,255,0.9);
  --bg: #0a1829;
  --surface: #0f2a40;
  --ink: rgba(255,255,255,0.9);
  --ink-soft: rgba(255,255,255,0.48);
  --border: rgba(91,196,232,0.2);
  --shadow-sm: 0 2px 14px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.5);
}

body.app .topbar {
  position: sticky; top: 0; z-index: 50;
}
body.app .topbar {
  background: rgba(13,27,42,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(91,196,232,0.15);
}
body.app .topbar-link {
  color: rgba(255,255,255,0.55);
}
body.app .topbar-link:hover {
  color: white; background: rgba(255,255,255,0.08);
}
body.app .ghost-btn {
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.65);
}
body.app .ghost-btn:hover { border-color: var(--red); color: var(--red); }
body.app .admin-link { color: var(--blue) !important; border-color: rgba(91,196,232,0.4) !important; }

body.app .nav {
  background: rgba(13,27,42,0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom-color: rgba(91,196,232,0.12);
}
body.app .nav-btn { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5); }
body.app .nav-btn.active { background: var(--red); color: white; box-shadow: 0 3px 12px rgba(230,57,70,0.45); }
body.app .nav-btn:hover:not(.active) { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.85); }

body.app label { color: rgba(255,255,255,0.55); }
body.app input,
body.app select,
body.app textarea {
  background: rgba(255,255,255,0.07);
  border-color: rgba(91,196,232,0.22);
  color: rgba(255,255,255,0.9);
}
body.app input:focus,
body.app select:focus,
body.app textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(91,196,232,0.15); }
body.app input::placeholder,
body.app textarea::placeholder { color: rgba(255,255,255,0.28); }
body.app input:disabled {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.28);
  -webkit-text-fill-color: rgba(255,255,255,0.28);
  border-color: rgba(91,196,232,0.1);
}
body.app .field-note { color: rgba(255,255,255,0.35); }
body.app .success { color: #4ade80; }

body.app .card { background: rgba(255,255,255,0.05); border-color: rgba(91,196,232,0.2); }
body.app .card-title { color: rgba(255,255,255,0.92); }

body.app .friend-dropdown {
  background: #0f2a40;
  border-color: rgba(91,196,232,0.28);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
}
body.app .dd-item { border-bottom-color: rgba(255,255,255,0.06); }
body.app .dd-item:hover { background: rgba(91,196,232,0.1); }
body.app .dd-name { color: rgba(255,255,255,0.92); }
body.app .dd-user { color: rgba(255,255,255,0.42); }
body.app .dd-empty { color: rgba(255,255,255,0.38); }

body.app .selected-friend { background: rgba(91,196,232,0.1); border-color: rgba(91,196,232,0.35); }
body.app .sf-name { color: var(--blue); }
body.app .sf-clear { color: rgba(255,255,255,0.4); }

body.app .code-timer { color: rgba(255,255,255,0.4); }

body.app .item-card { background: rgba(255,255,255,0.05); border-color: rgba(91,196,232,0.18); }
body.app .item-card .name { color: rgba(255,255,255,0.9); }
body.app .item-card .muted { color: rgba(255,255,255,0.45); }

body.app .table th {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.42);
  border-bottom-color: rgba(91,196,232,0.15);
}
body.app .table td { border-bottom-color: rgba(91,196,232,0.1); }
body.app .table tbody tr:first-child td { color: white; }
body.app .table tbody tr:hover td { background: rgba(91,196,232,0.07); }
body.app .empty { color: rgba(255,255,255,0.35); }

body.app .admin-table-card { border: 1.5px solid rgba(91,196,232,0.15); border-radius: var(--radius); }
body.app .stat-card { background: rgba(255,255,255,0.06); border-color: rgba(91,196,232,0.2); }
body.app .stat-label { color: rgba(255,255,255,0.45); }

body.app .badge-gray { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); }

body.app .admin-tabs { border-bottom-color: rgba(91,196,232,0.2); }
body.app .admin-tab { color: rgba(255,255,255,0.45); }
body.app .admin-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
body.app .admin-tab:hover:not(.active) { color: rgba(255,255,255,0.75); }

body.app .toggle-admin-btn { border-color: rgba(91,196,232,0.4); color: var(--blue); }
body.app .toggle-admin-btn:hover { background: rgba(91,196,232,0.12); color: var(--blue); border-color: var(--blue); }

body.app .msg-card { background: rgba(255,255,255,0.04); border-color: rgba(91,196,232,0.18); }
body.app .msg-name { color: rgba(255,255,255,0.92); }
body.app .msg-email { color: var(--blue); }
body.app .msg-date,
body.app .msg-meta { color: rgba(255,255,255,0.38); }
body.app .msg-body { color: rgba(255,255,255,0.72); border-top-color: rgba(91,196,232,0.15); }
body.app .empty-msg { color: rgba(255,255,255,0.35); }
body.app .history-toggle { color: rgba(255,255,255,0.5); }
body.app .process-btn { border-color: rgba(91,196,232,0.4); color: var(--blue); }
body.app .process-btn:hover { background: rgba(91,196,232,0.12); color: var(--blue); border-color: var(--blue); }

/* === TABLET (≤ 900px) === */
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* === MOBILE (≤ 600px) === */
@media (max-width: 600px) {
  body { font-size: 16px; }

  /* Auth */
  .auth-wrap { margin: 4vh auto; padding: 0 16px; }
  .brand { margin-bottom: 24px; }
  .brand .logo-svg { width: 56px; height: 56px; }
  .brand h1 { font-size: 2.4rem; }
  .tagline { font-size: 0.95rem; }
  .card { padding: 20px; }
  .verify-sent { padding: 28px 20px; }

  /* Topbar */
  .topbar { padding: 10px 14px; gap: 8px; grid-template-columns: auto auto; }
  .topbar .logo-svg { width: 26px; height: 26px; }
  .app-name { font-size: 1.1rem; }
  .topbar-links { display: none; }
  .topbar-right { justify-self: end; }
  .whoami { display: none; }
  .ghost-btn { padding: 7px 11px; font-size: 0.82rem; }
  .admin-badge { font-size: 0.7rem; padding: 2px 7px; }

  /* Nav — scrollable strip, no scrollbar visible */
  .nav { overflow-x: auto; padding: 10px 14px; gap: 6px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-btn { padding: 9px 15px; font-size: 0.85rem; white-space: nowrap; flex-shrink: 0; }

  /* Content */
  .content { padding: 16px; padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 24px); }
  .section-gap { margin-top: 28px; }
  h2 { font-size: 1.2rem; }

  /* Form rows */
  .row { grid-template-columns: 1fr; gap: 10px; }

  /* Inline form (friend search + button) */
  .inline-form { flex-direction: column; gap: 10px; }
  #initiate-btn { width: 100%; }
  .friend-search-wrap { width: 100%; }

  /* QR fullscreen */
  .qr-canvas { padding: 10px; }

  /* Item cards — stack content and actions */
  .item-card { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .item-card .name { width: 100%; margin-bottom: 2px; }
  .item-card button { flex: 1; }

  /* Tables — geen scroll, alles zichtbaar */
  .table-wrap { overflow-x: visible; margin-top: 12px; }
  .table { font-size: 0.78rem; width: 100%; }
  .table th, .table td { padding: 7px 5px; }

  /* Leaderboard tabellen: vaste layout met emoji kolommen */
  table[id^="leaderboard"] { table-layout: fixed; }
  table[id^="leaderboard"] th:nth-child(1),
  table[id^="leaderboard"] td:nth-child(1) { width: 26px; }
  table[id^="leaderboard"] th:nth-child(3),
  table[id^="leaderboard"] td:nth-child(3) { width: 52px; text-align: center; }
  table[id^="leaderboard"] th:nth-child(4),
  table[id^="leaderboard"] td:nth-child(4) { width: 46px; text-align: center; }
  table[id^="leaderboard"] th:nth-child(5),
  table[id^="leaderboard"] td:nth-child(5) { width: 66px; text-align: center; }
  table[id^="leaderboard"] td:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0; }

  /* Compacte vriendenknop en badges */
  .btn-friend-add { padding: 3px 7px; font-size: 0.68rem; }
  .lb-friend-badge, .lb-pending { font-size: 0.65rem; padding: 2px 6px; }

  /* Geschiedenis: verberg "Unieke vrienden" (3e kolom) */
  #history-table th:nth-child(3), #history-table td:nth-child(3) { display: none; }

  /* Admin tabel blijft horizontaal scrollbaar */
  .table-scroll { overflow-x: auto; }

  /* Profile */
  .profile-grid { grid-template-columns: 1fr; gap: 14px; }
  .card-title { font-size: 1rem; margin-bottom: 14px; }

  /* Admin stats */
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 1.8rem; }

  /* Reg overlay — bottom sheet op mobile */
  .reg-panel { border-radius: 20px 20px 0 0; padding: 22px 18px 36px; }
  .reg-panel-title { font-size: 1.15rem; }
}


/* === BOTTOM NAVIGATION === */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 150;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  align-items: center;
  overflow: visible;
}

.bnav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; height: 100%;
  background: none; border: none; cursor: pointer;
  color: var(--ink-soft); font-size: 0.63rem; font-weight: 600;
  padding: 6px 4px; transition: color 0.15s;
}
.bnav-btn.active { color: var(--red); }
.bnav-btn svg { transition: transform 0.15s; }
.bnav-btn.active svg { transform: scale(1.12); }


body.app .bottom-nav {
  background: rgba(10, 24, 41, 0.96);
  border-top-color: rgba(91, 196, 232, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body.app .bnav-btn { color: rgba(255,255,255,0.38); }
body.app .bnav-btn.active { color: var(--red); }

/* === HAMBURGER MENU TOGGLE === */
.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--ink-soft); padding: 8px; border-radius: 8px;
  align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s; flex-shrink: 0;
}
.menu-toggle:hover { color: var(--ink); background: var(--bg); }

/* === MENU BACKDROP === */
.menu-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.menu-backdrop.open { opacity: 1; pointer-events: auto; }

/* === SIDE DRAWER === */
.side-menu {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 272px;
  background: var(--surface);
  border-right: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 210;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
}
.side-menu.open { transform: translateX(0); }

.side-menu-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}
.side-menu-title { font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.side-menu-close {
  background: none; border: none; cursor: pointer;
  color: var(--ink-soft); padding: 6px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.side-menu-close:hover { color: var(--ink); background: var(--bg); }

.side-nav {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 10px; flex: 1; overflow-y: auto;
}
.side-nav-btn {
  display: flex; align-items: center; gap: 14px;
  background: none; border: none; cursor: pointer;
  padding: 12px 14px; border-radius: 11px;
  font-size: 1rem; font-weight: 700; color: var(--ink-soft);
  transition: background 0.15s, color 0.15s;
  text-align: left; width: 100%;
}
.side-nav-btn svg { flex-shrink: 0; }
.side-nav-btn:hover { background: var(--bg); color: var(--ink); }
.side-nav-btn.active { background: rgba(230,57,70,0.1); color: var(--red); }

/* === FLOATING REGISTER BUTTON === */
.register-fab {
  position: relative;
  margin-top: -22px; /* pop out boven de nav balk */
  flex-shrink: 0;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--red); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(230,57,70,0.5);
  z-index: 100;
  transition: transform 0.2s, box-shadow 0.2s, background 0.15s;
}
.register-fab:hover {
  background: var(--red-deep);
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 10px 32px rgba(230,57,70,0.6);
}
.register-fab:active { transform: scale(0.95); }

/* === REGISTRATION OVERLAY === */
.reg-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: flex-end; justify-content: center;
}
.reg-overlay.hidden { display: none; }

.reg-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.reg-panel {
  position: relative; z-index: 1;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  width: 100%; max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 28px 44px;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.3);
  animation: regSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reg-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.reg-panel-title { margin: 0; font-size: 1.3rem; font-weight: 800; }
.reg-close {
  background: none; border: none; cursor: pointer;
  color: var(--ink-soft); padding: 8px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.reg-close:hover { color: var(--ink); background: var(--bg); }

.reg-subtitle { font-size: 1.1rem; font-weight: 800; margin: 0 0 6px; color: var(--ink); }
.reg-divider { border: none; border-top: 1.5px solid var(--border); margin: 24px 0; }

/* Desktop: centered modal instead of bottom sheet */
@media (min-width: 640px) {
  .reg-overlay { align-items: center; }
  .reg-panel {
    border-radius: 20px;
    max-height: 85vh;
    margin: 16px;
  }
}

/* === QR HOME SECTION === */
.qr-home-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 65vh; padding: 24px;
}
.qr-home-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 24px;
  padding: 40px 36px; box-shadow: var(--shadow-md);
  width: 100%; max-width: 320px;
}
.qr-home-tagline {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--blue-mid); margin: 0;
}
.qr-home-img {
  padding: 12px; background: #fff; border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.qr-home-img img { display: block; }
.qr-home-username {
  font-size: 1.2rem; font-weight: 800; color: var(--ink);
  letter-spacing: -0.02em; margin: 0;
}
.qr-home-hint {
  font-size: 0.88rem; color: var(--ink-soft); margin: 0; line-height: 1.55;
}

/* === APPROVAL MODAL === */
.approval-modal {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.approval-modal.hidden { display: none; }
.approval-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.approval-panel {
  position: relative; z-index: 1;
  background: var(--surface); border-radius: 20px;
  padding: 32px 28px; width: 100%; max-width: 340px;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  animation: popIn 0.2s ease;
}
@keyframes popIn {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.approval-icon { font-size: 2.6rem; margin-bottom: 10px; }
.approval-question {
  font-size: 1.05rem; font-weight: 600; color: var(--ink);
  margin: 0 0 24px; line-height: 1.5;
}
.approval-btns { display: flex; gap: 10px; }
.approval-decline {
  flex: 1; padding: 13px; border: 1.5px solid var(--border);
  background: none; border-radius: 10px; cursor: pointer;
  font-weight: 700; color: var(--ink-soft); font-size: 1rem;
  transition: border-color 0.15s, color 0.15s;
}
.approval-decline:hover { border-color: var(--red); color: var(--red); }
.approval-accept {
  flex: 1; padding: 13px; border: none;
  background: var(--red); border-radius: 10px; cursor: pointer;
  font-weight: 700; color: white; font-size: 1rem;
  box-shadow: 0 4px 14px rgba(230,57,70,0.4);
  transition: background 0.15s, transform 0.1s;
}
.approval-accept:hover { background: var(--red-deep); transform: translateY(-1px); }

/* === SCAN STATUS OVERLAY === */
.scan-status-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(10, 20, 35, 0.97);
  display: flex; align-items: center; justify-content: center;
}
.scan-status-overlay.hidden { display: none; }
.scan-status-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 18px; padding: 32px 24px; text-align: center;
}
.scan-spinner {
  width: 52px; height: 52px;
  border: 4px solid rgba(91,196,232,0.2);
  border-top-color: var(--blue); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.scan-status-msg {
  font-size: 1.1rem; font-weight: 600;
  color: rgba(255,255,255,0.82); margin: 0;
}
.scan-status-timer {
  font-size: 2.2rem; font-weight: 900; color: var(--blue);
  margin: 0; font-variant-numeric: tabular-nums;
}

/* === TOAST === */
.toast {
  position: fixed; bottom: 90px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(10,20,35,0.94); color: white;
  padding: 11px 22px; border-radius: 12px;
  font-weight: 600; font-size: 0.95rem;
  opacity: 0; transition: opacity 0.22s, transform 0.22s;
  z-index: 9999; white-space: nowrap;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
  pointer-events: none;
}
.toast.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* === DARK THEME: new components === */
body.app .qr-home-card {
  background: rgba(255,255,255,0.05);
  border-color: rgba(91,196,232,0.2);
}
body.app .qr-home-username { color: rgba(255,255,255,0.9); }
body.app .qr-home-hint { color: rgba(255,255,255,0.42); }

body.app .approval-panel {
  background: #0f2a40;
  box-shadow: 0 20px 60px rgba(0,0,0,0.65);
}
body.app .approval-question { color: rgba(255,255,255,0.9); }
body.app .approval-decline {
  border-color: rgba(91,196,232,0.2); color: rgba(255,255,255,0.55);
}
body.app .approval-decline:hover { border-color: var(--red); color: var(--red); }

body.app .menu-toggle { color: rgba(255,255,255,0.55); }
body.app .menu-toggle:hover { background: rgba(255,255,255,0.08); color: white; }

body.app .side-menu {
  background: #0f2a40;
  border-right-color: rgba(91,196,232,0.15);
}
body.app .side-menu-header { border-bottom-color: rgba(91,196,232,0.15); }
body.app .side-menu-title  { color: rgba(255,255,255,0.9); }
body.app .side-menu-close  { color: rgba(255,255,255,0.45); }
body.app .side-menu-close:hover { background: rgba(255,255,255,0.08); color: white; }
body.app .side-nav-btn     { color: rgba(255,255,255,0.48); }
body.app .side-nav-btn:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.88); }
body.app .side-nav-btn.active { background: rgba(230,57,70,0.16); color: var(--red); }

body.app .reg-panel {
  background: #0f2a40;
  box-shadow: 0 -8px 48px rgba(0,0,0,0.6);
}
body.app .reg-panel-title { color: rgba(255,255,255,0.9); }
body.app .reg-subtitle    { color: rgba(255,255,255,0.9); }
body.app .reg-close       { color: rgba(255,255,255,0.45); }
body.app .reg-close:hover { background: rgba(255,255,255,0.08); color: white; }
body.app .reg-divider     { border-top-color: rgba(91,196,232,0.15); }
