/* ============================================================
   Farm Lord - Main CSS Design System
   Frontend Engineer v1.0
   Google Fonts: Inter + Cinzel (loaded via index.php)
   ============================================================ */

/* -- RESET & ROOT -------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Color Palette */
  --bg:          #080f09;
  --bg-2:        #0d1a0e;
  --surface:     #111f12;
  --surface-2:   #182a19;
  --surface-3:   #1e3320;
  --border:      #2a4d2c;
  --border-2:    #3a6b3d;

  --primary:     #4caf50;
  --primary-d:   #388e3c;
  --primary-l:   #81c784;
  --primary-glow: rgba(76,175,80,0.35);

  --gold:        #f9a825;
  --gold-l:      #ffd54f;
  --gold-glow:   rgba(249,168,37,0.4);

  --earth:       #6d4c41;
  --earth-l:     #a1887f;

  --water:       #29b6f6;
  --water-d:     #0288d1;

  --danger:      #ef5350;
  --danger-d:    #c62828;

  --sky:         #0d1b6b;
  --sky-l:       #1a237e;

  --text:        #e8f5e9;
  --text-2:      #a5d6a7;
  --text-muted:  #558b2f;
  --text-dim:    #4a6e4c;

  /* CSS Variable Aliases for Page Compatibility */
  --gold-light:  var(--gold-l);
  --bg-card:     var(--surface-2);
  --green:       var(--primary);
  --success:     var(--primary);

  /* Typography */
  --font-body:   'Inter', system-ui, sans-serif;
  --font-title:  'Cinzel', Georgia, serif;

  /* Spacing */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;
  --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --space-7: 48px; --space-8: 64px; --space-9: 96px;

  /* Radius */
  --r-sm:  6px;  --r-md:  12px;
  --r-lg:  20px; --r-xl:  32px; --r-full: 9999px;

  --radius-sm:   var(--r-sm);
  --radius-md:   var(--r-md);
  --radius-lg:   var(--r-lg);
  --radius-xl:   var(--r-xl);
  --radius-full: var(--r-full);

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.6);
  --shadow-glow-green: 0 0 20px var(--primary-glow);
  --shadow-glow-gold:  0 0 20px var(--gold-glow);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-mid:  280ms;
  --duration-slow: 500ms;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* -- SCROLLBAR ----------------------------------------------─ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary-d); }

/* -- TYPOGRAPHY ---------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-title);
  letter-spacing: 0.03em;
  line-height: 1.2;
}

a { color: var(--primary-l); text-decoration: none; transition: color var(--duration-fast); }
a:hover { color: var(--primary); }

/* -- UTILITY -------------------------------------------------- */
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
.flex { display:flex; }
.flex-center { display:flex; align-items:center; justify-content:center; }
.flex-between { display:flex; align-items:center; justify-content:space-between; }
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); } .gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.text-gold { color: var(--gold); }
.text-green { color: var(--primary); }
.text-muted { color: var(--text-2); }
.text-dim { color: var(--text-dim); }
.fw-bold { font-weight: 700; }
.text-center { text-align: center; }
.mt-1 { margin-top: var(--space-1); } .mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); } .mb-5 { margin-bottom: var(--space-5); }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* -- BUTTONS -------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 22px;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-mid) var(--ease);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.06);
  opacity: 0;
  transition: opacity var(--duration-fast);
}
.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(0.95); }

.btn-primary, .btn-green {
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-primary:hover, .btn-green:hover {
  box-shadow: 0 8px 30px var(--primary-glow);
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.2);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #f57c00);
  color: #111;
  font-weight: 700;
  box-shadow: 0 4px 15px var(--gold-glow);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-gold:hover {
  box-shadow: 0 8px 30px var(--gold-glow);
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.4);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-2);
}
.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.btn-danger, .btn-red {
  background: linear-gradient(135deg, var(--danger), var(--danger-d));
  color: #fff;
}
.btn-danger:hover, .btn-red:hover {
  box-shadow: 0 6px 25px rgba(239,83,80,0.4);
  transform: translateY(-1px);
}

