:root {
  --bg: #0B1A17;
  --bg-alt: #0E1F1B;
  --card: #142F28;
  --card-border: #1F433A;
  --text: #F5EFE6;
  --muted: #93AFA6;
  --orange: #FF7A3D;
  --gold: #FFC24B;
  --pink: #E6407E;
  --online: #3ECF8E;
  --offline: #E6407E;

  --font-display: 'Anton', sans-serif;
  --font-body: 'Work Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.accent { color: var(--orange); }
.mono { font-family: var(--font-mono); }

/* subtle grain texture over everything, gives the poster/street feel without being loud */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 26, 23, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; }
.brand-mark {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
}
.brand-mark.small { font-size: 20px; }
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 15px;
  font-weight: 500;
}
.nav-links a { color: var(--muted); transition: color 0.15s; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; gap: 10px; }

@media (max-width: 820px) {
  .nav-links { display: none; }
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.btn-primary { background: var(--orange); color: #16110A; }
.btn-primary:hover { background: #ff8f5c; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,0.18); color: var(--text); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }
.btn-block { width: 100%; }
.btn-copy {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 8px 14px;
  font-size: 13px;
}
.btn-copy:hover { background: rgba(255,255,255,0.14); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 0 24px 80px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(11,26,23,0.15) 0%, rgba(11,26,23,0.55) 55%, var(--bg) 100%),
    url("/images/banner.jpg");
  background-size: cover;
  background-position: center 30%;
  transform: scale(1.05);
}
.hero-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 10%, rgba(255,122,61,0.18), transparent 55%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
  margin: 0 0 14px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 9vw, 108px);
  line-height: 0.94;
  letter-spacing: 0.01em;
  margin: 0 0 20px;
  text-shadow: 0 4px 40px rgba(0,0,0,0.4);
}
.hero-sub {
  font-size: 18px;
  color: var(--muted);
  max-width: 480px;
  margin: 0 0 36px;
}

/* signature element: the live status card, styled like a painted street sign */
.status-card {
  background: rgba(20, 47, 40, 0.82);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 20px 24px;
  max-width: 440px;
  backdrop-filter: blur(6px);
}
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.status-dot-wrap { display: flex; align-items: center; gap: 10px; }
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.5);
}
.status-dot.online {
  background: var(--online);
  animation: pulse 2s infinite;
}
.status-dot.offline { background: var(--offline); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(62, 207, 142, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0); }
}
.status-text { font-size: 14px; font-weight: 600; }
.status-players { text-align: right; }
.status-players .mono { font-size: 20px; font-weight: 600; display: block; }
.status-label { font-size: 10px; color: var(--muted); letter-spacing: 0.1em; }
.connect-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.25);
  border-radius: 6px;
  padding: 10px 12px;
}
.connect-code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gold);
  flex: 1;
  overflow-x: auto;
  white-space: nowrap;
}

/* ---------- SECTIONS ---------- */
.section { padding: 100px 24px; }
.section-alt { background: var(--bg-alt); }
.section-inner { max-width: 900px; margin: 0 auto; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  margin: 0 0 16px;
  letter-spacing: 0.01em;
}
.section-lead {
  color: var(--muted);
  font-size: 17px;
  max-width: 640px;
  margin: 0 0 56px;
}

/* ---------- RULES ---------- */
.rules-list { display: flex; flex-direction: column; gap: 28px; }
.rules-list li {
  display: flex;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rules-list li:last-child { border-bottom: none; padding-bottom: 0; }
.rule-num {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--orange);
  min-width: 56px;
  opacity: 0.85;
}
.rules-list h3 { margin: 0 0 6px; font-size: 18px; }
.rules-list p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- PENALTY TABLE ---------- */
.table-wrap {
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
}
.penalty-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.penalty-table th {
  text-align: left;
  padding: 14px 18px;
  background: var(--card);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--card-border);
}
.penalty-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--muted);
}
.penalty-table tr:last-child td { border-bottom: none; }
.penalty-table td:first-child { color: var(--text); font-weight: 500; }

/* ---------- DONATIONS ---------- */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 780px) {
  .tier-grid { grid-template-columns: 1fr; }
}
.tier-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}
.tier-featured { border-color: var(--orange); }
.tier-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--orange);
  color: #16110A;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.tier-card h3 { font-size: 20px; margin: 0 0 8px; }
.tier-price { font-family: var(--font-mono); font-size: 28px; margin: 0 0 20px; }
.tier-price span { font-size: 13px; color: var(--muted); font-weight: 400; }
.tier-card ul { margin-bottom: 24px; flex: 1; }
.tier-card li {
  font-size: 14px;
  color: var(--muted);
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
}
.tier-card li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--orange);
}

