:root {
  --bg-0: #050505;
  --bg-1: #0e0e0e;
  --bg-2: #171717;
  --card: #121212;
  --card-2: #0b0b0b;
  --line: #2a2a2a;
  --line-soft: #393939;
  --text: #d8d2c3;
  --muted: #978f80;
  --gold: #c8a56a;
  --gold-2: #d6b170;
  --ember: #a34d2c;
  --ember-soft: #743420;
  --chip: #1a1a1a;
  --chip-active: #2b2b2b;
  --bg-overlay-image: radial-gradient(900px 440px at 82% -8%, rgba(144, 118, 80, 0.18) 0%, rgba(0, 0, 0, 0) 62%);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  background-color: var(--bg-0);
  background-image:
    radial-gradient(920px 460px at 82% -10%, rgba(122, 101, 71, 0.18) 0%, rgba(0, 0, 0, 0) 62%),
    linear-gradient(180deg, rgba(7, 7, 7, 0.98) 0%, rgba(5, 5, 5, 0.99) 64%, rgba(4, 4, 4, 1) 100%),
    radial-gradient(1200px 500px at 50% -170px, #171717 0%, #060606 57%);
  background-size: cover;
  position: relative;
}

.app-shell {
  max-width: 540px;
  margin: 0 auto;
  min-height: auto;
  padding: 14px;
  padding-top: 72px;
  position: relative;
  z-index: 1;
}

.studio-home-btn {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid rgba(200, 165, 106, 0.45);
  color: #e5d7bf;
  border-radius: 10px;
  padding: 6px 10px;
  background: rgba(10, 10, 10, 0.72);
}

.studio-home-btn:hover,
.studio-home-btn:focus-visible {
  border-color: rgba(214, 177, 112, 0.85);
}

.panel {
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.95), rgba(9, 9, 9, 0.96));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.title {
  color: var(--gold);
  font-family: "Georgia", "Times New Roman", serif;
  letter-spacing: 0.35px;
  font-size: 1.18rem;
  margin: 0;
}

.forge {
  margin-top: 10px;
  border: 1px solid #2f2c28;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.78), rgba(10, 10, 10, 0.94));
  padding: 10px;
}

.forge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.forge-title {
  margin: 0;
  color: #e0c68d;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1.05rem;
}

.forge-reset {
  font-size: 0.82rem;
  padding: 4px 2px;
}

.forge-help {
  margin: 6px 0 0;
  color: #9b9386;
  font-size: 0.82rem;
}

.armor-body {
  position: absolute;
  width: 170px;
  transform-origin: center center;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  user-select: none;
  z-index: 3;
}

.armor-body.dragging {
  cursor: grabbing;
}

.archon-image {
  width: 100%;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.6));
}

.archon-sockets {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 2;
}

.socket-slot {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(150, 132, 92, 0.5);
  border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, rgba(42, 39, 33, 0.93) 0%, rgba(12, 11, 10, 0.96) 72%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px;
  box-shadow: inset 0 0 0 1px rgba(10, 9, 8, 0.9);
}

.socket-slot.filled {
  border-color: rgba(186, 166, 118, 0.82);
  background: radial-gradient(circle at 40% 30%, rgba(48, 42, 35, 0.9) 0%, rgba(15, 13, 12, 0.98) 74%);
}

.socket-empty {
  width: 8px;
  height: 8px;
  border: 1px solid #4e4638;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2b261f 0%, #0b0a08 72%);
}

.socket-rune-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
}

.armor-stats {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 16px);
  transform: translateX(-50%);
  width: min(280px, 92vw);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background: rgba(10, 10, 14, 0.97);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.42);
  padding: 10px;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

.archon-name {
  margin: 0;
  color: #aeb5c7;
  font-size: 1.5rem;
}

.archon-line {
  margin: 4px 0 0;
  color: #b5b8c2;
  font-size: 0.96rem;
}

.archon-socket-line {
  margin: 6px 0 0;
  color: #6f7dff;
  font-size: 1.02rem;
}

.inserted-runes {
  margin: 6px 0 0;
  color: #aeb5c7;
  font-size: 0.96rem;
}

.inserted-rune-list {
  color: #d6ba7e;
  letter-spacing: 0.2px;
}

.enigma-name {
  margin: 0;
  color: #d6ba7e;
  letter-spacing: 1.1px;
  font-size: 1.3rem;
}

.enigma-base {
  margin: 2px 0 0;
  color: #9ea3b1;
  font-size: 1.05rem;
  letter-spacing: 0.7px;
}

.enigma-runes {
  margin: 2px 0 0;
  color: #d6ba7e;
  font-size: 1rem;
}

.enigma-stat {
  margin: 4px 0 0;
  color: #e2e2e6;
  font-size: 1.02rem;
}

.enigma-effect {
  margin: 2px 0 0;
  color: #5f8fff;
  font-size: 1.01rem;
  line-height: 1.22;
}

.enigma-socketed {
  margin: 6px 0 0;
  color: #5f8fff;
  font-size: 1.02rem;
}

