:root {
  color-scheme: dark;
  --bg: #0c0e11;
  --panel: #15181d;
  --panel-2: #101318;
  --line: #2b3038;
  --line-soft: #222730;
  --text: #e5e8ed;
  --muted: #929aa6;
  --gold: #c9a85c;
  --gold-2: #f0d38c;
  --blue: #6f9ed8;
  --green: #6eb58b;
  --red: #d57474;
  --purple: #b18bd5;
  --orange: #d49765;
  --normal: #d5d5d5;
  --magic: #8197ff;
  --rare: #f2df72;
  --unique: #c9854e;
  --corrupted: #e25c5c;
  --shadow: 0 14px 36px rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% -10%, rgba(201,168,92,.11), transparent 28rem),
    linear-gradient(180deg, #101217 0%, var(--bg) 28%);
  color: var(--text);
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(1540px, calc(100% - 32px)); margin: 0 auto 80px; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; padding: 32px 4px 20px;
}
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(1.6rem, 2.6vw, 2.5rem); letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 1.07rem; letter-spacing: -.01em; }
.subtitle { margin: 0; color: var(--muted); font-size: .92rem; }
.eyebrow {
  margin-bottom: 7px; color: var(--gold); letter-spacing: .13em;
  font-size: .69rem; font-weight: 800;
}
.top-actions, .control-buttons, .item-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.panel {
  background: linear-gradient(180deg, rgba(24,27,33,.98), rgba(17,20,25,.98));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.control-strip {
  display: grid; grid-template-columns: 130px minmax(190px, 1fr) 210px auto;
  gap: 14px; align-items: end; padding: 14px;
  margin-bottom: 16px;
}
label { color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: .035em; }
input, select {
  width: 100%; margin-top: 6px; padding: 10px 11px;
  color: var(--text); background: #0e1115; border: 1px solid var(--line);
  border-radius: 7px; outline: none;
}
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,92,.11); }

