:root {
  --bg: #14110f;
  --panel: #2a2420;
  --panel-edge: #6b5a44;
  --text: #f1e6cf;
  --muted: #b9a888;
  --accent: #d9a441;
  --danger: #b5452f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: "Courier New", ui-monospace, monospace; }
canvas { display: block; width: 100vw; height: 100vh; touch-action: none; cursor: grab; }
canvas.dragging { cursor: grabbing; }

.corner-btn { position: fixed; right: 16px; bottom: 16px; width: 48px; height: 48px; font-size: 26px;
  background: var(--panel); color: var(--text); border: 2px solid var(--panel-edge); border-radius: 6px;
  cursor: pointer; opacity: .55; image-rendering: pixelated; }
.corner-btn:hover { opacity: 1; }
.corner-btn.left { right: auto; left: 16px; }
.corner-btn.second { right: 76px; font-size: 22px; }

.roll-pop { position: fixed; left: 50%; bottom: 18%; transform: translateX(-50%) scale(.6); opacity: 0;
  transition: opacity .25s, transform .25s; pointer-events: none; text-align: center; z-index: 5;
  background: rgba(30, 24, 20, .94); border: 4px solid var(--c, var(--accent)); box-shadow: 6px 6px 0 #000; padding: 14px 26px; }
.roll-pop.flip { bottom: auto; top: 18%; transform: translateX(-50%) rotate(180deg) scale(.6); }
.roll-pop.show { opacity: 1; transform: translateX(-50%) scale(1); }
.roll-pop.flip.show { transform: translateX(-50%) rotate(180deg) scale(1); }
.roll-pop .die { width: 110px; height: 110px; margin: 6px auto; display: flex; align-items: center; justify-content: center;
  font-size: 52px; font-weight: bold; color: #1b1714; background: var(--c, var(--accent));
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); }
.roll-pop .who { font-size: 20px; }
.roll-pop .detail { color: var(--muted); font-size: 16px; }
.roll-pop .verdict { font-size: 30px; font-weight: bold; margin-top: 4px; }
.roll-pop .ok { color: #5fbf5a; } .roll-pop .no { color: #e0553f; }

.turnbar { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 8px;
  background: rgba(30, 24, 20, .9); border: 3px solid var(--panel-edge); box-shadow: 4px 4px 0 #000; padding: 6px 10px;
  font-size: 16px; white-space: nowrap; max-width: calc(100vw - 32px); overflow-x: auto; }
.turnbar.flip { top: auto; bottom: 10px; transform: translateX(-50%) rotate(180deg); }
.turnbar .time { color: var(--accent); }
.turnbar .round { color: var(--muted); font-size: 13px; }
.turnbar .chip { border: 2px solid var(--c); padding: 2px 8px; opacity: .55; }
.turnbar .chip.on { opacity: 1; background: var(--c); color: #111; font-weight: bold; box-shadow: 0 0 12px var(--c); }
.turnbar .arrow { color: var(--muted); }
.turnbar button { padding: 3px 10px; }
.turnbar button[data-act=end] { background: var(--accent); color: #1b1714; font-weight: bold; }

.dialog { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%); width: min(560px, 80vw); z-index: 5;
  background: #f1e6cf; color: #2a2420; border: 4px solid #2a2420; box-shadow: 6px 6px 0 #000; padding: 12px 18px;
  font-size: 19px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.dialog.flip { top: 70%; transform: translate(-50%, -50%) rotate(180deg); }
.dialog.show { opacity: 1; }
.dialog b { color: #7a3a1a; }
.dialog small { color: #6b5a44; }
.dialog p { margin: 6px 0 0; }

.req { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 6; display: flex; gap: 10px; align-items: center;
  background: rgba(42, 36, 32, .96); border: 3px solid var(--accent); box-shadow: 4px 4px 0 #000; padding: 10px 14px; font-size: 18px; }
.req input { width: 70px; }

.qr-codes { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.qr-codes figure { margin: 0; text-align: center; }
.qr-codes svg { background: #fff; display: block; }
.qr-codes figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; word-break: break-all; }
.qr-players { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 14px 0; }
.qr-players div { border-left: 6px solid var(--c); padding: 4px 8px; background: #1b1714; }

.toast { position: fixed; left: 50%; bottom: 8%; transform: translateX(-50%); padding: 12px 22px;
  background: rgba(30, 24, 20, .92); border: 3px solid var(--accent); color: var(--text);
  font-size: 22px; letter-spacing: 1px; pointer-events: none; opacity: 0; transition: opacity .4s;
  box-shadow: 4px 4px 0 #000; white-space: nowrap; }
.toast.flip { bottom: auto; top: 8%; transform: translateX(-50%) rotate(180deg); }
.toast.show { opacity: 1; }

.panel { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); width: min(520px, 94vw);
  max-height: calc(100vh - 140px); overflow-y: auto; background: var(--panel); border: 3px solid var(--panel-edge);
  box-shadow: 6px 6px 0 #000; padding: 18px 22px; z-index: 10; }
.panel h2 { margin: 0 0 12px; color: var(--accent); }
.hidden { display: none !important; }
fieldset { border: 2px solid var(--panel-edge); margin: 0 0 12px; padding: 8px 12px 10px; }
legend { color: var(--accent); padding: 0 6px; }
label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0; }
input, select, button { font: inherit; background: #1b1714; color: var(--text); border: 2px solid var(--panel-edge); padding: 4px 8px; }
input[type=number] { width: 90px; }
input[type=text] { width: 180px; }
.row { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0; }
.ruler { position: relative; height: 26px; margin: 6px 0 2px; }
.ruler span { display: block; height: 10px; background: repeating-linear-gradient(90deg, var(--accent) 0 2px, transparent 2px 10%); border-bottom: 2px solid var(--accent); }
.ruler small { color: var(--muted); }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
button { cursor: pointer; }
button.primary { background: var(--accent); color: #1b1714; border-color: #f1c66b; }
button.danger { border-color: var(--danger); }

/* ---- Pokémon-Textbox ---- */
.pk-box { background: #f8f8f0; color: #282828; border: 4px solid #383838; border-radius: 10px;
  box-shadow: inset 0 0 0 3px #f8f8f0, inset 0 0 0 6px #6890c0, 4px 4px 0 #000; font-weight: bold; }
.dialog { position: fixed; left: 50%; top: auto; bottom: 64px; transform: translateX(-50%); width: min(720px, 86vw); z-index: 5;
  display: flex; gap: 14px; align-items: center; padding: 14px 20px; font-size: 21px; opacity: 0; transition: opacity .25s; pointer-events: none; }
.dialog.flip { top: 64px; bottom: auto; transform: translateX(-50%) rotate(180deg); }
.dialog.show { opacity: 1; }
.dialog img { width: 96px; height: 96px; image-rendering: pixelated; flex: none; background: #d8e8f0; border: 3px solid #383838; border-radius: 6px; }
.dialog .pk-body { flex: 1; min-height: 80px; }
.dialog .pk-name { color: #c03028; font-size: 16px; margin-bottom: 4px; }
.dialog .pk-text { line-height: 1.35; }
.pk-more { position: absolute; right: 18px; bottom: 10px; color: #c03028; animation: blink .8s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- Kampf ---- */
.battle { position: fixed; inset: 0; z-index: 8; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(#a8d8f0 0 45%, #88c070 45% 100%); padding: 14px; gap: 10px;
  background-size: cover; background-position: center 40%; image-rendering: pixelated; }
.battle::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.04) 0 2px, transparent 2px 4px); pointer-events: none; }
.bt-field { flex: 1; position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 0 3vw; min-height: 0; }
.bt-enemies, .bt-party { display: flex; gap: 2vw; align-items: flex-end; }
.bt-enemies { justify-content: flex-end; }
.bt-party { justify-content: flex-start; }
.bt-unit { display: flex; flex-direction: column; align-items: center; transition: transform .3s, opacity .5s; }
.bt-unit img { width: clamp(72px, 9vw, 150px); height: auto; image-rendering: pixelated;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.25)); }
.bt-unit .plat { width: 120%; height: 18px; margin-top: -10px; border-radius: 50%; background: rgba(0,0,0,.28); }
.bt-unit.act img { animation: bob .6s ease-in-out infinite alternate; }
.bt-unit.dead { opacity: .25; filter: grayscale(1); transform: translateY(10px); }
@keyframes bob { to { transform: translateY(-8px); } }
.pk-info { min-width: 150px; padding: 6px 10px; font-size: 15px; margin-bottom: 6px; }
.pk-info b { display: flex; justify-content: space-between; gap: 8px; }
.pk-info small { font-size: 12px; color: #585858; }
.hpbar { height: 8px; background: #484848; border-radius: 4px; padding: 1px; margin: 3px 0 1px; }
.hpbar i { display: block; height: 100%; border-radius: 3px; background: #58d080; transition: width .5s; }
.hpbar i.mid { background: #f8c030; } .hpbar i.low { background: #f05030; }
.bt-unit.act .pk-info { box-shadow: inset 0 0 0 3px #f8f8f0, inset 0 0 0 6px #f0a030, 0 0 16px #f0a030; }
.bt-bottom { display: flex; gap: 10px; position: relative; }
.bt-text { flex: 1; padding: 14px 20px; font-size: 21px; min-height: 104px; line-height: 1.4; }
.bt-text.flip { transform: rotate(180deg); flex: none; min-height: 70px; font-size: 18px; }
.bt-text .old { color: #888; font-size: 16px; }
.bt-menu { width: min(420px, 40vw); padding: 12px; font-size: 18px; }
.bt-menu .hdr { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: #585858; margin-bottom: 6px; }
.bt-menu button { font: inherit; font-weight: bold; color: #282828; background: #f8f8f0; border: 3px solid #383838; border-radius: 6px; padding: 8px; cursor: pointer; }
.bt-menu button:hover:not(:disabled) { background: #f8e8b0; }
.bt-menu button:disabled { opacity: .35; }
.bm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bm-grid .wide { grid-column: span 2; }
.bm-list { display: flex; flex-direction: column; gap: 5px; }
.bm-list small { color: #686868; font-size: 13px; }
.bm-back { margin-top: 6px; width: 100%; font-size: 14px !important; padding: 4px !important; }
.bm-q { margin: 0 0 6px; } .bm-err { color: #c03028; margin: 0 0 6px; }
.bt-menu label { display: flex; justify-content: space-between; color: #383838; }
.bt-menu input { background: #fff; color: #282828; width: 70px; }

.turnbar .chip small.hp { font-size: 12px; margin-left: 4px; }
.turnbar .chip.down { text-decoration: line-through; }

/* ---- Legende: oben links und gedreht unten rechts ---- */
.legend { position: fixed; width: 360px; z-index: 6;
  background: rgba(30, 24, 20, .94); border: 3px solid var(--panel-edge); box-shadow: 4px 4px 0 #000; font-size: 14px; }
/* wie die Zugleisten: eine normal, eine um 180° gedreht für die gegenüberliegende Tischseite */
.legend.left { left: 12px; top: 64px; }
.legend.right { right: 12px; bottom: 64px; transform: rotate(180deg); }
.legend summary { cursor: pointer; padding: 6px 12px; color: var(--accent); font-weight: bold; list-style: none; }
.legend summary::-webkit-details-marker { display: none; }
.legend[open] summary { border-bottom: 2px solid var(--panel-edge); }
.lg-body { padding: 4px 12px 10px; }
.lg-body h4 { margin: 8px 0 4px; color: var(--accent); font-size: 13px; }
.lg-body ol { margin: 0; padding-left: 18px; }
.lg-body ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.lg-body li { font-size: 13px; }
kbd { display: inline-block; min-width: 22px; text-align: center; background: #1b1714; border: 2px solid var(--panel-edge); padding: 0 4px; font-size: 12px; }

.combat-banner { position: fixed; left: 50%; top: 60px; transform: translateX(-50%); z-index: 7; display: flex; gap: 8px; }
.combat-banner button { background: #8a2a2a; color: #fff; border: 3px solid #ff6a50; padding: 6px 12px; font-weight: bold; animation: glowR 1s infinite alternate; }
@keyframes glowR { to { box-shadow: 0 0 14px #ff6a50; } }

.tip { position: fixed; z-index: 9; pointer-events: none; background: rgba(20,16,12,.95); border: 2px solid var(--panel-edge);
  padding: 4px 8px; font-size: 13px; opacity: 0; transition: opacity .15s; white-space: nowrap; }
.tip.show { opacity: 1; }

.turnbar .chip { cursor: pointer; opacity: .8; }
.turnbar .chip.ready { opacity: .55; background: rgba(255,255,255,.08); }
.turnbar .chip.fight { border-style: dashed; animation: glowR 1s infinite alternate; }
.turnbar .chip b { margin-right: 3px; }
.bt-map { margin-top: 8px; width: 100%; font-size: 14px !important; }

.inv-slots { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 10px 0; }
.inv-slot { display: flex; align-items: center; gap: 8px; border-left: 6px solid var(--c); padding: 6px 8px; background: #1b1714; }
.inv-slot span { flex: 1; }
.inv-slot small { color: var(--muted); }
.qr-codes .links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.qr-codes .links a, .qr-codes .links button { font-size: 13px; padding: 4px 8px; color: var(--text); background: #1b1714; border: 2px solid var(--panel-edge); text-decoration: none; }
.save-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 160px; overflow-y: auto; }
.save-list div { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.save-list div span { flex: 1; }
.chip-av { width: 18px; height: 18px; border-radius: 50%; vertical-align: middle; margin-right: 4px; object-fit: cover; }

/* ---- HUD: ◎ | Leiste | 📱 ⚙ ☰, alles auf einer Linie ---- */
.turnbar { z-index: 11; background: none; border: none; box-shadow: none; padding: 0; gap: 6px; overflow: visible; max-width: calc(100vw - 24px); align-items: stretch; }
.turnbar .bar { display: flex; align-items: center; gap: 6px; background: rgba(30, 24, 20, .92); border: 3px solid var(--panel-edge);
  box-shadow: 4px 4px 0 #000; padding: 5px 10px; min-width: 0; overflow-x: auto; }
.turnbar .hud-btn { width: 44px; flex: none; font-size: 20px; padding: 0; background: rgba(30, 24, 20, .92); border: 3px solid var(--panel-edge);
  box-shadow: 4px 4px 0 #000; color: var(--text); cursor: pointer; }
.turnbar .hud-btn:hover, .turnbar .hud-btn.on { border-color: var(--accent); }
.turnbar .chip.empty { min-width: 24px; padding: 2px 6px; text-align: center; font-size: 12px; opacity: .45; border-style: dotted; }
.turnbar .round { white-space: nowrap; }
.hud-menu { position: absolute; top: calc(100% + 30px); left: 0; width: 380px; max-height: 70vh; overflow-y: auto;
  background: rgba(30, 24, 20, .97); border: 3px solid var(--panel-edge); box-shadow: 6px 6px 0 #000; padding: 6px 14px 12px; white-space: normal; font-size: 14px; }
.hud-menu h4 { margin: 8px 0 4px; color: var(--accent); font-size: 13px; }
.hud-menu ol { margin: 0; padding-left: 18px; }
.hud-menu ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.hud-menu li { font-size: 13px; }

/* Nur eine Leiste (TV): gespiegelte Kopien ausblenden */
body.single .flip { display: none !important; }

/* ---- Feed am Hauptmonitor ---- */
.feed { position: fixed; left: 12px; bottom: 12px; z-index: 3; width: min(380px, 40vw); display: flex; flex-direction: column-reverse; gap: 4px; pointer-events: none; }
.feed.flip { left: auto; right: 12px; bottom: auto; top: 12px; transform: rotate(180deg); }
.feed-item { display: flex; align-items: center; gap: 8px; background: rgba(20, 17, 15, .82); border-left: 4px solid var(--c); border-radius: 6px;
  padding: 5px 9px; font-size: 14px; color: var(--text); }
.feed-item:first-child { animation: feedIn .35s ease-out; }
.feed-item .fi { font-size: 18px; flex: none; }
.feed-item .ft { flex: 1; line-height: 1.25; }
.feed-item small { color: var(--muted); font-size: 11px; flex: none; }
@keyframes feedIn { from { transform: translateX(-20px); opacity: 0; } }
/* Gruppenansicht: Admin-Bereiche verstecken */
body:not(.admin) .admin-only { display: none !important; }
body:not(.admin) .creator-overlay { display: none !important; }

/* ---- Kampagnen-Ersteller als Overlay (Admin) ---- */
/* lässt oben und unten Platz für die Zugleisten, damit 📜 das Fenster wieder schließen kann */
.creator-overlay { position: fixed; inset: 64px 16px; z-index: 10; border: 3px solid var(--panel-edge); box-shadow: 6px 6px 0 #000; background: #111; }
.creator-overlay iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---- Stadtübersicht ---- */
.town { position: fixed; left: 12px; top: 50%; transform: translateY(-50%); z-index: 4; width: 300px; max-height: 70vh; overflow-y: auto;
  background: rgba(30, 24, 20, .92); border: 3px solid var(--panel-edge); box-shadow: 4px 4px 0 #000; padding: 6px 12px; font-size: 14px; }
.town.flip { left: auto; right: 12px; transform: translateY(-50%) rotate(180deg); }
.town h3 { margin: 6px 0; color: var(--accent); font-size: 16px; }
.town h3 small { color: var(--muted); font-size: 12px; }
.town .here { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.town .here span { border-left: 4px solid var(--c); padding: 1px 6px; background: #1b1714; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.town .here img { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }
.town ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.town li { display: flex; align-items: center; gap: 6px; }
.town li img { width: 28px; height: 28px; image-rendering: pixelated; background: #3a2f22; }
/* Ortsansicht am Monitor: animierte Porträts wie am Handy */
.town li .portrait { width: 36px; height: 36px; flex: none; background-size: 500% 100%; background-repeat: no-repeat; image-rendering: pixelated; background-color: #3a2f22; }
.town li .portrait.idle { animation: pf-idle 4.2s step-end infinite; animation-delay: var(--d); }
.town li .portrait.sleep { background-position: 25% 0; filter: grayscale(1) brightness(.6); }
@keyframes pf-idle { 0% { background-position: 0 0; } 88% { background-position: 25% 0; } 92% { background-position: 0 0; } }
.town-x { float: right; padding: 0 6px; font-size: 14px; }
.town { pointer-events: auto; }
.town li span { flex: 1; }
.town li small { color: var(--muted); }
.town li.asleep { opacity: .5; } .town li.dead { opacity: .4; }
.town .warn { color: #f0a090; margin: 4px 0; }
.town .hint { margin: 6px 0 2px; }
.town section + section { border-top: 2px dashed var(--panel-edge); margin-top: 6px; }

.ts-steps { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 6px 0; }
.ts-steps > div { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 150px; text-align: center; }
.ts-steps small { color: var(--accent); }

/* ---- Das Buch des Chronisten (book.css): Menüs als aufgeschlagenes Buch ---- */
.panel.book { width: min(1040px, 96vw); padding: 26px 40px 22px; column-count: 2; column-gap: 80px;
  animation: bookOpen .35s ease-out; }
.panel.book > h2, .panel.book > .buttons, .panel.book > .qr-codes { column-span: all; }
.panel.book > h2 { text-align: center; font-size: 26px; margin-bottom: 18px; }
.panel.book fieldset, .panel.book .inv-slots, .panel.book > p { break-inside: avoid; }
.panel.book label { color: var(--ink); }
.panel.book .ruler span { background: repeating-linear-gradient(90deg, var(--rubric) 0 2px, transparent 2px 10%); border-bottom-color: var(--rubric); }
.panel.book .save-list > div, .panel.book .inv-slot { border-bottom: 1px dotted var(--parch-edge); }
.panel.book .qr-codes figcaption, .panel.book .inv-slot small { color: var(--ink-soft); }
.panel.book .qr-codes .links a, .panel.book .qr-codes .links button { background: var(--parch-dark); color: var(--ink); border-color: var(--ink-soft); }
/* Legende als lose Pergamentseite */
.hud-menu { background: var(--parch); color: var(--ink); border: 3px solid var(--leather); box-shadow: inset 0 0 0 2px var(--gilt), 6px 6px 0 #000; }
.hud-menu h4 { color: var(--rubric); font-family: Georgia, serif; }
.hud-menu kbd { background: var(--parch-dark); color: var(--ink); border-color: var(--ink-soft); }
/* Leiste oben: Lederband mit Goldrand */
.turnbar .bar, .turnbar .hud-btn { background: linear-gradient(180deg, var(--leather-light), var(--leather) 60%, var(--leather-dark)); border-color: var(--gilt); }
.creator-overlay { border: 12px solid var(--leather); box-shadow: inset 0 0 0 2px var(--gilt), 10px 14px 0 rgba(0,0,0,.55); }
.qr-codes .mail-row input { flex: 1; min-width: 160px; font: inherit; font-size: 13px; padding: 4px 6px; background: #1b1714; color: var(--text); border: 2px solid var(--panel-edge); }

/* Schadensrechnung im Kampf: körperlich schwarz, magisch blau, Heilung grün */
.dmg { white-space: nowrap; }
.dmg b { font-size: 1.1em; }
.dmg small { font-size: .78em; opacity: .85; }
.dmg.phys { color: #1a1410; }
.dmg.magic { color: #2a5ad8; }
.dmg.heal { color: #2a8a3a; }
/* Gegner stehen auf dem Boden der Kulisse statt am oberen Rand */
.bt-field { justify-content: flex-end; }
.bt-enemies { margin-bottom: -4vh; }
/* Gegner mittig – ein einzelner steht in der Bildschirmmitte */
.bt-enemies { justify-content: center; }
.rotbar { position: fixed; right: 18px; bottom: 18px; z-index: 4; display: flex; gap: 6px; }
.rotbar button { width: 40px; height: 34px; font-size: 20px; padding: 0; }

.bt-unit .fx-wrap { position: relative; }
.bt-pet { position: absolute; right: -30%; bottom: 0; width: 45% !important; height: auto !important; image-rendering: pixelated; animation: pet-hop 1.2s ease-in-out infinite; }
.bt-pet.down { filter: grayscale(1) brightness(.5); animation: none; transform: rotate(90deg); }
@keyframes pet-hop { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Unter der Zugleiste: Kompass mit Drehung + Uhrzeit/Wetter, daneben der Himmelsstreifen mit Sonne/Mond */
.turnbar .dayrow { position: absolute; left: 0; right: 0; top: calc(100% + 6px); display: flex; align-items: center; gap: 6px; }
.turnbar .compass-box { display: flex; align-items: center; gap: 2px; background: rgba(30, 24, 20, .92); border: 3px solid var(--panel-edge);
  box-shadow: 3px 3px 0 #000; padding: 2px 6px; flex: none; }
.turnbar .compass-box button { width: 26px; height: 26px; padding: 0; font-size: 16px; }
.turnbar .compass-box canvas { width: 56px; height: 56px; image-rendering: pixelated; }
.turnbar .compass-box .clock { display: flex; flex-direction: column; margin-left: 6px; line-height: 1.1; }
.turnbar .compass-box .clock b { font-size: 18px; } .turnbar .compass-box .clock small { font-size: 11px; color: var(--muted); }
.turnbar .daybar { position: relative; flex: 1; height: 18px; border: 3px solid var(--ink-line); box-shadow: 3px 3px 0 #000;
  background: linear-gradient(90deg, #141c2a 0%, #1c2638 20%, #8a5a3a 26%, #9aa684 33%, #c3c8a6 50%, #9aa684 67%, #8a4a32 75%, #1c2638 80%, #141c2a 100%); }
.turnbar .daybar .tick { position: absolute; top: 0; bottom: 0; border-left: 2px solid rgba(14,18,16,.6); font-size: 9px; color: #e2e4cc; padding-left: 2px; line-height: 12px; }
.turnbar .daybar i { position: absolute; top: 50%; transform: translate(-50%, -50%); font-style: normal; font-size: 16px; transition: left 1.5s linear; }
.turnbar .daybar i img { width: 18px; height: 18px; filter: drop-shadow(0 0 3px #fff6c0); }
.turnbar .daybar i.moon img { filter: drop-shadow(0 0 3px #a8c0e0); }
/* ☰ klappt die übrigen Knöpfe waagrecht auf */
.turnbar .hud-row { display: flex; gap: 6px; }
.turnbar .hud-row.hidden { display: none; }
/* Fenster aus den Knöpfen: links bündig mit dem Feed, von der anderen Tischseite aus gespiegelt rechts */
.panel, .panel.book { left: 12px !important; right: auto !important; top: 120px !important; transform: none !important; max-height: calc(100vh - 140px); overflow-y: auto; }
.panel.flip, .panel.book.flip { left: auto !important; right: 12px !important; top: auto !important; bottom: 120px !important; transform: rotate(180deg) !important; }
.hud-menu { left: 0 !important; right: auto !important; top: calc(100% + 76px) !important; }
.turnbar.flip .hud-menu { left: 0 !important; }
.rotbar { display: none; }
.turnbar .compass-box .climate { display: flex; flex-direction: column; margin-left: 10px; padding-left: 8px; border-left: 2px solid var(--panel-edge); line-height: 1.15; }
.turnbar .compass-box .climate b { font-size: 15px; } .turnbar .compass-box .climate small { font-size: 11px; color: var(--muted); }
/* Kompass und Tagesleiste bilden einen Kasten */
.turnbar .compass-box { flex-direction: column; align-items: stretch; gap: 4px; padding: 4px 6px 6px; }
.turnbar .compass-row { display: flex; align-items: center; gap: 2px; }
.turnbar .compass-box .daybar { flex: none; width: auto; box-shadow: none; }
/* Alles in einer linken Spalte, bündig mit dem Feed (per Spiegeln rechts, gedreht) */
:root { --col: min(380px, 40vw); }
.turnbar { left: 12px !important; right: auto; top: 10px; transform: none !important; width: var(--col); max-width: var(--col); flex-wrap: wrap; }
.turnbar.flip { left: auto !important; right: 12px !important; top: auto; bottom: 10px; transform: rotate(180deg) !important; }
.turnbar .bar { flex: 1; font-size: 12px; gap: 4px; padding: 4px 6px; }
.turnbar .chip { padding: 1px 5px; font-size: 12px; }
.turnbar .chip small, .turnbar .chip small.hp { font-size: 10px; }
.turnbar .round { font-size: 11px; }
.turnbar .chip-av { width: 14px; height: 14px; }
.turnbar .hud-row { order: 3; width: 100%; margin-top: 4px; }
.turnbar .dayrow { position: static; order: 4; width: 100%; margin-top: 6px; }
.turnbar .compass-box { width: 100%; box-sizing: border-box; }
.feed { width: var(--col); }
.town { width: var(--col); box-sizing: border-box; top: auto; transform: none; bottom: 50%; }
.panel, .panel.book { top: 250px !important; max-height: calc(100vh - 270px); }
.panel.flip, .panel.book.flip { bottom: 250px !important; }
.hud-menu { top: calc(100% + 8px) !important; width: var(--col) !important; box-sizing: border-box; }
.turnbar .bar { flex-wrap: wrap; overflow: visible; row-gap: 3px; }
/* Kompass-Kasten ganz oben, Spieler-Menü (☰ + Namensleiste) darunter */
.turnbar .dayrow { order: -1; margin-top: 0; margin-bottom: 6px; }
/* Einladung verschickt: Code ausgegraut, Hinweis auf die nächste */
.qr-codes .sent-row { display: block; margin-top: 6px; font-size: 14px; cursor: pointer; }
.qr-codes figure.sent svg { opacity: .15; }
.qr-codes figure.sent figcaption { text-decoration: line-through; }
.qr-codes .sent-next { margin-top: 6px; padding: 6px; border: 2px dashed #e8c34a; font-size: 13px; }
.qr-codes .sent-next button { display: block; margin: 6px auto 0; font-size: 15px; padding: 6px 12px; }
.qr-codes .inv-who { margin-top: 4px; font-size: 18px; font-weight: bold; }
