/* Minimal, clean, readable */

:root{
  --bg:#212121;
  --panel:#121824;
  --panel2:#0f141e;
  --border:rgba(255,255,255,.10);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.65);
  --muted2:rgba(255,255,255,.45);
  --link:#9ad0ff;
  --btn:#000;;
  --btnHover:#24324a;
  --shadow:0 10px 30px rgba(0,0,0,.35);

  --activeBg:#abffaa; /* requested */
  --contentPad:22px;
  --mobilebar-h:0px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;

  font-family: "Nunito", Arial, Helvetica, sans-serif;
  background: var(--bg);
  color:var(--text);
  overflow:hidden; /* separate scroll containers */
}

a{color:var(--link)}
a:hover{text-decoration:underline}

.mobilebar{
  display:none;
}

.overlay{
  display:none;
}

/* Desktop layout */
.layout{
  height:100vh;
  display:grid;
  grid-template-columns: 340px 1fr;
}

/* Sidebar */
.sidebar{
  background: #080808;
  display:grid;
  grid-template-rows: auto 1fr auto;
  height:100vh;
  min-height:0;
}

.brand{
  padding:18px 18px 12px;
  border-bottom:1px solid var(--border);
}

.brand-title{
  font-size:18px;
  font-weight:800;
  letter-spacing:.2px;
  margin-bottom:12px;
}

.search{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
}

.search::placeholder{color:var(--muted2)}
.search:focus{border-color:rgba(154,208,255,.55)}

.menu{
  overflow:auto;
  padding:10px;
  min-height:0;
}

.menu-item{
  display:block;
  width:100%;
  text-align:left;
  border:1px solid transparent;
  background:transparent;
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  transition: background .15s ease, transform .05s ease, border-color .15s ease;
  margin-bottom:8px;
}

.menu-item:hover{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.06);
}

.menu-item:active{transform:scale(.995)}
.menu-item .menu-title{
  font-weight:700;
  font-size:14px;
  line-height:1.2;
}
.menu-item .menu-meta{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
}

/* Active highlight requested */
.menu-item.active {
    background: #abffaa2b;
    border-color: rgb(171 255 170);
    color: rgb(171 255 170);
    text-shadow: 0px 0px 7px #000000;
    border-radius: 0px;
border-left: none;
border-right: none;
}
.menu-item.active .menu-meta{
  color: white;
}

.sidebar-bottom{
  border-top:1px solid var(--border);
  padding:12px 18px;
  color:var(--muted2);
  font-size:12px;
}

/* Content */
.content{
  height:100%;
  overflow:hidden;
  min-height:0;
  display:flex;
    padding: 0px;
  flex-direction:column;
  overflow-y:auto;
  overflow-x:hidden; /* wichtig: verhindert Seitwärts-Scroll der ganzen Seite */
  min-height:0;
  min-width:0;       /* wichtig bei Grid/Flex: erlaubt echtes Shrinken */
}

.chapter,
.chapter-body{
  min-width:0;
}

.chapter{
  flex:1;
  min-height:0;
  width:100%;
  height:100%;
  max-width:none;
  margin:0;
  padding:0;
  overflow:auto;
  background: rgba(255,255,255,.02);
}

.navrow{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  padding:12px var(--contentPad);
}

.navrow-top{
  position:static;
  top:auto;
  z-index:auto;
  border-bottom:1px solid var(--border);
}

.navrow-bottom{
  margin-top:0;
  padding-top: 15px;
  border-top:1px solid var(--border);
}

.btn{
  appearance:none;
  border:1px solid var(--border);
  background:var(--btn);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
  font-size:13px;
}

.btn:hover{background:var(--btnHover)}
.btn:disabled{opacity:.45; cursor:not-allowed}

.chapter-header{
  margin:0;
  padding:18px var(--contentPad) 14px;
}

.chapter-header h1{
  margin:0 0 10px;
  font-size:28px;
  line-height:1.15;
}

.chapter-meta{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:13px;
}

.chapter-body{
  line-height:1.6;
  font-size:16px;
  padding:0 var(--contentPad) 22px;
}

.chapter-body img{max-width:100%; height:auto}

.chapter-body table{
  width:100%;
  border-collapse:collapse;
  margin:14px 0 18px;
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
}

