/* SafeZone — Precision Dark Design System */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&display=swap');

/* ── Tokens ─────────────────────────────────────────── */
:root {
  --bg:       #0c0c0c;
  --surface:  #111111;
  --surface2: #161616;
  --surface3: #1c1c1c;
  --line:     #1e1e1e;
  --line-hi:  #2a2a2a;
  --line-red: rgba(232,64,64,0.2);

  --text:     #e2e2e2;
  --text-dim: #b8b8b8;
  --muted:    #666666;
  --faint:    #303030;

  --red:      #e84040;
  --red-dim:  #c03030;
  --red-bg:   rgba(232,64,64,0.07);
  --red-glow: rgba(232,64,64,0.15);

  --green:    #3dd68c;
  --yellow:   #f5c842;
  --blue:     #5b9cf6;

  --mono: "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  --nav-h: 52px;
  --r: 4px;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Grain texture overlay */
body::after {
  content: '';
  position: fixed; inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
input, textarea, select, button { font-family: var(--mono); font-size: inherit; }
button { cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--mono);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.025em;
}
h1 { font-size: 1.65rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }

/* ── Layout ─────────────────────────────────────────── */
.wrap    { max-width: 960px;  margin: 0 auto; padding: 0 24px; }
.wrap-sm { max-width: 680px;  margin: 0 auto; padding: 0 24px; }
.page    { padding-top: calc(var(--nav-h) + 40px); padding-bottom: 80px; }

/* Subtle top spotlight on every page */
.page::before {
  content: '';
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 200px;
  background: radial-gradient(ellipse at 50% 0%, rgba(232,64,64,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Nav ─────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  background: rgba(12,12,12,0.88);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
  padding: 0 24px;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

/* Red hairline glow under nav */
nav::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,64,64,0.35), transparent);
  pointer-events: none;
}

.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text) !important;
  text-decoration: none;
  margin-right: 32px;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
.nav-brand:hover { text-decoration: none; color: var(--text) !important; }
.nav-brand .accent { color: var(--red); }

