:root{
  --gold:#e6c36a;
  --gold-soft:#f5deb0;
  --gold-strong:#f2c66d;
  --dark-bg:#0b1320;
  --panel-bg:rgba(21,34,56,0.92);
  --panel-line:#2a3a50;
  --text-light:#e0e0e0;
  --text-muted:#a9b1bc;
  --shadow:0 18px 40px rgba(0,0,0,0.45);
}

*{ box-sizing:border-box; }

body{
  margin:0;
  min-height:100vh;
  font-family:'Inter',sans-serif;
  color:var(--text-light);
  background-color:var(--dark-bg);
  background-image:url('../textura.png');
  background-size:1024px 1024px;
  background-repeat:repeat;
}

header{
  position:sticky;
  top:0;
  z-index:100;
  height:70px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  padding:0 40px;
  background:linear-gradient(rgba(10,20,35,0.95), rgba(5,10,20,0.98)), url('../textura.png');
  border-bottom:2px solid var(--gold);
  box-shadow:0 5px 20px rgba(0,0,0,0.5);
}

.logo img{ height:50px; }

nav{
  justify-self:center;
  display:flex;
  flex-wrap:wrap;
}

nav a{
  padding:10px 20px;
  font-size:14px;
  font-weight:600;
  color:#bbb;
  text-decoration:none;
  text-transform:uppercase;
  letter-spacing:1px;
  transition:0.3s;
}

nav a:hover,
nav a.is-active{
  color:var(--gold);
  text-shadow:0 0 10px rgba(230,195,106,0.5);
}

.search-box{
  display:flex;
  align-items:center;
}

.search-box input{
  padding:8px 15px;
  border:1px solid #334;
  border-radius:4px 0 0 4px;
  background:rgba(255,255,255,0.1);
  color:#fff;
  outline:none;
}

.search-box button{
  background:#334;
  border:1px solid #334;
  border-left:none;
  border-radius:0 4px 4px 0;
  color:var(--gold);
  padding:8px 12px;
  cursor:pointer;
}

.page-shell{
  width:min(1180px, calc(100% - 32px));
  margin:0 auto;
  padding:34px 0 60px;
}

.breadcrumbs{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin-bottom:20px;
  font-size:13px;
  color:var(--text-muted);
}

.breadcrumbs a{
  color:var(--gold-soft);
  text-decoration:none;
}

.section-hero{
  margin-bottom:22px;
  padding:32px;
  border:1px solid rgba(230,195,106,0.22);
  border-radius:8px;
  background:linear-gradient(135deg, rgba(17,25,37,0.98), rgba(14,18,27,0.9));
  box-shadow:var(--shadow);
}

.eyebrow{
  margin:0 0 10px;
  color:var(--gold-strong);
  text-transform:uppercase;
  letter-spacing:0.16em;
  font-size:0.78rem;
  font-weight:700;
}

.section-hero h1,
.status-panel h2,
.monster-card h2,
.monster-section h3{
  font-family:'Cinzel',serif;
}

.section-hero h1{
  margin:0;
  font-size:clamp(2.3rem, 4vw, 4.2rem);
  line-height:1.05;
}

.hero-copy{
  width:min(840px, 100%);
  margin:14px 0 0;
  color:var(--text-muted);
  line-height:1.7;
}

.source-strip{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:20px;
}

.source-strip span{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border:1px solid rgba(230,195,106,0.2);
  border-radius:6px;
  background:rgba(8,14,24,0.68);
  color:#f1dfb4;
  font-size:13px;
  font-weight:800;
}

.bestiary-toolbar{
  display:grid;
  grid-template-columns:minmax(240px, 1fr) minmax(180px, 240px) minmax(150px, 190px);
  gap:14px;
  margin-bottom:18px;
  padding:16px;
  border:1px solid rgba(227,194,116,0.18);
  border-radius:8px;
  background:var(--panel-bg);
  box-shadow:var(--shadow);
}

.search-control,
.select-control{
  display:grid;
  gap:7px;
}

.search-control span,
.select-control span{
  color:var(--gold-soft);
  font-size:12px;
  font-weight:800;
  letter-spacing:0.08em;
  text-transform:uppercase;
}

.search-control input,
.select-control select{
  width:100%;
  min-height:42px;
  border:1px solid rgba(230,195,106,0.24);
  border-radius:6px;
  background:#101d2f;
  color:#fff;
  font:inherit;
  outline:none;
  padding:0 12px;
}

