:root {
  --gold-1: #f3c24a;
  --gold-2: #e2b33d;
  --ink-1: #f7edd7;
  --ink-2: #e6d1af;
  --board-1: #60412c;
  --board-2: #4f3625;
  --board-3: #714c31;
  --board-dark: #332318;
  --line-1: rgba(215, 155, 66, 0.38);
  --line-2: rgba(215, 155, 66, 0.52);
}

#content {
  padding-inline: 0;
}

#setOverview {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

#setOverview:empty {
  display: none;
}

#setOverview > .set-shell,
#setOverview > .empty-state {
  flex: 1 1 auto;
}

.set-shell {
  background: rgba(32, 23, 17, 0.82);
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-1);
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
}

.set-head {
  border-bottom: 1px solid var(--line-2);
  padding: 10px 12px;
  background: var(--gf-navbar-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.set-title {
  margin: 0;
  color: var(--gold-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 20px;
}

.set-subtitle {
  margin: 2px 0 0;
  color: var(--ink-2);
  font-size: 13px;
}

.set-kpis {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.kpi-pill {
  border: 1px solid var(--line-2);
  color: var(--ink-1);
  background: rgba(79, 54, 37, 0.86);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.set-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  flex: 1 1 auto;
  min-height: 0;
}

.panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel + .panel {
  border-left: 1px solid var(--line-2);
}

.panel-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(51, 35, 24, 0.96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--gold-1);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-size: 13px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-2);
}

.pieces-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.piece-row {
  display: grid;
  grid-template-columns: 98px 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(215, 155, 66, 0.2);
  background: rgba(79, 54, 37, 0.86);
}

.piece-row:nth-child(2n) {
  background: rgba(73, 49, 34, 0.84);
}

.piece-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  align-self: center;
  justify-content: center;
}

.piece-image {
  width: 66px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.piece-image img,
.piece-image canvas {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border: 2px solid #d44646;
  border-radius: 2px;
  background: rgba(25, 18, 13, 0.42);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 3px 8px rgba(0, 0, 0, 0.28);
}

.piece-dev-id {
  color: var(--gold-1);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.piece-dev-id.is-copied {
  color: #fff;
}

.piece-name {
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.piece-name-type {
  color: rgba(247, 237, 215, 0.62);
  font-size: 0.82em;
  font-weight: 650;
}

.piece-name-mobile {
  display: none;
}

.piece-meta {
  margin: 2px 0 0;
  color: #e6d1af;
  font-size: 11px;
}

.piece-sell-value {
  width: fit-content;
  margin: 6px 0 0;
  padding: 3px 8px;
  border: 1px solid rgba(243, 194, 74, 0.45);
  border-radius: 4px;
  background: rgba(35, 25, 18, 0.52);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fff4dc;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
}

.piece-sell-value strong {
  color: var(--gold-1);
  font-size: 11px;
  font-weight: 900;
}

.piece-sell-value img {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

.effect-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-1);
  font-size: 12px;
  line-height: 1.35;
}

.effect-list li {
  margin: 1px 0;
  font-size: 12px;
}

.effect-list li::before {
  content: "•";
  color: var(--gold-1);
  margin-right: 5px;
  font-weight: 800;
}

.effect-list li.reward-effect-row::before {
  content: "";
  margin-right: 0;
  color: transparent;
  font-weight: 400;
  background: rgba(245, 230, 207, 0.78);
}

.bonus-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 6px 12px 12px;
}

.bonus-wrap.summary-mode {
  background: rgba(51, 35, 24, 0.82);
}

.bonus-line {
  position: relative;
  padding-left: 22px;
  margin: 10px 0;
}

.bonus-line::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: -14px;
  width: 2px;
  background: rgba(243, 194, 74, 0.55);
}

.bonus-line:last-child::before {
  content: none;
}

.bonus-node {
  position: absolute;
  left: 0;
  top: 7px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold-1);
  border: 2px solid #5e3e27;
  box-shadow: 0 0 0 3px rgba(243, 194, 74, 0.2);
}

.bonus-card {
  background: rgba(79, 54, 37, 0.86);
  border: 1px solid var(--line-1);
  border-radius: 0;
  padding: 8px 10px;
}

.bonus-threshold {
  margin: 0;
  color: var(--gold-1);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.bonus-name {
  margin: 2px 0 0;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.bonus-effects {
  margin: 5px 0 0;
  color: var(--ink-1);
  font-size: 12px;
  line-height: 1.35;
}

.summary-view {
  padding: 2px 0;
}

.summary-grid {
  display: grid;
  gap: 4px;
}

.summary-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-1);
  border-radius: 0;
  padding: 8px 10px;
  background: rgba(79, 54, 37, 0.86);
}

.summary-row.is-positive {
  box-shadow: inset 3px 0 0 rgba(243, 194, 74, 0.95);
}

