/* ---------- Rechte Spalte: der Laden als „ruhige Bühne“ (A-180) ----------
   Eine schmale Kopfzeile (die Laden-Reiter), darunter das Upgrade-Regal mit einer leisen Filterzeile,
   eine einzeilige Kauf-Leiste und die Liste. Kein Titel – nur in der Sakristei steht oben „Schneider“. */

/* Titel nur noch als Kopf in der Sakristei (sakristei-ui.js setzt den Text) */
.store-title { display: none; }
body.sk-offen #right .store-title {
  display: block; margin: 0; padding: 9px 10px 8px; text-align: center;
  font-family: var(--pix); font-size: 11px; letter-spacing: 1px; color: var(--gold);
  background: #1e1109; border-bottom: 2px solid var(--gold-d); text-shadow: 1px 1px 0 #000;
}

/* --- Kopfzeile: Laden-Reiter als einzeilige Segment-Leiste --- */
#storeTabs {
  flex: none; position: relative; display: flex; gap: 0; height: 36px; padding: 0 2px;
  background: #1e1109; border-bottom: 2px solid var(--gold-d);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
#storeTabs::-webkit-scrollbar { display: none; }
/* Schatten am Rand, wenn es seitwärts weitergeht (laden.js: UI.tabsRand) */
#storeTabs::before, #storeTabs::after { content: ''; position: sticky; z-index: 2; flex: none; width: 22px; pointer-events: none; opacity: 0; transition: opacity .15s; }
#storeTabs::before { left: 0; margin-right: -22px; background: linear-gradient(90deg, #1e1109 30%, transparent); }
#storeTabs::after { right: 0; margin-left: -22px; background: linear-gradient(270deg, #1e1109 30%, transparent); }
#storeTabs.mehr-l::before, #storeTabs.mehr-r::after { opacity: 1; }
#storeTabs button {
  flex: none; margin: 0 auto; position: relative; display: flex; align-items: center; justify-content: center; gap: 3px; /* Auto-Ränder: verteilt, solange Platz ist */
  padding: 0 4px; white-space: nowrap; font-size: 13px; color: var(--muted);
  background: none; border: none; box-shadow: none;
}
#storeTabs button.on { color: var(--gold-l); box-shadow: inset 0 -3px 0 var(--gold); }
#storeTabs button.locked { color: #8a6c50; }
#storeTabs button.locked::before { content: '🔒'; font-size: 10px; filter: grayscale(.4); }
#storeTabs button.locked.on { color: var(--muted); box-shadow: inset 0 -3px 0 #8a6c50; }
#storeTabs .cnt { position: absolute; top: 3px; right: 0; min-width: 13px; padding: 0 3px; font-size: 10px; line-height: 13px; text-align: center; color: #fff; background: var(--red); border-radius: 7px; }
#storeTabs .cnt:empty { display: none; }
#storeTabs button:has(.cnt:not(:empty)) { padding-right: 10px; }

/* --- Upgrade-Regal: leise Filterzeile, darunter das Raster --- */
#upgradeFilters { flex: none; display: flex; flex-wrap: nowrap; align-items: center; gap: 1px; padding: 7px 8px 3px; overflow-x: auto; scrollbar-width: none; }
#upgradeFilters::-webkit-scrollbar { display: none; }
#upgradeFilters.leer { display: none; }
#upgradeFilters .sep { flex: 1; }
#upgradeFilters .chip {
  flex: none; padding: 1px 6px; font-size: 14px; line-height: 18px; color: #a08a6c;
  background: none; border: 1px solid transparent; font-weight: 400;
}
#upgradeFilters .chip[data-f].on { color: var(--gold-l); background: rgba(244,194,60,.12); border-color: rgba(244,194,60,.45); }
#upgradeFilters .chip.buyall, #upgradeFilters .chip.auto { margin-left: 4px; color: #c4ef7e; border-color: rgba(95,174,58,.6); background: rgba(95,174,58,.14); }
#upgradeFilters .chip.auto { padding: 1px 4px; }
#upgradeFilters .chip.auto:not(.on) { color: #a08a6c; border-color: #4a2c16; background: none; }
#upgrades {
  flex: none; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px;
  padding: 4px 8px 9px; max-height: 32vh; min-height: 62px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--wood-l) transparent;
  border-bottom: 2px solid #140a05;
}
#upgrades .up { width: 56px; height: 56px; border-width: 2px; }
.up.up-more {
  display: grid; place-items: center; font-family: var(--pix); font-size: 11px; color: var(--gold);
  background: none; border: 2px dashed rgba(244,194,60,.4); box-shadow: none; cursor: pointer; opacity: 1; filter: none;
}
.up-empty { padding: 10px 2px; font-size: 14px; }

