/* Timber & Brass - the UI look from the menu mockup: dark wood/leather
   panels, thin brass borders with corner brackets, cream text, condensed
   uppercase headings. Type is the two page-wide faces, --font-display and
   --font-body; this file defines no family of its own. Shared primitives
   for the main menu, HUD, shop and build panel; each screen's own layout
   lives next to its markup. */

:root {
  --tb-bg-1: #1e1812;
  --tb-bg-2: #16110d;
  --tb-border: #4a3b2a;
  --tb-rule: #3a2f24;
  --tb-row: #1f1914;
  --tb-row-border: #2e261e;
  --tb-row-active: #3a3024;
  --tb-row-active-border: #8a7250;
  --tb-brass: #e0a94d;
  --tb-brass-text: #f5d897;
  --tb-brass-dim: #8f7148;
  --tb-cream: #e8dcc4;
  --tb-cream-hi: #f2ead9;
  --tb-muted: #cfc4ae;
  --tb-faint: #a89a82;
  --tb-good: #8fd46e;
  --tb-glow: 0 0 14px rgba(232, 163, 62, 0.45), inset 0 0 12px rgba(255, 190, 90, 0.12);
}

/* Panel: wood gradient, brass hairline, drop shadow. */
.tb-panel {
  position: relative;
  box-sizing: border-box;
  background: linear-gradient(180deg, var(--tb-bg-1) 0%, var(--tb-bg-2) 100%);
  border: 1px solid var(--tb-border);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), 0 14px 40px rgba(0, 0, 0, 0.7);
  color: var(--tb-cream);
  font-family: var(--font-body);
}

/* Four brass corner brackets, drawn with one pseudo-element. */
.tb-corners::before {
  content: '';
  position: absolute;
  inset: 5px;
  pointer-events: none;
  background:
    linear-gradient(var(--tb-brass-dim), var(--tb-brass-dim)) top left / 14px 2px no-repeat,
    linear-gradient(var(--tb-brass-dim), var(--tb-brass-dim)) top left / 2px 14px no-repeat,
    linear-gradient(var(--tb-brass-dim), var(--tb-brass-dim)) top right / 14px 2px no-repeat,
    linear-gradient(var(--tb-brass-dim), var(--tb-brass-dim)) top right / 2px 14px no-repeat,
    linear-gradient(var(--tb-brass-dim), var(--tb-brass-dim)) bottom left / 14px 2px no-repeat,
    linear-gradient(var(--tb-brass-dim), var(--tb-brass-dim)) bottom left / 2px 14px no-repeat,
    linear-gradient(var(--tb-brass-dim), var(--tb-brass-dim)) bottom right / 14px 2px no-repeat,
    linear-gradient(var(--tb-brass-dim), var(--tb-brass-dim)) bottom right / 2px 14px no-repeat;
}

.tb-title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e6dac2;
}

/* Buttons: plain wood, and the brass-lit primary action. */
.tb-btn,
.tb-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-sizing: border-box;
  min-height: 40px;
  padding: 0 22px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 3px;
  user-select: none;
}
.tb-btn {
  background: linear-gradient(180deg, #2c241c 0%, #201a14 100%);
  border: 1px solid #5a4a36;
  color: var(--tb-cream);
}
.tb-btn:hover { border-color: var(--tb-brass-dim); color: var(--tb-cream-hi); }
.tb-btn-primary {
  background: linear-gradient(180deg, #5a4428 0%, #3a2c1b 100%);
  border: 1.5px solid var(--tb-brass);
  box-shadow: var(--tb-glow);
  color: var(--tb-brass-text);
  font-weight: 700;
}
.tb-btn-primary:hover { filter: brightness(1.08); }
.tb-btn:disabled,
.tb-btn-primary:disabled { opacity: 0.45; cursor: default; filter: none; }

/* List rows and tabs share one active state: brass border, warm fill. */
.tb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  box-sizing: border-box;
  min-height: 46px;
  padding: 0 16px 0 10px;
  background: var(--tb-row);
  border: 1px solid var(--tb-row-border);
  color: #e2d6bd;
  cursor: pointer;
}
.tb-row:hover { border-color: #4a3d2e; }
.tb-row.is-active { background: var(--tb-row-active); border-color: var(--tb-row-active-border); color: var(--tb-cream-hi); }

.tb-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  background: var(--tb-row);
  border: 1px solid var(--tb-row-border);
  color: #cfc2a8;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
}
.tb-tab.is-active {
  background: linear-gradient(180deg, #46361f 0%, #2e2416 100%);
  border: 1.5px solid var(--tb-brass);
  box-shadow: 0 0 12px rgba(232, 163, 62, 0.4);
  color: var(--tb-brass-text);
}

/* A key cap, e.g. [E] Trade. */
.tb-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  box-sizing: border-box;
  border: 1.5px solid #d4c8b0;
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--tb-cream-hi);
  background: rgba(20, 16, 12, 0.5);
}

/* Gold coin, drawn in CSS so it needs no asset. */
.tb-coin {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 50%;
  background: radial-gradient(circle, #e2a93a 0 45%, #fbe08a 46% 55%, #e2a93a 56% 100%);
}

/* Class badge on shop rows. */
.tb-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tb-badge.cls-warrior { background: #5a2a22; color: #f4d6cc; }
.tb-badge.cls-archer { background: #2b4a2a; color: #d5f0cf; }
.tb-badge.cls-artisan { background: #5a4722; color: #f5e6c4; }
.tb-badge.cls-all { background: #3a3a3a; color: #e6e6e6; }
