/* ============================================================
   L3a Token Economy — Enderklas
   Black background, deep ender-purple header, greys/whites,
   colored borders on crafting equipment. Smartboard-scale type.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces */
  --bg-void:     #000000;
  --bg-deep:     #060608;
  --bg-panel:    #141416;
  --bg-card:     #1c1c20;
  --bg-elev:     #26262c;
  --bg-hover:    #32323a;

  /* Greys */
  --line:        #36363e;
  --line-strong: #54545e;
  --line-faint:  #26262c;

  /* Ink */
  --ink:         #ffffff;
  --ink-dim:     #c4c4cc;
  --ink-faint:   #898996;
  --ink-ghost:   #4a4a54;

  /* Ender class purple (header + class accent) */
  --ender:       #6e3ec8;
  --ender-hi:    #b48ef0;
  --ender-low:   #3e1f7a;
  --ender-deep:  #2a1148;
  --ender-bg:    #1f0e3c;       /* deep header tone */
  --ender-soft:  rgba(110, 62, 200, 0.18);
  --ender-glow:  rgba(180, 142, 240, 0.55);

  /* Tier colors (used for icons + colored borders on crafting boxes) */
  --blue:        #4d92dc;
  --red:         #d65a48;
  --yellow:      #e8c050;
  --orange:      #e08840;
  --green:       #6ca042;
  --gold:        #d4a73a;
  --danger:      #d65a48;

  --font-disp: 'Press Start 2P', 'VT323', monospace;
  --font-body: 'VT323', ui-monospace, Menlo, monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--bg-void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 24px;
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  /* Subtle purple-tinted pixel grid */
  background-image:
    linear-gradient(rgba(110, 62, 200, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 62, 200, 0.04) 1px, transparent 1px);
  background-size: 10px 10px;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input  { font: inherit; color: inherit; }
img { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ---------- App bar (deep ender purple) ---------- */
.appbar {
  display: flex; align-items: center; gap: 28px;
  height: 76px;
  padding: 0 32px;
  background: var(--ender-bg);
  border-bottom: 4px solid var(--ender-deep);
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 4px 0 0 rgba(0,0,0,0.4);
}
.brand {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--font-disp);
  font-size: 18px;
  color: var(--ink);
  line-height: 1;
  letter-spacing: 1.5px;
  text-shadow: 0 0 12px var(--ender-glow);
}
.brand-glyph { width: 32px; height: 32px; }
.brand-sub {
  font-family: var(--font-disp);
  font-size: 10px;
  color: var(--ender-hi);
  letter-spacing: 2px;
  padding: 5px 8px;
  background: var(--ender-deep);
  border: 2px solid var(--ender);
  line-height: 1;
}

/* Tabs */
.tabs { display: flex; gap: 0; margin-left: 16px; }
.tab {
  font-family: var(--font-disp);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  padding: 12px 22px;
  background: transparent;
  border: 3px solid transparent;
  border-bottom: 3px solid transparent;
  position: relative;
  transition: color 0.1s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); }
.tab.active::after {
  content: '';
  position: absolute;
  left: 22px; right: 22px; bottom: -4px;
  height: 4px;
  background: var(--ender-hi);
  box-shadow: 0 0 8px var(--ender-glow);
}

.appbar-spacer { flex: 1; }

/* ---------- Admin toggle ---------- */
.admin-toggle {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-disp);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  padding: 12px 16px;
  background: var(--ender-deep);
  border: 3px solid var(--ender);
  transition: all 0.1s;
}
.admin-toggle:hover { color: var(--ink); border-color: var(--ender-hi); }
.admin-toggle.active {
  background: var(--ender);
  border-color: var(--ender-hi);
  color: white;
  box-shadow: inset 0 0 0 1px var(--ender-hi);
}
.admin-dot {
  width: 9px; height: 9px;
  background: rgba(255,255,255,0.4);
}
.admin-toggle.active .admin-dot {
  background: var(--ender-hi);
  animation: blink 1.4s steps(2, end) infinite;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

/* ---------- Page ---------- */
.page {
  height: calc(100vh - 76px);
  overflow: auto;
  padding: 20px 28px 36px;
}
.page-eyebrow {
  font-family: var(--font-disp);
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--ender-hi);
  margin: 0 0 14px;
  text-transform: uppercase;
}
.page-title {
  font-family: var(--font-disp);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 1.5px;
  margin: 0 0 14px;
  color: var(--ink);
}
.page-sub { color: var(--ink-dim); font-size: 24px; margin: 0; }