.chapter-body th, .chapter-body td{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  vertical-align:top;
}

.chapter-body th{
  text-align:left;
  font-weight:800;
  color:var(--text);
  background:rgba(255,255,255,.04);
}

.chapter-body tr:last-child td{border-bottom:none}

/* Kampfbericht-Tabellen (aus deinen Kapitel-Dateien) */
.kb{
  margin:20px 0 26px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(255,255,255,.02);
}

.kbOverflow{
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling: touch;
}

/* Damit die Tabelle ihre natürliche Breite behalten darf und bei Bedarf overflowt */
.kbOverflow > table{
  min-width:100%;
}

.kbTitle{
  margin:0 0 10px;
  font-weight:900;
  letter-spacing:.2px;
}

.kbMeta{
  display:grid;
  grid-template-columns: max-content 1fr;
  gap:6px 10px;
  margin:0 0 14px;
  color:var(--muted);
  font-size:13px;
}

.kbMeta .k{ color:var(--muted2); font-weight:800; }

.kbGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
  margin:12px 0;
}

.kbGrid h4{
  margin:0 0 8px;
  font-size:14px;
  color:var(--text);
}

.kbGrid table{
  margin:0;
}

.kbList td, .kbStats td{
  padding:8px 10px;
}

.kbList td:first-child,
.kbStats td:first-child{
  color:var(--muted);
  font-weight:700;
}

.kb .n{
  text-align:right;
  font-variant-numeric: tabular-nums;
  white-space:nowrap;
}

.kbText{
  margin:12px 0;
  padding:10px 12px;
  border:1px dashed rgba(255,255,255,.14);
  border-radius:12px;
  color:var(--muted);
  font-size:13px;
}

.kbFooter{
  margin-top:12px;
  color:var(--muted);
  font-size:13px;
}


/* Mobile: topbar + hamburger drawer */
@media (max-width: 900px){
  :root{ --mobilebar-h:52px; --contentPad:16px; }

  .layout{
    grid-template-columns:1fr;
  }

  .mobilebar{
    display:flex;
    position:fixed;
    top:0; left:0; right:0;
    height:var(--mobilebar-h);
    align-items:center;
    justify-content:space-between;
    padding:0 12px;
    z-index:50;
    background:rgba(0,0,0,.5);
    backdrop-filter: blur(8px);
    border-bottom:1px solid rgba(255,255,255,.12);
  }

  .mobilebar-title{
    font-weight:900;
    letter-spacing:.2px;
  }

  .burger{
    width:42px;
    height:36px;
    border-radius:10px;
    border:1px solid rgb(171 255 170);
    background:black;
    color:rgb(171 255 170);
    font-size:18px;
    cursor:pointer;
  }

  .overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.55);
    z-index:45;
    opacity:0;
    pointer-events:none;
    transition:opacity .2s ease;
  }

  /* Drawer */
  .sidebar{
    position:fixed;
    top:0; bottom:0; left:0;
    width:min(360px, 88vw);
    transform:translateX(-105%);
    transition:transform .22s ease;
    z-index:60;
    box-shadow:var(--shadow);
    border-right:1px solid var(--border);
  }

  body.sidebar-open .sidebar{ transform:translateX(0); }
  body.sidebar-open .overlay{
    display:block;
    opacity:1;
    pointer-events:auto;
  }

  .content{
    padding-top:var(--mobilebar-h);
  }

.chapter-body{ overflow-x:hidden; }

  .kbGrid{ grid-template-columns:1fr; }

}

.chapter-body > p {
    text-align: justify;
}

/* Kampfbericht: ganze Box scrollen (nicht nur Tabellen-Inhalt) */
.kbWrap{
  margin:20px 0 26px;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  width:100%;
}

.kbWrap > .kb{
  margin:0;
  min-width:600px; /* mobile: Box bleibt breit genug, Wrapper scrollt */
}

/* Mobile: wichtig – NICHT die ganze chapter-body scrollen */
@media (max-width: 900px){
  .chapter-body{ overflow-x:hidden; }
}

pre.code {
    background-color: black;
    color: #00ff00;
    padding: 20px;
}

div#mobileTitle {
    color: rgb(171 255 170);
}

div#siteTitle {
    color: #abffaa;
    font-family: Roboto, Sans-serif, arial;
}
