:root {
  --ink: #2a1d16;
  --ink-soft: #5a4636;
  --parch: #f3e3bf;
  --parch-d: #e4cf9f;
  --parch-dd: #cdb37e;
  --wood: #6b4226;
  --wood-l: #8a5a32;
  --gold: #f2c84b;
  --gold-d: #c4962b;
  --red: #b8433a;
  --green: #4f8a3a;
  --green-l: #6fae4f;
  --blue: #466fae;
  --night: #1b1830;
  --night-2: #262143;
  --px: 3px;
  --bevel: inset calc(var(--px) * -1) calc(var(--px) * -1) 0 rgba(0,0,0,.22), inset var(--px) var(--px) 0 rgba(255,255,255,.35);
  --drop: 4px 4px 0 rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Pixelify Sans', system-ui, sans-serif;
  font-size: 17px;
  color: var(--ink);
  background-color: var(--night);
  background-image:
    radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(180deg, var(--night-2), var(--night));
  background-size: 6px 6px, 100% 100%;
  min-height: 100vh;
  -webkit-font-smoothing: none;
}
img.px, canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }
h1, h2, h3 { margin: 0; font-weight: 700; }
h2 { font-family: 'Press Start 2P', monospace; font-size: 13px; line-height: 1.5; letter-spacing: .5px; }
h3 { font-size: 18px; }

.parchment {
  background: var(--parch);
  border: var(--px) solid var(--ink);
  box-shadow: var(--bevel), var(--drop);
}

