: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,
.equipment-card h2,
.equipment-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,
.category-strip{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:20px;
}

.source-strip span,
.category-strip button{
  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;
}

.source-strip a.workbench-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border:1px solid rgba(230,195,106,0.28);
  border-radius:6px;
  background:rgba(14,30,52,0.82);
  color:#f5deb0;
  font-size:13px;
  font-weight:800;
  text-decoration:none;
}

.source-strip a.workbench-link:hover{
  background:rgba(28,49,79,0.92);
  color:#fff2c8;
}

.category-strip{
  margin:0 0 18px;
}

.category-strip button{
  cursor:pointer;
}

.category-strip strong{
  color:#fff;
}

.equipment-toolbar{
  display:grid;
  grid-template-columns:minmax(240px, 1fr) minmax(170px, 210px) minmax(140px, 170px) minmax(140px, 170px);
  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);
}

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

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

.equipment-card{
  border:1px solid rgba(227,194,116,0.22);
  border-radius:8px;
  background:rgba(17,28,45,0.96);
  overflow:hidden;
}

.equipment-header-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  background:rgba(8,12,20,0.78);
}

.equipment-header-actions{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.equipment-header-row h2{
  margin:0;
  color:#fff4cd;
  font-size:1.2rem;
}

.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;
}

.workbench-add-btn{
  width:30px;
  height:30px;
  border-radius:50%;
  border:1px solid rgba(230,195,106,0.35);
  background:#13243a;
  color:#f5deb0;
  display:grid;
  place-items:center;
  cursor:pointer;
}

.workbench-add-btn:hover{
  background:#1a3352;
  color:#fff0bf;
}

.workbench-add-btn.is-added{
  background:#305423;
  border-color:#7fc15a;
  color:#d6f8b8;
}

.workbench-add-btn.is-disabled{
  background:#3a1d1d;
  border-color:#7f4a4a;
  color:#f0b2b2;
}

.equipment-toast-tray{
  position:fixed;
  right:16px;
  top:86px;
  z-index:400;
  display:grid;
  gap:8px;
}

.equipment-toast{
  min-width:260px;
  max-width:360px;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid rgba(230,195,106,0.25);
  background:rgba(14,24,38,0.96);
  color:#f5deb0;
  font-size:13px;
  font-weight:700;
  box-shadow:0 12px 24px rgba(0,0,0,0.4);
  transition:opacity 0.2s ease, transform 0.2s ease;
}

.equipment-toast.ok{
  border-color:#6aa94f;
  color:#d8f5c3;
}

.equipment-toast.warn{
  border-color:#c47a7a;
  color:#ffd0d0;
}

.equipment-toast.hide{
  opacity:0;
  transform:translateY(-4px);
}

.equipment-main-row{
  display:grid;
  grid-template-columns:96px 1fr;
  min-height:122px;
}

.equipment-icon{
  display:grid;
  place-items:center;
  padding:8px;
  background:#102137;
  border-right:1px solid var(--panel-line);
}

.equipment-icon img{
  width:auto;
  height:auto;
  max-width:78px;
  max-height:94px;
  object-fit:contain;
}

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

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

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

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

.equipment-section{
  margin-top:9px;
  border:1px solid var(--panel-line);
}

.equipment-section h3{
  margin:0;
  padding:6px 9px;
  background:#1f344f;
  color:#fff2c8;
  font-size:1rem;
}

.sec-title{
  display:inline-flex;
  align-items:center;
  gap:7px;
}

.sec-title i{
  color:var(--gold-soft);
  font-size:12px;
}

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

.equipment-section p a{
  color:#f5deb0;
  font-weight:700;
  text-decoration:none;
}

.equipment-section p a:hover{
  color:#fff4cd;
  text-decoration:underline;
}

.effect-inline-list{
  list-style:none;
  margin:0;
  padding:8px 9px;
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:6px 20px;
}

.effect-inline-list li{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin:0;
  color:#d6dde8;
  font-size:13px;
}

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

.effect-icon{
  width:16px;
  height:16px;
  display:grid;
  place-items:center;
  border-radius:50%;
  border:1px solid rgba(230,195,106,0.5);
  color:#f5deb0;
  font-size:9px;
  flex:0 0 auto;
  margin-top:1px;
}