/* --- Kauf-Leiste: eine Zeile, klein --- */
#buyBar { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: #1e1109; border-bottom: 1px solid #0e0703; }
#buyBar .sep { flex: 1; }
#buyBar .seg { display: inline-flex; border: 1px solid #4a2c16; }
#buyBar button {
  padding: 2px 9px; font-size: 14px; line-height: 18px; color: #a08a6c;
  background: none; border: none; font-weight: 400;
}
#buyBar .seg button + button { border-left: 1px solid #4a2c16; }
#buyBar .seg button.on { color: var(--ink); background: var(--gold); }
#buyBar .sell-tg, #buyBar .auto { border: 1px solid #4a2c16; }
#buyBar .sell-tg.on { color: #fff; background: var(--red); border-color: #ff6a5a; }
#buyBar .auto.on { color: #c4ef7e; background: rgba(95,174,58,.14); border-color: rgba(95,174,58,.6); }
#right.verkauf #buildings { box-shadow: inset 0 2px 0 var(--red); }

/* --- Liste: ruhiger, Preis und Anzahl klar --- */
.bld {
  grid-template-columns: 52px 1fr auto auto; gap: 10px; min-height: 62px; padding: 4px 12px 4px 8px;
  background: linear-gradient(90deg, #4a2e17, #36210f); border-bottom: 1px solid #140a05; box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.bld-main { min-width: 0; }
.bld-name { font-size: 17px; text-shadow: 1px 1px 0 #000; }
.bld-price { margin-top: 1px; font-size: 15px; }
.bld-st { margin-right: 0; }
.bld-own { min-width: 2ch; font-size: 13px; text-align: right; color: var(--gold-l); opacity: .7; text-shadow: 1px 1px 0 #000; }
.bld-own:empty { min-width: 0; }
.bld.can .bld-own { opacity: .9; }
@media (hover: hover) {
  .bld.can:hover { background: linear-gradient(90deg, #64401f, #472b14); }
}

/* --- Handy hochkant: dieselbe Ordnung, nur fingerfreundlicher --- */
@media (max-width: 900px) {
  #storeTabs { height: 42px; }
  #storeTabs button { padding: 0 10px; font-size: 16px; }
  #storeTabs .cnt { top: 4px; }
  #upgradeFilters { padding: 8px 8px 4px; }
  #upgradeFilters .chip { padding: 4px 8px; font-size: 15px; }
  #upgrades { max-height: 30vh; }
  #buyBar { padding: 6px 8px; }
  #buyBar button { padding: 6px 12px; font-size: 15px; }
  .bld { min-height: 60px; }
}

/* --- Handy quer: Reiter oben über die ganze Breite, darunter Upgrades | Liste --- */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  #right { display: grid; grid-template-columns: 1fr 1.25fr; grid-template-rows: auto auto 1fr; }
  #storeTabs { grid-column: 1 / -1; grid-row: 1; height: 36px; }
  #storeTabs button { font-size: 15px; }
  #upgradeFilters { grid-column: 1; grid-row: 2; }
  #upgrades { grid-column: 1; grid-row: 3; max-height: none; min-height: 0; border-bottom: none; border-right: 2px solid #140a05; }
  #upgradeFilters.leer + #upgrades { grid-row: 2 / span 2; }
  #buyBar { grid-column: 2; grid-row: 2; }
  #buildings { grid-column: 2; grid-row: 3; min-height: 0; }
  #juenger, .store-list { grid-column: 2; grid-row: 2 / span 2; min-height: 0; }
  #buyBar button { padding: 4px 10px; }
  .bld { min-height: 52px; }
}