/* ---------- Class Chest banner ---------- */
.chest-banner {
  background: var(--ender);
  padding: 3px;
  margin-bottom: 18px;
  clip-path: polygon(
    0 4px, 4px 4px, 4px 0,
    calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)
  );
  box-shadow: 0 0 20px var(--ender-soft);
  transition: box-shadow 0.12s, transform 0.08s;
}
.chest-banner.clickable { cursor: pointer; }
.chest-banner.clickable:hover {
  box-shadow: 0 0 32px var(--ender-soft), 0 0 0 2px var(--ender-hi);
  transform: translateY(-1px);
}
.chest-banner .gift-hint {
  color: var(--ender-hi);
  margin-left: 4px;
}
.chest-banner .inner {
  background: var(--bg-panel);
  padding: 16px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  clip-path: polygon(
    0 3px, 3px 3px, 3px 0,
    calc(100% - 3px) 0, calc(100% - 3px) 3px, 100% 3px,
    100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), calc(100% - 3px) 100%,
    3px 100%, 3px calc(100% - 3px), 0 calc(100% - 3px)
  );
}
.chest-banner .title { display: flex; align-items: center; gap: 14px; }
.chest-banner .title-mark {
  width: 48px; height: 48px;
  background: var(--ender);
  border: 3px solid var(--ender-hi);
  display: grid; place-items: center;
  color: white;
  font-size: 22px;
}
.chest-banner h2 {
  font-family: var(--font-disp);
  font-size: 16px;
  letter-spacing: 1.5px;
  margin: 0 0 6px;
  color: var(--ender-hi);
  text-transform: uppercase;
  line-height: 1;
}
.chest-banner .sub {
  font-family: var(--font-disp);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.chest-stash { display: flex; flex-wrap: wrap; gap: 8px; }
.stash-slot {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 3px solid var(--line);
  padding: 6px 14px 6px 8px;
  min-height: 44px;
  font-family: var(--font-body);
  font-size: 22px;
  color: var(--ink);
  line-height: 1;
}
.stash-slot.has  { border-color: var(--ender); }
.stash-slot.empty { opacity: 0.4; }
.stash-slot svg { width: 24px; height: 24px; }
.stash-slot .val {
  font-family: var(--font-body);
  font-size: 24px;
  color: var(--ender-hi);
  font-weight: bold;
  margin-left: 2px;
}
.stash-slot.empty .val { color: var(--ink-ghost); }
.stash-slot .admin-mini { margin-left: 4px; }
.stash-slot .admin-mini button { width: 22px; height: 22px; font-size: 12px; }

.chest-banner .actions {
  display: flex; flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.chest-banner .btn-pixel {
  padding: 14px 20px;
  font-size: 13px;
}
.chest-banner .rewards-line {
  display: flex; gap: 6px; align-items: center;
  font-family: var(--font-disp);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--ender-hi);
  text-transform: uppercase;
}
.chest-banner .rewards-line svg { width: 18px; height: 18px; }

/* ---------- Villager grid ---------- */
.villager-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
@media (max-width: 1180px) { .villager-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width:  920px) { .villager-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width:  640px) { .villager-grid { grid-template-columns: repeat(2, 1fr); } }

.villager-card {
  background: var(--line-strong);
  padding: 3px;
  cursor: pointer;
  transition: transform 0.08s;
  clip-path: polygon(
    0 4px, 4px 4px, 4px 0,
    calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)
  );
}
.villager-card:hover { transform: translate(-2px, -2px); }
.villager-card:active { transform: translate(0, 0); }
.villager-card .inner {
  background: var(--bg-card);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 100px 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 12px;
  row-gap: 8px;
  clip-path: polygon(
    0 3px, 3px 3px, 3px 0,
    calc(100% - 3px) 0, calc(100% - 3px) 3px, 100% 3px,
    100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), calc(100% - 3px) 100%,
    3px 100%, 3px calc(100% - 3px), 0 calc(100% - 3px)
  );
}

.villager-name {
  grid-column: 1 / -1;
  font-family: var(--font-disp);
  font-size: 14px;
  letter-spacing: 1.5px;
  color: var(--ink);
  text-align: center;
  text-transform: uppercase;
  margin: 4px 0 2px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

/* Bigger avatar */
.avatar-block {
  width: 100px;
  height: 100px;
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
  border: 3px solid var(--line-strong);
  display: grid; place-items: center;
  grid-row: 2 / 3;
  grid-column: 1 / 2;
  align-self: start;
}
.avatar-block img {
  width: 100%; height: 100%; object-fit: cover;
  image-rendering: pixelated;
  display: block;
}
.avatar-block svg { width: 100%; height: 100%; display: block; }

.villager-card .rows {
  grid-row: 2 / 3;
  grid-column: 2 / 3;
  display: flex; flex-direction: column;
  gap: 5px;
  min-width: 0;
}

/* Inventory rows — compact but legible. Colored borders by tier. */
.row-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 3px 5px;
  background: var(--bg-elev);
  border: 2px solid var(--ink-ghost);    /* tier 1 default — neutral light */
  flex: 1;
}
.row-strip.tier-2 { border-color: var(--orange); }
.row-strip.tier-3 { border-color: var(--ender-hi); }

