:root{
  --bg-0:#1a1a1a;     /* donker grijs-bruin i.p.v. pikzwart */
  --bg-1:#22201d;     /* paneel donkerbruin */
  --bg-2:#2a2825;     /* alt panelen */
  --edge:#3a322b;     /* zachte bruine randen */
  --ink:#f8f2e7;      /* warm ivoorwit */
  --muted:#b3a996;    /* verouderd papiergrijs */
  --accent:#d9b66a;   /* warm gangster goud */
  --danger:#a94442;   /* bloedrood */
  --success:#5e7b5e;  /* verweerd groen */

  --shadow-1:0 6px 18px rgba(0,0,0,.45);
  --shadow-2:0 0 0 1px rgba(217,182,106,.15), 0 10px 28px rgba(0,0,0,.55);
}

/* ---------- Base ---------- */
*,*::before,*::after{box-sizing:border-box;}
html,body{height:100%}

body {
  margin:0;
  color:var(--ink);
  font-family:"Cinzel","Cormorant Garamond","Playfair Display",serif;

  /* Lichtere noir achtergrond */
  background-image:url('/img/back.webp');
  background-attachment:fixed;
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  background-color:#1f1a17; /* fallback sepia tint */
  min-height:100vh;
  overflow-x:hidden;
}

body::after { content:none; }

/* ---------- Containers ---------- */
.container{
  background:linear-gradient(180deg, rgba(42,40,37,.92), rgba(28,26,24,.92));
  border:1px solid var(--edge);
  border-radius:12px;
  padding:24px;
  width:min(1200px,92%);
  margin:24px auto;
  box-shadow:var(--shadow-1);
  backdrop-filter:blur(3px);
}