.btn-xs  { padding: 4px 8px; font-size: 0.72rem; }
.btn-sm  { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg  { padding: 14px 32px; font-size: 1.05rem; }
.btn-xl  { padding: 18px 48px; font-size: 1.2rem; border-radius: var(--r-lg); }

.btn-icon { padding: 10px; border-radius: var(--r-md); }

/* -- CARDS ---------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-5);
  transition: all var(--duration-mid) var(--ease);
}
.card:hover {
  border-color: var(--primary-l);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 15px var(--primary-glow);
  transform: translateY(-4px);
}
.card-glass {
  background: rgba(17,31,18,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(76,175,80,0.2);
}
.card-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--primary-l);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* -- FORM ELEMENTS -------------------------------------------- */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label {
  font-size: 0.83rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
}
.form-input {
  width: 100%;
  padding: 11px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  outline: none;
}
.form-input::placeholder { color: var(--text-dim); }
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-input.error { border-color: var(--danger); }
.form-error {
  font-size: 0.8rem;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* -- PROGRESS BARS -------------------------------------------- */
.progress-wrap {
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
  height: 8px;
  position: relative;
}
.progress-bar {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.6s var(--ease);
  position: relative;
}
.progress-bar::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 8px;
  background: rgba(255,255,255,0.4);
  border-radius: var(--r-full);
  filter: blur(2px);
}
.progress-green { background: linear-gradient(90deg, var(--primary-d), var(--primary)); }
.progress-gold  { background: linear-gradient(90deg, #e65100, var(--gold)); }
.progress-water { background: linear-gradient(90deg, var(--water-d), var(--water)); }
.progress-xp    { background: linear-gradient(90deg, #7b1fa2, #ce93d8); }

/* -- BADGES --------------------------------------------------─ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-green  { background: rgba(76,175,80,0.2);  color: var(--primary-l); border: 1px solid rgba(76,175,80,0.4); }
.badge-gold   { background: rgba(249,168,37,0.2); color: var(--gold-l);   border: 1px solid rgba(249,168,37,0.4); }
.badge-blue   { background: rgba(41,182,246,0.2); color: var(--water);    border: 1px solid rgba(41,182,246,0.4); }
.badge-red    { background: rgba(239,83,80,0.2);  color: #ef9a9a;         border: 1px solid rgba(239,83,80,0.4); }
.badge-purple { background: rgba(156,39,176,0.2); color: #ce93d8;         border: 1px solid rgba(156,39,176,0.4); }

/* -- TOAST NOTIFICATIONS -------------------------------------- */
#toast-container {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  max-width: 360px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s var(--ease);
  pointer-events: all;
  backdrop-filter: blur(12px);
}
.toast.toast-success { border-left-color: var(--primary); }
.toast.toast-error   { border-left-color: var(--danger); }
.toast.toast-gold    { border-left-color: var(--gold); }
.toast.toast-info    { border-left-color: var(--water); }
.toast-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 2px; }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 2px; }
.toast-msg   { font-size: 0.82rem; color: var(--text-2); }
.toast-out   { animation: toastOut 0.3s var(--ease) forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); max-height: 100px; }
  to   { opacity: 0; transform: translateX(20px); max-height: 0; padding: 0; margin: 0; }
}

/* -- MODAL ---------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 0.2s var(--ease);
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: var(--space-6);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg), 0 0 40px var(--primary-glow);
  animation: slideUp 0.3s var(--ease);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.modal-title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--primary-l);
}
.modal-close {
  background: none; border: none;
  color: var(--text-muted); font-size: 1.5rem;
  cursor: pointer; line-height: 1;
  transition: color var(--duration-fast);
}
.modal-close:hover { color: var(--danger); }

@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

/* -- LOADING SPINNER ------------------------------------------ */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(76,175,80,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -- DIVIDER -------------------------------------------------- */
.divider {
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.1em; margin: var(--space-4) 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border);
}

/* -- LANDING PAGE SPECIFIC ------------------------------------ */

/* Stars / particles background */
.stars-bg {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(13,27,14,0.8) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(8,20,60,0.6) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(10,20,8,0.9) 0%, transparent 50%),
    url('../img/bg-farm.jpg') center/cover no-repeat;
  z-index: -2;
}
.stars-overlay {
  position: fixed; inset: 0;
  background: rgba(8,15,9,0.55);
  z-index: -1;
}

/* Floating particles */
.particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.particle {
  position: absolute;
  width: 3px; height: 3px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0;
  animation: float-particle linear infinite;
  box-shadow: 0 0 6px var(--primary);
}