.row-strip .slot {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-family: var(--font-body);
  font-size: 22px;
  color: var(--ink);
  line-height: 1;
  min-height: 24px;
}
.row-strip .slot svg { width: 20px; height: 20px; flex-shrink: 0; }
.row-strip .slot.zero { color: var(--ink-ghost); }
.row-strip .slot.zero svg { opacity: 0.4; }

/* Inline +/− admin */
.row-strip .slot .admin-mini { display: inline-flex; gap: 2px; margin-left: 2px; }
.row-strip .slot .admin-mini button {
  width: 20px; height: 20px;
  font-size: 11px;
  padding: 0;
}

/* ---------- Detail overlay ---------- */
.detail-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.78);
  display: flex; justify-content: center; align-items: flex-start;
  padding: 40px 24px;
  overflow: auto;
  animation: fade-in 0.12s;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.detail-panel {
  width: min(1000px, 100%);
  background: var(--ender);
  padding: 4px;
  clip-path: polygon(
    0 6px, 6px 6px, 6px 0,
    calc(100% - 6px) 0, calc(100% - 6px) 6px, 100% 6px,
    100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%,
    6px 100%, 6px calc(100% - 6px), 0 calc(100% - 6px)
  );
  box-shadow: 0 0 50px var(--ender-soft);
}
.detail-panel .detail-inner {
  background: var(--bg-panel);
  clip-path: polygon(
    0 4px, 4px 4px, 4px 0,
    calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)
  );
}
.detail-head {
  display: flex; align-items: center; gap: 24px;
  padding: 26px 32px;
  border-bottom: 4px solid var(--line);
}
.detail-head .name {
  font-family: var(--font-disp);
  font-size: 28px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 0 0 8px;
  line-height: 1.2;
  color: var(--ink);
}
.detail-head .meta {
  font-family: var(--font-disp);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.detail-head .avatar-block {
  width: 120px; height: 120px;
  flex-shrink: 0;
}
.detail-close {
  margin-left: auto;
  width: 42px; height: 42px;
  background: var(--bg-elev);
  border: 3px solid var(--line);
  font-family: var(--font-disp);
  font-size: 13px;
  color: var(--ink-dim);
  display: grid; place-items: center;
}
.detail-close:hover { border-color: var(--danger); color: var(--danger); }

.detail-body { padding: 28px 32px 32px; }

.section-eyebrow {
  font-family: var(--font-disp);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ender-hi);
  margin: 0 0 14px;
}
.section-heading {
  font-family: var(--font-disp);
  font-size: 18px;
  letter-spacing: 1.2px;
  margin: 0 0 18px;
  color: var(--ink);
}

/* Inventory chips */
.you-have { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.have-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  border: 2px solid var(--line);
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
}
.have-chip svg { width: 20px; height: 20px; }
.have-chip.zero { opacity: 0.45; }

/* ---------- Recipe cards ---------- */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.recipe-card {
  background: var(--line);
  padding: 3px;
  clip-path: polygon(
    0 4px, 4px 4px, 4px 0,
    calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)
  );
}
.recipe-card .recipe-inner {
  background: var(--bg-card);
  padding: 16px;
  display: flex; flex-direction: column;
  gap: 14px;
  min-height: 170px;
  clip-path: polygon(
    0 3px, 3px 3px, 3px 0,
    calc(100% - 3px) 0, calc(100% - 3px) 3px, 100% 3px,
    100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), calc(100% - 3px) 100%,
    3px 100%, 3px calc(100% - 3px), 0 calc(100% - 3px)
  );
}
.recipe-card.craftable          { background: var(--ender); }
.recipe-card.craftable .recipe-inner { background: var(--bg-card); }

/* Class recipes always carry a purple border (regardless of craftable state) */
.recipe-card.cat-class { background: var(--ender); }
.recipe-card.cat-class .recipe-inner { background: var(--bg-card); }
.recipe-card.cat-class .recipe-icon-box { border-color: var(--ender); }