/* ---------- APPLICATIONS ---------- */
.apply-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 700px) {
  .apply-grid { grid-template-columns: 1fr; }
}
.apply-card {
  text-align: left;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 32px 28px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.apply-card:hover { border-color: var(--orange); transform: translateY(-2px); }
.apply-icon { font-size: 32px; display: block; margin-bottom: 16px; }
.apply-card h3 { margin: 0 0 8px; font-size: 20px; }
.apply-card p { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.apply-cta { color: var(--orange); font-weight: 600; font-size: 14px; }

/* ---------- FOOTER ---------- */
.footer { padding: 48px 24px; border-top: 1px solid rgba(255,255,255,0.06); }
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-copy { font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 20px; font-size: 14px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 32px;
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal h3 { font-family: var(--font-display); font-size: 24px; margin: 0 0 20px; }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
#apply-form { display: flex; flex-direction: column; gap: 16px; }
#apply-form label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.field-hint { font-size: 11px; color: var(--muted); opacity: 0.8; font-weight: 400; }
#apply-form input, #apply-form textarea {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}
#apply-form input:focus, #apply-form textarea:focus {
  outline: none;
  border-color: var(--orange);
}
.form-status { font-size: 13px; text-align: center; margin: 4px 0 0; min-height: 18px; }
.form-status.success { color: var(--online); }
.form-status.error { color: var(--offline); }

/* ---------- USER BADGE (nav auth slot) ---------- */
.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  padding: 4px 6px 4px 4px;
}
.user-avatar { width: 26px; height: 26px; border-radius: 50%; display: block; }
.user-name { font-size: 13px; font-weight: 600; }
.user-level {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  background: rgba(255,194,75,0.15);
  padding: 2px 8px;
  border-radius: 999px;
}
.user-logout {
  color: var(--muted);
  font-size: 16px;
  padding: 0 4px;
}
.user-logout:hover { color: var(--offline); }
.nav-links a.active-link { color: var(--orange); }

/* ---------- GENERIC PAGE LAYOUT (chat/forum) ---------- */
.page-main { padding: 60px 24px 100px; }
.page-inner { max-width: 1000px; margin: 0 auto; }
.page-inner.narrow { max-width: 720px; }
.back-link { color: var(--muted); font-size: 14px; display: inline-block; margin-bottom: 24px; }
.back-link:hover { color: var(--orange); }

/* ---------- CHAT ---------- */
.chat-box {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  height: 60vh;
  min-height: 420px;
  margin-top: 32px;
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-msg { display: flex; gap: 12px; }
.chat-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; }
.chat-msg-body { flex: 1; min-width: 0; }
.chat-msg-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.chat-msg-name { font-weight: 600; font-size: 13px; }
.chat-msg-level {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gold);
  background: rgba(255,194,75,0.15);
  padding: 1px 6px;
  border-radius: 999px;
}
.chat-msg-time { font-size: 11px; color: var(--muted); }
.chat-msg-text { font-size: 14px; word-wrap: break-word; }
.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.chat-input {
  flex: 1;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.chat-input:focus { outline: none; border-color: var(--orange); }
.chat-input:disabled { opacity: 0.5; }
.chat-login-hint { text-align: center; padding: 14px; font-size: 13px; color: var(--muted); }
.chat-login-hint a { color: var(--orange); font-weight: 600; }

/* ---------- FORUM ---------- */
.forum-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.thread-list { display: flex; flex-direction: column; gap: 10px; }
.thread-row {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 16px 18px;
  transition: border-color 0.15s;
}
.thread-row:hover { border-color: var(--orange); }
.thread-row-body { flex: 1; min-width: 0; }
.thread-row-top { display: flex; gap: 8px; margin-bottom: 6px; }
.thread-category-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--orange);
  background: rgba(255,122,61,0.15);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}
.thread-closed-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  background: rgba(255,255,255,0.08);
  padding: 3px 8px;
  border-radius: 4px;
}
.thread-title { margin: 0 0 4px; font-size: 16px; }
.thread-meta { margin: 0; font-size: 12px; color: var(--muted); }

.thread-detail-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 38px);
  margin: 10px 0 24px;
}
.thread-post {
  display: flex;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.thread-post-body { flex: 1; }
.thread-post-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.thread-post-text { margin: 0; font-size: 14px; white-space: pre-wrap; }
.replies-heading { font-size: 14px; color: var(--muted); margin: 24px 0 12px; }
.reply-box { margin-top: 20px; }
.reply-box form { display: flex; flex-direction: column; gap: 12px; }
.reply-box textarea {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}
.reply-box textarea:focus { outline: none; border-color: var(--orange); }

#new-thread-form select {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.form-identity { font-size: 13px; color: var(--muted); margin: -8px 0 4px; }

/* ---------- SCROLL REVEAL (fade + rise dok skroluješ) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in-view { opacity: 1; transform: none; }
.reveal-group > * { transition-delay: calc(var(--reveal-index, 0) * 70ms); }