.btn {
  min-height: 38px; padding: 8px 13px; border-radius: 7px;
  border: 1px solid var(--line); color: var(--text); background: #1c2027;
  font-weight: 700; font-size: .78rem;
}
.btn:hover:not(:disabled) { border-color: #505866; transform: translateY(-1px); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn.primary { color: #17150d; background: var(--gold-2); border-color: var(--gold-2); }
.btn.danger { color: #ffd7d7; background: #322024; border-color: #5d3037; }
.btn.subtle { background: #14181e; }
.btn.compact { min-height: 31px; padding: 5px 9px; }

.workspace {
  display: grid; grid-template-columns: minmax(390px, .84fr) minmax(570px, 1.42fr);
  gap: 16px; align-items: start;
}
.left-column, .right-column { display: grid; gap: 16px; }
.item-panel, .currency-panel, .metric-panel, .history-panel, .assumptions-panel { padding: 16px; }
.panel-heading {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; margin-bottom: 14px;
}

.item-card {
  width: min(100%, 520px); min-height: 450px; margin: 0 auto;
  padding: 18px 22px 20px; background:
  linear-gradient(rgba(4,5,7,.87), rgba(7,8,11,.92)),
  repeating-linear-gradient(45deg, transparent 0 11px, rgba(255,255,255,.012) 11px 12px);
  border: 1px solid #4b4333; box-shadow: inset 0 0 35px rgba(201,168,92,.055), 0 8px 30px rgba(0,0,0,.35);
  font-family: Georgia, "Times New Roman", serif; text-align: center;
}
.item-title-block { line-height: 1.28; }
.rarity-label { color: var(--muted); font: 700 .68rem/1 ui-sans-serif, system-ui; letter-spacing: .15em; margin-bottom: 8px; }
.item-name { color: var(--normal); font-size: 1.22rem; font-weight: 700; }
.base-name { color: #afb5be; font-size: .91rem; }
.divider { height: 1px; margin: 13px 0; background: linear-gradient(90deg, transparent, #594d36, transparent); }
.requirements, .stat-lines, .implicit-lines, .socket-lines, .special-lines { color: #cdd2da; font-size: .88rem; line-height: 1.48; }
.mod-block { margin-top: 13px; }
.mod-block:empty { display: none; }
.mod-section-label {
  margin: 12px 0 7px; color: #737c89;
  font: 800 .64rem/1 ui-sans-serif, system-ui; letter-spacing: .15em;
}
.mod-line { position: relative; color: var(--blue); line-height: 1.42; font-size: .91rem; padding: 1px 0; }
.mod-line.crafted { color: var(--purple); }
.mod-line.desecrated { color: #ce7aaa; }
.mod-line.fractured { color: #d7b06b; }
.mod-meta { color: #6f7681; font: .66rem ui-sans-serif, system-ui; margin-left: 5px; }
.socket-lines { margin-top: 10px; color: #d6b97a; }
.implicit-lines { margin-top: 10px; color: #91b5e1; }
.special-lines { margin-top: 14px; color: var(--corrupted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
.item-actions { margin-top: 14px; justify-content: center; }

.badge-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.badge, .count-chip {
  display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px;
  border: 1px solid var(--line); border-radius: 999px; background: #101318;
  color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .04em;
}
.badge.corrupted { color: #ff9999; border-color: #63383d; }
.badge.runeforged { color: #86c9d5; border-color: #31565d; }
.badge.mirrored { color: #d2b4ef; border-color: #55406b; }
.badge.destroyed { color: #ffaaaa; border-color: #6b3434; }
.badge.sanctified { color: #fff1a8; border-color: #6b6034; box-shadow: inset 0 0 10px rgba(255,225,110,.08); }

.message-bar {
  margin-top: 13px; min-height: 38px; padding: 10px 12px;
  border-radius: 7px; border: 1px solid var(--line); background: #101318;
  color: var(--muted); font-size: .78rem; line-height: 1.4;
}
.message-bar.success { color: #a7dfbd; border-color: #315640; }
.message-bar.error { color: #f1a5a5; border-color: #62383c; }
.message-bar.preview { color: #d9b8f4; border-color: #5b4172; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.metric { padding: 11px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--panel-2); }
.metric-label { color: var(--muted); font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; }
.metric-value { margin-top: 5px; font-size: 1.05rem; font-weight: 800; }

.library-controls {
  display: grid; grid-template-columns: minmax(180px, 1fr) 180px auto;
  align-items: end; gap: 9px; margin-bottom: 13px;
}
.library-controls input, .library-controls select { margin-top: 0; }
.check-label { display: flex; align-items: center; gap: 7px; min-height: 39px; white-space: nowrap; }
.check-label input { width: auto; margin: 0; accent-color: var(--gold); }

.currency-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.currency-card {
  display: grid; grid-template-rows: auto auto 1fr auto; gap: 7px;
  min-height: 158px; padding: 11px; text-align: left;
  border: 1px solid var(--line-soft); border-radius: 9px; background: #101318;
  transition: border-color .12s ease, transform .12s ease;
}
.currency-card:hover { border-color: #474f5b; transform: translateY(-1px); }
.currency-card.incompatible { opacity: .6; border-style: dashed; }
.currency-card h3 { margin: 0; font-size: .83rem; line-height: 1.28; }
.currency-category { color: var(--gold); font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.currency-card p { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.38; }
.currency-footer { display: flex; justify-content: space-between; align-items: end; gap: 7px; }
.currency-tag { color: #77808c; font-size: .61rem; }
.currency-card .btn { min-height: 31px; padding: 5px 9px; }

.omen-tray {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-bottom: 12px; padding: 10px 12px; border: 1px solid #5b4172;
  border-radius: 8px; background: rgba(90,58,119,.12); color: #d9b8f4; font-size: .76rem;
}
.hidden { display: none !important; }

.history-list {
  max-height: 310px; overflow: auto; margin: 0; padding-left: 25px;
  color: var(--muted); font-size: .75rem;
}
.history-list li { padding: 6px 5px; border-bottom: 1px solid var(--line-soft); }
.history-list li::marker { color: #59616d; }
.history-empty { list-style: none; margin-left: -20px; color: #68717e; }

.assumptions-panel { display: grid; gap: 13px; }
.assumptions-panel .panel-heading { margin-bottom: 0; }
.accuracy-row { display: grid; grid-template-columns: 12px 1fr; gap: 10px; align-items: start; }
.accuracy-row strong { font-size: .76rem; }
.accuracy-row p { margin: 3px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.42; }
.accuracy-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; }
.accuracy-dot.exact { background: var(--green); }
.accuracy-dot.provisional { background: var(--gold); }
.accuracy-dot.simplified { background: var(--orange); }

dialog { width: min(520px, calc(100% - 30px)); padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(3px); }
.dialog-card { padding: 19px; }
.dialog-card h2 { margin-bottom: 8px; }
.dialog-card > p:not(.eyebrow) { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.dialog-options { display: grid; gap: 8px; margin: 15px 0; }
.choice-btn { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #101318; color: var(--text); text-align: left; }
.choice-btn:hover { border-color: var(--gold); }
.choice-btn strong, .choice-btn span { display: block; }
.choice-btn span { margin-top: 3px; color: var(--muted); font-size: .7rem; }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 1fr; }
  .right-column { grid-row: 1; }
  .currency-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .app-shell { width: min(100% - 18px, 1540px); }
  .topbar { align-items: flex-start; flex-direction: column; }
  .control-strip { grid-template-columns: 1fr 1fr; }
  .control-buttons { grid-column: 1 / -1; }
  .currency-grid { grid-template-columns: repeat(2, 1fr); }
  .library-controls { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .control-strip { grid-template-columns: 1fr; }
  .seed-field, .control-buttons { grid-column: auto; }
  .currency-grid { grid-template-columns: 1fr; }
  .item-card { padding: 16px 12px; }
}


/* v2 currency accordions */
.library-controls {
  grid-template-columns: minmax(220px, 1fr) auto;
}
.currency-accordion {
  display: grid;
  gap: 9px;
}
.currency-group {
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #101318;
  overflow: visible;
}
.currency-group > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 45px;
  padding: 10px 13px;
  color: var(--text);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .035em;
  cursor: pointer;
  list-style: none;
}
.currency-group > summary::-webkit-details-marker { display: none; }
.currency-group > summary::before {
  content: "▸";
  margin-right: 9px;
  color: var(--gold);
  transition: transform .12s ease;
}
.currency-group[open] > summary::before { transform: rotate(90deg); }
.currency-group > summary span:first-child { flex: 1; }
.group-count {
  min-width: 27px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-align: center;
  font-size: .63rem;
}
.currency-name-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  padding: 0 8px 8px;
}
.currency-tip {
  position: relative;
  min-width: 0;
}
.currency-name-button {
  width: 100%;
  min-height: 28px;
  padding: 4px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  color: var(--text);
  background: #171b21;
  font-size: .72rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
}
.currency-name-button.available {
  border-color: #5b5138;
  background: #201e18;
}
.currency-name-button.available:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}
.currency-name-button:disabled {
  color: #626a75;
  background: #111419;
  cursor: not-allowed;
  opacity: .67;
}
.currency-tip::after,
.omen-chip::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: calc(100% + 9px);
  width: min(310px, 80vw);
  padding: 9px 10px;
  border: 1px solid #4a515c;
  border-radius: 7px;
  background: #080a0d;
  color: #dce1e8;
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
  font-size: .68rem;
  font-weight: 500;
  line-height: 1.38;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .12s ease, transform .12s ease;
}
.currency-tip:hover::after,
.omen-chip:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.currency-tip.incompatible .currency-name-button {
  border-style: dashed;
}

/* stacked Omens */
.omen-tray {
  display: block;
  margin-bottom: 12px;
  padding: 10px;
}
.omen-tray-title {
  margin-bottom: 8px;
  color: #b995d6;
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .11em;
}
.omen-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.omen-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 7px 5px 10px;
  border: 1px solid #5b4172;
  border-radius: 999px;
  background: rgba(90,58,119,.16);
  color: #dfc3f5;
  font-size: .68rem;
  font-weight: 750;
}
.omen-chip button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #dfc3f5;
  background: rgba(255,255,255,.08);
  line-height: 1;
}

/* modifier targeting and unrevealed state */
.mod-line {
  border-radius: 4px;
  transition: color .11s ease, background .11s ease, text-shadow .11s ease;
}
.mod-line.unrevealed {
  color: #bd77d2;
  font-style: italic;
  letter-spacing: .015em;
}
.mod-line.omen-target {
  color: #ffad4f !important;
  background: rgba(255,145,35,.12);
  text-shadow: 0 0 9px rgba(255,137,28,.8);
}
.mod-meta {
  display: inline-block;
  margin-left: 7px;
}

@media (max-width: 900px) {
  .currency-name-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .currency-name-grid { grid-template-columns: 1fr; }
  .library-controls { grid-template-columns: 1fr; }
}

.mod-line[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 80;
  left: 50%;
  bottom: calc(100% + 7px);
  padding: 7px 9px;
  border: 1px solid #4a515c;
  border-radius: 6px;
  background: #080a0d;
  color: #e7ebf0;
  font: 600 .66rem/1.35 ui-sans-serif, system-ui;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .12s ease, transform .12s ease;
}
.mod-line[data-tooltip]:hover::after { opacity: 1; transform: translate(-50%, 0); }
.dialog-options { max-height: 58vh; overflow: auto; }
.dialog-option-list { display: grid; gap: 7px; }
.dialog-search { position: sticky; top: 0; z-index: 2; margin: 0 0 8px; background: #0b0e12; }
.dialog-secondary { width: 100%; margin-top: 9px; }
@media (max-width: 1150px) { .currency-name-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .currency-name-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media (max-width: 520px) { .currency-name-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* revision 4 — boot workspaces and confirmable Hinekora preview */
.boot-selector-label {
  display: block;
  width: min(250px, 100%);
  margin-top: 10px;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.boot-selector-label select {
  margin-top: 5px;
  min-height: 35px;
  padding: 7px 10px;
  color: var(--text);
  font-size: .76rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
}
.lock-preview-panel {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #745c29;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(65,49,19,.30), rgba(28,23,14,.72));
}
.lock-preview-panel.armed {
  box-shadow: inset 0 0 0 1px rgba(240,211,140,.08);
}
.lock-preview-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.lock-preview-title {
  color: var(--gold-2);
  font-size: .79rem;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.lock-preview-currency {
  margin-top: 4px;
  color: var(--text);
  font-size: .9rem;
  font-weight: 800;
}
.lock-preview-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.45;
}
.lock-impact {
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid #5e5132;
  border-radius: 7px;
  background: #0e1014;
  color: #f1d58d;
  font-size: .76rem;
  line-height: 1.5;
}
.lock-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}
.badge.locked {
  color: #f1d58d;
  border-color: #745c29;
}
.normal-currency-sections {
  display: grid;
  gap: 8px;
  padding: 0 8px 8px;
}
.normal-currency-section {
  border-top: 1px solid var(--line-soft);
  padding-top: 7px;
}
.normal-currency-section:first-child {
  border-top: 0;
  padding-top: 0;
}
.currency-subgroup-label {
  margin: 0 0 5px 2px;
  color: #7f8792;
  font-size: .58rem;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.normal-currency-section .currency-name-grid {
  padding: 0;
}
@media (max-width: 760px) {
  .lock-preview-heading { flex-direction: column; }
}


/* revision 5 — modifier browser */
.modifier-browser-dialog {
  width: min(1040px, calc(100% - 28px));
  max-height: 88vh;
}
.modifier-browser-card {
  padding: 18px;
}
.modifier-browser-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
}
.modifier-browser-header h2 {
  font-size: 1.2rem;
}
.modifier-browser-header p:not(.eyebrow) {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
}
.modifier-browser-search {
  margin: 15px 0 12px;
}
.modifier-browser-content {
  display: grid;
  gap: 12px;
  max-height: 66vh;
  overflow: auto;
  padding-right: 4px;
}
.modifier-browser-section {
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #101318;
  overflow: hidden;
}
.modifier-browser-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: #15191f;
}
.modifier-browser-section-heading h3 {
  margin: 0;
  font-size: .78rem;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.modifier-browser-section-heading span {
  color: var(--muted);
  font-size: .65rem;
}
.modifier-table-wrap {
  overflow-x: auto;
}
.modifier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .72rem;
}
.modifier-table th,
.modifier-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}
.modifier-table th {
  color: #8e97a3;
  font-size: .61rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.modifier-table tr:last-child td {
  border-bottom: 0;
}
.modifier-table strong,
.modifier-table small {
  display: block;
}
.modifier-table small {
  margin-top: 2px;
  color: #6f7783;
  font-size: .6rem;
}
.side-pill {
  display: inline-flex;
  min-width: 50px;
  justify-content: center;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: .59rem;
  font-weight: 800;
  text-transform: uppercase;
}
.side-pill.prefix { color: #8fb0dd; border-color: #3d5572; }
.side-pill.suffix { color: #d7bd7c; border-color: #655638; }
.modifier-browser-empty {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  color: var(--muted);
  text-align: center;
  font-size: .78rem;
}
@media (max-width: 700px) {
  .modifier-browser-header { flex-direction: column; }
  .modifier-table th:nth-child(1),
  .modifier-table td:nth-child(1) { display: none; }
}


/* revision 6 — icon controls and separated Desecration actions */
.currency-image-grid {
  grid-template-columns: repeat(8, minmax(48px, 1fr));
  gap: 7px;
}
.currency-tip { min-width: 0; }
.currency-image-button {
  width: 100%;
  min-height: 58px;
  padding: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0d1014;
  color: #cfd5dd;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.currency-image-button img,
.currency-fallback-label {
  grid-area: 1 / 1;
}
.currency-image-button img {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.45));
}
.currency-fallback-label {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #444b55;
  border-radius: 50%;
  background: radial-gradient(circle, #202630, #11151b 70%);
  color: #d5dbe4;
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .06em;
}
.currency-image-button.icon-loaded .currency-fallback-label { display: none; }
.currency-image-button.available {
  border-color: #594e35;
  background: #17150f;
}
.currency-image-button.available:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(201,168,92,.08);
}
.currency-image-button:disabled { opacity: .36; cursor: not-allowed; }
.currency-image-button.icon-fallback {
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .07em;
}
.currency-tip::after { white-space: pre-wrap; }
.currency-text-button {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #12161b;
  color: var(--text);
  font-size: .74rem;
  font-weight: 850;
}
.currency-text-button:disabled { opacity: .42; cursor: not-allowed; }
.desecration-control-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  gap: 14px;
  align-items: start;
}
.desecration-left-controls { min-width: 0; }
.desecration-right-controls {
  display: grid;
  gap: 9px;
  padding-left: 13px;
  border-left: 1px solid var(--line-soft);
}
.well-reveal-button {
  min-height: 55px;
  border-color: #397252;
  background: linear-gradient(180deg, #214a34, #173524);
  color: #c9f2d8;
}
.well-reveal-button.available:hover {
  border-color: #69bd86;
  box-shadow: 0 0 0 3px rgba(73,166,105,.12);
}
.abyssal-echo-control .currency-image-button { min-height: 64px; }
@media (max-width: 1100px) {
  .currency-image-grid { grid-template-columns: repeat(6, minmax(48px, 1fr)); }
}
@media (max-width: 760px) {
  .currency-image-grid { grid-template-columns: repeat(4, minmax(48px, 1fr)); }
  .desecration-control-layout { grid-template-columns: 1fr; }
  .desecration-right-controls {
    grid-template-columns: minmax(0,1fr) 82px;
    padding-left: 0;
    padding-top: 11px;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }
}
@media (max-width: 470px) {
  .currency-image-grid { grid-template-columns: repeat(3, minmax(48px, 1fr)); }
}


/* Revision 7 state treatments */
#choiceDialog.well-of-souls-dialog {
  background: rgba(20, 57, 40, .94);
  border-color: rgba(103, 184, 130, .62);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, .48),
    inset 0 0 42px rgba(87, 176, 116, .09);
}
#choiceDialog.well-of-souls-dialog .dialog-card {
  background:
    linear-gradient(180deg, rgba(44, 96, 66, .30), rgba(12, 31, 22, .16));
}
#choiceDialog.well-of-souls-dialog::backdrop {
  background: rgba(1, 12, 7, .72);
  backdrop-filter: blur(4px);
}

.item-panel {
  position: relative;
  overflow: hidden;
}
.item-panel.architect-destroyed::after {
  content: "DESTROYED BY ARCHITECT'S ORB";
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(142, 25, 32, .12) 0 18px,
      rgba(81, 7, 13, .18) 18px 36px
    ),
    rgba(126, 18, 25, .34);
  color: rgba(255, 214, 214, .88);
  border: 1px solid rgba(224, 91, 98, .52);
  font-size: clamp(.92rem, 1.8vw, 1.35rem);
  font-weight: 900;
  letter-spacing: .16em;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .8);
}


/* Revision 9: cost ledger, range-first modifiers, permanent socketables */
.history-heading { align-items: flex-start; }
.history-controls { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.history-tabs { display:inline-flex; padding:3px; border:1px solid var(--line); border-radius:8px; background:#0d1014; }
.history-tab { min-height:29px; padding:5px 10px; border:0; border-radius:5px; background:transparent; color:var(--muted); font-size:.7rem; font-weight:800; }
.history-tab.active { background:#282e37; color:var(--text); }
.cost-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:10px; }
.cost-summary > div { padding:10px; border:1px solid var(--line-soft); border-radius:8px; background:#101318; }
.cost-summary span, .cost-summary strong { display:block; }
.cost-summary span { color:var(--muted); font-size:.63rem; text-transform:uppercase; letter-spacing:.08em; }
.cost-summary strong { margin-top:4px; font-size:1rem; }
.cost-summary p { grid-column:1/-1; margin:0; color:#7d8692; font-size:.65rem; line-height:1.4; }
.cost-list { display:grid; gap:6px; max-height:340px; overflow:auto; }
.cost-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px; border:1px solid var(--line-soft); border-radius:7px; background:#101318; }
.cost-identity { display:flex; align-items:center; gap:9px; min-width:0; }
.cost-identity strong, .cost-identity small, .cost-value strong, .cost-value small { display:block; }
.cost-identity strong { font-size:.73rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cost-identity small, .cost-value small { margin-top:2px; color:var(--muted); font-size:.62rem; }
.cost-value { text-align:right; flex:0 0 auto; }
.cost-value strong { font-size:.74rem; }
.cost-icon { position:relative; display:grid; place-items:center; width:32px; height:32px; flex:0 0 32px; border:1px solid #383f49; border-radius:6px; background:#0b0e12; color:#747e8b; font-size:.57rem; font-weight:900; overflow:hidden; }
.cost-icon img { position:absolute; inset:2px; width:calc(100% - 4px); height:calc(100% - 4px); object-fit:contain; }
.cost-icon.loaded { color:transparent; }
.cost-empty { padding:18px; border:1px dashed var(--line); border-radius:8px; color:var(--muted); text-align:center; font-size:.72rem; }
.mod-meta { color:#858e9a; }
@media(max-width:560px){ .cost-summary{grid-template-columns:1fr;} .cost-summary p{grid-column:auto;} .history-controls{justify-content:flex-start;} }


/* Revision 10: technical drawer, relocated state controls, pinned Omens */
.technical-panel { margin-bottom:16px; overflow:hidden; }
.technical-toggle { display:flex; align-items:center; justify-content:space-between; min-height:46px; padding:0 15px; color:var(--text); font-size:.78rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; cursor:pointer; list-style:none; }
.technical-toggle::-webkit-details-marker { display:none; }
.technical-toggle::after { content:'+'; color:var(--gold); font-size:1.1rem; }
.technical-panel[open] .technical-toggle::after { content:'−'; }
.technical-panel[open] .technical-toggle { border-bottom:1px solid var(--line); }
.technical-content { margin:0; border:0; border-radius:0; box-shadow:none; background:transparent; }
.technical-note { grid-column:1/-1; margin:0; color:var(--muted); font-size:.78rem; line-height:1.4; }
.craft-state-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin-top:14px; }
.cost-toolbar { display:flex; justify-content:flex-end; margin-bottom:8px; }
.omen-chip.persistent { border-color:#ff9d25; box-shadow:0 0 0 2px rgba(255,139,20,.26), inset 0 0 0 1px rgba(255,174,57,.28); }
.omen-persistent-mark { margin-left:6px; color:var(--gold-2); font-size:.55rem; letter-spacing:.08em; }
.currency-tip.omen-pinned .currency-image-button { border-color:#ff9d25; box-shadow:0 0 0 2px rgba(255,139,20,.35), 0 0 16px rgba(255,139,20,.18); }
@media (max-width:760px) { .technical-content { grid-template-columns:1fr 1fr; } }
@media (max-width:480px) { .technical-content { grid-template-columns:1fr; } }


/* Revision 12: secondary-cost accounting and Omen state clarity */
.omen-chip.abyssal-echoes-active {
  border-color:#65c987;
  background:rgba(70,150,98,.16);
  box-shadow:0 0 0 2px rgba(101,201,135,.18), inset 0 0 0 1px rgba(101,201,135,.24);
}
.omen-chip.abyssal-echoes-active span { color:#c9f7d8; }


/* Revision 13: currency-hover learning overlay */
.mod-line.guide-target {
  background: rgba(245, 214, 112, .055);
  box-shadow: inset 0 0 0 1px rgba(245,214,112,.10);
}
.mod-line.slot-guide {
  color: rgba(242,223,114,.72);
  background: rgba(245,214,112,.05);
  border: 1px dashed rgba(245,214,112,.16);
  font-style: italic;
}
.socket-lines.zone-guide,
.implicit-lines.zone-guide,
.stat-lines.zone-guide {
  border-radius: 6px;
  background: rgba(245,214,112,.05);
  box-shadow: inset 0 0 0 1px rgba(245,214,112,.10);
}
.currency-tip:has(.currency-image-button:hover),
.currency-tip:has(.currency-text-button:hover) {
  filter: brightness(1.08);
}



/* Revision 15: restored Craft Record, stable split panes, tooltip stacking, soft scrollbars */
.cost-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.cost-price-label {
  display:flex;
  align-items:center;
  gap:8px;
  min-height:31px;
}
.cost-price-label select {
  width:auto;
  min-width:150px;
  margin-top:0;
  padding:6px 8px;
  font-size:.72rem;
}

/* Make the Craft Record impossible to collapse out of reach from layout rules. */
.history-panel {
  display:block;
  min-height:260px;
  position:relative;
  z-index:1;
}
#auditView,
#costView {
  position:relative;
  z-index:1;
}
#costView.hidden {
  display:none !important;
}
.history-list {
  max-height:360px;
}

/* Tooltip layer: raise hovered controls above neighboring icon buttons. */
.currency-accordion,
.currency-group,
.currency-name-grid,
.currency-image-grid,
.currency-grid {
  overflow:visible;
}
.currency-tip {
  position:relative;
  z-index:1;
  isolation:isolate;
}
.currency-tip:hover,
.currency-tip:focus-within {
  z-index:100000;
}
.currency-tip::after,
.omen-chip::after {
  z-index:100001;
}
.currency-tip:hover::after,
.currency-tip:focus-within::after,
.omen-chip:hover::after,
.omen-chip:focus-within::after {
  opacity:1;
  transform:translate(-50%, 0);
}
.currency-tip:hover .currency-image-button,
.currency-tip:focus-within .currency-image-button {
  position:relative;
  z-index:0;
}
.currency-tip:hover .currency-image-button img,
.currency-tip:focus-within .currency-image-button img {
  z-index:0;
}

/* Remove filter-created stacking collisions from the hover guidance wrapper. */
.currency-tip:has(.currency-image-button:hover),
.currency-tip:has(.currency-text-button:hover) {
  filter:none;
}

/* Soft, minimal scrollbars. */
.left-column,
.right-column,
.history-list,
.dialog-options,
.modifier-browser-content {
  scrollbar-width:thin;
  scrollbar-color:rgba(150,160,176,.24) transparent;
}
.left-column::-webkit-scrollbar,
.right-column::-webkit-scrollbar,
.history-list::-webkit-scrollbar,
.dialog-options::-webkit-scrollbar,
.modifier-browser-content::-webkit-scrollbar {
  width:6px;
  height:6px;
}
.left-column::-webkit-scrollbar-track,
.right-column::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track,
.dialog-options::-webkit-scrollbar-track,
.modifier-browser-content::-webkit-scrollbar-track {
  background:transparent;
}
.left-column::-webkit-scrollbar-thumb,
.right-column::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb,
.dialog-options::-webkit-scrollbar-thumb,
.modifier-browser-content::-webkit-scrollbar-thumb {
  background:rgba(150,160,176,.22);
  border-radius:999px;
}
.left-column:not(:hover)::-webkit-scrollbar-thumb,
.right-column:not(:hover)::-webkit-scrollbar-thumb {
  background:rgba(150,160,176,.08);
}

/* Desktop split panes without trapping the whole document. */
@media (min-width:1121px) {
  html, body {
    min-height:100%;
    overflow:auto;
  }
  .app-shell {
    min-height:100vh;
    margin-bottom:0;
  }
  .workspace {
    height:calc(100dvh - 128px);
    min-height:640px;
    overflow:visible;
    align-items:start;
  }
  .left-column,
  .right-column {
    height:100%;
    min-height:0;
    overflow-y:auto;
    overflow-x:visible;
    padding-right:6px;
    padding-bottom:96px;
    overscroll-behavior:contain;
    align-content:start;
  }
  .left-column {
    grid-auto-rows:max-content;
  }
  .right-column {
    grid-auto-rows:max-content;
  }
  .item-panel {
    position:sticky;
    top:8px;
    z-index:20;
  }
  .history-panel {
    scroll-margin-top:16px;
    margin-bottom:64px;
  }
}

/* On shorter screens, avoid hiding Craft Record below a trapped pane. */
@media (min-width:1121px) and (max-height:760px) {
  .workspace {
    height:auto;
    min-height:0;
  }
  .left-column,
  .right-column {
    max-height:none;
    height:auto;
    overflow:visible;
  }
  .item-panel {
    position:relative;
    top:auto;
  }
}


/* Revision 16: non-overlapping split panes */
@media (min-width:1121px) {
  .workspace {
    height:calc(100dvh - 128px);
    min-height:640px;
    overflow:visible;
    align-items:start;
  }
  .left-column,
  .right-column {
    height:100%;
    min-height:0;
    overflow-y:auto;
    overflow-x:visible;
    overscroll-behavior:contain;
    padding-right:6px;
    padding-bottom:96px;
    align-content:start;
  }

  /*
    The item panel previously used sticky positioning. That kept the craft
    window visible, but it also overlaid Metrics and Craft Record while the
    left pane scrolled. The craft window now participates in normal left-pane
    scrolling, so Metrics, Audit Trail, and Costs cannot render underneath it.
  */
  .item-panel {
    position:relative !important;
    top:auto !important;
    z-index:1 !important;
  }
  .metric-panel,
  .history-panel {
    position:relative;
    z-index:2;
  }
}

@media (min-width:1121px) and (max-height:760px) {
  .workspace {
    height:auto;
    min-height:0;
  }
  .left-column,
  .right-column {
    height:auto;
    max-height:none;
    overflow:visible;
  }
}


/* Revision 17: click-safe tooltips and collapsed modifier browser */
.currency-tip:focus-within::after,
.omen-chip:focus-within::after {
  opacity:0 !important;
  transform:translate(-50%, 4px) !important;
  pointer-events:none !important;
}
.currency-tip:hover::after,
.omen-chip:hover::after {
  opacity:1 !important;
  transform:translate(-50%, 0) !important;
}
.currency-image-button:disabled,
.currency-text-button:disabled {
  opacity:.32;
  cursor:not-allowed;
  filter:grayscale(.2);
}
.modifier-pool-group {
  border:1px solid var(--line);
  border-radius:9px;
  background:rgba(10,12,16,.52);
  overflow:hidden;
  margin-bottom:8px;
}
.modifier-pool-group summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  cursor:pointer;
  user-select:none;
  color:var(--text);
  font-weight:800;
  font-size:.78rem;
  letter-spacing:.02em;
}
.modifier-pool-group summary:hover {
  background:rgba(255,255,255,.035);
}
.modifier-pool-group summary small {
  color:var(--muted);
  font-weight:700;
  font-size:.67rem;
}
.modifier-pool-group .modifier-table-wrap {
  max-height:360px;
  overflow:auto;
  border-top:1px solid var(--line-soft);
}


/* Revision 19: multi-base selector and implicit ranges */
.item-selector-stack {
  display:grid;
  gap:8px;
  margin-top:8px;
}
.implicit-lines .mod-meta {
  float:right;
  margin-left:12px;
  color:#7f8794;
}
#amuletBaseLabel.hidden {
  display:none;
}


/* Revision 22: tooltip priority and catalyst quality display */
.currency-accordion,
.currency-group,
.currency-grid,
.currency-name-grid,
.currency-image-grid,
.right-column {
  isolation:isolate;
}
.currency-tip:hover,
.currency-tip:focus-within {
  z-index:2147483000 !important;
}
.currency-tip::after,
.omen-chip::after {
  z-index:2147483001 !important;
}
.item-panel {
  z-index:1 !important;
}
.mod-line.catalyst-enhanced {
  background:rgba(118,164,255,.055);
  box-shadow:inset 0 0 0 1px rgba(118,164,255,.13);
}
.quality-original {
  color:rgba(180,187,198,.62);
  text-decoration:line-through;
}
.quality-arrow {
  color:rgba(180,187,198,.56);
  padding:0 6px;
}
.quality-boosted {
  color:#dce8ff;
  font-weight:800;
}


/* Revision 23: entrance screen, bottom technical drawer, catalyst value cleanup */
.entrance-screen {
  position:fixed;
  inset:0;
  z-index:2147483600;
  display:grid;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(circle at 50% 28%, rgba(206,170,93,.13), transparent 34%),
    linear-gradient(180deg, rgba(11,13,17,.98), rgba(5,6,8,.995));
}
.entrance-screen.hidden {
  display:none;
}
.entrance-card {
  width:min(760px, 94vw);
  border:1px solid rgba(210,185,120,.22);
  border-radius:18px;
  background:rgba(15,17,22,.88);
  box-shadow:0 28px 90px rgba(0,0,0,.55);
  padding:38px;
  text-align:center;
}
.entrance-game {
  margin:0 0 6px;
  color:rgba(196,201,210,.68);
  text-transform:uppercase;
  letter-spacing:.28em;
  font-size:.72rem;
  font-weight:800;
}
.entrance-card h1 {
  margin:0;
  font-size:clamp(2.1rem, 5vw, 4rem);
  letter-spacing:.02em;
}
.entrance-version {
  margin:8px 0 28px;
  color:rgba(185,190,198,.48);
  font-size:.86rem;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.entrance-options {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}
.entrance-choice {
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.035);
  color:var(--text);
  padding:18px;
  min-height:132px;
  display:grid;
  align-content:center;
  gap:10px;
  text-align:left;
}
button.entrance-choice {
  cursor:pointer;
}
button.entrance-choice:hover,
.amulet-choice:hover {
  border-color:rgba(224,192,124,.42);
  background:rgba(224,192,124,.055);
}
.entrance-choice strong {
  font-size:1.05rem;
}
.entrance-choice span,
.entrance-choice label {
  color:var(--muted);
  font-size:.78rem;
}
.amulet-choice select {
  margin-top:6px;
}
.entrance-start {
  width:100%;
}
.technical-panel {
  margin-top:18px;
}
.quality-original {
  font-size:.68em;
  vertical-align:baseline;
  opacity:.78;
}
@media (max-width:760px) {
  .entrance-options {
    grid-template-columns:1fr;
  }
  .entrance-card {
    padding:24px;
  }
}


/* Revision 24: title return and right-side currency descriptions */
.sandbox-title-link {
  cursor:pointer;
}
.sandbox-title-link:hover {
  color:#f0d18a;
}
.currency-tip::after {
  top:50% !important;
  bottom:auto !important;
  left:calc(100% + 12px) !important;
  right:auto !important;
  transform:translate(0, -50%) !important;
  text-align:left;
}
.currency-tip:hover::after,
.currency-tip:focus-within::after {
  transform:translate(0, -50%) !important;
}
@media (max-width:1120px) {
  .currency-tip::after {
    left:50% !important;
    top:auto !important;
    bottom:calc(100% + 8px) !important;
    transform:translate(-50%, 0) !important;
  }
  .currency-tip:hover::after,
  .currency-tip:focus-within::after {
    transform:translate(-50%, 0) !important;
  }
}


/* Revision 25: adaptive currency descriptions, mode toggle, nested modifier browser */
.mode-toggle {
  display:inline-flex;
  justify-content:center;
  align-items:center;
  margin:0 auto 24px;
  padding:8px 14px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
  font-weight:800;
  font-size:.76rem;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.mode-toggle:hover {
  border-color:rgba(224,192,124,.42);
  color:#f0d18a;
}
.currency-tip.tooltip-right::after {
  top:50% !important;
  bottom:auto !important;
  left:calc(100% + 12px) !important;
  right:auto !important;
  transform:translate(0, -50%) !important;
  text-align:left;
}
.currency-tip.tooltip-left::after {
  top:50% !important;
  bottom:auto !important;
  right:calc(100% + 12px) !important;
  left:auto !important;
  transform:translate(0, -50%) !important;
  text-align:left;
}
.currency-tip.tooltip-right:hover::after,
.currency-tip.tooltip-right:focus-within::after,
.currency-tip.tooltip-left:hover::after,
.currency-tip.tooltip-left:focus-within::after {
  transform:translate(0, -50%) !important;
}
.modifier-family-list {
  display:grid;
  gap:7px;
  padding:8px;
  border-top:1px solid var(--line-soft);
}
.modifier-family-group {
  border:1px solid var(--line-soft);
  border-radius:8px;
  background:rgba(255,255,255,.025);
  overflow:hidden;
}
.modifier-family-group summary {
  padding:8px 10px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  cursor:pointer;
  font-size:.75rem;
}
.modifier-family-group summary small {
  color:var(--muted);
  font-weight:700;
}
.experienced-mode .mode-toggle {
  border-color:rgba(118,164,255,.4);
}
@media (max-width:1120px) {
  .currency-tip.tooltip-left::after,
  .currency-tip.tooltip-right::after {
    left:50% !important;
    right:auto !important;
    top:auto !important;
    bottom:calc(100% + 8px) !important;
    transform:translate(-50%, 0) !important;
  }
}


/* Revision 26: hidden item/base selectors and tighter experienced mode */
.hidden-control {
  display:none !important;
}

/* Revision 30: four-entry welcome grid */
@media (min-width:1180px) {
  .entrance-options {
    grid-template-columns:repeat(6, minmax(0, 1fr));
  }
}


/* Revision 31: one-slot saved base controls */
.item-selector-stack {
  align-items:flex-start;
}
.save-base-controls {
  display:grid;
  gap:6px;
  min-width:138px;
  position:relative;
}
.save-base-button {
  width:100%;
  white-space:nowrap;
  position:relative;
}
.save-base-button::after {
  content:attr(data-tooltip);
  position:absolute;
  left:calc(100% + 10px);
  top:50%;
  transform:translateY(-50%);
  width:min(300px, 70vw);
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(12,14,18,.97);
  color:var(--text);
  box-shadow:0 14px 40px rgba(0,0,0,.45);
  opacity:0;
  pointer-events:none;
  transition:opacity .12s ease;
  z-index:2147483001;
  text-align:left;
  white-space:normal;
  font-size:.74rem;
  line-height:1.35;
}
.save-base-button:hover::after,
.save-base-button:focus-visible::after {
  opacity:1;
}
.save-base-button:disabled {
  opacity:.45;
  cursor:not-allowed;
}
@media (max-width:760px) {
  .save-base-button::after {
    left:50%;
    top:auto;
    bottom:calc(100% + 8px);
    transform:translateX(-50%);
  }
}


/* Revision 32: active crafted item background silhouette */
.item-card {
  position:relative;
  overflow:hidden;
}
.item-card::before {
  content:"";
  position:absolute;
  inset:36px 18px auto auto;
  width:190px;
  height:260px;
  opacity:.105;
  pointer-events:none;
  background:linear-gradient(180deg, rgba(229,205,143,.88), rgba(118,164,255,.28));
  mask:var(--item-mask, radial-gradient(ellipse at center, #000 45%, transparent 47%));
  -webkit-mask:var(--item-mask, radial-gradient(ellipse at center, #000 45%, transparent 47%));
  filter:drop-shadow(0 18px 26px rgba(0,0,0,.55));
  z-index:0;
}
.item-card::after {
  content:"";
  position:absolute;
  right:42px;
  top:58px;
  width:92px;
  height:18px;
  opacity:.20;
  pointer-events:none;
  background:
    radial-gradient(circle, rgba(230,214,170,.95) 0 5px, transparent 6px),
    radial-gradient(circle, rgba(230,214,170,.95) 0 5px, transparent 6px),
    radial-gradient(circle, rgba(230,214,170,.95) 0 5px, transparent 6px);
  background-size:30px 18px;
  background-position:0 0, 32px 0, 64px 0;
  background-repeat:no-repeat;
  display:none;
  z-index:0;
}
.item-card[data-socket-count="2"]::after,
.item-card[data-socket-count="3"]::after { display:block; }
.item-card[data-socket-count="2"]::after { width:62px; background-position:0 0, 32px 0; }
.item-card[data-socket-count="3"]::after { width:92px; background-position:0 0, 32px 0, 64px 0; }
.item-card > * { position:relative; z-index:1; }
.item-card[data-item-class="boots"] { --item-mask: polygon(29% 8%, 58% 8%, 64% 45%, 83% 74%, 76% 90%, 35% 90%, 24% 75%, 39% 47%); }
.item-card[data-item-class="amulet"] { --item-mask: radial-gradient(circle at 50% 54%, transparent 0 34%, #000 35% 46%, transparent 47%), radial-gradient(circle at 50% 70%, #000 0 19%, transparent 20%); }
.item-card[data-item-class="wand"] { --item-mask: polygon(45% 0, 55% 0, 58% 78%, 72% 100%, 28% 100%, 42% 78%); }
.item-card[data-item-class="focus"] { --item-mask: radial-gradient(ellipse at 50% 52%, #000 0 46%, transparent 47%); }
.item-card[data-item-class="gloves"] { --item-mask: polygon(40% 5%, 60% 5%, 70% 38%, 88% 54%, 74% 91%, 46% 91%, 28% 68%, 24% 35%); }
.item-card[data-item-class="body"] { --item-mask: polygon(35% 3%, 65% 3%, 88% 28%, 75% 98%, 25% 98%, 12% 28%); }


/* Revision 33: active crafted item background art */
.item-card {
  position:relative;
  overflow:hidden;
  isolation:isolate;
}
.item-card.has-item-art::before {
  content:"";
  position:absolute;
  inset:14px 10px 10px auto;
  width:min(42%, 260px);
  background-image:var(--item-art);
  background-repeat:no-repeat;
  background-position:center right;
  background-size:contain;
  opacity:.18;
  filter:drop-shadow(0 18px 30px rgba(0,0,0,.7));
  z-index:-1;
  pointer-events:none;
}
.item-card.socket-art-2::after,
.item-card.socket-art-3::after {
  position:absolute;
  right:18px;
  bottom:14px;
  color:rgba(176,203,255,.42);
  font-size:.78rem;
  letter-spacing:.28em;
  text-shadow:0 2px 10px rgba(0,0,0,.8);
  z-index:0;
  pointer-events:none;
}
.item-card.socket-art-2::after { content:"○ ○"; }
.item-card.socket-art-3::after { content:"○ ○ ○"; }
.item-card > * {
  position:relative;
  z-index:1;
}
@media (max-width:760px) {
  .item-card.has-item-art::before {
    width:55%;
    opacity:.11;
  }
}


/* Revision 34: centered, fully visible crafted-item background art */
.item-card.has-item-art::before {
  content:"" !important;
  position:absolute !important;
  inset:50% auto auto 50% !important;
  transform:translate(-50%, -50%) !important;
  width:min(68%, 360px) !important;
  height:calc(100% - 34px) !important;
  background-image:var(--item-art) !important;
  background-color:transparent !important;
  background-repeat:no-repeat !important;
  background-position:center center !important;
  background-size:contain !important;
  opacity:.17 !important;
  filter:drop-shadow(0 18px 32px rgba(0,0,0,.68)) !important;
  mask:none !important;
  -webkit-mask:none !important;
  border-radius:0 !important;
  z-index:0 !important;
  pointer-events:none !important;
}
.item-card.has-item-art[data-item-class="amulet"]::before {
  width:min(46%, 230px) !important;
  height:calc(100% - 48px) !important;
  opacity:.20 !important;
}
.item-card.has-item-art[data-item-class="wand"]::before,
.item-card.has-item-art[data-item-class="body"]::before {
  width:min(58%, 310px) !important;
  height:calc(100% - 24px) !important;
}
.item-card.has-item-art[data-item-class="gloves"]::before,
.item-card.has-item-art[data-item-class="boots"]::before,
.item-card.has-item-art[data-item-class="focus"]::before {
  width:min(62%, 330px) !important;
}
.item-card.has-item-art > * {
  position:relative;
  z-index:1;
}
.currency-grid,
.currency-group,
.currency-name-grid,
.currency-image-grid,
.currency-tip,
.currency-image-button,
.currency-text-button {
  pointer-events:auto;
}
@media (max-width:760px) {
  .item-card.has-item-art::before {
    width:70% !important;
    height:calc(100% - 42px) !important;
    opacity:.11 !important;
  }
}


/* Revision 35: smaller amulet background art and corruption/socket tuning */
.item-card.has-item-art[data-item-class="amulet"]::before {
  width:min(30%, 150px) !important;
  height:calc(100% - 74px) !important;
  opacity:.18 !important;
  image-rendering:auto;
}


/* Revision 36: expanded item set art sizing */
.item-card.has-item-art[data-item-class="helmet"]::before {
  width:min(58%, 300px) !important;
  height:calc(100% - 34px) !important;
}
.item-card.has-item-art[data-item-class="belt"]::before {
  width:min(54%, 320px) !important;
  height:calc(100% - 54px) !important;
}
.item-card.has-item-art[data-item-class="ring"],
.item-card.has-item-art[data-item-class="jewel"] {
  --item-art-opacity:.18;
}
.item-card.has-item-art[data-item-class="ring"]::before,
.item-card.has-item-art[data-item-class="jewel"]::before {
  width:min(30%, 160px) !important;
  height:calc(100% - 78px) !important;
  opacity:.20 !important;
}

/* Revision 37 */
.entrance-choice strong{pointer-events:none;}

/* Revision 38: Gold Amulet-only homepage routing. */
#entranceAmuletBase{display:none!important;}


/* Revision 39: homepage help panels */
.home-info-actions {
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
  margin:0 auto 24px;
}
.home-info-action {
  margin:0;
}
.home-info-overlay {
  position:fixed;
  inset:0;
  z-index:2147483650;
  display:grid;
  place-items:center;
  padding:22px;
  background:rgba(3,4,6,.72);
  backdrop-filter:blur(10px);
}
.home-info-overlay.hidden {
  display:none;
}
.home-info-card {
  position:relative;
  width:min(780px, 94vw);
  max-height:min(78vh, 760px);
  overflow:auto;
  border:1px solid rgba(210,185,120,.24);
  border-radius:18px;
  background:rgba(15,17,22,.98);
  box-shadow:0 28px 90px rgba(0,0,0,.62);
  padding:28px;
  text-align:left;
}
.home-info-card h2 {
  margin:0 0 16px;
  font-size:1.65rem;
}
.home-info-content p {
  color:rgba(222,226,236,.84);
  line-height:1.58;
  margin:0 0 14px;
}
.home-info-content strong {
  color:#f0d18a;
}
.home-info-close {
  position:absolute;
  top:12px;
  right:12px;
  width:34px;
  height:34px;
  border-radius:50%;
  border:1px solid var(--line);
  background:rgba(255,255,255,.045);
  color:var(--text);
  cursor:pointer;
  font-size:1.2rem;
}
.signature-line {
  margin-top:20px !important;
  font-weight:900;
  color:#f0d18a !important;
}
.contact-line {
  color:rgba(190,198,214,.74) !important;
  font-size:.88rem;
}


/* Revision 41: launch disclosure overlay for public release */
.legal-disclosure-overlay {
  position:fixed;
  inset:0;
  z-index:2147483640;
  display:grid;
  place-items:center;
  padding:24px;
  background:rgba(3,4,7,.78);
  backdrop-filter:blur(10px);
}
.legal-disclosure-overlay.hidden {
  display:none;
}
.legal-disclosure-card {
  width:min(860px, 94vw);
  max-height:min(86vh, 820px);
  overflow:auto;
  border:1px solid rgba(210,185,120,.28);
  border-radius:20px;
  background:linear-gradient(180deg, rgba(17,19,25,.98), rgba(9,10,14,.985));
  box-shadow:0 32px 100px rgba(0,0,0,.68);
  padding:30px;
}
.legal-disclosure-card h2 {
  margin:0 0 14px;
  font-size:clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing:.02em;
}
.legal-disclosure-content {
  display:grid;
  gap:12px;
  color:rgba(230,235,244,.88);
  line-height:1.55;
  font-size:.93rem;
}
.legal-disclosure-content p {
  margin:0;
}
.legal-disclosure-content a,
.contact-line a {
  color:#f0d18a;
  text-decoration:none;
  font-weight:800;
}
.legal-disclosure-content a:hover,
.contact-line a:hover {
  text-decoration:underline;
}
.legal-contact {
  border-top:1px solid var(--line-soft);
  padding-top:14px;
  margin-top:4px !important;
}
.legal-disclosure-accept {
  width:100%;
  margin-top:22px;
  min-height:44px;
}
@media (max-width:640px) {
  .legal-disclosure-overlay {
    padding:12px;
  }
  .legal-disclosure-card {
    padding:20px;
    max-height:90vh;
  }
  .legal-disclosure-content {
    font-size:.84rem;
  }
}