@keyframes float-particle {
  0%   { opacity:0; transform:translateY(100vh) scale(0); }
  10%  { opacity:0.8; }
  90%  { opacity:0.4; }
  100% { opacity:0; transform:translateY(-20px) scale(1.5); }
}

/* Landing layout */
.landing-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 460px;
  position: relative;
  z-index: 1;
}

/* Hero section */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-8) var(--space-8) var(--space-8) var(--space-9);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 16px;
  background: rgba(76,175,80,0.1);
  border: 1px solid rgba(76,175,80,0.3);
  border-radius: var(--r-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-l);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-5);
  width: fit-content;
  animation: pulseGlow 2.5s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%,100% { box-shadow: 0 0 0 0 var(--primary-glow); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.hero-title {
  font-family: var(--font-title);
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 1.05;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-l) 40%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-4);
  filter: drop-shadow(0 0 30px rgba(76,175,80,0.3));
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-2);
  max-width: 540px;
  margin-bottom: var(--space-6);
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  gap: var(--space-6);
  margin-bottom: var(--space-7);
}
.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-stat-value {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow);
}
.hero-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.hero-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.hero-feature {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.9rem;
  color: var(--text-2);
}
.hero-feature-icon {
  width: 32px; height: 32px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Auth panel */
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-7) var(--space-6);
  background: rgba(11,18,11,0.7);
  backdrop-filter: blur(24px);
  border-left: 1px solid var(--border);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}
.auth-panel::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(76,175,80,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.auth-panel::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(249,168,37,0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* Logo */
.logo-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.logo-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--primary-d), var(--primary));
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  box-shadow: var(--shadow-glow-green);
  flex-shrink: 0;
}
.logo-text { font-family: var(--font-title); }
.logo-title { font-size: 1.5rem; color: var(--text); line-height: 1; }
.logo-domain { font-size: 0.72rem; color: var(--text-dim); letter-spacing: 0.08em; margin-top: 2px; }

/* Tabs */
.auth-tabs {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: var(--space-5);
  gap: 4px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-mid) var(--ease);
}
.auth-tab.active {
  background: linear-gradient(135deg, var(--primary-d), var(--primary));
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.auth-form { display: none; }
.auth-form.active {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  animation: slideUp 0.3s var(--ease);
}

/* Server message banner */
.alert {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r-md);
  font-size: 0.88rem;
  font-weight: 500;
}
.alert-success { background: rgba(76,175,80,0.12); border:1px solid rgba(76,175,80,0.3); color: var(--primary-l); }
.alert-error   { background: rgba(239,83,80,0.12); border:1px solid rgba(239,83,80,0.3); color: #ef9a9a; }
.alert-info    { background: rgba(41,182,246,0.12);border:1px solid rgba(41,182,246,0.3); color: var(--water); }

/* Season badge in corner */
.season-indicator {
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  background: rgba(11,18,11,0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 0.8rem;
  color: var(--text-2);
}
.season-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulseGlow 2s ease-in-out infinite;
  box-shadow: 0 0 6px var(--primary);
}

/* -- RESPONSIVE ----------------------------------------------─ */
@media (max-width: 900px) {
  .landing-wrap {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .hero {
    padding: var(--space-6) var(--space-5);
    text-align: center;
    align-items: center;
  }
  .hero-stats { justify-content: center; }
  .hero-features { align-items: flex-start; max-width: 400px; }
  .auth-panel {
    min-height: auto;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: var(--space-6) var(--space-5);
  }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2.2rem; }
  .hero-stats { flex-wrap: wrap; gap: var(--space-4); }
  #toast-container { left: var(--space-3); right: var(--space-3); max-width: none; }
}

/* ============================================================
   GAME LAYOUT (Header, Footer, Navigation, HUD)
   ============================================================ */
.game-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 10% 20%, rgba(13,27,14,0.8) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(8,15,60,0.4) 0%, transparent 50%);
}

/* -- GAME HEADER ---------------------------------------------- */
.game-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,15,9,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.game-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-5);
  height: 62px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}
.nav-logo {
  display: flex; align-items: center; gap: var(--space-2);
  text-decoration: none; flex-shrink: 0;
}
.nav-logo-icon { font-size: 1.5rem; }
.nav-logo-text {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--primary-l);
  white-space: nowrap;
}