/* ---------- Tables ---------- */
table{
  width:100%;
  border-collapse:collapse;
  margin:20px 0;
  background:var(--bg-1);
  border:1px solid var(--edge);
  border-radius:10px;
  overflow:hidden;
  box-shadow:var(--shadow-1);
}
table th,table td{
  padding:12px 14px;
  border-bottom:1px solid #2e2a27;
  text-align:left;
  color:var(--ink);
}
table th{
  background:linear-gradient(180deg,#2e2a27,#221f1c);
  color:var(--accent);
  letter-spacing:.05em;
  font-family:"Cinzel",serif;
  position:sticky; top:0; z-index:1;
}
table tr:nth-child(even) td{background:rgba(255,255,255,.03)}
table tr:hover td{background:rgba(217,182,106,.08)}

/* ---------- Header ---------- */
header{ text-align:center; margin:10px 0 22px; }
.game-title{
  width:200px; height:auto;
  border:2px solid var(--accent);
  border-radius:6px;
  box-shadow:0 0 20px rgba(196,167,71,.3);
  background:linear-gradient(180deg,#1a1a1a,#2a2a2a);
}

/* ---------- Forms ---------- */
.forms-container{display:flex; gap:20px; justify-content:center; flex-wrap:wrap;}
.form-box{
  background:linear-gradient(180deg, rgba(40,38,35,.95), rgba(26,24,22,.95));
  padding:20px; border-radius:12px; box-shadow:var(--shadow-2);
  width:100%; max-width:420px; border:1px solid var(--edge);
}
fieldset{
  border:1px solid var(--edge);
  border-radius:10px; padding:16px;
  background:rgba(255,255,255,.03);
}
legend{
  font-size:1.05rem; color:var(--accent);
  padding:0 10px; border:1px solid rgba(217,182,106,.25);
  border-radius:6px; background:#2a2622;
  text-shadow:0 0 10px rgba(217,182,106,.3);
}
input[type="text"],input[type="password"],input[type="email"],select{
  width:100%; padding:11px 12px; margin-top:10px;
  border:1px solid #3a322b; border-radius:8px;
  background:#2a2622; color:var(--ink);
  transition:border-color .2s, box-shadow .2s, background .2s;
}
input:focus,select:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(217,182,106,.15);
  background:#24201d;
}

/* ---------- Buttons ---------- */
button,.start-button,.train-button{
  padding:11px 18px;
  background:linear-gradient(145deg,#2c2926,#1f1c19);
  color:var(--ink); border:1px solid #3a322b;
  border-radius:8px; cursor:pointer; font-size:1rem;
  font-weight:700; letter-spacing:.05em; text-transform:uppercase;
  box-shadow:var(--shadow-1);
  transition:transform .08s, box-shadow .2s, border-color .2s, color .2s, background .2s;
}
button:hover,.start-button:hover,.train-button:hover{
  border-color:var(--accent); color:#1a120b;
  background:linear-gradient(145deg,var(--accent),#b49247);
  box-shadow:0 0 0 2px rgba(217,182,106,.25), 0 10px 24px rgba(0,0,0,.6);
}
button:active,.start-button:active,.train-button:active{ transform:translateY(1px); }

/* ---------- Sections ---------- */
.about-game,.user-stats{
  margin-top:20px; background:linear-gradient(180deg,#2a2723,#1f1d1a);
  padding:20px; border-radius:12px; box-shadow:var(--shadow-1); border:1px solid var(--edge);
}

/* ---------- Features ---------- */
.features-container{
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
  gap:20px; text-align:center;
}
.feature{
  padding:14px; background:#2c2824; border:1px solid #3a322b;
  border-radius:12px; box-shadow:var(--shadow-1);
  transition:transform .12s, box-shadow .2s, border-color .2s;
}
.feature:hover{ transform:translateY(-2px); border-color:var(--accent);
  box-shadow:0 0 0 2px rgba(217,182,106,.15), var(--shadow-1); }
.feature h3{ margin-bottom:8px; font-size:1.15em; color:var(--accent); text-shadow:0 0 10px rgba(217,182,106,.25); }
.feature p{ color:var(--muted); }

/* ---------- Sidebar & Main ---------- */
.sidebar{
  width:260px !important;
  background:linear-gradient(180deg,#2a2622,#1c1a18) !important;
  padding:20px !important; box-shadow:var(--shadow-1) !important;
  border-radius:12px !important; position:fixed !important;
  top:48px !important; left:0 !important; height:calc(100vh - 56px) !important;
  overflow-y:auto !important; z-index:900 !important; border:1px solid var(--edge) !important;
}
.main-content{
  margin-left:276px !important; padding:22px !important;
  width:calc(100% - 276px) !important; min-height:calc(100vh - 60px) !important;
  background:transparent !important; position:relative !important; z-index:800 !important; float:right !important;
}

/* ---------- Brand ---------- */
.brand-title{
  font-size:2em; font-weight:800; text-align:center; margin:18px 0 10px;
  color:var(--accent);
  text-shadow:0 0 22px rgba(217,182,106,.35), 0 0 2px rgba(0,0,0,.7);
  letter-spacing:.06em;
  font-family:"Cinzel", serif;
}

/* ---------- User Panel & Bars ---------- */
.user-panel{
  background:linear-gradient(180deg,#2a2723,#1c1a18);
  padding:12px; border-radius:12px; margin-bottom:20px;
  border:1px solid var(--edge); box-shadow:var(--shadow-1);
}
.user-info{margin-bottom:10px}
.stats-bars{margin-bottom:10px}
.stat-bar{margin:8px 0}

.progress-bar{
  background:#1e1b18; width:100%; height:14px; border-radius:999px;
  overflow:hidden; border:1px solid #3a322b; box-shadow:inset 0 2px 6px rgba(0,0,0,.5); position:relative;
}
.progress-bar span{
  display:block; height:100%; width:0%; transition:width .45s ease;
  border-radius:999px; box-shadow:inset 0 -1px 0 rgba(255,255,255,.15);
}
/* mafia palettes */
.energy-bar{ background:linear-gradient(90deg,#6d5f4b,#8c7a63); color:#e6d8c0;}
.will-bar  { background:linear-gradient(90deg,#6e5c5c,#8b7373); color:#e8d0d0;}
.brave-bar { background:linear-gradient(90deg,#a94442,#7a2a2a); color:#f0c0c0;}
.exp-bar   { background:linear-gradient(90deg,#d9b66a,#9c7d3c); color:#fff2c9;}
.health-bar{ background:linear-gradient(90deg,#5e7b5e,#3d513d); color:#cde6cd;}

/* ---------- Headings & Text ---------- */
h3{
  color:var(--accent); border-bottom:1px solid rgba(217,182,106,.25);
  padding-bottom:6px; margin-bottom:14px; font-size:1.4em;
  text-shadow:0 0 10px rgba(217,182,106,.25);
  font-family:"Cinzel", serif;
}
p{ color:var(--muted); margin:0 0 14px 0; font-size:1rem; }

/* ---------- Footer ---------- */
.footer{
  background:#1c1a18; color:var(--muted); padding:12px; text-align:center;
  margin-top:auto; border-radius:12px; border-top:1px solid var(--edge);
}

/* ---------- Hide unused nav ---------- */
.navbar-links,.navbar{display:none}

/* ---------- Links ---------- */
a{
  color:var(--accent); text-decoration:none; font-weight:700;
  transition:color .2s, text-shadow .2s;
}
a:hover{ color:#e6c97c; text-shadow:0 0 10px rgba(217,182,106,.35); }

/* ---------- Expedition ---------- */
.expedition-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:18px; padding:12px 0 4px; }
.expedition-box{
  background:#2c2824; border:1px solid #3a322b; padding:14px; text-align:center;
  color:var(--ink); border-radius:12px; box-shadow:var(--shadow-1);
  transition:transform .12s, box-shadow .2s;
}
.expedition-box:hover{ transform:translateY(-2px); box-shadow:0 0 0 2px rgba(160,39,39,.18), var(--shadow-1); border-color:var(--danger); }
.expedition-box h4{ color:var(--accent); font-size:1.15em; margin:4px 0 6px; text-shadow:0 0 10px rgba(217,182,106,.25); }
.expedition-box p{ color:var(--muted); }
.expedition-image{ width:100%; height:auto; border-radius:10px; box-shadow:0 6px 18px rgba(0,0,0,.4); }
.start-button{ margin-top:10px; }

/* ---------- Gym / Actions ---------- */
.divider{ border:1px solid #3a322b; margin:16px 0; box-shadow:inset 0 1px 0 rgba(255,255,255,.04); }
.error-message{
  color:#ffd0d0; text-align:center; font-weight:800; font-size:1.05rem;
  background:linear-gradient(180deg, rgba(70,20,20,.75), rgba(40,10,10,.75));
  padding:12px; border-radius:10px; border:1px solid rgba(160,39,39,.45);
  box-shadow:0 0 0 2px rgba(160,39,39,.15), var(--shadow-1); margin:12px 0;
}
.energy-status{
  text-align:center; font-size:1.05rem;
  background:linear-gradient(180deg,#2c2824,#1c1a18);
  padding:12px; border-radius:10px; border:1px solid var(--edge); box-shadow:var(--shadow-1); margin:12px 0;
}
.input-field{
  width:70px; padding:7px 8px; margin-top:10px;
  border:1px solid #3a322b; border-radius:8px; background:#2a2622; color:var(--ink); text-align:center;
}
.input-field:focus{ border-color:var(--danger); box-shadow:0 0 0 3px rgba(160,39,39,.18); }

/* ---------- Responsive ---------- */
@media (max-width:1024px){
  .main-content{ margin-left:0 !important; width:100% !important; float:none !important; }
}
@media (max-width:768px){
  .forms-container{ flex-direction:column; align-items:center; }
  .form-box{ width:92%; }
  .container{ width:94%; margin:16px auto; }
  .sidebar{
    width:230px !important;
    transform:translateX(-100%) !important;
    transition:transform .28s ease !important;
    z-index:999 !important;
  }
  .sidebar.active{ transform:translateX(0) !important; }
}

/* ---------- Accessibility ---------- */
:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:6px; }