/* Reward explanation block — shows on any recipe that has an `explanation`. */
.recipe-explanation {
  font-family: var(--font-body);
  font-size: 19px;
  color: var(--ink);
  margin: 0;
  padding: 8px 10px;
  background: var(--bg-elev);
  border-left: 4px solid var(--ender);
  line-height: 1.3;
}

.recipe-head { display: flex; align-items: center; gap: 14px; }
.recipe-icon-box {
  width: 52px; height: 52px;
  background: var(--bg-elev);
  border: 2px solid var(--line);
  display: grid; place-items: center;
}
.recipe-icon-box svg { width: 32px; height: 32px; }
.recipe-card.craftable .recipe-icon-box { border-color: var(--ender); }
.recipe-name {
  font-family: var(--font-disp);
  font-size: 13px;
  letter-spacing: 1px;
  margin: 0;
  line-height: 1.3;
  color: var(--ink);
}
.recipe-tag {
  font-family: var(--font-disp);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 6px;
  display: block;
}

.recipe-cost {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 12px;
  border-top: 2px dashed var(--line);
}
.cost-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-body);
  font-size: 20px;
  color: var(--ink);
  padding: 4px 9px;
  background: var(--bg-elev);
  border: 2px solid var(--line);
  line-height: 1;
}
.cost-chip svg { width: 18px; height: 18px; }
.cost-chip.missing { border-color: var(--danger); color: var(--danger); }
.cost-chip .have { color: var(--ink-faint); font-size: 17px; }
.cost-chip.missing .have { color: var(--danger); opacity: 0.8; }

.craft-btn {
  margin-top: auto;
  padding: 12px;
  font-family: var(--font-disp);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: var(--bg-elev);
  border: 3px solid var(--line);
  color: var(--ink-faint);
  cursor: not-allowed;
  transition: all 0.1s;
}
.craft-btn.enabled {
  background: var(--ender);
  border-color: var(--ender-hi);
  color: white;
  cursor: pointer;
}
.craft-btn.enabled:hover {
  background: var(--ender-low);
  box-shadow: inset 0 0 0 1px var(--ender-hi);
}
.craft-btn.enabled:active { transform: translate(1px, 1px); }

/* ---------- Buttons ---------- */
.cta-bar { margin-top: 28px; display: flex; gap: 14px; flex-wrap: wrap; }
.btn-pixel {
  font-family: var(--font-disp);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 16px 26px;
  background: var(--bg-elev);
  border: 3px solid var(--line-strong);
  color: var(--ink);
  display: inline-flex; align-items: center; gap: 12px;
  transition: all 0.1s;
  box-shadow: 4px 4px 0 0 #000;
}
.btn-pixel:hover {
  background: var(--bg-hover);
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 0 #000;
}
.btn-pixel:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 0 #000; }

.btn-pixel.violet {
  background: var(--ender);
  border-color: var(--ender-hi);
  color: white;
  box-shadow: 4px 4px 0 0 var(--ender-deep);
}
.btn-pixel.violet:hover {
  background: var(--ender-low);
  box-shadow: 5px 5px 0 0 var(--ender-deep);
}
.btn-pixel.gold {
  background: var(--gold);
  border-color: #b08d28;
  color: #1a1208;
  box-shadow: 4px 4px 0 0 #2a1a08;
}
.btn-pixel.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-dim);
  box-shadow: none;
}
.btn-pixel.ghost:hover { color: var(--ink); border-color: var(--ink-faint); transform: none; }

/* Inline admin +/- (purple accent) */
.admin-mini { display: inline-flex; gap: 3px; margin-left: 6px; }
.admin-mini button {
  width: 26px; height: 26px;
  background: var(--bg-elev);
  border: 2px solid var(--ender);
  color: var(--ender-hi);
  font-family: var(--font-disp);
  font-size: 13px;
  display: grid; place-items: center;
  line-height: 1;
  padding: 0;
}
.admin-mini button:hover { background: var(--ender); color: white; }
.admin-mini button:active { transform: translate(1px, 1px); }
.admin-mini button:disabled {
  border-color: var(--line);
  color: var(--ink-ghost);
  cursor: not-allowed;
}

