/* Historische Schmuck Galerie · Goldwaage
   Feinwaage auf dunklem Samt, Tablett mit Stücken, Rechner. Bewegung nur über transform und opacity. */

.wg { display: grid; gap: var(--r4); align-items: start; }
.wg-szene { min-width: 0; }

/* ---------- Bühne ---------- */
.wg-tisch { --seite: 1.25; position: relative; width: min(100%, calc(60svh * var(--seite))); aspect-ratio: var(--seite); margin-inline: auto; isolation: isolate;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.wg-samt { position: absolute; inset: -4% -6% -6%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 42% 30% at 30% 34%, rgba(255, 222, 170, .07), transparent 70%),
    url("../bilder/textur/rauschen-samt.png"),
    radial-gradient(ellipse 58% 54% at 47% 50%, #2a4636 0%, #1f382b 34%, #172a20 60%, #15251c 100%);
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); }
.wg-gerät { position: absolute; inset: 0; pointer-events: none; }
.wg-gerät svg, .wg-gerät img { width: 100%; height: 100%; object-fit: contain; }
.wg-druck { font-family: var(--text-font); font-weight: 750; font-size: 19px; letter-spacing: 2.4px; fill: #b3ada1; }

/* Schale: Box so breit wie die Schale, Mitte = Mitte der Schalenfläche */
.wg-schale { position: absolute; z-index: 2; left: calc((var(--sx) - var(--sb) / 2) * 100%); top: calc(var(--sy) * 100%); width: calc(var(--sb) * 100%);
  aspect-ratio: 1; margin-top: calc(var(--sb) * -50%); pointer-events: none; }
.wg-senk { position: absolute; inset: 0; }
.wg-schale-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wg-stapel { position: absolute; inset: 0; }
.wg-auf { position: absolute; display: flex; align-items: flex-end; min-height: 44px; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; transform-origin: 50% 100%;
  will-change: transform; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.wg-auf img { position: relative; width: 100%; height: auto; pointer-events: none; }
.wg-auf.weg { pointer-events: none; }
.wg-auf-schatten { position: absolute; left: 6%; right: -2%; bottom: -5%; height: 26%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0)); }
.wg-mehr { position: absolute; z-index: 80; right: -3%; top: 40%; min-width: 34px; height: 30px; padding: 0 9px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold-hell); color: var(--stein); font-weight: 800; font-size: .9rem; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .7); }

/* Display: Fenster über die Lage-Konstanten, Segmente leuchten wie das LCD im Hero */
.wg-display { position: absolute; z-index: 3; left: calc((var(--dx) - var(--db) / 2) * 100%); top: calc(var(--dy) * 100%); width: calc(var(--db) * 100%);
  transform: translateY(-50%) rotate(var(--dd, 0deg)); pointer-events: none; }
.wg-display-svg { width: 100%; height: auto; overflow: visible; }
.wg-seg { fill: rgba(221, 242, 230, .065); }
.wg-seg.an { fill: #DDF2E6; }
.wg-einheit { font-family: var(--text-font); font-weight: 750; font-size: 30px; }

/* ---------- Tablett ---------- */
.wg-tablett { position: relative; margin-top: var(--r3); display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 10px;
  border-radius: 10px; border: 1px solid rgba(216, 184, 120, .26);
  background: radial-gradient(ellipse 80% 120% at 30% 0%, #24402F, #18291F 70%);
  box-shadow: inset 0 2px 14px rgba(0, 0, 0, .55), 0 18px 34px -24px rgba(0, 0, 0, .9); }
.wg-fach { position: relative; display: grid; grid-template-rows: 70px auto; gap: 6px; justify-items: center; align-items: end; min-width: 0; min-height: 108px; padding: 10px 4px 9px;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--hell); cursor: pointer; text-align: center;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: background-color .25s, border-color .25s; }
.wg-fach:hover { background: rgba(216, 184, 120, .07); }
.wg-fach-bild { position: relative; width: 100%; height: 70px; display: grid; place-items: center; }
.wg-fach-bild img { max-width: 100%; max-height: 70px; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .45));
  transition: opacity .2s, transform .35s var(--aus-quart); }