.effect-icon.hp{ color:#ff7d86; border-color:#ff7d86; }
.effect-icon.wis{ color:#b9b5ff; border-color:#b9b5ff; }
.effect-icon.str{ color:#f4c987; border-color:#f4c987; }
.effect-icon.int{ color:#ff9b74; border-color:#ff9b74; }
.effect-icon.cha{ color:#86d9ff; border-color:#86d9ff; }
.effect-icon.agi{ color:#98f1c0; border-color:#98f1c0; }
.effect-icon.pow{ color:#ffd766; border-color:#ffd766; }
.effect-icon.ini{ color:#d5bcff; border-color:#d5bcff; }
.effect-icon.rng{ color:#f7dea0; border-color:#f7dea0; }
.effect-icon.sum{ color:#ffca8b; border-color:#ffca8b; }
.effect-icon.heal{ color:#ff9ba7; border-color:#ff9ba7; }
.effect-icon.pa{ color:#ffdf7c; border-color:#ffdf7c; }
.effect-icon.pm{ color:#b6e87b; border-color:#b6e87b; }
.effect-icon.lock{ color:#f7d0a5; border-color:#f7d0a5; }
.effect-icon.dodge{ color:#95f2c2; border-color:#95f2c2; }
.effect-icon.pods{ color:#bcbcbc; border-color:#bcbcbc; }
.effect-icon.res{ color:#8fd0ff; border-color:#8fd0ff; }
.effect-icon.crit{ color:#ff8b8b; border-color:#ff8b8b; }
.effect-icon.pp{ color:#8fd0ff; border-color:#8fd0ff; }
.effect-icon.neutral{ color:#f2f2f2; border-color:#f2f2f2; }
.effect-icon.earth{ color:#d2ac7b; border-color:#d2ac7b; }
.effect-icon.fire{ color:#ff9b74; border-color:#ff9b74; }
.effect-icon.water{ color:#86d9ff; border-color:#86d9ff; }
.effect-icon.air{ color:#98f1c0; border-color:#98f1c0; }
.effect-icon.push{ color:#ffc889; border-color:#ffc889; }
.effect-icon.rescrit{ color:#ff8c8c; border-color:#ff8c8c; }

.recipe-job{
  color:#f5deb0 !important;
  font-weight:800;
  padding-bottom:0 !important;
}

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

.ingredient-inline-link{
  border:0;
  background:transparent;
  color:#f5deb0;
  font:inherit;
  font-weight:800;
  padding:0;
  cursor:pointer;
  text-decoration:none;
}

.ingredient-inline-link:hover{
  color:#fff4cd;
  text-decoration:underline;
}

.equipment-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);
}

.featured-equipment-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  padding:12px 14px 10px;
  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);
}

.featured-equipment-header h2{
  display:flex;
  align-items:center;
  gap:9px;
  margin:0 0 8px;
  color:#fff3cd;
  font-size:1.16rem;
  line-height:1.2;
  text-transform:uppercase;
}

.featured-equipment-header 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;
}

.featured-equipment-header .title-star{
  color:#e6c36a;
  font-size:14px;
}

.featured-meta-row{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}

.featured-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;
}

.featured-meta-row strong{
  color:#67c7f2;
}

.featured-equipment-layout{
  display:grid;
  grid-template-columns:minmax(142px, 220px) minmax(280px, 1fr) minmax(190px, 260px);
  align-items:start;
  gap:8px;
  padding:8px;
}

.featured-portrait-panel,
.featured-effects-panel,
.featured-side-panel section,
.featured-used-panel,
.featured-inline-description{
  border:1px solid rgba(65,144,198,0.18);
  border-radius:7px;
  background:rgba(14,33,53,0.74);
}

.featured-portrait-panel{
  display:grid;
  align-content:start;
  gap:8px;
  border:0;
  background:transparent;
  overflow:hidden;
}

.featured-portrait-frame{
  width:100%;
  min-height:190px;
  display:grid;
  place-items:center;
  padding:18px;
  background:
    radial-gradient(circle at 50% 52%, rgba(230,195,106,0.12), transparent 48%),
    rgba(7,18,31,0.72);
}

.featured-portrait-frame img{
  max-width:80px;
  max-height:80px;
  object-fit:contain;
  filter:drop-shadow(0 14px 18px rgba(0,0,0,0.45));
  image-rendering:crisp-edges;
}

.featured-side-note,
.featured-side-panel section > p,
.featured-used-panel p,
.featured-inline-description p{
  margin:0;
  padding:9px 10px;
  color:#aebdd0;
  font-size:12px;
  line-height:1.55;
}

.featured-effects-panel{
  display:grid;
  align-content:start;
  gap:8px;
}

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

.featured-effects-panel .effect-inline-list{
  grid-template-columns:repeat(3, minmax(0, 1fr));
  padding:12px 14px;
  gap:8px 16px;
  border-bottom:1px solid rgba(65,144,198,0.18);
}

.featured-effects-panel .effect-inline-list li{
  font-size:12px;
}

.featured-side-panel{
  display:grid;
  align-content:start;
}

.featured-recipe-job{
  margin:0;
  padding:8px 10px 2px;
  color:#f3c85f;
  font-size:12px;
  font-weight:900;
}

.featured-recipe-list{
  list-style:none;
  margin:0;
  padding:7px 10px 10px;
  display:grid;
  gap:5px;
}

.featured-recipe-list li{
  display:grid;
  grid-template-columns:22px 1fr;
  align-items:center;
  gap:7px;
  min-height:24px;
  color:#d6dde8;
  font-size:12px;
}

.ingredient-mini-icon{
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
}

.ingredient-mini-icon img{
  max-width:22px;
  max-height:22px;
  object-fit:contain;
}

.ingredient-mini-fallback{
  width:18px;
  height:18px;
  display:grid;
  place-items:center;
  border-radius:4px;
  background:rgba(230,195,106,0.12);
  color:#e6c36a;
  font-size:10px;
}

.ingredient-mini-text{
  min-width:0;
}

.featured-inline-description{
  margin:0 8px 8px;
  min-height:118px;
  overflow:hidden;
}

.featured-inline-description h3{
  padding-top:10px;
  padding-bottom:10px;
}

.featured-inline-description p{
  padding:12px 14px;
  color:#bfd5ee;
  font-size:13px;
  line-height:1.7;
}

.ingredient-modal{
  position:fixed;
  inset:0;
  z-index:520;
}

.ingredient-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,0.55);
}

.ingredient-modal-card{
  position:relative;
  width:min(760px, calc(100% - 20px));
  max-height:80vh;
  margin:8vh auto 0;
  border:1px solid rgba(230,195,106,0.26);
  border-radius:10px;
  background:rgba(11,20,34,0.98);
  overflow:hidden;
  box-shadow:0 18px 36px rgba(0,0,0,0.55);
}

.ingredient-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  background:#1f344f;
  border-bottom:1px solid #2a3a50;
}

.ingredient-modal-head h3{
  margin:0;
  font-family:'Cinzel',serif;
  color:#fff2c8;
  font-size:1.15rem;
}

.ingredient-modal-head button{
  width:32px;
  height:32px;
  border-radius:6px;
  border:1px solid rgba(230,195,106,0.28);
  background:#11243d;
  color:#f5deb0;
  cursor:pointer;
}

.ingredient-modal-body{
  padding:12px;
  overflow:auto;
  max-height:calc(80vh - 54px);
}

.ingredient-meta{
  display:grid;
  grid-template-columns:64px 1fr;
  gap:10px;
  margin-bottom:10px;
}

.ingredient-meta img{
  width:60px;
  height:60px;
  object-fit:contain;
  border:1px solid #2a3a50;
  border-radius:6px;
  background:#0f1d31;
}

.ingredient-meta .icon-fallback{
  width:60px;
  height:60px;
  border:1px solid #2a3a50;
  border-radius:6px;
  background:#0f1d31;
  color:#f0d89c;
  display:grid;
  place-items:center;
}

.ingredient-meta p{
  margin:0;
  color:#d6dde8;
  line-height:1.5;
}

.drop-list{
  margin:8px 0 0;
  padding-left:18px;
}

.drop-list li{
  margin:4px 0;
  color:#d6dde8;
  font-size:13px;
}

.drop-list a{
  color:#f5deb0;
  text-decoration:none;
  font-weight:700;
}

.drop-list a:hover{
  color:#fff4cd;
  text-decoration:underline;
}

.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){
  .equipment-toolbar{
    grid-template-columns:1fr 1fr;
  }

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

  .effect-inline-list{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:6px 14px;
  }

  .featured-equipment-layout{
    grid-template-columns:minmax(132px, 180px) 1fr;
  }

  .featured-side-panel{
    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;
  }

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

  .equipment-main-row{
    grid-template-columns:78px 1fr;
  }

  .effect-inline-list{
    grid-template-columns:1fr;
    gap:6px;
  }

  .featured-equipment-header{
    display:grid;
  }

  .featured-equipment-header h2{
    font-size:1rem;
  }

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

  .featured-side-panel{
    grid-column:auto;
  }

  .featured-effects-panel .effect-inline-list{
    grid-template-columns:1fr;
  }

  .featured-portrait-panel{
    min-height:128px;
  }

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

  .featured-portrait-frame img{
    max-width:72px;
    max-height:72px;
  }
}
