:root {
  --ui-bg: rgba(20, 22, 20, 0.82);
  --ui-edge: #3a3f36;
  --ui-text: #cdd0c4;
  --ui-dim: #7e8474;
  --accent: #b7c27a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/cinzel.woff2') format('woff2');
}
html, body {
  height: 100%;
  background: #0c0d0b;
  overflow: hidden;
  font-family: "Cinzel", Georgia, serif; /* unified RPG font across UI + canvas */
  color: var(--ui-text);
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

#game-wrap { position: fixed; inset: 0; }

canvas#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  cursor: pointer;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

#clock {
  background: var(--ui-bg);
  border: 1px solid var(--ui-edge);
  border-radius: 4px;
  padding: 8px 12px;
  line-height: 1.3;
  text-shadow: 0 1px 2px #000;
}
#day { font-size: 13px; color: var(--ui-dim); letter-spacing: 1px; }
#time { font-size: 22px; font-weight: bold; color: var(--ui-text); }
#season { font-size: 12px; color: var(--accent); letter-spacing: 2px; text-transform: uppercase; }
#health {
  position: relative;
  margin-top: 5px;
  width: 120px; height: 12px;
  background: #2a1414;
  border: 1px solid #5a2f2f;
  border-radius: 6px;
  overflow: hidden;
}
#health-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #c93b34, #e06b54); transition: width .15s; }
#health-txt { position: absolute; inset: 0; text-align: center; font-size: 9px; line-height: 12px; color: #fff; text-shadow: 0 1px 1px #000; }
#energy {
  position: relative; margin-top: 4px;
  width: 120px; height: 12px;
  background: #2a2a14; border: 1px solid #5a5a2f; border-radius: 6px; overflow: hidden;
}
#energy-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #c9a834, #ecd24a); transition: width .15s; }
#energy-fill.low { background: linear-gradient(90deg, #c0392b, #e67e22); }
#energy-txt.empty { color: #ff6b5e; animation: energyPulse 0.9s ease-in-out infinite; }
@keyframes energyPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
#energy-txt { position: absolute; inset: 0; text-align: center; font-size: 9px; line-height: 12px; color: #1a1a1a; text-shadow: 0 1px 1px rgba(255,255,255,.3); }

#cash {
  background: var(--ui-bg);
  border: 1px solid var(--ui-edge);
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 18px;
  font-weight: bold;
  color: #d8c98a;
  text-shadow: 0 1px 2px #000;
}