.wg-fach:active .wg-fach-bild img { transform: scale(.95); }
.wg-mulde { position: absolute; left: 14%; right: 14%; top: 34%; bottom: 8%; border-radius: 50%; opacity: 0; transition: opacity .3s;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .42), rgba(0, 0, 0, .15) 70%, rgba(0, 0, 0, 0));
  box-shadow: inset 0 -1px 0 rgba(216, 184, 120, .12); }
.wg-fach-name { font-size: .88rem; font-weight: 650; line-height: 1.2; color: var(--hell-2); max-width: 100%; -webkit-hyphens: auto; hyphens: auto; }
.wg-fach.leer .wg-fach-bild img { opacity: 0; transition: opacity .12s; }
.wg-fach.leer .wg-mulde { opacity: 1; }
.wg-fach[aria-pressed="true"] { border-color: rgba(216, 184, 120, .3); }
.wg-fach[aria-pressed="true"] .wg-fach-name { color: var(--gold-hell); }

/* ---------- Rechner ---------- */
.wg-rechner { display: grid; gap: var(--r4); padding: clamp(20px, 2.6vw, 34px); background: var(--stein); border: 1px solid rgba(216, 184, 120, .2); border-radius: 6px; min-width: 0; }
.wg-ergebnis { display: grid; gap: 6px; }
.wg-ergebnis-titel, .wg-auflage-kopf, .wg-feld-titel { font-weight: 750; font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-hell); margin: 0; }
.wg-summe { font-family: var(--antiqua); font-size: clamp(2.7rem, 5.2vw, 4rem); line-height: 1; color: var(--gold-hell); white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum", "lnum"; }
.wg-summe-euro { font-size: .72em; }
.wg-kurs { color: var(--hell-3); }
.wg-kurs span { white-space: nowrap; }

.wg-auflage { display: grid; gap: 10px; }
.wg-auflage-kopf { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wg-auflage-kopf .ziffern { color: var(--hell-3); letter-spacing: .02em; text-transform: none; font-weight: 650; font-size: .9rem; }
.wg-leer { color: var(--hell-2); font-size: .98rem; padding: 14px 16px; border: 1px dashed rgba(216, 184, 120, .3); border-radius: var(--ecke); }
.wg-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wg-posten { border: 1px solid rgba(216, 184, 120, .16); border-radius: var(--ecke); background: var(--eisen); transition: border-color .25s; }
.wg-posten.offen { border-color: rgba(216, 184, 120, .42); }
.wg-posten-kopf { width: 100%; min-height: 58px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 14px 8px 10px;
  border: 0; background: transparent; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wg-mini { width: 44px; height: 36px; object-fit: contain; }
.wg-posten-name { display: grid; font-weight: 700; font-size: 1.02rem; line-height: 1.25; min-width: 0; }
.wg-posten-name small { font-weight: 550; font-size: .88rem; color: var(--hell-3); }
.wg-posten-wert { font-weight: 750; color: var(--hell); white-space: nowrap; }
.wg-ed { display: grid; gap: 16px; padding: 6px 14px 10px; }
.wg-feld { display: grid; gap: 10px; }
.wg-feld-titel { font-size: .72rem; color: var(--hell-3); }
.wg-chips { gap: 6px; }
.wg-chip { min-width: 54px; justify-content: center; padding: 0 12px; font-size: 1rem; touch-action: manipulation; }
.wg-stempel-text { color: var(--hell-3); }
.wg-gewicht { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; gap: 8px; align-items: stretch; max-width: 340px; }
.wg-tick { min-height: 52px; border-radius: var(--ecke); border: 1px solid rgba(216, 184, 120, .4); background: transparent; color: var(--gold-hell); display: grid; place-items: center; cursor: pointer;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; transition: background-color .2s, transform .15s; }
.wg-tick:hover { background: rgba(216, 184, 120, .1); }
.wg-tick:active { transform: scale(.95); background: rgba(216, 184, 120, .16); }
.wg-tick .ic { width: 22px; height: 22px; }
.wg-zahlfeld { display: flex; align-items: center; gap: 6px; padding: 0 14px; min-height: 52px; border-radius: var(--ecke); background: var(--stein); border: 1px solid rgba(237, 230, 216, .22); }
.wg-zahlfeld:focus-within { border-color: var(--gold-hell); }
.wg-zahlfeld input { flex: 1; align-self: stretch; min-width: 0; width: 100%; min-height: 50px; border: 0; background: transparent; color: var(--hell); font-family: var(--text-font); font-weight: 700; font-size: 1.2rem; text-align: right; padding: 0; outline: none; }
.wg-zahlfeld span { color: var(--hell-2); font-weight: 650; }

/* Feinregler: Strichskala wie am Messschieber */
.wg-regler { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.wg-regler::-webkit-slider-runnable-track { height: 14px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, rgba(216, 184, 120, .5) 0 1px, transparent 1px 8px) center / 100% 8px no-repeat, linear-gradient(rgba(216, 184, 120, .25), rgba(216, 184, 120, .25)) center bottom / 100% 1px no-repeat; }
.wg-regler::-moz-range-track { height: 14px; background: repeating-linear-gradient(90deg, rgba(216, 184, 120, .5) 0 1px, transparent 1px 8px) center / 100% 8px no-repeat; }
.wg-regler::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -6px; border-radius: 50%; background: var(--gold-hell); border: 3px solid var(--stein); box-shadow: 0 0 0 1px var(--gold-hell), 0 4px 10px rgba(0, 0, 0, .5); }
.wg-regler::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--gold-hell); border: 3px solid var(--stein); box-shadow: 0 0 0 1px var(--gold-hell); }
.wg-ab { justify-self: start; min-height: 44px; padding: 0; border: 0; background: none; color: var(--hell-2); font-weight: 650; font-size: .95rem; cursor: pointer;
  text-decoration: underline; text-decoration-color: rgba(237, 230, 216, .35); text-underline-offset: 4px; }
