:root {
  color-scheme: dark;
  --bg: #071012;
  --panel: #10191c;
  --panel-2: #162327;
  --line: #284046;
  --text: #f7fbf8;
  --muted: #a9c0bd;
  --red: #b8844a;
  --red-2: #66e0d2;
  --green: #7df2bb;
  --yellow: #f0c978;
  --danger: #ff7f72;
  --teal: #55d8cc;
  --gold: #d9b86f;
  --violet: #7d78d8;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(85, 216, 204, 0.13), transparent 330px),
    radial-gradient(circle at 78% 0%, rgba(217, 184, 111, 0.16), transparent 34rem),
    radial-gradient(circle at 16% 8%, rgba(125, 120, 216, 0.12), transparent 28rem),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.app {
  width: min(1480px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  gap: 18px;
  align-items: stretch;
  min-height: 250px;
}

.brand,
.quick-card,
.mascot-card,
.search-panel,
.controls,
.summary article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 18, 21, 0.96);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 34px;
  background:
    linear-gradient(90deg, rgba(7, 16, 18, 0.98), rgba(7, 16, 18, 0.58)),
    url("./esturjao-avaloniano.png") center / cover;
}

.brand span,
.panel-head span {
  color: var(--red-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  margin-top: 8px;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-top: 4px;
  font-size: 23px;
  letter-spacing: 0;
}

.brand p {
  max-width: 700px;
  margin-top: 16px;
  color: #dedee3;
  font-size: 17px;
  line-height: 1.5;
}

.quick-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
}

.mascot-card {
  overflow: hidden;
  min-height: 250px;
  background:
    radial-gradient(circle at 50% 24%, rgba(85, 216, 204, 0.2), transparent 12rem),
    linear-gradient(180deg, #132124, #0b1315);
}

.mascot-card img {
  width: 100%;
  height: 100%;
  min-height: 250px;
  object-fit: cover;
}

.quick-card img {
  width: 154px;
  height: 154px;
  object-fit: contain;
  border-radius: 8px;
  background: radial-gradient(circle, #2b1115, #0c0c0e 68%);
  border: 1px solid rgba(227, 40, 53, 0.28);
}

.quick-card strong,
.quick-card span {
  display: block;
}

.quick-card strong {
  font-size: 20px;
}

.quick-card span {
  margin-top: 6px;
  color: var(--muted);
  word-break: break-word;
}

.search-panel,
.controls,
.summary,
.main-grid {
  margin-top: 16px;
}

.search-panel {
  position: relative;
  border-color: rgba(255, 74, 87, 0.18);
}

.search-panel::before,
.top-sales::before,
.kill-intel::before {
  content: "";
  display: block;
  height: 3px;
  margin: -16px -16px 14px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--red), transparent);
}

.search-panel,
.controls,
.panel {
  padding: 16px;
}

.search-line {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 230px 180px;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b0b0d;
  color: var(--text);
  outline: none;
}

input,
select {
  min-height: 43px;
  padding: 0 12px;
}

textarea {
  min-height: 94px;
  resize: vertical;
  padding: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 74, 87, 0.72);
  box-shadow: 0 0 0 3px rgba(227, 40, 53, 0.16);
}

.item-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 10px;
  margin-top: 12px;
  max-height: 380px;
  overflow: auto;
  padding-right: 4px;
}

.item-button {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 8px;
  text-align: left;
}

.item-button.active {
  border-color: var(--red-2);
  background: linear-gradient(180deg, #2b1519, #191014);
}

.item-button img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.item-button strong,
.item-button span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-button strong {
  font-size: 14px;
}

.item-button span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) 190px;
  gap: 12px;
  align-items: end;
  background: #101013;
}

