* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  color: #f7f8ff;
  background-color: #0b1320;
  background-image: url('../textura.png');
  background-size: 1024px 1024px;
  background-repeat: repeat;
}
a { color: #f0d28f; text-decoration: none; }
.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 60px; }
.breadcrumbs { display: flex; gap: 10px; align-items: center; color: #a9b1bc; font-size: 13px; margin-bottom: 20px; }
.section-hero, .toolbar, .status-panel, .set-card { border: 1px solid rgba(230, 195, 106, 0.22); border-radius: 8px; background: rgba(17,28,45,0.96); }
.section-hero { padding: 32px; margin-bottom: 22px; background: linear-gradient(135deg, rgba(17,25,37,0.98), rgba(14,18,27,0.9)); box-shadow: 0 18px 40px rgba(0,0,0,0.45); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-weight: 700; color: #f2c66d; font-size: 0.78rem; margin: 0 0 10px; }
h1, h2, h3, h4 { font-family: 'Cinzel', serif; color: #f7e8c0; margin: 0; }
h1 { font-size: clamp(2.3rem, 4vw, 4.2rem); line-height: 1.05; margin-bottom: 0; }
.hero-copy { max-width: 840px; color: #a9b1bc; font-size: 1rem; line-height: 1.7; margin: 14px 0 0; }
.source-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.source-strip span { border: 1px solid rgba(230, 195, 106, 0.2); border-radius: 6px; padding: 8px 12px; font-weight: 800; color: #f1dfb4; background: rgba(8,14,24,0.68); font-size: 13px; }
.toolbar { padding: 16px; display: grid; grid-template-columns: 1fr 220px 220px; gap: 14px; margin-bottom: 18px; box-shadow: 0 18px 40px rgba(0,0,0,0.45); }
.search-control, .select-control { display: flex; flex-direction: column; gap: 6px; }
.search-control span, .select-control span { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; color: #f5deb0; font-size: 12px; }
input, select {
  width: 100%; height: 42px; border-radius: 6px; border: 1px solid rgba(230, 195, 106, 0.24);
  background: #101d2f; color: #fff; padding: 0 12px; font-size: 16px;
}
.status-panel { padding: 20px; margin-bottom: 18px; background: rgba(10,18,31,0.9); }
.status-panel h2 { font-size: 1.3rem; margin-bottom: 8px; color: #fff4cd; }
.status-panel p { margin: 0 0 8px; color: #a9b1bc; }
.status-panel code { display: inline-block; padding: 8px 10px; border: 1px dashed rgba(230, 195, 106, 0.4); border-radius: 8px; font-size: 13px; white-space: pre-wrap; }
.sets-grid { display: grid; gap: 12px; }
.set-card { overflow: hidden; }
.set-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); }
.set-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid rgba(230, 195, 106, 0.22); background: rgba(4, 12, 28, 0.65); }
.set-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); }
.set-head h2 { font-size: 1.16rem; text-transform: uppercase; }
.set-featured-head h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 8px; font-size: 1.16rem; }
.set-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; }
.set-featured-head .title-star { color: #e6c36a; font-size: 14px; }
.set-meta-row { display: flex; flex-wrap: wrap; gap: 7px; }
.set-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; }
.set-meta-row strong { color: #67c7f2; }
.badge { border: 1px solid rgba(230, 195, 106, 0.35); border-radius: 4px; padding: 5px 9px; font-weight: 800; color: #f5deb0; background: rgba(230,195,106,0.18); font-size: 12px; white-space: nowrap; }
.set-body { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(240px, 320px); align-items: start; gap: 8px; padding: 8px; }
.set-content, .set-side { display: grid; gap: 8px; align-content: start; }
.set-content { grid-template-columns: 1fr; }
.set-panel { border: 1px solid rgba(111, 143, 205, 0.3); border-radius: 8px; overflow: hidden; background: rgba(4, 15, 34, 0.55); }
.set-panel h3 { font-size: 0.98rem; padding: 9px 11px; background: rgba(8,20,34,0.44); border-bottom: 1px solid rgba(65,144,198,0.18); }
.set-panel .body { padding: 10px 12px; }
.pieces-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.set-head-actions { display: flex; align-items: center; gap: 8px; }
.set-hammer-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(230, 195, 106, 0.36);
  background: rgba(9, 27, 50, 0.9);
  color: #e7c87c;
  cursor: pointer;
}
.set-hammer-btn.is-active {
  background: rgba(58, 138, 84, 0.35);
  border-color: rgba(125, 228, 154, 0.65);
  color: #c8ffd7;
}
.piece-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(65, 144, 198, 0.18);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(11, 33, 60, 0.88), rgba(8, 23, 44, 0.92));
}
.piece-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(65, 144, 198, 0.22);
  border-radius: 8px;
  background: rgba(10, 29, 54, 0.88);
  cursor: pointer;
}
.piece-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: auto;
}
.piece-main { min-width: 0; }
.piece-name {
  color: #ffd88f;
  font-weight: 800;
  display: block;
  overflow-wrap: anywhere;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.piece-open-btn { font: inherit; }
.piece-meta { color: #99b0d6; font-size: 13px; margin: 2px 0 6px; }
.piece-effects { margin: 0; padding-left: 15px; color: #eaf0ff; font-size: 13px; line-height: 1.25; }
.bonus-select-wrap { display: block; margin-bottom: 10px; }
.bonus-select { height: 40px; }
.is-muted-panel .muted { color: #93a8cb; }
.bonus-group { margin-bottom: 10px; }
.bonus-group:last-child { margin-bottom: 0; }
.bonus-title { display: inline-block; font-weight: 700; color: #f0d28f; margin-bottom: 6px; }
.bonus-lines { margin: 0; padding-left: 16px; color: #eaf0ff; }
.bonus-lines li, .piece-effects li, .piece-modal-effects li {
  margin-bottom: 2px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
.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; }
.set-total-panel .body { min-height: 210px; }
.set-total-panel .bonus-lines {
  padding-left: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 6px 24px;
}
.muted { color: #9cb0d6; }
.pagination-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 14px 0 6px; }
.pagination-bar button, .page-ellipsis { min-width: 38px; height: 34px; border: 1px solid rgba(230, 195, 106, 0.3); border-radius: 8px; background: rgba(10, 24, 46, 0.9); color: #f4d79c; font-weight: 700; padding: 0 10px; }
.pagination-bar button:disabled { opacity: 0.55; }
.pagination-bar .is-current { background: rgba(230, 195, 106, 0.2); }
footer { text-align: center; color: #a9bedf; padding: 24px 12px 30px; font-size: 14px; }
.piece-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 16, 0.72);
  display: grid;
  place-items: center;
  z-index: 1200;
  padding: 16px;
}
.piece-modal[hidden] { display: none; }
.piece-modal-panel {
  width: min(620px, 100%);
  border-radius: 10px;
  border: 1px solid rgba(230, 195, 106, 0.35);
  background: linear-gradient(180deg, rgba(9,20,36,0.98), rgba(5,14,26,0.98));
  overflow: hidden;
}
.piece-modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(230, 195, 106, 0.2);
}
.piece-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(230, 195, 106, 0.4);
  background: rgba(11, 30, 55, 0.8);
  color: #f4dbad;
  cursor: pointer;
}
.piece-modal-body { padding: 14px; }
.piece-modal-card { border: 1px solid rgba(111, 143, 205, 0.3); border-radius: 8px; padding: 12px; background: rgba(4, 15, 34, 0.6); }
.piece-modal-head { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: center; margin-bottom: 8px; }
.piece-modal-icon { width: 90px; height: 90px; display: grid; place-items: center; border-radius: 8px; background: rgba(9, 28, 52, 0.86); border: 1px solid rgba(65, 144, 198, 0.26); }
.piece-modal-icon img { width: 80px; height: 80px; object-fit: contain; image-rendering: auto; }
.piece-modal-head h3 { font-size: 1.12rem; margin-bottom: 2px; }
.piece-modal-head p { margin: 0; color: #9db3d8; }
.piece-modal-effects { margin: 10px 0 0; padding-left: 17px; color: #eaf0ff; }
.piece-modal-recipe { margin-top: 12px; border-top: 1px solid rgba(111, 143, 205, 0.26); padding-top: 10px; }
.piece-modal-recipe h4 { font-size: 0.95rem; margin-bottom: 6px; color: #f0d28f; }
.piece-modal-recipe-meta { margin: 0 0 7px; color: #9db3d8; font-size: 13px; }
.piece-modal-recipe-list { margin: 0; padding-left: 18px; color: #eaf0ff; }
body.modal-open { overflow: hidden; }
@media (max-width: 980px) {
  .toolbar { grid-template-columns: 1fr; }
  .set-body { grid-template-columns: 1fr; }
  .set-side { grid-column: 1 / -1; }
  .set-total-panel .bonus-lines { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .set-body { grid-template-columns: 1fr; }
  .set-featured-head { display: grid; }
  .set-featured-head h2 { font-size: 1rem; }
  .set-side { grid-column: auto; }
  .set-head-actions { justify-content: space-between; }
}
