:root {
  --ink: #2b2a33;
  --panel: rgba(255, 252, 245, 0.94);
  --panel-line: rgba(60, 50, 40, 0.14);
  --accent: #a8384f;
  --accent-dark: #7a2438;
  --muted: #6d6a73;
  --chip: rgba(40, 36, 48, 0.72);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #c4e3f0; color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior: none;
}
#app { position: fixed; inset: 0; height: 100dvh; overflow: hidden; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
.topbar {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; align-items: center; gap: 8px;
  padding: calc(8px + var(--safe-t)) calc(10px + var(--safe-r)) 8px calc(10px + var(--safe-l));
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.spacer { flex: 1; pointer-events: none !important; }
.brand {
  display: flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--panel-line);
  padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.logo { font-size: 17px; }
.chip {
  background: var(--chip); color: #fff; border-radius: 999px;
  padding: 5px 11px; font-size: 13px; font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}
.iconbtn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--panel-line);
  background: var(--panel); font-size: 19px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.iconbtn:active { transform: scale(0.94); }
.hint {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + var(--safe-b)); max-width: calc(100% - 24px);
  background: var(--chip); color: #fff; font-size: 13px; text-align: center;
  padding: 7px 14px; border-radius: 12px; transition: opacity 0.8s;
  pointer-events: none !important;
}
.hint.fade { opacity: 0; }

/* ---------- Panels ---------- */
.panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 24px)); max-height: calc(100% - 40px); overflow: auto;
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 18px;
  padding: 16px 18px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.panel[hidden], .chip[hidden] { display: none; }
.panel h2 { margin: 0 0 12px; font-size: 19px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; font-size: 15px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--panel-line); border-radius: 10px; overflow: hidden; }
.seg button {
  border: 0; background: transparent; padding: 7px 11px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink);
}
.seg button + button { border-left: 1px solid var(--panel-line); }
.seg button.on { background: var(--accent); color: #fff; font-weight: 600; }
.small { font-size: 12.5px; color: var(--muted); min-height: 1em; margin: 6px 0 12px; }
.btn {
  display: block; width: 100%; border: 0; border-radius: 12px; padding: 11px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 3px 0 var(--accent-dark);
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-dark); }

/* ---------- Laden ---------- */
#loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: #c4e3f0; color: var(--ink); font-size: 15px; text-align: center; padding: 20px; transition: opacity 0.4s;
}
#loading.done { opacity: 0; pointer-events: none; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 4px solid rgba(0, 0, 0, 0.12); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 380px) {
  .brand { font-size: 13px; padding: 5px 10px; }
  .row { font-size: 14px; }
  .seg button { padding: 6px 8px; font-size: 13px; }
}

/* ---------- Geld ---------- */
.money {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 999px;
  padding: 6px 14px; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); color: #2d6a32;
}
.money.bump { animation: bump 0.25s ease-out; }
@keyframes bump { 50% { transform: scale(1.12); } }
@media (max-width: 640px) { .brand span:not(.logo) { display: none; } }

/* ---------- Ziel / Anleitung ---------- */
.goal {
  position: absolute; left: 50%; transform: translateX(-50%); top: calc(62px + var(--safe-t));
  background: var(--panel); border: 2px solid var(--accent); border-radius: 14px; padding: 7px 14px;
  font-weight: 700; font-size: 15px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15); white-space: nowrap;
  max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; pointer-events: none !important;
}
.goal[hidden] { display: none; }
.goal::before { content: '➜ '; color: var(--accent); }

/* ---------- Joystick ---------- */
.joy {
  position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.22); border: 3px solid rgba(255, 255, 255, 0.6);
  pointer-events: none !important; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
