/* Shared panel, button and row primitives. The established tb-* class names
   remain stable for game code; their paint follows the main menu. */

:root {
  --tb-bg-1: #202527;
  --tb-bg-2: var(--ui-well);
  --tb-border: var(--ui-border);
  --tb-rule: var(--ui-rule);
  --tb-row: #24292c;
  --tb-row-border: var(--ui-rule);
  --tb-row-active: var(--ui-selected);
  --tb-row-active-border: var(--ui-gold);
  --tb-brass: var(--ui-gold);
  --tb-brass-text: var(--ui-gold-text);
  --tb-brass-dim: #a18b5d;
  --tb-cream: var(--ui-text);
  --tb-cream-hi: var(--ui-text-hi);
  --tb-muted: var(--ui-muted);
  --tb-faint: var(--ui-faint);
  --tb-good: var(--ui-good);
  --tb-glow: var(--ui-gold-shadow);
  --tb-font-title: var(--ui-font-display);
}

/* Same charcoal surface and frame as a menu card. */
.tb-panel {
  position: relative;
  box-sizing: border-box;
  background: var(--ui-surface);
  border: var(--ui-border-width) solid var(--tb-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  color: var(--tb-cream);
  font-family: var(--font-body);
}

/* Rounded menu frames replace the old decorative corner brackets. */
.tb-corners::before {
  content: none;
}

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

/* Quiet secondary buttons and a gold 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-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: var(--ui-radius-sm);
  user-select: none;
}
.tb-btn {
  background: #262b2d;
  border: 1px solid var(--ui-border-hi);
  color: var(--tb-cream);
}
.tb-btn:hover { border-color: var(--tb-brass-dim); color: var(--tb-cream-hi); }
.tb-btn-primary {
  background: var(--ui-gold-fill);
  border: var(--ui-border-width) solid var(--ui-gold-edge);
  border-radius: var(--ui-radius);
  box-shadow: var(--tb-glow);
  color: #10110e;
  font-weight: 700;
}
.tb-btn-primary:hover:not(:disabled) { filter: brightness(1.12); }
.tb-btn:disabled,
.tb-btn-primary:disabled { opacity: 0.45; cursor: default; filter: none; }

/* List rows and tabs share the menu's selected state. */
.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);
  border-radius: var(--ui-radius-sm);
  color: var(--ui-text);
  cursor: pointer;
}
.tb-row:hover { border-color: var(--ui-border-hi); }
.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);
  border-radius: var(--ui-radius-sm);
  color: var(--ui-muted);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
}
.tb-tab.is-active {
  background: var(--ui-selected);
  border: 1.5px solid var(--tb-brass);
  box-shadow: inset 0 -2px 0 var(--ui-gold);
  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: 1px solid var(--ui-border-hi);
  border-bottom-width: 3px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--tb-cream-hi);
  background: #262b2de6;
}

/* 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; }