/* ---------- Hotbar ---------- */
#hotbar {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  max-width: 96vw;
  flex-wrap: wrap;
  justify-content: center;
  pointer-events: auto;
  z-index: 9; /* above the inventory/panels (z-8) so you can drag/tap tools onto slots while the backpack is open */
}
.slot {
  width: 54px; height: 54px;
  background: var(--ui-bg);
  border: 2px solid var(--ui-edge);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: border-color .12s, transform .12s;
}
.slot:hover { border-color: #5a6150; }
.slot.active { border-color: var(--accent); transform: translateY(-4px); }
.slot.dragging { opacity: .45; }
.slot.dragover { outline: 2px dashed #fff; outline-offset: -2px; }
.slot.picked { outline: 2px solid #ffd24a; outline-offset: -2px; box-shadow: 0 0 8px #ffd24a88; }
.slot.empty { border-style: dashed; border-color: #44493e; opacity: .65; } /* unfilled hotbar slot */
.inv-item.picked { outline: 2px solid #ffd24a; box-shadow: 0 0 8px #ffd24a88; } /* a backpack tool picked to place in the hotbar */
.slot .ico { font-size: 24px; line-height: 1; filter: saturate(.6); }
.slot .fist { opacity: .3; font-size: 22px; line-height: 1; } /* empty-slot fists hint */
.slot.active .fist { opacity: 1; } /* brightens when fists are the selected "tool" */
.slot .lbl { font-size: 9px; color: var(--ui-dim); margin-top: 3px; letter-spacing: .5px; }
.slot .key { position: absolute; top: 2px; left: 4px; font-size: 10px; color: var(--ui-dim); }
.slot .qty { position: absolute; bottom: 2px; right: 4px; font-size: 11px; color: #d8c98a; font-weight: bold; }

#hud-right { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
#hud-right button { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; padding: 0; background: var(--ui-bg); border: 1px solid var(--ui-edge); border-radius: 7px; cursor: pointer; transition: border-color .12s; } /* uniform HUD icon buttons */
#editor-btn.on { border-color: var(--accent); background: #2a3320; }
/* admin map-editor palette (built dynamically, admin-only) */
#map-editor { position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 5px; max-width: 92vw; justify-content: center; background: rgba(13,15,10,0.93); border: 1px solid var(--ui-edge); border-radius: 9px; padding: 7px; z-index: 40; box-shadow: 0 4px 14px #000a; }
.me-swatch { background: var(--ui-bg); border: 1px solid var(--ui-edge); color: var(--ui-text); font-size: 12px; padding: 5px 9px; border-radius: 6px; cursor: pointer; }
.me-swatch.on { border-color: var(--accent); background: #2a3320; }
#hud-right button:hover { border-color: var(--accent); }
#minimap { position: fixed; top: 54px; right: 10px; width: 144px; height: 144px; border: 2px solid var(--ui-edge); border-radius: 6px; background: #0d0f0a; z-index: 7; pointer-events: none; box-shadow: 0 2px 8px #0007; }
@media (max-width: 640px) { #minimap { width: 104px; height: 104px; top: 48px; } }
@media (hover: none) and (pointer: coarse) { #minimap { display: none; } } /* hide the minimap on touch / mobile devices */
#online {
  background: var(--ui-bg); border: 1px solid var(--ui-edge); border-radius: 4px;
  padding: 5px 9px; font-size: 11px; letter-spacing: .5px; text-shadow: 0 1px 2px #000;
}
#online.on { color: #7fd06a; border-color: #3f6a35; }
#online.off { color: var(--ui-dim); }
#inv-btn {
  background: var(--ui-bg);
  border: 1px solid var(--ui-edge);
  border-radius: 4px;
  font-size: 20px;
  padding: 5px 9px;
  cursor: pointer;
  line-height: 1;
}
#inv-btn:hover { border-color: #5a6150; }
#logout-btn {
  background: var(--ui-bg); border: 1px solid var(--ui-edge); border-radius: 4px;
  font-size: 16px; padding: 5px 9px; line-height: 1; cursor: pointer; color: var(--ui-dim);
}
#logout-btn:hover { border-color: #6a3f35; color: #e0a090; }

/* ---------- Inventory / Shop / Trader / Skills / Quests panels ---------- */
#inventory, #shop, #trader, #skills, #quests, #market, #bank {
  position: absolute; inset: 0;
  background: rgba(6, 8, 6, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 8;
}
#inventory.hidden, #shop.hidden, #trader.hidden, #skills.hidden, #quests.hidden, #market.hidden, #bank.hidden { display: none; }
#bank-body { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px; }

/* player marketplace */
#market-btn { background: var(--ui-bg); border: 1px solid var(--ui-edge); border-radius: 4px; font-size: 16px; padding: 4px 8px; cursor: pointer; }
#market-btn:hover { border-color: #5a6150; }
#market-coins { color: #ffd84a; font-size: 14px; }
#market-tabs { display: flex; gap: 6px; margin: 8px 0 10px; }
.mk-tab { flex: 1; background: #20251c; border: 1px solid var(--ui-edge); color: var(--ui-dim); border-radius: 5px; padding: 7px 0; font-family: inherit; font-size: 12px; cursor: pointer; }
.mk-tab.sel { border-color: var(--accent); color: var(--ui-text); background: #2a3122; }
#market-body { display: flex; flex-direction: column; gap: 7px; max-height: 64vh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px; }
.mk-note { font-size: 11px; color: var(--ui-dim); line-height: 1.4; margin-bottom: 4px; }
.mk-row { display: flex; align-items: center; gap: 9px; background: #20251c; border: 1px solid var(--ui-edge); border-radius: 5px; padding: 7px 9px; }
.mk-row .ii-ico { font-size: 20px; filter: saturate(.7); }
.mk-info { flex: 1; font-size: 13px; color: var(--ui-text); min-width: 0; }
.mk-sub { display: block; font-size: 10px; color: var(--ui-dim); margin-top: 2px; }
.mk-qty, .mk-price { width: 56px; background: #14160f; border: 1px solid var(--ui-edge); color: var(--ui-text); border-radius: 4px; padding: 5px; font-family: inherit; font-size: 12px; }
.mk-act { background: #2a3122; border: 1px solid var(--accent); color: var(--ui-text); border-radius: 5px; padding: 6px 12px; font-family: inherit; font-size: 12px; cursor: pointer; }
.mk-act:hover { background: #38402c; }
.mk-act.danger { border-color: #a23b34; }
.mk-act.danger:hover { background: #4a2420; }
#quests-btn { background: var(--ui-bg); border: 1px solid var(--ui-edge); border-radius: 4px; font-size: 16px; padding: 4px 8px; cursor: pointer; }
#quests-btn:hover { border-color: #5a6150; }
#quests-body { display: flex; flex-direction: column; gap: 7px; padding: 2px; max-height: 60vh; overflow-y: auto; }
.q-section { font-size: 11px; color: var(--ui-dim); text-transform: uppercase; letter-spacing: .5px; margin: 6px 0 2px; }
.q-row { display: flex; align-items: center; gap: 9px; background: #20251c; border: 1px solid var(--ui-edge); border-radius: 5px; padding: 7px 9px; }
.q-row.done { opacity: .55; border-color: #3f6a35; }
.q-check { font-size: 15px; width: 18px; text-align: center; }
.q-text { flex: 1; font-size: 12px; color: var(--ui-text); }
.q-reward { font-size: 11px; color: #ffe14a; }
.q-prog { font-size: 11px; color: var(--ui-dim); }
#quest-tracker {
  position: absolute; top: 92px; left: 12px; z-index: 6; pointer-events: none;
  background: var(--ui-bg); border: 1px solid var(--ui-edge); border-left: 3px solid #ffe14a;
  border-radius: 4px; padding: 6px 10px; font-size: 12px; color: var(--ui-text);
  text-shadow: 0 1px 2px #000; max-width: 60vw;
}
#quest-tracker.hidden { display: none; }
#quest-tracker .qt-label { color: #ffe14a; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
#skills-total { color: #d8c98a; font-size: 14px; }
#skills-btn { background: var(--ui-bg); border: 1px solid var(--ui-edge); border-radius: 4px; font-size: 16px; padding: 4px 8px; cursor: pointer; }
#skills-btn:hover { border-color: #5a6150; }
#skills-body { display: flex; flex-direction: column; gap: 9px; padding: 4px 2px; }
.skill-row { display: flex; align-items: center; gap: 10px; }
.skill-ico { font-size: 22px; width: 26px; text-align: center; }
.skill-meta { flex: 1; }
.skill-name { font-size: 13px; color: var(--ui-text); display: flex; justify-content: space-between; margin-bottom: 3px; }
.skill-lvl { color: #ffe14a; font-weight: 700; }
.skill-bar { height: 7px; background: #20251c; border: 1px solid var(--ui-edge); border-radius: 4px; overflow: hidden; }
.skill-fill { height: 100%; background: linear-gradient(90deg, #4a9a3a, #6fce58); }
#shop-cash, #trader-cash { color: #d8c98a; font-size: 15px; }
.inv-item.owned { border-color: var(--accent); }
.inv-item .ii-eq { font-size: 9px; color: var(--accent); margin-top: 2px; }
.gear-sell {
  margin-top: 4px; background: #3a2420; border: 1px solid #6a3f35; color: #e0a090;
  font-family: inherit; font-size: 9px; padding: 2px 6px; border-radius: 4px; cursor: pointer;
}
.gear-sell:hover { background: #4a2e28; }
.inv-item .ii-price { font-size: 10px; color: #8fcf6a; margin-top: 2px; }
.shop-allbtn {
  background: #2a3a22; border: 1px solid #5a7a40; color: #cfe6b0;
  font-family: inherit; font-size: 12px; padding: 6px 12px; border-radius: 5px;
  cursor: pointer; margin-top: 4px;
}
.shop-allbtn:hover { background: #35472b; }
.inv-box {
  width: min(440px, 92vw);
  background: var(--ui-bg);
  border: 2px solid var(--ui-edge);
  border-radius: 10px;
  padding: 14px 16px 18px;
  box-shadow: 0 10px 40px #000;
  max-height: 92vh;                       /* never taller than the screen (mobile) */
  overflow-y: auto;                       /* scroll the whole panel if it overflows */
  -webkit-overflow-scrolling: touch;      /* momentum scrolling on iOS */
}
.inv-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 18px; letter-spacing: 3px; color: var(--accent);
  text-transform: uppercase; margin-bottom: 12px;
}
.inv-head button {
  background: none; border: none; color: var(--ui-dim);
  font-size: 18px; cursor: pointer; font-family: inherit;
}
.inv-section-title { font-size: 11px; color: var(--ui-dim); letter-spacing: 2px; margin: 12px 0 6px; text-transform: uppercase; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, 54px); gap: 5px; justify-content: start; } /* fixed 54px cells = same size as the hotbar slots */
.inv-item {
  background: #1c2018; border: 1px solid var(--ui-edge); border-radius: 6px;
  padding: 8px 6px; text-align: center;
}
.inv-item .ii-ico { font-size: 22px; filter: saturate(.7); }
.inv-item .ii-name { font-size: 10px; color: var(--ui-dim); margin-top: 3px; }
.inv-item .ii-qty { font-size: 15px; color: var(--ui-text); font-weight: bold; }
.inv-empty { color: var(--ui-dim); font-size: 12px; padding: 4px 2px; }
.inv-item.clickable { cursor: pointer; transition: border-color .12s, transform .1s; }
.inv-item.clickable:hover { border-color: var(--accent); transform: translateY(-2px); }
.inv-item.clickable:active { transform: translateY(0); }

/* Backpack: every cell a uniform square — icon centred, quantity as a corner badge, name on hover only */
.inv-item.bag { padding: 0; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; position: relative; }
.inv-item.bag .ii-ico { font-size: 26px; line-height: 1; margin: 0; display: flex; align-items: center; justify-content: center; }
.inv-item.bag .ii-ico img { width: 26px; height: 26px; }
.inv-item.bag .ii-qty { position: absolute; top: 1px; right: 3px; margin: 0; font-size: 11px; font-weight: bold; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.inv-item.bag.equipped { outline: 2px solid var(--accent); outline-offset: -2px; }
.inv-item.bag:not(.empty-cell):hover::after { /* :not(.empty-cell) -> no blank tooltip box over empty slots */
  content: attr(data-name); position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%);
  background: #0d0f0a; border: 1px solid var(--ui-edge); color: var(--ui-text); font-size: 11px;
  padding: 3px 8px; border-radius: 5px; white-space: nowrap; z-index: 30; pointer-events: none; box-shadow: 0 2px 8px #000a;
}
/* worn-equipment slots at the top of the inventory (RuneScape-style) */
.equip-slots { display: flex; gap: 8px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--ui-edge); }
.eq-slot { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 8px 10px; background: #15170f; border: 1px solid var(--ui-edge); border-radius: 6px; }
.eq-slot.clickable { cursor: pointer; transition: border-color .12s, background .12s; }
.eq-slot.filled { border-color: var(--accent); }
.eq-slot.clickable:hover { background: #1c2018; }
.eq-ico { font-size: 22px; line-height: 1; }
.eq-ico .eq-ph { opacity: .3; filter: grayscale(1); }
.eq-lbl { font-size: 12px; color: var(--ui-text); }
.eq-slot:not(.filled) .eq-lbl { color: var(--ui-dim); font-style: italic; }
.inv-item.bag.empty-cell { background: #14160e; border-style: dashed; border-color: #2c3024; cursor: default; } /* empty backpack slot */
.inv-item.dragover { outline: 2px dashed var(--accent); outline-offset: -2px; }
.inv-item.dragging { opacity: .45; }

/* ---------- Username (title) ---------- */
#username, #password {
  background: #15170f;
  border: 2px solid #5a6150;
  color: var(--ui-text);
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 1px;
  text-align: center;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 10px;
  width: 240px;
  outline: none;
}
#username:focus, #password:focus { border-color: var(--accent); }
#login-note { color: var(--ui-dim); font-size: 11px; letter-spacing: 1px; margin-bottom: 8px; }
#login-error { color: #e06b54; font-size: 12px; min-height: 16px; margin-bottom: 8px; }
#auth-toggle { margin-top: 12px; font-size: 12px; color: var(--ui-dim); }
#auth-toggle a { color: var(--accent); cursor: pointer; text-decoration: underline; }
#start-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Chat ---------- */
#chat {
  position: absolute;
  left: 12px; bottom: 84px;
  width: min(320px, 56vw);
  display: flex; flex-direction: column;
  gap: 4px;
  z-index: 6;
}
#chat.hidden { display: none; }
#chat-log {
  display: flex; flex-direction: column;
  gap: 2px;
  max-height: 150px;
  overflow: hidden;
  font-size: 12px;
  text-shadow: 0 1px 2px #000;
}
#chat-log .cm { background: rgba(20,22,20,0.5); border-radius: 4px; padding: 2px 7px; align-self: flex-start; }
#chat-log .cm b { color: var(--accent); }
#chat-log .cm.sys { color: var(--ui-dim); font-style: italic; }
#chat-input {
  background: var(--ui-bg);
  border: 1px solid var(--ui-edge);
  color: var(--ui-text);
  font-family: inherit;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 5px;
  outline: none;
  opacity: 0.55;
  transition: opacity .15s, border-color .15s;
}
#chat-input:focus { opacity: 1; border-color: var(--accent); }

/* ---------- Mobile layout: keep the hotbar to one row + clear of chat/buttons ---------- */
@media (max-width: 640px) {
  #hotbar { flex-wrap: nowrap; gap: 4px; bottom: 10px; max-width: 100vw; }
  .slot { width: 40px; height: 40px; border-width: 1px; }
  .slot .lbl { display: none; }
  .slot .ico { font-size: 19px; }
  .slot .key { font-size: 8px; }
  .slot .qty { font-size: 10px; }
  /* chat sits above the single-row hotbar, compact, and never covers it */
  #chat { left: 8px; bottom: 60px; width: 56vw; }
  #chat-log { max-height: 84px; }
  #chat-input { font-size: 12px; padding: 5px 8px; }
  /* action buttons stack on the right, clear of the hotbar */
  #touch-actions { bottom: 58px; right: 8px; gap: 8px; }
  .tbtn.round { width: 58px; height: 58px; }
  #t-buy { width: 50px; height: 50px; }
  #touch-zoom { top: 92px; }
  #tz-out, #tz-in { width: 38px; height: 38px; }
  #clock { padding: 6px 9px; }
  #day, #season { font-size: 10px; }
  #time { font-size: 18px; }
  #health, #energy { width: 96px; }
  /* HUD buttons (incl. 🎒 inventory) must stay reachable on narrow screens: let them wrap, keep them touch-sized */
  #hud-right { flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 62vw; }
  #hud-right button { width: 34px; height: 34px; font-size: 16px; padding: 0; }
  #online { font-size: 11px; padding: 2px 5px; }
  #cash { font-size: 13px; }
}

/* ---------- Touch controls (mobile only) ---------- */
#touch-zoom, #touch-actions { position: absolute; display: none; gap: 10px; z-index: 5; }
body.touch #touch-zoom, body.touch #touch-actions { display: flex; }
#touch-zoom { top: 64px; right: 12px; flex-direction: column; }
#touch-actions { bottom: 84px; right: 14px; align-items: center; }

.tbtn {
  background: var(--ui-bg);
  border: 2px solid var(--ui-edge);
  color: var(--ui-text);
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-shadow: 0 1px 2px #000;
}
.tbtn:active { background: #38402c; transform: translateY(1px); }
.tbtn.round {
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
#tz-out, #tz-in { width: 44px; height: 44px; padding: 0; font-size: 22px; }
#t-action { border-color: var(--accent); }
#t-buy { border-color: #d8c98a; color: #d8c98a; width: 60px; height: 60px; font-size: 14px; }
.tbtn.hidden { display: none; }

/* ---------- Hint ---------- */
#hint {
  position: absolute;
  bottom: 88px; left: 50%;
  transform: translateX(-50%);
  background: var(--ui-bg);
  border: 1px solid var(--ui-edge);
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--ui-text);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 1px 2px #000;
}
#hint.show { opacity: 1; }

/* prominent toast (important notices like running out of energy) */
#toast {
  position: absolute;
  top: 76px; left: 50%;
  transform: translate(-50%, -10px);
  background: rgba(28, 18, 16, 0.92);
  border: 1px solid #7a3f33;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px; font-weight: 600;
  color: #ffd9cf;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 2px #000;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  max-width: 86vw; text-align: center;
  z-index: 9;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Title ---------- */
#title {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, #1a1d17 0%, #0a0b09 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity .6s;
}
#title.hidden { opacity: 0; pointer-events: none; }
#title h1 {
  font-size: 64px;
  letter-spacing: 14px;
  color: #c4cba0;
  text-shadow: 0 3px 0 #2a2f22, 0 6px 18px #000;
  margin-left: 14px;
}
#title .tag { color: var(--ui-dim); letter-spacing: 4px; margin: 8px 0 36px; font-size: 14px; }
#start-btn {
  background: #2a2f22;
  border: 2px solid #5a6150;
  color: #d6dcc0;
  font-family: inherit;
  font-size: 18px;
  letter-spacing: 3px;
  padding: 12px 40px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
#start-btn:hover { background: #38402c; }
#start-btn:active { transform: translateY(2px); }
/* character customizer on the title screen */
#customize {
  margin-top: 18px;
  width: 440px; max-width: 90vw;
  border: 1px solid #3a4030;
  border-radius: 8px;
  background: rgba(20,23,17,0.6);
}
#customize > summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 14px;
  color: #c4cba0;
  font-size: 13px;
  letter-spacing: 1px;
  text-align: center;
}
#customize > summary::-webkit-details-marker { display: none; }
#customize-body {
  display: flex;
  gap: 14px;
  padding: 4px 14px 14px;
  align-items: flex-start;
}
#avatar {
  flex: 0 0 auto;
  width: 120px; height: 170px;
  background: radial-gradient(circle at 50% 60%, #23271d 0%, #14160f 100%);
  border: 1px solid #3a4030;
  border-radius: 6px;
  image-rendering: pixelated;
}
#custom-opts { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cust-row { display: flex; flex-direction: column; gap: 4px; }
.cust-label { color: var(--ui-dim); font-size: 11px; letter-spacing: 1px; }
.cust-swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.cust-sw {
  width: 22px; height: 22px;
  border: 2px solid #2a2f22;
  border-radius: 5px;
  cursor: pointer;
  padding: 0;
}
.cust-sw.text {
  width: auto; height: 22px;
  padding: 0 8px;
  background: #2a2f22;
  color: #c4cba0;
  font-family: inherit;
  font-size: 11px;
  text-transform: capitalize;
}
.cust-sw.sel { border-color: #e8c33a; box-shadow: 0 0 0 1px #e8c33a; }
#title .controls {
  margin-top: 40px;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 560px;
  color: var(--ui-dim);
  font-size: 12px;
}
#title .controls b { color: var(--accent); }