.status-panel{
  margin-bottom:18px;
  padding:20px;
  border:1px solid rgba(230,195,106,0.2);
  border-radius:8px;
  background:rgba(10,18,31,0.9);
}

.status-panel[hidden]{ display:none; }

.status-panel h2{
  margin:0 0 8px;
  color:#fff4cd;
  font-size:1.3rem;
}

.status-panel p{
  margin:0 0 12px;
  color:var(--text-muted);
  line-height:1.65;
}

.status-panel code{
  display:block;
  width:100%;
  overflow:auto;
  padding:12px;
  border-radius:6px;
  background:#07101c;
  color:#f5deb0;
}

.monster-grid{
  display:grid;
  gap:14px;
}

.monster-card{
  border:1px solid rgba(227,194,116,0.22);
  border-radius:8px;
  background:rgba(17,28,45,0.96);
  overflow:hidden;
}
.monster-card-featured{
  background:linear-gradient(180deg, rgba(7,14,24,0.98), rgba(10,24,40,0.98));
  border-color:rgba(230,195,106,0.32);
  box-shadow:0 10px 30px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.03);
}

.monster-header-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  background:rgba(8,12,20,0.78);
}
.monster-featured-head{
  align-items:flex-start;
  background:linear-gradient(90deg, rgba(6,12,21,0.96), rgba(10,25,42,0.92));
  border-bottom:1px solid rgba(230,195,106,0.18);
}