/* ---------------- buttons ---------------- */
.btn {
  background: var(--parch-d);
  border: var(--px) solid var(--ink);
  box-shadow: var(--bevel);
  padding: 6px 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translate(1px, 2px); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-gold { background: var(--gold); }
.btn-green { background: var(--green-l); color: #fff; text-shadow: 1px 1px 0 var(--ink); }
.btn-red { background: #d06a5e; color: #fff; text-shadow: 1px 1px 0 var(--ink); }
.btn-big { font-size: 20px; padding: 10px 18px; width: 100%; }
.btn-small { padding: 3px 8px; font-size: 15px; }
.icon-btn {
  background: var(--parch-d);
  border: var(--px) solid var(--ink);
  box-shadow: var(--bevel);
  width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  position: relative;
  padding: 0;
}
.icon-btn img { width: 24px; height: 24px; }
.icon-btn .badge {
  position: absolute; top: -8px; right: -8px;
  background: var(--red); color: #fff; font-size: 12px;
  border: 2px solid var(--ink); min-width: 20px; height: 20px; line-height: 16px; padding: 0 3px;
  text-align: center;
}
.seg { display: flex; gap: 0; margin: 10px 0; flex-wrap: wrap; }
.seg-btn {
  flex: 1;
  background: var(--parch-d);
  border: var(--px) solid var(--ink);
  margin-left: calc(var(--px) * -1);
  padding: 5px 8px;
  font-weight: 600;
}
.seg-btn:first-child { margin-left: 0; }
.seg-btn.active { background: var(--gold); box-shadow: var(--bevel); }

label { display: block; font-weight: 600; margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input:not([type]), select, textarea {
  width: 100%;
  background: #fff8e6;
  border: var(--px) solid var(--ink);
  padding: 7px 9px;
  font-size: 17px;
  margin-top: 4px;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,.12);
  border-radius: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.form-error { color: var(--red); min-height: 1.2em; margin: 8px 0; font-weight: 600; }
.hint { color: var(--ink-soft); font-size: 15px; margin: 4px 0; }

/* ---------------- auth ---------------- */
.auth { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; overflow: auto; }
.auth-bg { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.7); }
.auth-card { position: relative; width: min(420px, 100%); padding: 24px; }
.logo {
  font-family: 'Press Start 2P', monospace; font-size: 30px; line-height: 1.25; text-align: center;
  color: var(--gold); text-shadow: 3px 3px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink);
}
.tagline { text-align: center; margin: 10px 0 4px; font-size: 19px; font-weight: 600; }
.auth-features { margin: 16px 0 0; padding-left: 20px; color: var(--ink-soft); }
.auth-features li { margin: 3px 0; }

/* ---------------- HUD ---------------- */
.hud {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 8px 16px;
  background: var(--wood);
  border-bottom: var(--px) solid var(--ink);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.12), 0 4px 0 rgba(0,0,0,.3);
  color: #fff;
  flex-wrap: wrap;
}
.hud-logo { font-family: 'Press Start 2P', monospace; font-size: 13px; color: var(--gold); text-shadow: 2px 2px 0 var(--ink); }
.hud-level { display: flex; align-items: center; gap: 8px; min-width: 210px; }
.lvl-badge {
  font-family: 'Press Start 2P', monospace; font-size: 11px;
  background: var(--gold); color: var(--ink); border: var(--px) solid var(--ink); padding: 5px 6px; box-shadow: var(--bevel);
}
.lvl-info { flex: 1; font-size: 15px; text-shadow: 1px 1px 0 var(--ink); }
.bar { height: 12px; background: var(--ink); border: 2px solid var(--ink); position: relative; margin-top: 3px; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #8fd0ff 0 40%, #3c8fd6 40%); transition: width .5s steps(12); }
.bar.gold > i { background: linear-gradient(180deg, #ffe58a 0 40%, #f2c84b 40%); }
.bar.green > i { background: linear-gradient(180deg, #9ad46f 0 40%, #5fae4a 40%); }
.hud-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.stat { display: flex; align-items: center; gap: 5px; font-weight: 700; font-size: 18px; text-shadow: 2px 2px 0 var(--ink); }
.stat img { width: 22px; height: 22px; }
.stat.bump { animation: bump .35s steps(3); }
@keyframes bump { 50% { transform: scale(1.25); } }
.hud-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------------- layout ---------------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 16px; padding: 16px; align-items: start; }
.world { position: sticky; top: 76px; }
.world-frame {
  background: var(--wood-l);
  border: var(--px) solid var(--ink);
  box-shadow: var(--bevel), var(--drop);
  padding: 10px;
}
.world-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #fff; text-shadow: 2px 2px 0 var(--ink); margin-bottom: 8px; flex-wrap: wrap; }
.world-title { font-family: 'Press Start 2P', monospace; font-size: 12px; }
.world-stats { display: flex; gap: 12px; font-weight: 700; flex-wrap: wrap; }
.world-stats span { display: inline-flex; align-items: center; gap: 4px; }
.world-stats img { width: 18px; height: 18px; }
.village-canvas { display: block; width: 100%; height: auto; border: var(--px) solid var(--ink); background: #3d7429; }
.world-hint { color: #f3e3bf; font-size: 14px; margin: 8px 2px 0; opacity: .85; }
.placing-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-top: 8px; padding: 8px 10px; background: var(--gold); border: var(--px) solid var(--ink); font-weight: 700;
  animation: pulse 1.2s steps(2) infinite;
}
@keyframes pulse { 50% { background: #ffe58a; } }

.side { display: flex; flex-direction: column; min-height: 70vh; }
.tabs { display: grid; grid-template-columns: repeat(6, 1fr); border-bottom: var(--px) solid var(--ink); background: var(--parch-dd); }
.tabs button {
  border: none; border-right: 2px solid var(--ink); background: transparent; padding: 10px 2px; font-weight: 700; font-size: 15px;
}
.tabs button:last-child { border-right: none; }
.tabs button.active { background: var(--parch); box-shadow: inset 0 3px 0 var(--gold); }
.tab-content { padding: 14px; overflow-y: auto; max-height: calc(100vh - 150px); }
.tab-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.summary { background: var(--parch-d); border: 2px solid var(--ink); padding: 8px 10px; margin-bottom: 12px; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.summary img { width: 20px; height: 20px; }
.section-title { font-family: 'Press Start 2P', monospace; font-size: 10px; color: var(--ink-soft); margin: 16px 0 8px; }
.empty { text-align: center; padding: 18px 10px; color: var(--ink-soft); }
.empty img { width: 48px; height: 48px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }

/* ---------------- habits ---------------- */
.habit {
  display: grid; grid-template-columns: 40px 1fr auto auto; gap: 10px; align-items: center;
  background: #fff8e6; border: var(--px) solid var(--ink); padding: 8px; margin-bottom: 8px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.15);
}
.habit.done { background: #e3efc9; }
.habit-icon { width: 36px; height: 36px; }
.h-name { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.habit.done .h-name { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-soft); }
.diff { font-size: 12px; color: #fff; padding: 1px 5px; border: 2px solid var(--ink); text-shadow: 1px 1px 0 var(--ink); font-weight: 600; text-decoration: none; }
.h-cue { font-size: 14px; color: var(--ink-soft); }
.h-meta { font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.h-meta img { width: 16px; height: 16px; }
.dots { display: inline-flex; gap: 2px; }
.dots i { width: 9px; height: 9px; border: 2px solid var(--ink); background: #fff; display: inline-block; }
.dots i.on { background: var(--green-l); }
.dots i.frozen { background: #8fd0ff; }
.rally { margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--red); }
.check {
  width: 46px; height: 46px; border: var(--px) solid var(--ink); background: #fff; box-shadow: var(--bevel);
  font-size: 26px; font-weight: 700; line-height: 1;
}
.check:hover { background: #fff3c4; }
.habit.done .check { background: var(--green-l); color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.more { background: none; border: none; font-size: 20px; padding: 4px; color: var(--ink-soft); }
.reward-tag { font-size: 13px; color: var(--gold-d); font-weight: 700; }

/* ---------------- goals ---------------- */
.goal { background: #fff8e6; border: var(--px) solid var(--ink); padding: 10px; margin-bottom: 10px; box-shadow: 3px 3px 0 rgba(0,0,0,.15); }
.goal.complete { background: #fbefc4; }
.goal-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.goal-why { font-style: italic; color: var(--ink-soft); font-size: 15px; margin: 2px 0 6px; }
.goal .bar { height: 18px; margin: 8px 0 4px; background: #d9c9a5; }
.goal .bar .tick { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); }
.goal-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; flex-wrap: wrap; }
.goal-log { display: flex; gap: 6px; margin-top: 8px; }
.goal-log input { width: 90px; margin: 0; padding: 4px 6px; }

/* ---------------- market ---------------- */
.items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.item {
  background: #fff8e6; border: var(--px) solid var(--ink); padding: 8px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.15);
}
.item.locked { opacity: .6; }
.item-art { height: 80px; display: grid; place-items: end center; background: #c9e0a6; border: 2px solid var(--ink); background-image: radial-gradient(rgba(0,0,0,.06) 1px, transparent 1px); background-size: 4px 4px; }
.item-art img { image-rendering: pixelated; max-height: 76px; }
.item-name { font-weight: 700; }
.item-desc { font-size: 13px; color: var(--ink-soft); flex: 1; }
.item-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.price { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.price img { width: 16px; height: 16px; }
.lock { font-size: 13px; font-weight: 700; color: var(--red); }
.inventory { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.inv { display: flex; align-items: center; gap: 6px; background: var(--parch-d); border: 2px solid var(--ink); padding: 4px 6px; }
.inv img { height: 28px; image-rendering: pixelated; }

/* ---------------- ranks ---------------- */
.rank-row {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center;
  padding: 7px 8px; border: 2px solid var(--ink); background: #fff8e6; margin-bottom: 5px; cursor: pointer;
}
.rank-row:hover { background: #fff3c4; }
.rank-row.me { background: #e3efc9; border-width: 3px; }
.rank-num { font-family: 'Press Start 2P', monospace; font-size: 11px; text-align: center; }
.rank-num img { width: 24px; height: 24px; }
.rank-name { font-weight: 700; }
.rank-sub { font-size: 13px; color: var(--ink-soft); }
.rank-val { font-weight: 700; font-size: 18px; }
.npc { font-size: 11px; background: #c8c8cc; border: 2px solid var(--ink); padding: 0 4px; margin-left: 4px; font-weight: 600; vertical-align: middle; }

/* ---------------- guild ---------------- */
.guild-card { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; border: 2px solid var(--ink); background: #fff8e6; padding: 8px; margin-bottom: 6px; }
.crest { width: 36px; height: 40px; border: var(--px) solid var(--ink); clip-path: polygon(0 0, 100% 0, 100% 65%, 50% 100%, 0 65%); position: relative; }
.crest::after { content: ''; position: absolute; left: 40%; top: 18%; width: 20%; height: 50%; background: var(--gold); }
.crest.big { width: 56px; height: 64px; }
.guild-banner { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.guild-motto { font-style: italic; color: var(--ink-soft); }
.member { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 6px 8px; border-bottom: 2px dashed var(--parch-dd); }
.member-stats { font-size: 13px; color: var(--ink-soft); }
.feed { background: #fff8e6; border: var(--px) solid var(--ink); max-height: 300px; overflow-y: auto; padding: 8px; font-size: 15px; }
.feed-item { padding: 4px 0; border-bottom: 1px dashed var(--parch-dd); }
.feed-item.event { color: var(--ink-soft); }
.feed-item b { color: var(--ink); }
.feed-time { font-size: 12px; color: var(--ink-soft); float: right; }
.chat-form { display: flex; gap: 6px; margin-top: 6px; }
.chat-form input { margin: 0; }
.swatches { display: flex; gap: 6px; }
.swatches label { margin: 0; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 30px; height: 30px; border: var(--px) solid var(--ink); cursor: pointer; }
.swatches input:checked + span { outline: 3px solid var(--gold); outline-offset: 1px; }

/* ---------------- hero ---------------- */
.hero-card { display: flex; gap: 14px; align-items: center; background: #fff8e6; border: var(--px) solid var(--ink); padding: 12px; }
.hero-card img { width: 54px; image-rendering: pixelated; }
.hero-title { font-family: 'Press Start 2P', monospace; font-size: 11px; color: var(--gold-d); margin-top: 4px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.stats-grid div { background: var(--parch-d); border: 2px solid var(--ink); padding: 6px; text-align: center; font-size: 13px; }
.stats-grid b { display: block; font-size: 20px; }
.heat { display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column; grid-auto-columns: 12px; gap: 2px; overflow-x: auto; padding: 6px; background: #fff8e6; border: 2px solid var(--ink); }
.heat i { background: #e4d8bc; display: block; }
.heat i.l1 { background: #b6dd8f; } .heat i.l2 { background: #7fbf55; } .heat i.l3 { background: #4f8a3a; } .heat i.l4 { background: #2f5e22; }
.ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ach { display: flex; gap: 8px; align-items: center; border: 2px solid var(--ink); padding: 6px; background: #fff8e6; font-size: 13px; }
.ach img { width: 28px; height: 28px; }
.ach.locked { opacity: .45; filter: grayscale(1); }
.ach b { display: block; font-size: 15px; }

/* ---------------- icon picker / radio grids ---------------- */
.icon-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.icon-pick label, .diff-pick label { margin: 0; }
.icon-pick input, .diff-pick input { position: absolute; opacity: 0; }
.icon-pick span { display: grid; place-items: center; height: 44px; border: var(--px) solid var(--ink); background: #fff8e6; cursor: pointer; }
.icon-pick img { width: 30px; height: 30px; }
.icon-pick input:checked + span { background: var(--gold); box-shadow: var(--bevel); }
.diff-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.diff-pick span { display: block; text-align: center; border: var(--px) solid var(--ink); background: #fff8e6; padding: 6px 2px; cursor: pointer; font-size: 14px; font-weight: 700; }
.diff-pick small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-soft); }
.diff-pick input:checked + span { background: var(--gold); box-shadow: var(--bevel); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------------- modal / toasts ---------------- */
.modal-back { position: fixed; inset: 0; background: rgba(10,8,20,.65); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px; position: relative; animation: pop .2s steps(4); }
.modal.wide { width: min(860px, 100%); }
.modal-close { position: absolute; top: 8px; right: 8px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.modal-actions .spacer { flex: 1; }
.celebrate { text-align: center; }
.celebrate img.big { width: 96px; height: 96px; image-rendering: pixelated; animation: float 1.4s steps(4) infinite; }
.celebrate h2 { font-size: 16px; margin: 10px 0; }
.celebrate .amount { font-size: 26px; font-weight: 700; color: var(--gold-d); }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes pop { from { transform: scale(.85); } }
@keyframes fade { from { opacity: 0; } }

.toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(420px, calc(100% - 32px)); }
.toast { display: flex; align-items: center; gap: 8px; background: var(--parch); border: var(--px) solid var(--ink); box-shadow: var(--drop); padding: 8px 12px; font-weight: 700; animation: slide .25s steps(4); }
.toast img { width: 24px; height: 24px; }
.toast.error { background: #f3c4bc; }
@keyframes slide { from { transform: translateY(-14px); opacity: 0; } }

.float-text { position: fixed; z-index: 70; pointer-events: none; font-weight: 700; font-size: 20px; color: var(--gold); text-shadow: 2px 2px 0 var(--ink), -1px -1px 0 var(--ink); animation: rise 1.1s ease-out forwards; white-space: nowrap; }
.float-text.xp { color: #8fd0ff; }
@keyframes rise { to { transform: translateY(-60px); opacity: 0; } }

.confetti { position: fixed; top: -12px; width: 8px; height: 8px; z-index: 80; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

.visit-canvas { width: 100%; border: var(--px) solid var(--ink); }

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; }
  .world { position: static; }
  .tab-content { max-height: none; }
  .side { min-height: 0; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .hud { gap: 8px; padding: 8px 12px; }
  .hud-logo { display: none; }
  .hud-level { min-width: 0; flex: 1 1 100%; order: 3; }
  .hud-stats { gap: 10px; }
  .hud-actions { margin-left: auto; }
  .layout { padding: 10px 12px; gap: 12px; }
  .tabs button { font-size: 13px; padding: 9px 0; }
  .items { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ach-grid { grid-template-columns: 1fr; }
  .habit { grid-template-columns: 30px 1fr auto 22px; gap: 8px; }
  .habit-icon { width: 30px; height: 30px; }
  .icon-pick { grid-template-columns: repeat(4, 1fr); }
  .diff-pick { grid-template-columns: repeat(3, 1fr); }
  .row2 { grid-template-columns: 1fr; }
}

.volume { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.volume input { width: 120px; accent-color: var(--gold-d); }
.tabs button { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 360px) {
  .tabs button { font-size: 11px; }
  .layout { padding: 8px; }
  .items { grid-template-columns: 1fr; }
}

/* ---------------- hero ---------------- */
.hud-hero { background: var(--parch-d); border: var(--px) solid var(--ink); box-shadow: var(--bevel); padding: 1px 4px; height: 44px; display: grid; place-items: center; }
.hud-hero img { height: 36px; width: 22px; }
.hero-portrait { width: 66px !important; height: 108px; }
.avatar { width: 22px; height: 36px; flex: none; }
.avatar.big { width: 44px; height: 72px; }
.rank-who { display: flex; gap: 8px; align-items: center; min-width: 0; }
.visit-head { display: flex; gap: 12px; align-items: center; }
.hero-designer { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: start; }
.hero-stage { display: flex; flex-direction: column; gap: 8px; align-items: center; background: #c9e0a6; border: var(--px) solid var(--ink); padding: 12px; background-image: radial-gradient(rgba(0,0,0,.06) 1px, transparent 1px); background-size: 4px 4px; }
.hero-stage canvas { width: 132px; height: 216px; image-rendering: pixelated; }
.hero-options { display: flex; flex-direction: column; gap: 6px; }
.hero-row { display: grid; grid-template-columns: 110px auto 1fr auto; gap: 6px; align-items: center; }
.hero-row > span { font-weight: 600; }
.hero-row b { text-align: center; }
.hero-row:has(.swatches) { grid-template-columns: 110px 1fr; }
.swatches.small { flex-wrap: wrap; gap: 4px; }
.swatch { width: 24px; height: 24px; border: var(--px) solid var(--ink); padding: 0; }
.swatch.on { outline: 3px solid var(--gold); outline-offset: 1px; }

/* ---------------- proof, timers, bounties ---------------- */
.proof-tag { display: inline-block; font-size: 12px; font-weight: 700; color: #2f5e22; background: #d9ecc2; border: 2px solid var(--ink); padding: 0 5px; margin-top: 3px; }
.proof-tag.proven { background: var(--gold); color: var(--ink); }
.seal { color: var(--gold); text-shadow: 2px 2px 0 var(--ink); }
.timer-btn { line-height: 1.1; font-size: 13px; padding: 4px 6px; min-width: 56px; }
.timer-box { width: 104px; text-align: center; }
.timer-time { font-family: 'Press Start 2P', monospace; font-size: 9px; margin-bottom: 3px; }
.timer-box .bar { height: 10px; margin: 0 0 4px; }
.timer-actions { display: flex; gap: 2px; justify-content: center; align-items: center; }
.bounties { background: #fff8e6; border: var(--px) solid var(--ink); padding: 8px 10px; margin-bottom: 10px; box-shadow: 3px 3px 0 rgba(0,0,0,.15); }
.bounty-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bounty { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 2px dashed var(--parch-dd); font-size: 15px; }
.bounty .bar { height: 8px; margin-top: 3px; }
.bounty.claimed { opacity: .6; }
.habit.quest { background: #f3ecff; }
.habit.quest.done { background: #e3efc9; }
.quest-ask { font-size: 20px; font-weight: 700; background: #fff8e6; border: var(--px) solid var(--ink); padding: 10px; margin: 8px 0; }
.merchant { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: #fbefc4; border: var(--px) solid var(--ink); padding: 8px; margin: 6px 0 10px; }
.merchant img { max-height: 48px; }
.photo-drop { display: block; border: var(--px) dashed var(--ink); background: #fff8e6; padding: 18px; text-align: center; cursor: pointer; margin: 10px 0; }
.photo-drop input { position: absolute; opacity: 0; width: 1px; }
.photo-drop img { max-width: 100%; max-height: 260px; }
.proof-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.proof-img { width: 96px; height: 72px; object-fit: cover; border: 2px solid var(--ink); background: var(--parch-d); }
.feed-item.proof { color: var(--ink); }
.icon-group { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin: 6px 0 3px; text-transform: uppercase; letter-spacing: .5px; }
.icon-pick + .icon-group { margin-top: 8px; }
.chips.left { justify-content: flex-start; max-height: 120px; overflow-y: auto; padding: 2px; }
.chip { display: inline-flex; align-items: center; gap: 4px; }
.chip img { width: 18px; height: 18px; }
.verify-pick { grid-template-columns: repeat(4, 1fr); }
.check-row { display: flex; align-items: center; gap: 6px; font-weight: 500; align-self: end; }
.check-row input { width: auto; margin: 0; }
@media (max-width: 600px) {
  .hero-designer { grid-template-columns: 1fr; }
  .hero-stage canvas { width: 88px; height: 144px; }
  .hero-row { grid-template-columns: 90px auto 1fr auto; }
  .hero-row:has(.swatches) { grid-template-columns: 90px 1fr; }
  .verify-pick { grid-template-columns: repeat(2, 1fr); }
  .hud-hero { height: 40px; }
}
.hero-options, .hero-row { min-width: 0; }
@media (max-width: 600px) {
  .hero-row { grid-template-columns: 70px 32px minmax(0, 1fr) 32px; font-size: 14px; gap: 4px; }
  .hero-row:has(.swatches) { grid-template-columns: 70px minmax(0, 1fr); }
  .hero-row .btn-small { padding: 2px 4px; }
  .swatch { width: 22px; height: 22px; }
}