/* ---------- Recipes page sections ---------- */
.recipes-section { margin-bottom: 40px; }
.recipes-section-head {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 16px;
}
.recipes-section-head h2 {
  font-family: var(--font-disp);
  font-size: 15px;
  letter-spacing: 1.5px;
  margin: 0;
  color: var(--ink);
  text-transform: uppercase;
}
.recipes-section-head .count {
  font-family: var(--font-disp);
  font-size: 11px;
  color: var(--ink-faint);
}

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.78);
  display: grid; place-items: center;
  animation: fade-in 0.12s;
  padding: 24px;
  overflow: auto;
}
.modal {
  background: var(--ender);
  padding: 4px;
  width: min(480px, 100%);
  clip-path: polygon(
    0 6px, 6px 6px, 6px 0,
    calc(100% - 6px) 0, calc(100% - 6px) 6px, 100% 6px,
    100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%,
    6px 100%, 6px calc(100% - 6px), 0 calc(100% - 6px)
  );
  box-shadow: 0 0 40px var(--ender-soft);
}
.modal .modal-inner {
  background: var(--bg-panel);
  padding: 30px 32px;
  clip-path: polygon(
    0 4px, 4px 4px, 4px 0,
    calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px)
  );
}
.modal h3 {
  font-family: var(--font-disp);
  font-size: 20px;
  margin: 0 0 8px;
  letter-spacing: 1.5px;
  color: var(--ink);
}
.modal p {
  color: var(--ink-dim);
  font-size: 22px;
  margin: 0 0 20px;
}
.modal input {
  width: 100%;
  background: var(--bg-deep);
  border: 3px solid var(--line);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 24px;
  color: var(--ink);
  outline: none;
  margin-bottom: 18px;
}
.modal input:focus { border-color: var(--ender); }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; }
.modal.wide { width: min(620px, 100%); }
.modal select, .modal textarea {
  font: inherit; color: var(--ink);
  background: var(--bg-deep); border: 2px solid var(--line);
  padding: 8px 10px; outline: none;
}
.modal select:focus, .modal textarea:focus { border-color: var(--ender); }

/* Donate rows */
.donate-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 4px;
  border-bottom: 2px dashed var(--line);
}
.donate-row:last-child { border-bottom: 0; }
.donate-row .icon-box {
  width: 42px; height: 42px;
  background: var(--bg-elev);
  border: 2px solid var(--line);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.donate-row .icon-box svg { width: 26px; height: 26px; }
.donate-row .name {
  font-family: var(--font-disp);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--ink);
  text-transform: uppercase;
  flex: 1;
}
.donate-row .have-count {
  font-family: var(--font-body);
  font-size: 22px;
  color: var(--ink-faint);
  min-width: 80px;
}
.donate-row .qty-picker { display: inline-flex; align-items: center; gap: 6px; }
.donate-row .qty-picker button {
  width: 32px; height: 32px;
  background: var(--bg-elev);
  border: 2px solid var(--ender);
  color: var(--ender-hi);
  font-family: var(--font-disp);
  font-size: 14px;
  display: grid; place-items: center;
}
.donate-row .qty-picker button:disabled {
  border-color: var(--line);
  color: var(--ink-ghost);
  cursor: not-allowed;
}
.donate-row .qty-picker .val {
  font-family: var(--font-body);
  font-size: 26px;
  color: var(--ender-hi);
  min-width: 32px;
  text-align: center;
  font-weight: bold;
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 14px 22px;
  background: var(--bg-panel);
  border: 3px solid var(--line-strong);
  font-family: var(--font-body);
  font-size: 22px;
  color: var(--ink);
  display: flex; align-items: center; gap: 12px;
  box-shadow: 4px 4px 0 0 #000;
  animation: toast-in 0.18s ease;
}
.toast.success { border-color: var(--green); }
.toast.error   { border-color: var(--danger); }
.toast.info    { border-color: var(--ender); }
@keyframes toast-in {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Splash */
@keyframes pop {
  0%   { transform: scale(0.5);  opacity: 0; }
  40%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}
.craft-splash { position: fixed; z-index: 150; pointer-events: none; animation: pop 0.55s cubic-bezier(.2,.7,.2,1) forwards; }
.craft-splash .box {
  width: 96px; height: 96px;
  background: var(--ender);
  border: 4px solid var(--ender-hi);
  display: grid; place-items: center;
  box-shadow: 0 0 32px var(--ender-glow);
}

/* Scrollbar */
.page::-webkit-scrollbar,
.detail-overlay::-webkit-scrollbar { width: 14px; }
.page::-webkit-scrollbar-track,
.detail-overlay::-webkit-scrollbar-track { background: var(--bg-deep); }
.page::-webkit-scrollbar-thumb,
.detail-overlay::-webkit-scrollbar-thumb {
  background: var(--ender-low);
  border: 3px solid var(--bg-deep);
}

.muted { color: var(--ink-faint); }
.center { text-align: center; }