.summary-row.is-neutral {
  box-shadow: inset 3px 0 0 rgba(243, 194, 74, 0.95);
}

.summary-row.is-negative {
  box-shadow: inset 3px 0 0 rgba(220, 93, 93, 0.9);
}

.summary-rank {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(35, 25, 18, 0.9);
  border: 1px solid rgba(243, 194, 74, 0.5);
  color: var(--gold-1);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-main {
  min-width: 0;
}

.summary-text {
  margin: 0;
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
}


.empty-state {
  border: 1px dashed rgba(243, 194, 74, 0.55);
  border-radius: 0;
  color: #f5e6cf;
  text-align: center;
  padding: 18px;
  background: rgba(79, 54, 37, 0.86);
  font-weight: 700;
}

.mobile-panel-control {
  display: none;
}

.compare-view-shell {
  border: 0;
}

.compare-view-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  background: rgba(51, 35, 24, 0.9);
}

.compare-table-wrap {
  border: 0;
  border-top: 1px solid var(--line-1);
  border-radius: 0;
  overflow: auto;
  background: rgba(32, 23, 17, 0.82);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  table-layout: fixed;
}

.compare-table th,
.compare-table td {
  border-bottom: 1px solid rgba(215, 155, 66, 0.34);
  padding: 8px 10px;
  font-size: 12px;
  background: rgba(79, 54, 37, 0.86);
  vertical-align: middle;
}

.compare-table th:not(:last-child),
.compare-table td:not(:last-child) {
  border-right: 1px solid rgba(215, 155, 66, 0.32);
}

.compare-table th {
  background: #332318;
  color: var(--gold-1);
  font-weight: 800;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 rgba(243, 194, 74, 0.42);
}

.compare-table tbody tr:nth-child(2n) td {
  background: rgba(73, 49, 34, 0.84);
}

.compare-stat-col {
  width: auto;
  color: #fff3dc;
  font-weight: 800;
  text-align: left;
}

.compare-value-col {
  width: auto;
  font-weight: 700;
  text-align: center;
  color: #fff3dc;
}

.compare-table.compare-cols-2 .compare-stat-col {
  width: 46%;
}

.compare-table.compare-cols-2 .compare-value-col {
  width: 27%;
}

.compare-table.compare-cols-3 .compare-stat-col {
  width: 40%;
}

.compare-table.compare-cols-3 .compare-value-col {
  width: 20%;
}

.compare-value-empty {
  color: rgba(247, 234, 213, 0.48);
  background: rgba(35, 25, 18, 0.76) !important;
}

.compare-value-win {
  color: #d8ead8;
  background: rgba(43, 79, 48, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(174, 207, 175, 0.14);
}

.compare-value-equal {
  color: #fff3dc;
  background: rgba(113, 76, 49, 0.82) !important;
  box-shadow: inset 0 0 0 1px rgba(243, 194, 74, 0.16);
}

.compare-value-lose {
  color: #ead7d2;
  background: rgba(100, 48, 43, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(213, 177, 169, 0.12);
}

.compare-empty {
  margin: 0;
  padding: 12px;
  color: #f7edd7;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 768px) {
  .set-layout {
    grid-template-columns: 1fr;
  }

  .panel + .panel {
    border-left: 0;
    border-top: 1px solid var(--line-1);
  }

  .pieces-wrap,
  .bonus-wrap {
    min-height: 0;
  }
}

@media (max-width: 768px) {
  #bonusViewCol {
    display: none;
  }

  .set-head {
    display: none;
  }

  .panel-head {
    display: none;
  }

  .set-shell {
    margin-bottom: 0;
  }

  .mobile-panel-control {
    display: block;
  }

  .compare-view-toolbar {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .set-layout.mobile-show-pieces .panel:nth-child(2) {
    display: none;
  }

  .set-layout.mobile-show-set-bonuses .panel:nth-child(1),
  .set-layout.mobile-show-effect-summary .panel:nth-child(1) {
    display: none;
  }

  .set-layout.mobile-show-set-bonuses .panel:nth-child(2),
  .set-layout.mobile-show-effect-summary .panel:nth-child(2) {
    border-top: 0;
  }
}

@media (max-width: 700px) {
  .piece-row {
    grid-template-columns: 62px 1fr;
    gap: 3px;
    padding: 7px 6px;
  }

  .piece-name-mobile {
    display: block;
    grid-column: 1 / -1;
    text-align: center;
    margin: 0 0 4px;
  }

  .piece-name-desktop {
    display: none;
  }

  .piece-image {
    width: 50px;
    height: 50px;
  }

  .piece-image img,
  .piece-image canvas {
    width: 46px;
    height: 46px;
  }

  .set-title {
    font-size: 17px;
  }
}