.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-links a {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 5px 9px;
  border-radius: var(--r);
  transition: color 0.1s, background 0.1s;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav-links a:hover { color: var(--text-dim); background: rgba(255,255,255,0.04); }
.nav-links a.active {
  color: var(--text);
  background: rgba(255,255,255,0.05);
  box-shadow: inset 0 0 0 1px var(--line-hi);
}

.nav-auth { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-auth a { font-size: 0.8rem; text-decoration: none; }
.nav-user { font-size: 0.8rem; color: var(--muted); }
.nav-user a { color: var(--muted) !important; text-decoration: none; }
.nav-user a:hover { color: var(--text) !important; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px;
  border-radius: var(--r);
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap; line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s,
    transform 0.1s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.12s,
    opacity 0.1s;
  position: relative;
}

.btn-primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 1px 4px rgba(232,64,64,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn-primary:hover {
  background: #f04848;
  border-color: #f04848;
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(232,64,64,0.3), 0 1px 4px rgba(232,64,64,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:active {
  background: var(--red-dim);
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(232,64,64,0.2);
}
.btn-primary:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.btn-outline {
  background: transparent;
  color: var(--text-dim);
  border-color: var(--line-hi);
}
.btn-outline:hover {
  border-color: #404040;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.btn-outline:active { transform: translateY(0); box-shadow: none; }
.btn-outline:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.05); text-decoration: none; }
.btn-ghost:active { opacity: 0.7; }
.btn-ghost:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: rgba(232,64,64,0.25);
}
.btn-danger:hover {
  background: var(--red-bg);
  border-color: rgba(232,64,64,0.4);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-danger:active { transform: translateY(0); }
.btn-danger:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.btn-sm { padding: 4px 10px; font-size: 0.75rem; }
.btn-lg { padding: 11px 22px; font-size: 0.9rem; }

/* ── Forms ───────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 0.72rem; color: var(--muted); font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.hint-text { font-weight: 400; color: var(--faint); text-transform: none; letter-spacing: 0; }

input, textarea, select {
  background: var(--surface);
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
  color: var(--text);
  padding: 9px 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow), inset 0 1px 0 rgba(255,255,255,0.02);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
select { cursor: pointer; }
select option { background: var(--surface2); }
textarea { resize: vertical; min-height: 72px; }

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.7);
  align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface2);
  border: 1px solid var(--line-hi);
  border-radius: 6px;
  padding: 28px;
  width: 100%; max-width: 480px;
  position: relative;
  animation: modal-enter 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
  box-shadow:
    0 0 0 1px var(--line-hi),
    0 8px 32px rgba(0,0,0,0.5),
    0 32px 80px rgba(0,0,0,0.4);
}
.modal-lg { max-width: 600px; }

@keyframes modal-enter {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h2 { margin-bottom: 20px; font-size: 1.1rem; }

.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; color: var(--muted);
  font-size: 1rem; line-height: 1; padding: 4px 7px;
  border-radius: var(--r);
  transition: color 0.1s, background 0.1s;
}
.modal-close:hover { color: var(--text); background: var(--line-hi); }
.modal-close:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ── Messages ────────────────────────────────────────── */
.msg { display: none; padding: 9px 13px; border-radius: var(--r); font-size: 0.82rem; margin-bottom: 12px; }
.msg-error   { background: var(--red-bg); color: #f08080; border: 1px solid rgba(232,64,64,0.25); }
.msg-success { background: rgba(61,214,140,0.07); color: #5eead4; border: 1px solid rgba(61,214,140,0.2); }

/* ── Avatar ──────────────────────────────────────────── */
.av {
  border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: #fff; overflow: hidden;
  background-size: cover; background-position: center;
  font-size: 0.72rem; letter-spacing: 0.02em;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
}
.av-24 { width: 24px; height: 24px; font-size: 0.58rem; }
.av-32 { width: 32px; height: 32px; }
.av-40 { width: 40px; height: 40px; font-size: 0.8rem; }
.av-48 { width: 48px; height: 48px; font-size: 0.88rem; }
.av-64 { width: 64px; height: 64px; font-size: 1rem; }
.av-80 { width: 80px; height: 80px; font-size: 1.2rem; }

/* ── Stars ───────────────────────────────────────────── */
.stars    { color: var(--yellow); letter-spacing: 1px; font-size: 0.9rem; }
.stars-sm { font-size: 0.72rem; color: var(--yellow); }

/* ── Tags ────────────────────────────────────────────── */
.tag {
  display: inline-block; padding: 2px 8px;
  border: 1px solid var(--line-hi); border-radius: 2px;
  font-size: 0.7rem; color: var(--muted); letter-spacing: 0.02em;
  background: rgba(255,255,255,0.02);
}
.tag-red    { border-color: rgba(232,64,64,0.3);  color: var(--red);    background: var(--red-bg); }
.tag-green  { border-color: rgba(61,214,140,0.25); color: var(--green);  background: rgba(61,214,140,0.07); }
.tag-yellow { border-color: rgba(245,200,66,0.25); color: var(--yellow); background: rgba(245,200,66,0.07); }
.tag-blue   { border-color: rgba(91,156,246,0.25); color: var(--blue);   background: rgba(91,156,246,0.07); }

/* ── Divider ─────────────────────────────────────────── */
.div     { border: none; border-top: 1px solid var(--line); }
.div-gap { border: none; border-top: 1px solid var(--line); margin: 24px 0; }

/* ── Image / Media Picker ────────────────────────────── */
.img-picker {
  border: 1px dashed var(--line-hi); border-radius: var(--r);
  padding: 20px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 80px; color: var(--muted); font-size: 0.82rem;
  background: rgba(255,255,255,0.01);
}
.img-picker:hover { border-color: var(--muted); background: rgba(255,255,255,0.025); }
.img-picker-avatar { width: 80px; height: 80px; border-radius: 50%; min-height: unset; padding: 0; overflow: hidden; }

.img-picker-placeholder { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.img-picker-placeholder .icon  { font-size: 1.2rem; color: var(--faint); }
.img-picker-placeholder .label { font-size: 0.8rem; color: var(--muted); }
.img-picker-placeholder .hint  { font-size: 0.7rem;  color: var(--faint); }

.img-picker-img { width: 100%; height: 140px; object-fit: cover; border-radius: var(--r); }
.img-picker-avatar .img-picker-img { height: 100%; border-radius: 0; }

.img-picker-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; width: 100%; }
.img-picker-bar button {
  background: none; color: var(--red); border: 1px solid rgba(232,64,64,0.25);
  border-radius: var(--r); padding: 3px 8px; font-size: 0.72rem; font-family: var(--mono);
  transition: background 0.1s;
}
.img-picker-bar button:hover { background: var(--red-bg); }
.img-picker-filename { font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

/* ── Hero ────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 56px 0 44px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px; left: -120px; right: -120px; bottom: 0;
  background:
    radial-gradient(ellipse 500px 300px at 15% 70%, rgba(232,64,64,0.065) 0%, transparent 65%),
    radial-gradient(ellipse 350px 250px at 85% 20%, rgba(232,64,64,0.035) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }

.hero-brand {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.9;
  margin-bottom: 20px;
  color: var(--text);
}
.hero-brand .accent { color: var(--red); }
.hero-brand .accent::selection { background: var(--red); color: #fff; }

.hero-sub {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 400px;
  line-height: 1.8;
  margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.hero-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 40px 0 32px;
  position: relative;
}
.hero-divider::before {
  content: '';
  position: absolute;
  top: -1px; left: 0;
  width: 40px; height: 1px;
  background: var(--red);
}

/* ── Section heading ─────────────────────────────────── */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-size: 0.7rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: '';
  display: inline-block; flex-shrink: 0;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px rgba(232,64,64,0.7), 0 0 16px rgba(232,64,64,0.3);
}

/* ── Posts ───────────────────────────────────────────── */
.post {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  position: relative;
}
.post:first-child { border-top: 1px solid var(--line); }
.post::before {
  content: '';
  position: absolute;
  left: -24px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--red), transparent);
  opacity: 0;
  border-radius: 1px;
  transition: opacity 0.2s;
}
.post:hover::before { opacity: 0.7; }

.post-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 9px; }
.post-meta { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.post-author { font-size: 0.85rem; font-weight: 600; }
.post-author a { color: var(--text); text-decoration: none; }
.post-author a:hover { color: var(--red); }
.post-text { font-size: 0.875rem; line-height: 1.7; color: var(--text-dim); padding-left: 50px; }
.post-media { width: 100%; max-height: 420px; object-fit: cover; display: block; margin-top: 12px; border-radius: var(--r); border: 1px solid var(--line); }
.post-media-video { width: 100%; max-height: 420px; background: #000; display: block; margin-top: 12px; border-radius: var(--r); }

.post-actions { display: flex; align-items: center; gap: 4px; margin-top: 10px; padding-left: 50px; }
.post-action-btn {
  background: none; border: none; color: var(--muted); font-size: 0.75rem;
  padding: 3px 8px; border-radius: var(--r);
  transition: color 0.1s, background 0.1s;
  font-family: var(--mono);
}
.post-action-btn:hover { color: var(--text); background: var(--surface3); }
.post-del-btn {
  margin-left: auto; background: none; border: none; color: var(--faint);
  font-size: 0.75rem; padding: 2px 6px; border-radius: var(--r);
  transition: color 0.1s;
}
.post-del-btn:hover { color: var(--red); }

/* ── Comments ────────────────────────────────────────── */
.comments { padding-left: 50px; padding-top: 10px; }
.comment { display: flex; gap: 8px; margin-bottom: 8px; }
.comment-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 7px 11px; flex: 1;
}
.comment-who { font-size: 0.75rem; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.comment-who a { color: var(--muted); text-decoration: none; }
.comment-who a:hover { color: var(--text); }
.comment-text { font-size: 0.82rem; line-height: 1.55; color: var(--text-dim); }
.comment-del { background: none; border: none; color: var(--faint); font-size: 0.7rem; padding: 1px 4px; border-radius: 2px; margin-left: 6px; transition: color 0.1s; }
.comment-del:hover { color: var(--red); }

.comment-write { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.comment-write input { flex: 1; background: var(--surface); font-size: 0.82rem; }

/* ── Compose ─────────────────────────────────────────── */
.compose {
  background: var(--surface);
  border: 1px solid var(--line-hi);
  border-radius: 6px;
  padding: 16px; margin-bottom: 24px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.compose:focus-within {
  border-color: rgba(232,64,64,0.3);
  box-shadow: 0 0 0 3px rgba(232,64,64,0.05);
}
.compose-row { display: flex; gap: 11px; }
.compose-text {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 0.88rem; resize: none;
  min-height: 60px; font-family: var(--mono); line-height: 1.65; padding: 0;
}
.compose-footer { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.compose-attach {
  background: none; border: 1px solid var(--line-hi); color: var(--muted);
  font-size: 0.75rem; padding: 4px 9px; border-radius: var(--r);
  transition: color 0.1s, border-color 0.1s;
  font-family: var(--mono); cursor: pointer;
}
.compose-attach:hover { color: var(--text); border-color: var(--muted); }
.compose-count { font-size: 0.72rem; color: var(--muted); margin-left: auto; }
.compose-count.warn { color: var(--yellow); }
.compose-count.over { color: var(--red); }
.compose-preview-wrap { margin-top: 10px; position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.compose-preview-wrap img,
.compose-preview-wrap video { max-width: 100%; max-height: 240px; width: 100%; object-fit: cover; }
.compose-preview-rm {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.75); border: none; color: #fff;
  border-radius: 3px; padding: 2px 7px; font-size: 0.75rem;
  transition: background 0.1s;
}
.compose-preview-rm:hover { background: var(--red); }

/* ── Gallery ─────────────────────────────────────────── */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.gallery-item {
  position: relative; aspect-ratio: 1; overflow: hidden;
  background: var(--surface2); cursor: pointer;
}
.gallery-item img, .gallery-item video {
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity 0.2s, transform 0.35s cubic-bezier(0.34, 1.1, 0.64, 1);
}
.gallery-item:hover img, .gallery-item:hover video { opacity: 0.8; transform: scale(1.04); }

.gallery-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; padding: 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 55%);
  opacity: 0; transition: opacity 0.18s;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-caption { font-size: 0.7rem; color: #e0e0e0; line-height: 1.3; }

.gallery-del {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.65); border: none; color: #fff; border-radius: 3px;
  padding: 2px 7px; font-size: 0.68rem; opacity: 0;
  transition: opacity 0.15s, background 0.1s;
}
.gallery-item:hover .gallery-del { opacity: 1; }
.gallery-del:hover { background: var(--red); }

.gallery-video-tag {
  position: absolute; top: 6px; left: 6px;
  background: rgba(0,0,0,0.65); color: #e0e0e0; font-size: 0.65rem;
  padding: 2px 6px; border-radius: 3px; letter-spacing: 0.05em;
}

/* ── Star rating ─────────────────────────────────────── */
.star-pick { display: flex; flex-direction: row-reverse; gap: 2px; }
.star-pick input { display: none; }
.star-pick label { font-size: 1.4rem; color: var(--faint); cursor: pointer; transition: color 0.1s; }
.star-pick input:checked ~ label,
.star-pick label:hover,
.star-pick label:hover ~ label { color: var(--yellow); }

/* ── Reviews ─────────────────────────────────────────── */
.review { border-bottom: 1px solid var(--line); padding: 18px 0; }
.review:first-child { border-top: 1px solid var(--line); }
.review-img { width: 100%; height: 160px; object-fit: cover; border-radius: var(--r); margin-bottom: 12px; border: 1px solid var(--line); }
.review-site { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.02em; }
.review-loc  { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.review-row  { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--muted); margin: 8px 0; }
.review-text { font-size: 0.85rem; color: var(--text-dim); line-height: 1.7; }

/* ── Leaderboard ─────────────────────────────────────── */
.lb { border-top: 1px solid var(--line); }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  transition: background 0.1s;
}
.lb-rank { font-size: 0.75rem; color: var(--muted); width: 24px; text-align: right; flex-shrink: 0; font-weight: 600; }
.lb-rank.g1 { color: var(--yellow); font-weight: 700; }
.lb-rank.g2 { color: #c0c0c0;      font-weight: 700; }
.lb-rank.g3 { color: #cd7f32;      font-weight: 700; }
.lb-name { font-size: 0.875rem; flex: 1; }
.lb-name a { color: var(--text); text-decoration: none; }
.lb-name a:hover { color: var(--red); }
.lb-sub  { font-size: 0.7rem; color: var(--muted); margin-top: 1px; }
.lb-kd   { font-size: 1rem; font-weight: 700; text-align: right; letter-spacing: -0.02em; }
.lb-kd.pos { color: var(--green); }
.lb-kd.neg { color: var(--red); }

/* ── Profile ─────────────────────────────────────────── */
.profile-top {
  display: flex; gap: 20px; align-items: flex-start;
  padding-bottom: 24px; margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.profile-info { flex: 1; }
.profile-name { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.03em; }
.profile-bio  { font-size: 0.82rem; color: var(--muted); line-height: 1.7; margin-bottom: 12px; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 16px; }
.profile-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.stat-val { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-lbl { font-size: 0.68rem; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Tabs ────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tab-btn {
  padding: 9px 14px; background: none; border: none;
  font-size: 0.8rem; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: var(--mono); letter-spacing: 0.02em;
  transition: color 0.12s, border-color 0.12s;
}
.tab-btn:hover { color: var(--text-dim); }
.tab-btn.on { color: var(--text); border-bottom-color: var(--red); }
.tab-btn:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.tab-pane { display: none; }
.tab-pane.on { display: block; }

/* ── Field cards ─────────────────────────────────────── */
.fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.field-card { background: var(--bg); padding: 18px; cursor: pointer; transition: background 0.12s; }
.field-card:hover { background: var(--surface); }
.field-img { width: 100%; height: 130px; object-fit: cover; border-radius: var(--r); margin-bottom: 12px; background: var(--line); }
.field-name { font-size: 0.9rem; font-weight: 700; margin-bottom: 3px; letter-spacing: -0.02em; }
.field-loc  { font-size: 0.72rem; color: var(--muted); margin-bottom: 8px; }
.field-limits { display: flex; flex-wrap: wrap; gap: 4px; }

/* ── Card list rows ──────────────────────────────────── */
.card-list { border-top: 1px solid var(--line); }
.card-row {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: border-left-color 0.15s, background 0.1s, padding-left 0.15s;
}
.card-row:hover {
  border-left-color: var(--red);
  padding-left: 10px;
  background: rgba(232,64,64,0.015);
}
.card-row:hover .card-title { text-decoration: underline; }
.card-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; letter-spacing: -0.01em; }
.card-meta  { font-size: 0.72rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; }
.card-excerpt { font-size: 0.82rem; color: var(--muted); margin: 5px 0; line-height: 1.6; }

/* ── Stamps ──────────────────────────────────────────── */
.stamps { display: flex; flex-wrap: wrap; gap: 8px; }
.stamp {
  border: 1px solid var(--line-hi); border-radius: var(--r);
  padding: 9px 13px; font-size: 0.78rem;
  display: flex; flex-direction: column; gap: 2px; min-width: 100px;
  background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s;
}
.stamp:hover { border-color: var(--muted); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.stamp-name { font-weight: 600; font-size: 0.82rem; }
.stamp-date { color: var(--muted); font-size: 0.68rem; margin-top: 1px; }

/* ── Session row ─────────────────────────────────────── */
.session-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}
.session-kd  { font-weight: 700; width: 52px; flex-shrink: 0; letter-spacing: -0.02em; }
.session-kd.pos { color: var(--green); }
.session-kd.neg { color: var(--red); }
.session-field { flex: 1; color: var(--muted); }
.session-date  { color: var(--faint); font-size: 0.7rem; }
.session-del   { background: none; border: none; color: var(--faint); padding: 2px 5px; border-radius: 2px; transition: color 0.1s; }
.session-del:hover { color: var(--red); }

/* ── KD block ────────────────────────────────────────── */
.kd-block {
  display: flex; gap: 0;
  border: 1px solid var(--line-hi);
  border-radius: 6px; overflow: hidden;
  margin-bottom: 20px; background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.kd-cell { padding: 18px 20px; text-align: center; flex: 1; border-right: 1px solid var(--line); }
.kd-cell:last-child { border-right: none; }
.kd-num { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; }
.kd-num.pos { color: var(--green); }
.kd-num.neg { color: var(--red); }
.kd-lbl { font-size: 0.65rem; color: var(--muted); margin-top: 3px; letter-spacing: 0.07em; text-transform: uppercase; }

/* ── Calculator ──────────────────────────────────────── */
.calc-result {
  border: 1px solid var(--line-hi); border-radius: 6px;
  padding: 24px; text-align: center; margin-top: 20px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.calc-joule { font-size: 2.8rem; font-weight: 700; letter-spacing: -0.04em; }
.calc-fps   { font-size: 1.1rem; color: var(--muted); margin-top: 6px; }
.calc-ok    { color: var(--green); font-size: 0.85rem; margin-top: 10px; }
.calc-bad   { color: var(--red);   font-size: 0.85rem; margin-top: 10px; }

/* ── Two-col layout ──────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 260px; gap: 40px; align-items: start; }
.half    { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 28px; }
.sidebar-block { }
.sidebar-block-title {
  font-size: 0.65rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 7px;
}
.sidebar-block-title::before {
  content: '';
  display: inline-block; flex-shrink: 0;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px rgba(232,64,64,0.6);
}

/* ── Player row ──────────────────────────────────────── */
.player-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.player-row:last-child { border-bottom: none; }
.player-row-name { font-size: 0.82rem; flex: 1; }
.player-row-name a { color: var(--text); text-decoration: none; }
.player-row-name a:hover { color: var(--red); }
.player-row-sub { font-size: 0.7rem; color: var(--muted); }

/* ── Empty & loading ─────────────────────────────────── */
.empty {
  padding: 52px 0; text-align: center; color: var(--muted);
  font-size: 0.85rem; line-height: 1.7;
}
.empty::before {
  content: '—';
  display: block;
  font-size: 1.5rem; color: var(--faint);
  margin-bottom: 12px; letter-spacing: 0.2em;
}

.loading {
  padding: 40px; text-align: center; color: var(--faint); font-size: 0.8rem;
  animation: loading-pulse 1.8s ease-in-out infinite;
}
@keyframes loading-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* ── Honesty ─────────────────────────────────────────── */
.honesty-line { font-size: 0.82rem; color: var(--muted); }
.honesty-score { font-weight: 700; }
.honesty-score.hi  { color: var(--green); }
.honesty-score.mid { color: var(--yellow); }
.honesty-score.lo  { color: var(--red); }

/* ── Anticheat ───────────────────────────────────────── */
.flagged-notice {
  font-size: 0.78rem; color: var(--yellow);
  border: 1px solid rgba(245,200,66,0.2); border-radius: var(--r);
  padding: 9px 13px; margin-bottom: 16px;
  background: rgba(245,200,66,0.04);
}

/* ── RSVP ────────────────────────────────────────────── */
.rsvp-going { color: var(--green); font-weight: 600; }
.rsvp-maybe { color: var(--yellow); }

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 2px; }
::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #404040; }

/* ── Utility ─────────────────────────────────────────── */
.muted  { color: var(--muted); }
.red    { color: var(--red); }
.green  { color: var(--green); }
.yellow { color: var(--yellow); }
.small  { font-size: 0.78rem; }
.mt8    { margin-top: 8px; }
.mt16   { margin-top: 16px; }
.mt24   { margin-top: 24px; }
.mb8    { margin-bottom: 8px; }
.mb16   { margin-bottom: 16px; }
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap8   { gap: 8px; }
.gap12  { gap: 12px; }
.flex-1 { flex: 1; }
.bold   { font-weight: 700; }
.block  { display: block; }

/* ── Image Carousel ──────────────────────────────────── */
.field-carousel {
  position: relative; width: 100%; height: 300px;
  border-radius: var(--r); overflow: hidden;
  margin-bottom: 24px; background: var(--surface);
  border: 1px solid var(--line);
}
.carousel-track {
  display: flex; height: 100%;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.carousel-track img {
  flex-shrink: 0; width: 100%; height: 100%;
  object-fit: cover; cursor: zoom-in;
}
.carousel-track img:hover { opacity: 0.95; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.1);
  color: #fff; border-radius: 50%; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2;
  transition: background 0.15s, transform 0.15s;
  backdrop-filter: blur(4px);
}
.carousel-btn:hover { background: rgba(0,0,0,0.8); transform: translateY(-50%) scale(1.08); }
.carousel-btn-prev { left: 10px; }
.carousel-btn-next { right: 10px; }
.carousel-dots {
  position: absolute; bottom: 10px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 5px; z-index: 2;
}
.carousel-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,0.35); cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.carousel-dot.active { background: #fff; transform: scale(1.25); }
.carousel-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 28px 16px 28px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  font-size: 0.72rem; color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em; text-align: left;
  pointer-events: none;
}

/* ── Theater / Lightbox ──────────────────────────────── */
#theater-overlay {
  display: none; position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,0.96);
  flex-direction: column; align-items: center; justify-content: center;
  cursor: zoom-out;
  animation: theater-in 0.18s ease;
}
#theater-overlay.active { display: flex; }
@keyframes theater-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#theater-inner {
  position: relative; max-width: 92vw; max-height: 90vh;
  cursor: default; animation: theater-scale 0.2s cubic-bezier(0.34,1.2,0.64,1);
}
@keyframes theater-scale {
  from { transform: scale(0.93); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
#theater-img, #theater-vid {
  max-width: 92vw; max-height: 88vh;
  border-radius: var(--r); object-fit: contain;
  display: block;
}
#theater-close {
  position: fixed; top: 18px; right: 22px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  color: #fff; font-size: 1rem; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  z-index: 8001;
}
#theater-close:hover { background: rgba(255,255,255,0.15); }
#theater-caption {
  text-align: center; font-size: 0.72rem;
  color: rgba(255,255,255,0.45); letter-spacing: 0.04em;
  margin-top: 10px;
}

/* ── Tutorial widget (floating mission card) ─────────── */
#tut-widget {
  position: fixed; bottom: 24px; right: 24px;
  width: 290px; z-index: 6500;
  background: var(--surface2);
  border: 1px solid var(--line-hi);
  border-radius: 10px; padding: 18px 18px 16px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3), 0 16px 48px rgba(0,0,0,0.55);
  animation: tut-slide-in 0.3s cubic-bezier(0.34,1.2,0.64,1);
}
@keyframes tut-slide-in {
  from { transform: translateY(24px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}
@keyframes tut-slide-out {
  from { transform: translateY(0)    scale(1);    opacity: 1; }
  to   { transform: translateY(24px) scale(0.96); opacity: 0; }
}
#tut-w-head {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 12px;
}
#tut-w-progress {
  font-size: 0.62rem; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
  display: flex; align-items: center; gap: 6px;
}
#tut-w-progress::before {
  content: ''; display: inline-block; width: 4px; height: 4px;
  border-radius: 50%; background: var(--red);
  box-shadow: 0 0 5px rgba(232,64,64,0.7); flex-shrink: 0;
}
#tut-w-skip {
  font-size: 0.65rem; color: var(--muted); background: none;
  border: none; cursor: pointer; padding: 0; transition: color 0.12s;
}
#tut-w-skip:hover { color: var(--text); }
#tut-w-icon { font-size: 1.5rem; margin-bottom: 7px; }
#tut-w-title {
  font-size: 0.85rem; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text); margin-bottom: 7px;
}
#tut-w-body {
  font-size: 0.76rem; color: var(--muted); line-height: 1.7;
  margin-bottom: 14px;
}
#tut-w-hint {
  font-size: 0.72rem; color: var(--red);
  margin-bottom: 0; text-align: center;
  animation: tut-pulse 1.6s ease-in-out infinite;
}
@keyframes tut-pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.45; }
}
#tut-w-cta {
  width: 100%; padding: 9px 0; margin-top: 12px;
  background: var(--red); color: #fff; border: none;
  border-radius: var(--r); font-size: 0.78rem; font-weight: 600;
  cursor: pointer; letter-spacing: 0.01em;
  transition: opacity 0.15s, transform 0.1s;
}
#tut-w-cta:hover { opacity: 0.88; transform: translateY(-1px); }
#tut-w-cta:active { transform: translateY(0); }

