/* ===== game.css — Blacksmith Scavenger prototype ===== */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=Cinzel:wght@400;600&display=swap');

:root {
  --ink: #3a2418;
  --parchment: #f4e8c8;
  --parchment-br: #faf0d8;
  --parchment-dk: #d4b88a;
  --wax: #8b1a1a;
  --gold: #b88b3a;
  --gold-br: #f4d68a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0a0705;
  font-family: 'Lora', Georgia, serif;
}

#game {
  display: block;
  width: 100vw; height: 100vh;
  cursor: crosshair;
}

/* ===== overlays ===== */
.overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 5, 3, 0.72);
  z-index: 10;
}
.overlay.hidden { display: none; }

.panel {
  background:
    radial-gradient(ellipse at 20% 12%, #faf0d8 0%, transparent 55%),
    linear-gradient(135deg, #f4e8c8 0%, #e2cda0 100%);
  color: var(--ink);
  border: 2px solid #5a4030;
  border-radius: 3px;
  box-shadow: inset 0 0 60px rgba(139, 80, 30, 0.25), 0 18px 50px rgba(0, 0, 0, 0.8);
  padding: 34px 44px;
  max-width: 640px;
  width: min(92vw, 640px);
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  text-align: center;
}

.panel h1 {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  font-size: 2.1em;
  margin: 0 0 4px;
  letter-spacing: 0.04em;
}
.panel h2 {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  font-size: 1.1em;
  color: var(--wax);
  margin: 18px 0 8px;
}
.tagline { font-style: italic; color: #5a4030; margin: 0 0 20px; }

.seal {
  width: 72px; height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #d24848 0%, #8b1a1a 50%, #5a0e0e 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--parchment);
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 1.9em;
  box-shadow: inset -3px -4px 8px rgba(0,0,0,0.55), inset 3px 3px 6px rgba(255,180,180,0.3), 3px 5px 12px rgba(0,0,0,0.5);
  transform: rotate(-6deg);
}

.best-line { font-style: italic; color: #7a5a38; font-size: 0.92em; margin: 14px 0 0; }

.controls { text-align: left; margin-top: 10px; }
.ctl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 18px;
  font-size: 0.92em;
  color: #4a3222;
}
.ctl-grid b {
  font-family: 'Cinzel', serif;
  color: var(--wax);
  font-weight: 600;
}
.lore {
  font-size: 0.9em;
  font-style: italic;
  color: #5a4030;
  border-top: 1px dashed var(--parchment-dk);
  margin-top: 14px;
  padding-top: 12px;
  line-height: 1.55;
}

.go-stats { font-size: 1.05em; line-height: 1.7; color: #4a3222; }
.go-stats strong { color: var(--wax); font-family: 'Cinzel', serif; }

/* ===== buttons ===== */
.btn {
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.1em;
  background: var(--wax);
  color: var(--parchment-br);
  border: 2px solid #5a0e0e;
  box-shadow: 2px 3px 0 #5a0e0e;
  padding: 9px 20px;
  font-size: 0.95em;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 3px 4px 0 #5a0e0e; }
.btn:active:not(:disabled) { transform: translate(1px, 2px); box-shadow: 1px 1px 0 #5a0e0e; }
.btn:disabled { opacity: 0.45; cursor: default; filter: grayscale(0.4); }
.btn.big { font-size: 1.15em; padding: 13px 34px; margin: 8px 0; }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: 2px 3px 0 #8a6a4a;
  margin-left: 10px;
}

.close-x {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none;
  font-size: 1.2em; color: var(--wax);
  cursor: pointer;
  font-family: Georgia, serif;
}
.close-x:hover { color: #b83838; }

/* ===== shop ===== */
.shop-panel { max-width: 720px; width: min(94vw, 720px); text-align: left; }
.shop-panel h1 { text-align: center; }

.shop-tabs {
  display: flex; justify-content: center;
  gap: 0; margin: 6px 0 16px;
  border-bottom: 2px solid var(--ink);
}
.tab-btn {
  font-family: 'Cinzel', serif; font-weight: 600;
  letter-spacing: 0.08em;
  background: rgba(212, 184, 138, 0.4);
  border: 2px solid var(--ink);
  border-bottom: none;
  color: #5a4030;
  padding: 8px 22px;
  margin-right: -2px;
  cursor: pointer;
}
.tab-btn.active { background: var(--parchment-br); color: var(--wax); }

.shop-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .shop-list { grid-template-columns: 1fr; } }

.shop-item {
  background: rgba(255, 248, 220, 0.55);
  border: 1.5px solid #8a6a4a;
  padding: 10px 14px;
  display: flex; flex-direction: column; gap: 5px;
}
.shop-item.locked {
  opacity: 0.55;
  border-style: dashed;
  filter: grayscale(0.5);
}
.si-head { display: flex; justify-content: space-between; align-items: baseline; }
.si-head strong { font-family: 'Cinzel', serif; font-weight: 600; color: var(--wax); font-size: 0.95em; }
.cost { color: var(--gold); font-style: italic; white-space: nowrap; }
.si-flavor { font-size: 0.85em; font-style: italic; color: #5a4030; }
.si-mats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.8em; }
.si-block { font-size: 0.8em; color: var(--wax); font-style: italic; }
.shop-item .btn { align-self: flex-start; font-size: 0.8em; padding: 6px 14px; margin-top: 2px; }

.mat { color: #4a3222; white-space: nowrap; }
.mat i {
  display: inline-block; width: 9px; height: 9px;
  border-radius: 2px; margin-right: 4px;
  border: 1px solid rgba(58, 36, 24, 0.5);
  vertical-align: baseline;
}
.mat em { color: #8a6a4a; font-style: normal; font-size: 0.9em; }
.mat.lack { color: var(--wax); }
.mat.lack em { color: var(--wax); }

.durbar {
  display: inline-block; width: 90px; height: 8px;
  background: rgba(58, 36, 24, 0.25);
  border: 1px solid #5a4030;
  vertical-align: middle;
  margin-left: 6px;
}
.durbar span { display: block; height: 100%; }

.pip {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid #5a4030;
  background: rgba(58, 36, 24, 0.15);
  margin-right: 3px;
  vertical-align: middle;
}
.pip.on { background: var(--wax); }

.shop-empty, .shop-note { font-style: italic; color: #5a4030; text-align: center; }
.shop-h3 {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  color: var(--wax);
  text-align: center;
  margin: 18px 0 10px;
  border-top: 1px dashed var(--parchment-dk);
  padding-top: 12px;
}
.purse-line {
  text-align: center;
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px dashed var(--parchment-dk);
  color: #4a3222;
}
.purse-line strong { color: var(--gold); font-family: 'Cinzel', serif; }

.ledger table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}
.ledger td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--parchment-dk);
}
.ledger td:last-child { text-align: right; font-family: 'Cinzel', serif; color: var(--wax); }
.ledger h3 { font-family: 'Cinzel', serif; color: var(--wax); margin: 10px 0 6px; font-weight: 600; }

.gate-panel { text-align: center; }
.gate-quota {
  font-family: 'Cinzel', serif; font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin-top: 6px;
}
.gate-quota.big {
  font-size: 2.2em;
  color: var(--wax);
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.8);
  margin: 4px 0 10px;
}

.small-panel { max-width: 480px; }