.monster-header-row h2{
  margin:0;
  color:#fff4cd;
  font-size:1.2rem;
}
.monster-featured-head h2{
  display:flex;
  align-items:center;
  gap:9px;
  margin:0 0 8px;
  text-transform:uppercase;
}
.monster-featured-head h2 > i:first-child{
  width:24px;
  height:24px;
  display:grid;
  place-items:center;
  border-radius:50%;
  border:1px solid rgba(230,195,106,0.4);
  background:rgba(230,195,106,0.12);
  color:#e6c36a;
  font-size:12px;
  flex:0 0 auto;
}
.monster-featured-head .title-star{ color:#e6c36a; font-size:14px; }
.monster-meta-row{display:flex;flex-wrap:wrap;gap:7px}
.monster-meta-row span{padding:4px 9px;border:1px solid rgba(65,144,198,0.24);border-radius:999px;background:rgba(12,43,67,0.68);color:#b9d5ed;font-size:11px;font-weight:700}
.monster-meta-row strong{color:#67c7f2}

.level-badge{
  padding:5px 9px;
  border-radius:4px;
  background:rgba(230,195,106,0.18);
  color:var(--gold-soft);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

.monster-main-row{
  display:grid;
  grid-template-columns:minmax(142px, 220px) minmax(280px, 1fr) minmax(190px, 260px);
  align-items:start;
  gap:8px;
  padding:8px;
  min-height:124px;
}

.monster-left,
.monster-center,
.monster-side{
  display:grid;
  gap:8px;
  align-content:start;
}

.monster-portrait{
  display:grid;
  place-items:center;
  min-height:190px;
  padding:18px;
  border:1px solid rgba(65,144,198,0.18);
  border-radius:7px;
  background:
    radial-gradient(circle at 50% 52%, rgba(230,195,106,0.12), transparent 48%),
    rgba(7,18,31,0.72);
}

.monster-portrait img{
  width:auto;
  height:auto;
  max-width:180px;
  max-height:180px;
  object-fit:contain;
  filter:drop-shadow(0 14px 18px rgba(0,0,0,0.45));
  image-rendering:auto;
}

.monster-placeholder{
  color:rgba(230,195,106,0.64);
  font-size:30px;
}

.monster-content{
  padding:10px 14px 14px;
}

.monster-meta{
  margin:0 0 4px;
  color:#d0d7e3;
  font-size:13px;
}

.monster-meta strong{
  color:#fff1c4;
}

.monster-section{
  border:1px solid var(--panel-line);
  border-radius:7px;
  overflow:hidden;
  background:rgba(14,33,53,0.74);
}

.monster-section h3{
  margin:0;
  padding:9px 11px;
  background:rgba(8,20,34,0.44);
  color:#fff2c8;
  font-size:0.98rem;
  border-bottom:1px solid rgba(65,144,198,0.18);
}

.monster-section p{
  margin:0;
  padding:8px 9px;
  line-height:1.5;
  color:#d6dde8;
  font-size:13px;
}

.monster-columns{
  display:grid;
  grid-template-columns:1fr 1fr;
}

.inline-list{
  list-style:none;
  margin:0;
  padding:6px 9px;
  border-right:1px solid var(--panel-line);
}

.inline-list:last-child{
  border-right:0;
}

.inline-list li{
  display:grid;
  grid-template-columns:max-content max-content max-content;
  justify-content:start;
  align-items:center;
  column-gap:8px;
  margin:0 0 5px;
  color:#d6dde8;
  font-size:13px;
}

.inline-list li:last-child{
  margin-bottom:0;
}

.inline-list strong{
  color:#f5deb0;
}

.inline-stat-row .stat-label{
  color:#f5deb0;
  font-weight:700;
}

.inline-stat-row .stat-value{
  color:#ffffff;
  font-weight:700;
}

.stat-icon{
  width:19px;
  height:19px;
  display:grid;
  place-items:center;
  border-radius:50%;
  font-size:10px;
  border:1px solid currentColor;
  background:rgba(8,14,24,0.6);
}

.stat-icon.hp{
  color:#ff7d86;
}

.stat-icon.pa{
  color:#ffd976;
}

.stat-icon.pm{
  color:#b6e87b;
}

.stat-icon.earth{
  color:#d2ac7b;
}

.stat-icon.air{
  color:#98f1c0;
}

.stat-icon.fire{
  color:#ff9b74;
}

.stat-icon.water{
  color:#86d9ff;
}

.stat-icon.neutral{
  color:#f2f2f2;
}

.inline-drop-list{
  padding:8px 9px;
  color:#d6dde8;
  line-height:1.7;
  font-size:13px;
}

.inline-drop-link{
  color:#f5deb0;
  text-decoration:none;
}

.inline-race-link{
  border:0;
  margin:0;
  padding:0;
  background:transparent;
  color:#f5deb0;
  font:inherit;
  cursor:pointer;
  text-decoration:underline;
  text-underline-offset:2px;
}

.inline-race-link:hover{
  color:#fff2c8;
}

.inline-drop-link:hover{
  text-decoration:underline;
}

.drop-rate{
  color:#fff;
}

.muted-inline{
  color:#95a3b8 !important;
}

.pagination-bar{
  margin-top:14px;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
}

.pagination-bar button{
  min-height:34px;
  padding:0 12px;
  border:1px solid rgba(230,195,106,0.28);
  border-radius:6px;
  background:#11243d;
  color:#f5deb0;
  font:inherit;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
}

.pagination-bar button:disabled{
  opacity:0.45;
  cursor:not-allowed;
}

.pagination-bar .page-number.is-current{
  background:rgba(230,195,106,0.28);
  color:#fff8de;
  opacity:1;
}

.pagination-bar span{
  color:#f5deb0;
  font-size:13px;
  font-weight:700;
}

.pagination-bar .page-ellipsis{
  padding:0 2px;
  opacity:0.8;
}

footer{
  margin-top:44px;
  padding:30px 20px;
  text-align:center;
  border-top:2px solid var(--gold);
  background:linear-gradient(to top, #050a10, #0b1320);
}

footer p{
  margin:6px 0;
  font-size:13px;
  color:#888;
}

footer a{
  color:var(--gold);
  text-decoration:none;
}

@media (max-width: 980px){
  .bestiary-toolbar{
    grid-template-columns:1fr 1fr;
  }

  .search-control{
    grid-column:1 / -1;
  }

  .monster-main-row{
    grid-template-columns:minmax(132px, 180px) 1fr;
  }

  .monster-side{
    grid-column:1 / -1;
  }
}

@media (max-width: 640px){
  header{
    grid-template-columns:1fr;
    height:auto;
    padding:10px;
    gap:10px;
  }

  nav{
    justify-content:center;
  }

  .search-box{
    justify-content:center;
  }

  .page-shell{
    width:min(100% - 20px, 1180px);
    padding-top:20px;
    padding-bottom:40px;
  }

  .section-hero{
    padding:22px;
  }

  .bestiary-toolbar{
    grid-template-columns:1fr;
  }

  .monster-main-row{
    grid-template-columns:1fr;
  }

  .monster-featured-head{
    display:grid;
  }

  .monster-featured-head h2{
    font-size:1rem;
  }

  .monster-side{
    grid-column:auto;
  }

  .monster-portrait{
    min-height:128px;
    padding:12px;
  }

  .monster-portrait img{
    max-width:140px;
    max-height:140px;
  }

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

  .inline-list{
    border-right:0;
    border-bottom:1px solid var(--panel-line);
  }

  .inline-list:last-child{
    border-bottom:0;
  }
}