button {
  min-height: 43px;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  background: linear-gradient(180deg, var(--teal), #2aaea3);
  color: #041011;
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0 14px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.summary article {
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent), rgba(18, 18, 21, 0.96);
}

.summary span,
.route-card span,
.death-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.list-status {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0d10;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.panel-head b {
  border: 1px solid rgba(255, 74, 87, 0.38);
  border-radius: 999px;
  color: #ff9da5;
  padding: 7px 10px;
  font-size: 12px;
}

.cost-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.recommendation {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0d10;
  padding: 14px;
  line-height: 1.45;
}

.profit-breakdown {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.break-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0d10;
  padding: 11px 12px;
}

.break-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.break-row strong {
  font-size: 16px;
}

.break-row.plus strong {
  color: var(--green);
}

.break-row.minus strong {
  color: var(--danger);
}

.break-row.result {
  border-color: rgba(255, 74, 87, 0.55);
  background: linear-gradient(180deg, #211115, #0d0d10);
}

.break-row.result strong {
  font-size: 20px;
}

.formula-box {
  margin-top: 14px;
  border: 1px solid rgba(255, 74, 87, 0.28);
  border-radius: 8px;
  background: rgba(227, 40, 53, 0.07);
  padding: 14px;
}

.formula-box strong,
.formula-box p,
.formula-box code {
  display: block;
}

.formula-box p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}

.formula-box code {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #09090b;
  color: #ffd1d5;
  padding: 10px;
  white-space: normal;
}

.empty-state {
  border: 1px dashed #3a3a45;
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.recommendation.good {
  border-color: rgba(69, 209, 140, 0.5);
}

.recommendation.warn {
  border-color: rgba(255, 209, 102, 0.5);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.route-list,
.death-history {
  display: grid;
  gap: 10px;
}

.route-card,
.death-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 13px;
}

.route-card strong,
.death-card strong {
  display: block;
  margin-top: 4px;
}

.route-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
}

.risk-low {
  color: var(--green);
}

.risk-medium {
  color: var(--yellow);
}

.risk-high {
  color: var(--danger);
}

.wide {
  min-width: 0;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.death-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.footnote {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.5;
}

.kill-intel {
  margin-top: 16px;
}

.top-sales {
  margin-top: 16px;
}

.control-deck {
  margin-top: 16px;
}

.top-controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.top-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0d10;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 12px;
  line-height: 1.45;
}

.spotlight {
  margin-top: 16px;
}

.best-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(85, 216, 204, 0.14), transparent),
    linear-gradient(180deg, #121e21, #0a1214);
  box-shadow: var(--shadow);
  padding: 18px;
}

.best-card.good {
  border-color: rgba(125, 242, 187, 0.55);
}

.best-card.mid {
  border-color: rgba(240, 201, 120, 0.52);
}

.best-card.warn,
.best-card.bad {
  border-color: rgba(255, 127, 114, 0.55);
}

.best-item {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.best-item img {
  width: 86px;
  height: 86px;
  object-fit: contain;
}

.best-item span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.best-item h2 {
  margin-top: 4px;
  font-size: clamp(28px, 4vw, 46px);
}

.best-item p,
.best-detail {
  color: var(--muted);
  line-height: 1.45;
}

.best-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.best-metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.best-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.best-metrics strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.best-detail {
  margin-top: 14px;
}

.advice-pill {
  display: inline-grid;
  min-width: 98px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.advice-pill.good {
  color: var(--green);
  border-color: rgba(125, 242, 187, 0.42);
}

.advice-pill.mid {
  color: var(--yellow);
  border-color: rgba(240, 201, 120, 0.42);
}

.advice-pill.warn,
.advice-pill.bad {
  color: var(--danger);
  border-color: rgba(255, 127, 114, 0.42);
}

.top-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.top-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #19191d, #101013);
  padding: 12px;
}

.top-card.best {
  border-color: rgba(255, 74, 87, 0.65);
  box-shadow: 0 0 0 1px rgba(255, 74, 87, 0.1);
}

.top-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.top-card span,
.top-card small,
.top-card strong,
.top-card b {
  display: block;
}

.top-card span {
  color: var(--red-2);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.top-card strong {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-card small {
  color: var(--muted);
  margin-top: 2px;
}

.top-card b {
  margin-top: 8px;
  color: var(--green);
}

.top-item {
  display: grid;
  grid-template-columns: 42px minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
}

.top-item img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.top-item strong,
.top-item small {
  display: block;
}

.top-item small,
td small {
  color: var(--muted);
  line-height: 1.35;
}

tbody tr:hover {
  background: rgba(255, 74, 87, 0.055);
}

.order-button {
  min-height: 34px;
}

.kill-tools {
  display: grid;
  grid-template-columns: 220px 240px minmax(0, 1fr) 190px;
  gap: 12px;
  align-items: end;
}

.kill-actions {
  display: grid;
  gap: 10px;
}

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

.intel-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0d10;
  padding: 14px;
}

h3 {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: 0;
}

.mini-list {
  display: grid;
  gap: 8px;
}

.mini-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px 12px;
}

.mini-row span {
  color: var(--muted);
  font-size: 12px;
}

.kill-rows {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.kill-card {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(360px, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 14px;
}

.kill-main strong,
.kill-main span {
  display: block;
}

.kill-main strong {
  font-size: 18px;
}

.kill-main span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.albion-set {
  display: grid;
  grid-template-columns: repeat(5, 78px);
  grid-template-rows: repeat(4, 78px);
  gap: 9px;
  justify-content: center;
  align-content: center;
  min-height: 366px;
  border: 1px solid #34343e;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, rgba(227, 40, 53, 0.16), transparent 8rem),
    linear-gradient(180deg, #101014, #0a0a0c);
  padding: 14px;
}

.gear-slot {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid #3a3a45;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    #15151a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.gear-slot.empty {
  opacity: 0.45;
}

.gear-slot img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.gear-slot span {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 4px;
  overflow: hidden;
  color: #d6d6dc;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap;
}

.slot-head {
  grid-column: 3;
  grid-row: 1;
}

.slot-bag {
  grid-column: 2;
  grid-row: 1;
}

.slot-cape {
  grid-column: 4;
  grid-row: 1;
}

.slot-mainhand {
  grid-column: 1;
  grid-row: 2;
}

.slot-armor {
  grid-column: 3;
  grid-row: 2;
}

.slot-offhand {
  grid-column: 5;
  grid-row: 2;
}

.slot-potion {
  grid-column: 2;
  grid-row: 3;
}

.slot-shoes {
  grid-column: 3;
  grid-row: 3;
}

.slot-food {
  grid-column: 4;
  grid-row: 3;
}

.slot-mount {
  grid-column: 3;
  grid-row: 4;
}

@media (max-width: 1100px) {
  .hero,
  .search-line,
  .controls,
  .summary,
  .main-grid,
  .cost-grid,
  .best-metrics,
  .kill-tools,
  .top-controls,
  .top-cards {
    grid-template-columns: 1fr 1fr;
  }

  .search-box,
  .brand,
  .wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .app {
    width: min(100% - 20px, 1480px);
    padding-top: 10px;
  }

  .hero,
  .search-line,
  .controls,
  .summary,
  .main-grid,
  .cost-grid,
  .best-metrics,
  .top-controls,
  .top-cards,
  .kill-tools,
  .intel-grid,
  .kill-card {
    grid-template-columns: 1fr;
  }

  .brand {
    min-height: 360px;
    padding: 22px;
  }

  h1 {
    font-size: 40px;
  }

  .best-item {
    grid-template-columns: 64px 1fr;
  }

  .best-item img {
    width: 64px;
    height: 64px;
  }

  .albion-set {
    grid-template-columns: repeat(5, 62px);
    grid-template-rows: repeat(4, 62px);
    min-height: 304px;
  }

  .gear-slot img {
    width: 48px;
    height: 48px;
  }
}