/* ── Tutorial spotlight ──────────────────────────────── */
.tut-spotlight {
  outline: 2px solid var(--red) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(232,64,64,0.12), 0 0 24px rgba(232,64,64,0.25) !important;
  border-radius: var(--r) !important;
  position: relative;
  z-index: 100;
  animation: tut-spotlight-pulse 1.8s ease-in-out infinite;
}
@keyframes tut-spotlight-pulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(232,64,64,0.12), 0 0 24px rgba(232,64,64,0.25); }
  50%      { box-shadow: 0 0 0 8px rgba(232,64,64,0.08), 0 0 40px rgba(232,64,64,0.4); }
}

/* ── Tutorial welcome modal ──────────────────────────── */
#tut-welcome {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(0,0,0,0.88);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(12px);
}
#tut-welcome-box {
  background: var(--surface2);
  border: 1px solid var(--line-hi);
  border-radius: 12px;
  padding: 44px 36px 32px;
  max-width: 460px; width: 100%;
  text-align: center;
}
#tut-welcome-icon { font-size: 3rem; margin-bottom: 16px; }
#tut-welcome-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 12px; }
#tut-welcome-body { font-size: 0.85rem; color: var(--muted); line-height: 1.8; margin-bottom: 10px; }
#tut-welcome-sub { font-size: 0.72rem; color: var(--faint); margin-bottom: 28px; }
#tut-welcome-cta {
  display: block; width: 100%; padding: 13px 0;
  background: var(--red); color: #fff;
  border: none; border-radius: var(--r);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  margin-bottom: 12px;
  transition: opacity 0.15s, transform 0.15s;
}
#tut-welcome-cta:hover { opacity: 0.88; transform: translateY(-1px); }
#tut-welcome-skip { background: none; border: none; color: var(--muted); font-size: 0.78rem; cursor: pointer; padding: 6px; }
#tut-welcome-skip:hover { color: var(--text); }

/* ── Messages / DM chat ──────────────────────────────── */
.convo-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}
.convo-row:hover { background: var(--surface); }
.convo-row.active { background: var(--surface2); }
#chat-active { display: flex; flex-direction: column; height: 100%; }
#chat-msgs { scroll-behavior: smooth; }

/* ── Post friend highlight ───────────────────────────── */
.post-friend { border-left: 2px solid rgba(39,174,96,0.4); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; }
  .half    { grid-template-columns: 1fr; }
  .fields-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .kd-block { flex-wrap: wrap; }
  .hero-brand { font-size: 3rem; }
  .post-text, .post-actions, .comments { padding-left: 0; }
  .post::before { display: none; }
  .field-carousel { height: 210px; }
}