.joy[hidden] { display: none; }
.knob {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.85); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ---------- Meldungen & Geld-Popups ---------- */
.toast {
  position: absolute; left: 50%; top: calc(108px + var(--safe-t) + var(--ucH, 0px)); transform: translateX(-50%);
  background: #2d6a32; color: #fff; padding: 8px 16px; border-radius: 12px; font-size: 15px; font-weight: 700;
  pointer-events: none !important; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  width: max-content; max-width: calc(100% - 24px); text-align: center;
}
.toast[hidden] { display: none; }
#popups { position: absolute; inset: 0; pointer-events: none !important; overflow: hidden; }
.pop {
  position: absolute; transform: translate(-50%, -50%); font-weight: 800; font-size: 16px; color: #2d6a32;
  text-shadow: 0 1px 0 #fff, 0 0 6px rgba(255, 255, 255, 0.9); animation: popup 1.1s ease-out forwards; white-space: nowrap;
}
@keyframes popup { from { opacity: 1; margin-top: 0; } 70% { opacity: 1; } to { opacity: 0; margin-top: -40px; } }
.maxlabel {
  position: absolute; transform: translate(-50%, -100%); background: #b8372c; color: #fff; font-weight: 800; font-size: 12px;
  padding: 2px 7px; border-radius: 7px; pointer-events: none !important;
}
.maxlabel[hidden] { display: none; }
.ghostbtn { background: #fff; color: #b8372c; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12); margin-bottom: 10px; border: 1px solid var(--panel-line); }
@media (orientation: landscape) and (max-height: 500px) {
  .goal { font-size: 13px; padding: 5px 12px; top: calc(56px + var(--safe-t)); }
  .toast { top: calc(96px + var(--safe-t) + var(--ucH, 0px)); font-size: 13px; }
  .ucard { top: calc(96px + var(--safe-t)); }
}

/* ---------- Hauptmenü ---------- */
.menu {
  position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(30, 28, 40, 0.15), rgba(30, 28, 40, 0.55));
  padding: calc(12px + var(--safe-t)) 16px calc(12px + var(--safe-b));
}
.menu[hidden] { display: none; }
.menucard {
  width: min(380px, 100%); max-height: 100%; overflow: auto; text-align: center;
  background: var(--panel); border-radius: 22px; padding: 18px 20px 14px; box-shadow: 0 14px 50px rgba(0, 0, 0, 0.3);
  animation: menuIn 0.45s ease-out;
}
@keyframes menuIn { from { transform: translateY(20px) scale(0.96); opacity: 0; } }
.menulogo { font-size: 46px; line-height: 1; }
.menucard h1 { margin: 4px 0 2px; font-size: 26px; letter-spacing: 0.3px; }
.tagline { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.btn.big { font-size: 19px; padding: 14px; }
.menurow { display: flex; gap: 8px; margin: 10px 0; }
.btn2 {
  flex: 1; border: 1px solid var(--panel-line); background: #fff; border-radius: 12px; padding: 10px 6px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.kofi {
  display: block; margin: 6px 0 4px; padding: 9px 10px; border-radius: 12px; background: #fff3e0; color: #8a4b00;
  font-size: 13.5px; font-weight: 600; text-decoration: none; border: 1px solid #f6d3a5;
}
.kofi:hover { background: #ffe7c4; }
.ver { font-size: 11px; color: var(--muted); margin-top: 6px; }
/* Android-App (body.native): keine Hinweise auf RoTronik, kein Ko-fi, kein Vollbild-Knopf */
.native .kofi, .native .promo, .native #btnFull { display: none !important; }
.adbonus { display: block; margin: 8px auto 0; }
.panel { z-index: 10; }
.credits { font-size: 13.5px; line-height: 1.45; margin-bottom: 12px; }
.credits p { margin: 0 0 8px; }
.credits a { color: var(--accent-dark); }
@media (orientation: landscape) and (max-height: 500px) {
  .menucard { padding: 10px 16px 8px; }
  .menulogo { font-size: 30px; }
  .menucard h1 { font-size: 21px; }
  .tagline { margin-bottom: 8px; }
  .btn.big { padding: 10px; font-size: 17px; }
  .menurow { margin: 6px 0; }
}

/* ---------- Info-Karte (in der Nähe einer Maschine / eines Kauf-Felds) ---------- */
.near {
  position: absolute; left: calc(10px + var(--safe-l)); bottom: calc(12px + var(--safe-b));
  max-width: min(330px, calc(100% - 20px)); background: var(--panel); border: 1px solid var(--panel-line); border-radius: 12px;
  padding: 7px 11px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14); font-size: 13px; pointer-events: none !important;
  display: flex; flex-direction: column; gap: 1px; animation: nearIn 0.2s ease-out;
}
.near[hidden] { display: none; }
.near b { font-size: 14px; }
#nearState { color: var(--muted); font-size: 12px; }
#nearState.bad { color: #b8372c; font-weight: 600; }
#nearState.good { color: #2d6a32; font-weight: 600; }
@keyframes nearIn { from { opacity: 0; transform: translateY(6px); } }
@media (orientation: portrait) { .near { bottom: calc(70px + var(--safe-b)); } }

/* ---------- Erfolge ---------- */
.stats { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 4px 10px; font-size: 13px; background: rgba(0,0,0,0.04); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
.stats b { font-variant-numeric: tabular-nums; text-align: right; }
.achlist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.ach { display: grid; grid-template-columns: 34px 1fr auto; gap: 2px 8px; align-items: center; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--panel-line); background: #fff; }
.ach .ai { font-size: 22px; text-align: center; grid-row: span 3; }
.ach .an { font-weight: 700; font-size: 14px; }
.ach .ad { font-size: 12px; color: var(--muted); grid-column: 2; }
.ach .ar { font-size: 12px; font-weight: 700; color: #2d6a32; grid-row: span 3; text-align: right; }
.ach .ab { grid-column: 2; height: 4px; background: rgba(0,0,0,0.08); border-radius: 2px; overflow: hidden; }
.ach .ab > i { display: block; height: 100%; background: var(--accent); }
.ach.done { background: #f0f8ee; border-color: #bfe0b8; }
@media (max-width: 420px) { .stats { grid-template-columns: 1fr auto; } }

/* ---------- Rand-Pfeil zum Ziel außerhalb des Bildschirms ---------- */
.edge {
  position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25); pointer-events: none !important;
  animation: edgePulse 1s ease-in-out infinite;
}
.edge[hidden] { display: none; }
.edge.gift { background: #5cb85c; }
@keyframes edgePulse { 50% { box-shadow: 0 3px 16px rgba(242, 165, 65, 0.8); } }

/* ---------- Filiale (Neustart mit Bonus) ---------- */
.star { background: #f4cf4a; color: #5a4500; font-weight: 800; }
.star[hidden] { display: none; }
.prtext { font-size: 14px; line-height: 1.45; margin: 0 0 12px; }
#prestigePanel .menurow { align-items: stretch; }
#prestigePanel .btn { flex: 1.3; margin: 0; }

/* ---------- Ladebildschirm & Sprachwahl ---------- */
.loadlogo { font-size: 46px; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-8deg); } }
.loadtitle { font-size: 24px; font-weight: 800; letter-spacing: 0.3px; margin-top: -6px; }
.loadbar { width: min(260px, 70vw); height: 10px; border-radius: 99px; background: rgba(0, 0, 0, 0.1); overflow: hidden; }
.loadbar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width 0.2s; }
#loading .spinner { width: 22px; height: 22px; border-width: 3px; }
.seg.langs { display: grid; grid-template-columns: repeat(3, 1fr); }
.seg.langs button { border-left: 0; padding: 6px 8px; }
.seg.langs button:nth-child(3n + 2), .seg.langs button:nth-child(3n + 3) { border-left: 1px solid var(--panel-line); }
.seg.langs button:nth-child(n + 4) { border-top: 1px solid var(--panel-line); }
.menulangs { width: 100%; margin: 4px 0 8px; font-size: 13px; }
.menulangs button { font-size: 13px; padding: 5px 4px; }
.chip { white-space: nowrap; }
@media (max-width: 380px) {
  .topbar { gap: 5px; padding-left: calc(6px + var(--safe-l)); padding-right: calc(6px + var(--safe-r)); }
  .iconbtn { width: 34px; height: 34px; font-size: 16px; }
  #btnFull { display: none; }   /* sehr schmales Hochformat: kein Platz, Vollbild über Querformat/Start */
  .brand:has(~ #fps:not([hidden])) { display: none; }   /* sehr schmal + FPS-Anzeige: Logo weglassen */
  .money { font-size: 16px; padding: 5px 10px; }
  .chip { font-size: 11.5px; padding: 4px 8px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .seg.langs.menulangs { grid-template-columns: repeat(6, 1fr); margin: 2px 0 6px; }   /* flaches Querformat: eine Zeile */
  .seg.langs.menulangs button { font-size: 11.5px; padding: 4px 2px; border-top: 0 !important; border-left: 1px solid var(--panel-line) !important; }
  .seg.langs.menulangs button:first-child { border-left: 0 !important; }
}

/* ---------- Hauptmenü: Werbung für weitere Spiele ---------- */
.promo { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 5px 6px; margin: 6px 0 2px; font-size: 12px; color: var(--muted); }
.promo a {
  display: inline-block; padding: 4px 9px; border-radius: 999px; background: #eef4f8; border: 1px solid #cfe0ea;
  color: #2b5d7a; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.promo a:hover { background: #ddebf3; }
@media (orientation: landscape) and (max-height: 500px) {
  .promo { margin: 4px 0 0; font-size: 11.5px; }
  .promo a { padding: 3px 8px; }
  .menucard .ver { display: none; }
  .promo > span { display: none; }   /* flaches Querformat: nur die drei Links in einer Zeile */
  .kofi { padding: 6px 10px; margin: 4px 0 2px; }
}
@media (orientation: landscape) and (max-height: 340px) {
  .menulogo, .tagline { display: none; }   /* sehr flache Handys: Platz für Sprachwahl + Links */
}
.flag-at { display: inline-block; width: 18px; height: 12px; vertical-align: -1px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
  background: linear-gradient(#c8102e 0 33.3%, #fff 33.3% 66.6%, #c8102e 66.6%); }   /* Österreich-Fahne (Emoji zeigt Windows nur als „AT“) */


/* ---------- Buschenschank ---------- */
.what { margin: -6px 0 12px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.guests { background: rgba(122, 36, 56, 0.82); }
.guests.busy { background: #c8463a; animation: bump 0.6s ease-in-out infinite; }
.pop.paid { color: #2d6a32; font-size: 18px; }
.pop.angry { color: #b8372c; font-size: 15px; }
.seg.langs { display: inline-flex; }
.menulangs { display: flex !important; }
.menulangs button { flex: 1; }
.menucard h1 { font-family: Georgia, 'Times New Roman', serif; }
.loadtitle { font-family: Georgia, 'Times New Roman', serif; }
.menu { background: radial-gradient(ellipse at center, rgba(40, 24, 20, 0.12), rgba(40, 24, 20, 0.5)); }
.promo a { background: #f6efe6; border-color: #e6d6c2; color: #6a3a24; }
.promo a:hover { background: #efe2d2; }
.kofi { background: #fff3e0; }
.toast { background: #6a2a3a; }
.edge { background: var(--accent); }
@keyframes edgePulse { 50% { box-shadow: 0 3px 16px rgba(168, 56, 79, 0.8); } }
.goal { border-color: var(--accent); }
@media (orientation: landscape) and (max-height: 500px) {
  .what { display: none; }
  .seg.langs.menulangs { grid-template-columns: none; }
}
@media (max-width: 380px) { .guests { display: none; } }

/* ---------- Busgruppe ---------- */
.buscard {
  position: absolute; left: calc(10px + var(--safe-l)); top: calc(58px + var(--safe-t));
  background: var(--panel); border: 2px solid #2f6a9a; border-radius: 12px; padding: 6px 10px 7px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14); font-size: 13.5px; font-weight: 700; min-width: 180px; pointer-events: none !important;
}
.buscard[hidden] { display: none; }
.buscard .bbar { height: 5px; background: rgba(0, 0, 0, 0.08); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.buscard .bbar > i { display: block; height: 100%; width: 0; background: #2f6a9a; transition: width 0.3s; }
.buscard.bumped { animation: bump 0.35s ease-out; }
@media (orientation: portrait) { .buscard { top: calc(104px + var(--safe-t)); } }
@media (orientation: landscape) and (max-height: 500px) { .buscard { top: calc(54px + var(--safe-t)); font-size: 12.5px; padding: 4px 9px 5px; } }

/* ---------- Abladen ---------- */
.dropbtn {
  position: absolute; right: calc(12px + var(--safe-r)); bottom: calc(14px + var(--safe-b));
  width: 58px; height: 58px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(122, 36, 56, 0.88); color: #fff; font-size: 26px; cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25); display: flex; align-items: center; justify-content: center;
}
.dropbtn[hidden] { display: none; }
.dropbtn b { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; border-radius: 11px; background: #fff; color: #7a2438; font-size: 12px; line-height: 22px; padding: 0 5px; }
.dropbtn.full { animation: bump 0.8s ease-in-out infinite; background: #c8463a; }
.dropbtn:active { transform: scale(0.92); }
@media (orientation: portrait) { .dropbtn { bottom: calc(78px + var(--safe-b)); } }

/* ---------- Ruf, Speisekarte, Überblick ---------- */
.rep { background: rgba(40, 36, 48, 0.72); color: #f4cf4a; letter-spacing: 1px; }
.rep i { font-style: normal; color: rgba(255, 255, 255, 0.35); }
#btnView.on { background: #f4cf4a; }
.cardsub { font-size: 12.5px; color: var(--muted); margin: -6px 0 8px; }
.cardlist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.cardlist h3 { margin: 8px 0 2px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.crow { display: grid; grid-template-columns: 30px 1fr auto; gap: 1px 8px; align-items: center; padding: 5px 8px; border-radius: 10px; background: #fff; border: 1px solid var(--panel-line); }
.crow .ci { font-size: 21px; grid-row: span 2; text-align: center; }
.crow .cn { font-weight: 700; font-size: 14px; }
.crow .cp { font-weight: 800; color: #2d6a32; font-size: 14px; text-align: right; }
.crow .cr { font-size: 12px; color: var(--muted); grid-column: 2 / 4; }
.crow.off { opacity: 0.5; }
.crow.idle .cp::after { content: ' ·'; }
@media (max-width: 420px) { .topbar #btnCard, .topbar #btnView { width: 34px; height: 34px; font-size: 16px; } }
@media (max-width: 380px) { .rep { display: none; } }

/* ---------- Weinlesefest ---------- */
.festcard { border-color: #e0a020; background: #fff6dc; }
.festcard .bbar > i { background: #e0a020; }
.buscard + .buscard, .festcard:not([hidden]) ~ .buscard { top: calc(104px + var(--safe-t)); }
@media (orientation: portrait) { .festcard:not([hidden]) ~ .buscard { top: calc(150px + var(--safe-t)); } }
/* ---------- Garderobe ---------- */
.wardrobe { top: auto; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); max-height: 58%; }
.wardrobe h3 { margin: 10px 0 6px; font-size: 14px; color: var(--muted); }
.wgrid { display: flex; flex-wrap: wrap; gap: 6px; }
.witem { min-width: 58px; border: 2px solid var(--panel-line); background: #fff; border-radius: 12px; padding: 5px 6px 4px; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.witem .wi { font-size: 22px; line-height: 1.1; }
.witem .wp { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.witem.owned .wp { color: #2d6a32; }
.witem.on { border-color: var(--accent); background: #fff0f2; }
.witem.poor { opacity: 0.5; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(0,0,0,0.15); }
@media (orientation: landscape) and (max-height: 500px) {
  .wardrobe { left: auto; right: calc(10px + var(--safe-r)); transform: none; width: min(380px, 55%); max-height: calc(100% - 20px); bottom: 10px; }
  .witem { min-width: 50px; padding: 3px 4px; } .witem .wi { font-size: 18px; }
}
@media (max-width: 400px) { .topbar #btnLook { width: 34px; height: 34px; font-size: 16px; } }

/* ---------- Tagesauftrag (unten rechts, über dem Abladen-Knopf) ---------- */
.taskcard {
  position: absolute; right: calc(10px + var(--safe-r)); bottom: calc(84px + var(--safe-b));
  background: var(--panel); border: 2px solid #3f6a3a; border-radius: 12px; padding: 5px 9px 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14); font-size: 13px; font-weight: 700; max-width: min(260px, 60%);
}
.taskcard[hidden] { display: none; }
.taskcard .trow { display: flex; align-items: center; gap: 6px; }
.taskcard .bbar { height: 5px; background: rgba(0, 0, 0, 0.08); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.taskcard .bbar > i { display: block; height: 100%; width: 0; background: #5cb85c; transition: width 0.3s; }
.taskcard .tskip { border: 0; background: rgba(0, 0, 0, 0.07); color: var(--muted); border-radius: 50%; width: 22px; height: 22px; font-size: 12px; padding: 0; cursor: pointer; flex: none; }
.taskcard.bumped { animation: bump 0.35s ease-out; }
@media (orientation: portrait) { .taskcard { bottom: calc(146px + var(--safe-b)); } }
/* ---------- Große Schrift ---------- */
.bigui .topbar, .bigui .goal, .bigui .toast, .bigui .near, .bigui .buscard, .bigui .taskcard, .bigui .hint, .bigui .dropbtn { zoom: 1.2; }
.bigui .panel, .bigui .menucard { zoom: 1.12; }
@media (max-width: 460px) { .bigui .topbar { zoom: 1; } .bigui .goal { zoom: 1.08; } }

/* ---------- Arbeitstafel (Familie, Keller) ---------- */
.board h3 { margin: 10px 0 6px; font-size: 14px; color: var(--muted); }
.board .frow { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 4px 0; font-size: 13px; }
.board .frow .seg button { min-width: 38px; padding: 6px 8px; font-size: 14px; }
.board #segCellar button { font-size: 13px; padding: 6px 7px; }
.board .barrels { font-size: 16px; letter-spacing: 2px; }
.fcard { background: rgba(255,255,255,0.6); border-radius: 12px; padding: 8px 10px; margin: 6px 0; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.fhead { display: flex; align-items: center; gap: 8px; }
.fhead .fi { font-size: 28px; line-height: 1; }
.fhead .fn { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.fhead .fn b { font-size: 15px; }
.fhead .fn span { font-size: 12px; color: var(--muted); }
.fhead .fe { width: 54px; height: 9px; border-radius: 5px; background: rgba(0,0,0,0.12); overflow: hidden; flex: none; }
.fhead .fe i { display: block; height: 100%; background: #5cb85c; transition: width 0.3s; }
.fhead .fe i.low { background: #d9483a; }
.fhead .fe i.boost { background: #f2c84b; }
.fstat { font-size: 12px; margin: 4px 0 2px; color: #4a3a2a; min-height: 15px; }
.ftrain { display: flex; gap: 6px; margin-top: 4px; }
.ftrain .ftr { flex: 1; display: flex; flex-direction: column; align-items: center; font-size: 12px; padding: 5px 2px; border-radius: 9px; border: 1px solid rgba(0,0,0,0.12); background: #fffaf0; cursor: pointer; }
.ftrain .ftr b { font-weight: 600; }
.ftrain .ftr span { font-size: 11px; color: var(--muted); }
.ftrain .ftr.poor { opacity: 0.55; }
.ftrain .ftr:disabled { opacity: 0.45; cursor: default; }
#btnBoard.alert { animation: boardPulse 1.2s ease-in-out infinite; }
@keyframes boardPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217,72,58,0); } 50% { box-shadow: 0 0 0 4px rgba(217,72,58,0.55); } }

/* Info-Karte: was ein Kauf-Feld bringt / nächste Stufe */
#nearFx { display: block; white-space: pre-line; margin-top: 3px; padding-top: 3px; border-top: 1px dashed var(--panel-line); font-size: 12.5px; color: #2d5a8a; font-weight: 600; }
#nearFx[hidden] { display: none; }
/* Freischalt-Karte */
.ucard {
  position: absolute; left: 50%; top: calc(108px + var(--safe-t)); transform: translateX(-50%); z-index: 6;
  display: flex; gap: 10px; align-items: flex-start; width: max-content; max-width: min(420px, calc(100% - 24px));
  background: var(--panel); border: 2px solid #c9a227; border-radius: 14px; padding: 9px 14px 9px 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); font-size: 13.5px; pointer-events: auto; cursor: pointer;
}
.ucard[hidden] { display: none; }
.ucard.pop { animation: ucpop 0.35s ease-out; }
@keyframes ucpop { from { transform: translateX(-50%) scale(0.85); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.ucard .uci { font-size: 30px; line-height: 1; padding-top: 2px; }
.ucard b { display: block; font-size: 15px; margin-bottom: 2px; }
.ucard #ucLines div { color: #2d5a8a; font-weight: 600; }
.ucard .uctip { margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.ucard .uctip[hidden] { display: none; }
/* Ausbau-Buch */
.book { max-height: min(86%, 640px); overflow-y: auto; }
.book h3 { margin: 12px 0 6px; font-size: 14px; color: var(--muted); }
.bstats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.bstat { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; border-bottom: 1px dotted var(--panel-line); padding: 2px 0; }
.bitem { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--panel-line); font-size: 12.5px; }
.bitem .bi { font-size: 20px; width: 26px; text-align: center; flex: none; }
.bitem b { font-size: 13.5px; }
.bitem .bp { float: right; font-weight: 700; color: #2d6a32; margin-left: 8px; }
.bitem div div { color: #2d5a8a; }
@media (max-width: 420px) { .bstats { grid-template-columns: 1fr; } }

.bigui .ucard { zoom: 1.2; }
@media (max-width: 860px) { .topbar .brand { display: none; } .topbar .iconbtn { width: 36px; height: 36px; font-size: 17px; } .topbar { gap: 6px; } }
@media (max-width: 420px) { .topbar .iconbtn { width: 34px; height: 34px; font-size: 16px; } .topbar { gap: 4px; } .topbar .brand { display: none; } }
.ucard .ucb { min-width: 0; overflow-wrap: anywhere; }
.bitem > div { flex: 1; min-width: 0; }
/* ✕ oben rechts in jedem Fenster (bleibt beim Scrollen sichtbar) */
.xbtn {
  position: sticky; top: 0; float: right; z-index: 3; margin: -6px -8px 0 8px;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--panel-line);
  background: var(--panel); color: #5a4a3a; font-size: 17px; font-weight: 700; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.xbtn:hover { background: #f3e6d6; }
/* Bestenliste */
.lbopen { width: 100%; margin: -4px 0 10px; }
.lbbranch { margin: 6px 0 8px; flex-wrap: wrap; }
.lbsubmit { background: rgba(201, 162, 39, 0.12); border: 1px solid #e2c766; border-radius: 12px; padding: 8px 10px; margin: 6px 0 10px; }
.lbsubmit p { margin: 0 0 6px; font-weight: 600; }
.lbsubmit p.small { font-weight: 400; margin: 6px 0 0; }
.lbform { display: flex; gap: 8px; }
.lbform input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--panel-line); background: #fff; }
.lbform .btn { margin: 0; width: auto; padding: 8px 14px; }
.lblist { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow: auto; }
.lblist li { display: flex; gap: 8px; align-items: baseline; padding: 5px 4px; border-bottom: 1px dotted var(--panel-line); font-size: 14px; }
.lblist li b { width: 30px; color: var(--muted); }
.lblist li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lblist li i { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; }
.lblist li.me { background: rgba(201, 162, 39, 0.18); border-radius: 8px; }
.lblist li.lbempty { color: var(--muted); justify-content: center; }
.lbbranch[hidden], .lberr[hidden], .lbsubmit[hidden] { display: none; }
.lberr { color: #b8372c; font-weight: 600; margin: 6px 0 0 !important; }
/* Selbst einteilen: beschriftete Bereichs-Knöpfe unter jeder Person */
.board .fpick { margin: 4px 0 6px; padding: 6px; background: rgba(201, 162, 39, 0.1); border: 1px dashed #d9bd5c; border-radius: 10px; }
.board .fpick .small { display: block; margin: 0 0 4px; }
.board .fareas { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.board .fareas button { text-align: left; font-size: 12.5px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--panel-line); background: #fff; cursor: pointer; line-height: 1.2; }
.board .fareas button.on { background: var(--accent, #9a2f3a); color: #fff; border-color: transparent; font-weight: 700; }
/* Hochformat am Handy: Knöpfe passen nicht neben Geld/Ruf/Uhr → zweite Zeile rechtsbündig; alles darunter rückt um --tbx nach unten (main.js misst) */
@media (orientation: portrait) and (max-width: 600px) {
  .topbar { flex-wrap: wrap; row-gap: 6px; justify-content: flex-end; }
  .topbar .spacer { flex-basis: 100%; height: 0; }
  .topbar #guests { margin-right: auto; }
}
#hud > :not(.topbar) { margin-top: var(--tbx, 0px); }
/* Querformat am Handy (niedrig): Knöpfe etwas kleiner, damit auch mit FPS-Anzeige und 📺 alles in eine Zeile passt */
@media (orientation: landscape) and (max-height: 500px) {
  .topbar { gap: 4px; }
  .topbar .iconbtn { width: 32px; height: 32px; font-size: 15px; }
  .topbar .chip { padding: 4px 7px; }
}