.rune-effect {
  margin: 2px 0 0;
  color: #66a8ff;
  font-size: 1.01rem;
  line-height: 1.22;
}

.rune-playfield {
  position: fixed;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.floating-rune {
  position: absolute;
  width: 36px;
  height: 36px;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  cursor: grab;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.55));
}

.floating-rune.dragging {
  cursor: grabbing;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.72));
}

.search {
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(15, 15, 15, 0.88);
  color: var(--text);
}

.search {
  width: 100%;
  padding: 9px 11px;
  font-size: 0.93rem;
}

.meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.progress-track {
  height: 9px;
  background: #191919;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
  border: 1px solid #222;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #88573b, #c18a57);
  width: 0%;
}

.search {
  margin-top: 10px;
  font-size: 0.98rem;
}

.search:focus {
  outline: 2px solid #5b4831;
  outline-offset: 0;
}

.filters-toggle-row {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

.btn-link {
  border: none;
  background: transparent;
  color: #bba578;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 4px;
}

.btn-link:hover {
  color: #d5be8c;
}

.filter-group {
  margin-top: 10px;
}

.filter-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line-soft);
  background: var(--chip);
  color: #d2c9b7;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.86rem;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  border-color: #715b3d;
  background: var(--chip-active);
  color: #efe2cb;
}

.list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px;
  background: linear-gradient(180deg, var(--card), var(--card-2));
}

.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.item-name-btn {
  border: none;
  background: transparent;
  color: var(--gold);
  padding: 0;
  margin: 0;
  font-size: 1.06rem;
  text-align: left;
  cursor: pointer;
  font-family: "Georgia", "Times New Roman", serif;
}

.item-name-btn:hover {
  color: #e0c28a;
}

.item-patch,
.item-runes {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.88rem;
}

.item-runes {
  color: #aca597;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.item-rune {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.item-rune-plus {
  color: #786f62;
  margin: 0 1px;
}

.item-rune-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 2px;
}

.item-rune-name {
  color: #d7c39b;
}

.detail {
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.96), rgba(8, 8, 8, 0.985) 70%);
  border: 1px solid #2c2c2c;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn {
  border: 1px solid #504635;
  background: #191817;
  color: #d3c9b8;
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
}

.btn:hover {
  border-color: #7a6a50;
}

.made-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #b2aa9d;
  font-size: 0.88rem;
}

.detail-name {
  margin: 12px 0 0;
  text-align: center;
  color: #e3bf84;
  font-size: clamp(2rem, 8vw, 2.35rem);
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 400;
}

.detail-patch {
  margin: 4px 0 0;
  text-align: center;
  color: #a29d93;
  font-size: 1.06rem;
}

.rune-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 8px;
  justify-content: center;
  align-items: center;
}

.rune-plus {
  color: #6f6a60;
  font-size: 1.16rem;
}

.rune-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 2px;
}

.rune-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 4px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

.rune-stone {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(180deg, #d6d4cf, #7f7b74);
  border: 1px solid #5c5851;
  color: #2d2a27;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.rune-name {
  color: #ffbf2f;
  font-size: clamp(1.65rem, 8vw, 2.15rem);
  line-height: 1;
  font-weight: 600;
}

.req {
  text-align: center;
  margin: 14px 0;
  color: #9a958b;
  font-size: 1.05rem;
}

.divider {
  border: none;
  height: 1px;
  background: #2a2a2a;
  margin: 14px 0;
}

.base-line {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.socket-part {
  color: #a09a8f;
  font-size: clamp(1.5rem, 7vw, 2rem);
}

.base-part {
  color: #f0f1f4;
  font-size: clamp(1.6rem, 7vw, 2rem);
  line-height: 1.15;
  font-weight: 700;
  text-wrap: balance;
}

.effect {
  text-align: center;
  color: #66a8ff;
  margin: 7px 0;
  font-size: clamp(1.04rem, 4.8vw, 1.22rem);
  line-height: 1.42;
}

.roll {
  color: #8ef3ff;
  border: 1px solid rgba(122, 252, 255, 0.55);
  background: rgba(14, 48, 54, 0.42);
  border-radius: 3px;
  padding: 0 5px;
  box-shadow: inset 0 0 0 1px rgba(4, 16, 18, 0.55);
}

.note {
  margin-top: 6px;
  text-align: center;
  color: #66a8ff;
  font-size: 1.04rem;
}

.empty {
  margin-top: 10px;
  color: #9b9386;
  text-align: center;
  border: 1px dashed #3e372f;
  border-radius: 12px;
  padding: 16px;
}

.small {
  font-size: 0.85rem;
}

@media (max-width: 420px) {
  .app-shell {
    padding: 10px;
    padding-top: 70px;
  }

  .panel,
  .detail {
    padding: 12px;
  }

  .armor-body {
    width: 148px;
  }

  .socket-slot {
    width: 30px;
    height: 30px;
  }

  .floating-rune {
    width: 32px;
    height: 32px;
  }

}

@media (max-width: 959px), (pointer: coarse) {
  .rune-playfield {
    display: none;
  }
}