.wg-ab:hover { color: var(--hell); }

.wg-hinweise { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wg-hinweise li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; font-size: .95rem; line-height: 1.5; color: var(--hell-2); }
.wg-hinweise .ic { width: 20px; height: 20px; margin-top: 2px; color: var(--gold-hell); }
.wg-hinweise b { color: var(--hell); font-weight: 700; }

.wg-abschluss { display: grid; gap: 10px; padding-top: var(--r3); border-top: 1px solid rgba(216, 184, 120, .16); }
.wg-knöpfe .knopf { flex: 1 1 auto; }
.wg-zusage { color: var(--hell-3); }
.waage-hinweis { margin-top: var(--r4); max-width: 52rem; }

/* ---------- Breite: Waage groß links, Rechner rechts ---------- */
@media (min-width: 960px) {
  .wg { grid-template-columns: minmax(0, 1.2fr) minmax(360px, 1fr); gap: var(--r5); }
  /* Waage bleibt beim Einstellen im Blick: kurzer Weg innerhalb des Abschnitts, kleiner als eine Bildschirmhöhe */
  .wg-szene { position: sticky; top: calc(var(--kopf-h) + 20px); container-type: inline-size; }
  /* schmale Waagenspalte (Laptop, Tablet quer): Tablett in zwei Reihen */
  @container (max-width: 620px) { .wg-tablett { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .wg-tisch { width: min(100%, calc((100svh - var(--kopf-h) - 230px) * var(--seite))); }
}

/* ---------- Handy und Tablet hochkant: Waage oben, Tablett als Leiste, Rechner darunter ---------- */
@media (max-width: 959px) {
  .wg { gap: var(--r3); }
  .wg-szene { margin-inline: calc(-1 * var(--rand)); }
  .wg-samt { inset: -2% 0 -4%; }
  .wg-tablett { display: flex; gap: 8px; margin-top: var(--r2); padding: 10px var(--rand); border-radius: 0; border-width: 1px 0;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--rand); scrollbar-width: none; }
  .wg-tablett::-webkit-scrollbar { display: none; }
  .wg-tablett::after { content: ""; flex: 0 0 1px; }
  .wg-fach { flex: 0 0 min(124px, max(88px, calc((100vw - var(--rand)) / 3.5 - 8px))); scroll-snap-align: start; min-height: 104px; grid-template-rows: 64px auto; }
  .wg-fach-bild { height: 64px; }
  .wg-fach-bild img { max-height: 64px; }
}
@media (max-width: 560px) {
  .wg-rechner { padding: 20px 16px; gap: var(--r3); }
  .wg-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .wg-chip { min-width: 0; padding: 0 4px; }
  .wg-knöpfe { display: grid; }
  .wg-ed { padding: 4px 12px 12px; }
  .wg-posten-kopf { padding-right: 12px; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .wg-fach-bild img, .wg-mulde { transition: none; }
}