.nav-links {
  display: flex; list-style: none;
  gap: 2px; flex: 1;
  padding: 0; margin: 0;
}
.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: all var(--duration-fast);
  position: relative; white-space: nowrap;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active {
  background: rgba(76,175,80,0.12);
  color: var(--primary-l);
  font-weight: 600;
}
.nav-link.active::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0; height: 2px;
  background: var(--primary); border-radius: var(--r-full);
}

/* Badge on nav items (notifications count) */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-full);
  position: absolute; top: 2px; right: 2px;
}
.nav-link .nav-badge { position: static; margin-left: 2px; }

/* HUD Stats */
.hud-stats {
  display: flex; align-items: center; gap: var(--space-3);
  flex-shrink: 0; margin-left: auto;
}
.hud-stat {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.82rem;
}
.hud-stat-icon { font-size: 0.9rem; }
.hud-stat-val { font-weight: 700; color: var(--text); font-size: 0.85rem; }
.hud-gold .hud-stat-val { color: var(--gold); }

.hud-energy-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 100px; }
.hud-energy-bar {
  height: 5px; background: var(--surface-3);
  border-radius: var(--r-full); overflow: hidden;
}
.progress-bar--energy {
  height: 100%;
  background: linear-gradient(90deg, var(--water-d), var(--water));
  border-radius: var(--r-full);
  transition: width 1s ease;
}

.hud-xp-wrap { display: flex; flex-direction: column; gap: 2px; }

/* Notification panel */
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
}
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 0.9rem;
}
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
  display: flex; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--duration-fast);
  text-decoration: none; color: inherit;
}
.notif-item:hover { background: var(--surface-2); color: var(--text); }
.notif-item.unread { background: rgba(76,175,80,0.06); }
.notif-item-icon { font-size: 1.2rem; flex-shrink: 0; }
.notif-item-body { flex: 1; }
.notif-item-title { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.notif-item-msg   { font-size: 0.75rem; color: var(--text-2); margin-top: 1px; }
.notif-item-time  { font-size: 0.68rem; color: var(--text-dim); margin-top: 3px; }
.notif-loading    { padding: var(--space-5); display:flex;justify-content:center; }

/* Player menu */
.hud-player { position: relative; }
.hud-avatar-btn {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 5px 10px;
  cursor: pointer; color: var(--text);
  transition: all var(--duration-fast);
}
.hud-avatar-btn:hover {
  border-color: var(--border-2);
  background: var(--surface-3);
}
.hud-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--primary-d), var(--primary));
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: #fff;
  flex-shrink: 0;
}
.hud-player-name { font-size: 0.82rem; font-weight: 600; }

.player-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden; z-index: 200;
  animation: slideUp 0.2s var(--ease);
}
.player-menu-item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 10px var(--space-4);
  color: var(--text-2); font-size: 0.88rem;
  text-decoration: none; cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.player-menu-item:hover { background: var(--surface-2); color: var(--text); }
.player-menu-danger:hover { color: var(--danger); }
.player-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* World event banner */
.world-event-banner {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 8px var(--space-5);
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid;
  font-size: 0.85rem; font-weight: 600;
}

/* -- GAME FOOTER ---------------------------------------------- */
.game-footer { margin-top: auto; border-top: 1px solid var(--border); }
.game-footer-inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  max-width: 1400px; margin: 0 auto; width: 100%;
}

/* Mobile hamburger */
.nav-mobile-toggle {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.hamburger-line {
  display: block; width: 22px; height: 2px;
  background: var(--text-2); border-radius: 2px;
  transition: all 0.3s;
}

/* -- RESPONSIVE HEADER ---------------------------------------- */
@media (max-width: 1024px) {
  .hud-xp { display: none; }
}
@media (max-width: 860px) {
  .nav-links { display: none; position: absolute; top: 62px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: var(--space-3); gap: 2px; z-index: 99; }
  .nav-links.open { display: flex; }
  .nav-link { padding: 10px 16px; }
  .nav-mobile-toggle { display: flex; }
  .hud-energy-wrap { display: none; }
}
@media (max-width: 600px) {
  .hud-gold, .hud-energy { display: none; }
  .hud-player-info { display: none; }
}
