/* ═══════════════════════════════════════════════════════════════
   MYDOG WEB – Spiel-Overlay (Weltbuch 11.2–11.9), Thema „Creme & Holz“
   ═══════════════════════════════════════════════════════════════ */

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
#hud > * { pointer-events: auto; }
#hotspots, #bubbles, #zettels { pointer-events: none; }
body.hud-rest #topbar, body.hud-rest #dock { opacity: 0.3; transition: opacity 0.8s; }

/* ── Kopfleiste ── */
#topbar {
    position: fixed; left: 0; right: 0; top: 0; height: calc(60px + var(--safe-t));
    padding: var(--safe-t) 12px 0; display: flex; align-items: center; gap: 10px;
    background: rgba(251, 243, 228, 0.92); border-bottom: 3px solid #D9A86C; box-shadow: 0 1px 0 #8A5A3B, 0 4px 14px rgba(74, 52, 66, 0.15);
}
#medal { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px; cursor: pointer; min-width: 0; flex: 1 1 auto; font: inherit; color: var(--cocoa); }
#medal .face { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: var(--oat); border: 3px solid var(--amber); box-shadow: 0 3px 0 var(--amber-deep); flex: none; }
#medal .name { font-family: var(--f-title); font-weight: 600; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#medal .stat { font-size: 18px; }
#medal .more { background: var(--coral); color: #fff; border-radius: 99px; padding: 1px 7px; font: 700 12px var(--f-label); }
#clock { flex: none; width: 96px; height: 44px; border-radius: 22px; background: var(--oat); border: 2px solid var(--amber); display: grid; place-items: center; line-height: 1; }
#clock b { font-family: var(--f-title); font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
#clock small { font: 11px var(--f-label); color: var(--latte); }
#clock.warn { border-color: var(--coral); animation: wob 60s infinite; }
#clock.ok { border-color: #7FA77A; }
@keyframes wob { 0%, 98% { transform: rotate(0); } 99% { transform: rotate(-3deg); } 100% { transform: rotate(3deg); } }
#wx, #bell { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #C9A045; background: var(--oat); font-size: 20px; cursor: pointer; position: relative; padding: 0; }
#wx.wx-sun { background: #FDF0C8; } #wx.wx-rain { background: #DCEBF5; } #wx.wx-mud { background: #EAD9C8; } #wx.wx-snow { background: #F1F7FB; }
#bell { background: #F4D58A; }
#bell i { position: absolute; top: -4px; right: -6px; background: var(--coral); color: #fff; font: 700 11px var(--f-label); border-radius: 99px; padding: 1px 5px; font-style: normal; }

/* Ortsleiste */
#placebar { position: fixed; left: calc(12px + var(--safe-l)); top: calc(12px + var(--safe-t)); text-align: left; background: rgba(255, 250, 240, 0.9); border: 2px solid var(--linen); border-radius: 99px; padding: 5px 16px; text-align: center; box-shadow: var(--shadow); pointer-events: none; }
body.has-top #placebar { top: calc(70px + var(--safe-t)); }
#placebar b { font-family: var(--f-title); font-weight: 600; font-size: 15px; display: block; }
#placebar small { font: 12px var(--f-label); color: var(--latte); }

/* Münz-Marke im Spiel: oben rechts unter der Kopfleiste */
body.ingame.has-top #coin-badge { top: calc(68px + var(--safe-t)); }
body.ingame #coin-badge { z-index: 19; top: calc(12px + var(--safe-t)); right: calc(12px + var(--safe-r)); left: auto; bottom: auto; translate: none; }
body.ingame #coin-badge .hook { display: none; }

/* ── Dock ── */
#dock {
    position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(640px, 100%);
    height: calc(88px + var(--safe-b)); padding: 0 18px var(--safe-b); display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(#9a6644, #8A5A3B); border-top: 3px solid #6E4630; border-radius: 24px 24px 0 0; box-shadow: 0 -6px 18px rgba(74, 52, 66, 0.25);
}
#dock button { font: inherit; cursor: pointer; }
#basket, #door { width: 64px; height: 64px; border-radius: 18px; border: 2px solid #6E4630; background: #C99A5B; box-shadow: 0 4px 0 #6E4630; display: grid; place-items: center; align-content: center; gap: 0; color: var(--cocoa); padding: 0; position: relative; }
#door { width: 60px; background: #B97A4A; }
#basket span, #door span { font-size: 26px; line-height: 1; }
#basket small, #door small { font: 11px var(--f-label); }
#basket:active, #door:active, #call:active { transform: translateY(3px); box-shadow: 0 1px 0 #6E4630; }
#door .paws { position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%); display: flex; gap: 3px; }
#door .paws i { width: 7px; height: 7px; border-radius: 50%; background: #5A3A26; }
#door .paws i.on { background: var(--brass); }
#call { width: 80px; height: 80px; border-radius: 50%; margin-top: -40px; border: 3px solid var(--amber-deep); background: var(--amber); box-shadow: 0 6px 0 var(--amber-deep), var(--shadow); font-size: 34px; display: grid; place-items: center; }
#call.pulse { animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { scale: 1.06; } }

/* Pflege-Fächer */
#fan { position: absolute; left: 50%; bottom: 46px; width: 0; height: 0; }
#fan .fan-b { position: absolute; left: -28px; top: -28px; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--linen); background: var(--oat); box-shadow: 0 4px 0 var(--linen-deep), var(--shadow); display: grid; place-items: center; align-content: center; transform: translate(0, 0) scale(0.4); opacity: 0; transition: transform 0.24s cubic-bezier(.3, 1.3, .5, 1), opacity 0.2s; padding: 0; }
#fan.open .fan-b { transform: translate(var(--x), var(--y)) scale(1); opacity: 1; }
#fan .fan-b span { font-size: 22px; line-height: 1; }
#fan .fan-b small { position: absolute; top: 58px; white-space: nowrap; font: 11px var(--f-label); color: var(--paper); text-shadow: 0 1px 2px #3e2a1e; }
#fan .fan-b.wish { border-color: var(--amber); animation: breathe 2s infinite; }
#fan .fan-b.done::after { content: '✓'; position: absolute; right: -4px; top: -4px; background: #7FA77A; color: #fff; border-radius: 50%; width: 18px; height: 18px; font: 700 12px/18px var(--f-label); }
#fan .fan-b.locked { filter: saturate(0.4); opacity: 0.6; }

/* ── Hotspots in der Szene ── */
.hs { position: fixed; left: 0; top: 0; margin: -22px 0 0 -22px; pointer-events: auto; border: 2px solid var(--linen); background: rgba(255, 250, 240, 0.94); border-radius: 22px; height: 44px; min-width: 44px; padding: 0 10px 0 6px; display: flex; align-items: center; gap: 6px; box-shadow: 0 3px 0 var(--linen-deep), var(--shadow); cursor: pointer; font: 600 14px var(--f-title); color: var(--cocoa); white-space: nowrap; }
.hs .i { font-size: 20px; width: 30px; text-align: center; }
.hs.big { background: var(--amber); border-color: var(--amber-deep); box-shadow: 0 3px 0 var(--amber-deep), var(--shadow); }
.hs:active { transform: translateY(2px); }

.bubble-say { position: fixed; left: 0; top: 0; translate: -50% -100%; background: var(--milk); border: 2px solid var(--linen); border-radius: 16px; padding: 7px 12px; max-width: 220px; font: 800 15px var(--f-text); box-shadow: var(--shadow); white-space: normal; text-align: center; }
.heart-pop { position: fixed; z-index: 40; pointer-events: none; color: #E0584F; font-size: 26px; text-shadow: 0 2px 0 #A8372F; animation: heart 1.3s ease-out forwards; }
.heart-pop.spark { color: inherit; text-shadow: none; }
@keyframes heart { 0% { transform: translate(-50%, 0) scale(0.4); opacity: 0; } 20% { opacity: 1; transform: translate(-50%, -20px) scale(1.15); } 100% { transform: translate(-50%, -90px) scale(0.9); opacity: 0; } }

/* ── Zettel ── */
#zettels { position: fixed; left: 50%; top: calc(110px + var(--safe-t)); transform: translateX(-50%); display: grid; gap: 8px; width: min(342px, 92vw); z-index: 30; }
.zettel-n { background: #FFFAF0; border-left: 6px solid var(--amber); border-radius: 6px; padding: 10px 14px; font: 600 15px var(--f-text); box-shadow: var(--shadow); transform: rotate(-1.5deg); animation: zin 0.25s ease-out; }
.zettel-n.ok { border-color: #7FA77A; } .zettel-n.warn { border-color: var(--coral); } .zettel-n.hint { border-color: #F6C945; }
.zettel-n.out { opacity: 0; transform: rotate(-1.5deg) translateY(-8px); transition: 0.35s; }
@keyframes zin { from { opacity: 0; transform: rotate(-1.5deg) translateY(-10px); } }

/* ── Sheet ── */
#sheet-wrap { position: fixed; inset: 0; z-index: 35; }
.sheet-dim, .card-dim { position: absolute; inset: 0; background: rgba(62, 42, 30, 0.35); opacity: 0; transition: opacity 0.28s; }
#sheet-wrap.open .sheet-dim, #card-wrap.open .card-dim { opacity: 1; }
#sheet { position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 100%); width: min(640px, 100%); max-height: 78%; display: flex; flex-direction: column; background: var(--plaster); border-radius: 28px 28px 0 0; border-top: 3px solid var(--linen-deep); box-shadow: 0 -10px 30px rgba(74, 52, 66, 0.3); transition: transform 0.28s ease-out; padding: 14px 16px calc(16px + var(--safe-b)); }
#sheet-wrap.open #sheet { transform: translate(-50%, 0); }
#sheet h2 { margin: 2px 40px 10px 4px; font: 600 24px var(--f-title); }
#sheet h2 small { font: 14px var(--f-label); color: var(--latte); }
#sheet h2 .sx { color: var(--coral); }
.sheet-x { position: absolute; right: 14px; top: 12px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--linen); background: var(--oat); cursor: pointer; font-size: 16px; }
#sheet .tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
#sheet .tab { flex: none; border: 2px solid var(--linen); background: var(--oat); border-radius: 99px; padding: 6px 12px; font: 600 14px var(--f-title); color: var(--latte); cursor: pointer; }
#sheet .tab.on { background: var(--amber); border-color: var(--amber-deep); color: var(--cocoa); }
#sheet .body { overflow-y: auto; padding: 4px 2px; -webkit-overflow-scrolling: touch; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tile { background: var(--oat); border: 2px solid var(--linen); border-left: 6px solid var(--rar, var(--linen)); border-radius: 16px; padding: 10px; display: grid; gap: 4px; align-content: start; box-shadow: 0 3px 0 var(--linen-deep); }
.tile.off { opacity: 0.6; }
.tile .ti { font-size: 28px; }
.tile b { font: 600 15px var(--f-title); }
.tile small { font: 12px var(--f-label); color: var(--latte); }
.tile em { font: 600 15px var(--f-title); font-style: normal; color: var(--amber-deep); }
.tile .btn { margin-top: 4px; padding: 7px 10px; font-size: 14px; }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: 0.5; filter: saturate(0.4); }
.facts p { margin: 6px 0; font-size: 16px; }
.facts b { font-family: var(--f-title); font-weight: 600; margin-right: 6px; }
.dim { color: var(--oat-grey); }
.chain { display: inline-flex; gap: 4px; vertical-align: middle; }
.chain i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--amber); }
.chain i.on { background: var(--amber); }
.vit { position: relative; height: 16px; border-radius: 8px; background: #E9DBC2; border: 2px solid var(--linen); margin: 4px 0 10px; overflow: hidden; }
.vit span { position: absolute; inset: 0 auto 0 0; width: var(--v); background: linear-gradient(90deg, #E0584F, #F07E62); }
.vit .peg { position: absolute; left: 80%; top: -2px; bottom: -2px; width: 3px; background: var(--cocoa); }
.bonebar { height: 20px; border-radius: 10px; background: #E9DBC2; border: 2px solid var(--linen); overflow: hidden; }
.bonebar span { display: block; height: 100%; background: var(--brass); }
.notes p { background: #FFFAF0; border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.notes small { color: var(--latte); margin-right: 4px; }
.hist { font-size: 14px; color: var(--latte); }

/* ── Karten ── */
#card-wrap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; }
#card { position: relative; width: min(342px, 92vw); max-height: 86vh; overflow-y: auto; transform: scale(0.94); opacity: 0; transition: 0.2s ease-out; }
#card-wrap.open #card { transform: none; opacity: 1; }
#card .price { font: 600 28px var(--f-title); margin: 0 4px 6px; color: var(--amber-deep); }
#card .txt { font-size: 17px; line-height: 1.4; }
#card .after { font-size: 14px; color: var(--latte); }
.btn.hold { position: relative; overflow: hidden; }
.btn.hold::after { content: ''; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.35); transform: scaleX(0); transform-origin: left; }
.btn.hold.holding::after { transform: scaleX(1); transition: transform var(--hold) linear; }
.name-box input { width: 100%; font: 600 22px var(--f-title); padding: 10px 14px; border-radius: 14px; border: 2px solid var(--brass); background: linear-gradient(#f6dc93, #E9B949); color: var(--cocoa); text-align: center; }
.name-box .hint { font-size: 13px; color: var(--latte); text-align: center; }
.name-box .hint.bad { color: var(--coral); }
.berni-row { display: flex; gap: 12px; align-items: flex-start; }
.medal-b { font-size: 34px; background: var(--paper); border-radius: 50%; width: 52px; height: 52px; display: grid; place-items: center; border: 3px solid #C0443A; flex: none; }
.fc { display: flex; justify-content: space-between; gap: 4px; margin: 6px 0 10px; }
.fc span { display: grid; justify-items: center; font-size: 12px; }
.fc b { font-size: 22px; }

/* Szenen-Steuerungen (Gassi-Leine, Minispiele, Kino) */
.ctl { position: fixed; z-index: 25; }
#leash { right: 14px; bottom: calc(110px + var(--safe-b)); width: 72px; height: 220px; border-radius: 36px; background: rgba(255, 250, 240, 0.85); border: 2px solid var(--linen); box-shadow: var(--shadow); touch-action: none; }
#leash .grip { position: absolute; left: 6px; right: 6px; height: 60px; border-radius: 30px; background: #A8683C; border: 3px solid #D9A84E; display: grid; place-items: center; font-size: 22px; color: #FFF8EC; transition: top 0.1s; }
#leash small { position: absolute; left: -64px; width: 60px; text-align: right; font: 12px var(--f-label); color: var(--paper); text-shadow: 0 1px 2px #000; }
.game-pad { left: 50%; bottom: calc(120px + var(--safe-b)); transform: translateX(-50%); background: rgba(255, 250, 240, 0.92); border: 2px solid var(--linen); border-radius: 20px; padding: 12px 16px; box-shadow: var(--shadow); text-align: center; min-width: 240px; }
.game-pad b { font: 600 18px var(--f-title); display: block; margin-bottom: 8px; }
.game-pad .row { display: flex; gap: 10px; justify-content: center; }
.game-pad .meter { height: 14px; border-radius: 7px; background: #E9DBC2; overflow: hidden; margin: 8px 0; }
.game-pad .meter span { display: block; height: 100%; width: 0; background: var(--brass); transition: width 0.1s; }
.big-tap { width: 120px; height: 120px; border-radius: 50%; font-size: 48px; border: 3px solid var(--amber-deep); background: var(--amber); box-shadow: 0 6px 0 var(--amber-deep); cursor: pointer; }
.big-tap:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--amber-deep); }
.board { right: 12px; top: calc(110px + var(--safe-t)); background: rgba(30, 24, 18, 0.88); color: #F8FAFC; border: 2px solid rgba(245, 158, 11, 0.35); border-radius: 16px; padding: 10px 12px; min-width: 200px; font: 14px var(--f-text); }
.board b { font-family: var(--f-title); color: var(--amber-light); }
.board ol { margin: 6px 0 0; padding-left: 22px; }
.board li.me { color: var(--amber); font-weight: 800; }

@media (orientation: landscape) and (min-width: 900px) {
    html:not(.frame) #sheet { left: auto; right: 0; bottom: 0; top: 0; max-height: none; width: 420px; transform: translateX(100%); border-radius: 28px 0 0 28px; }
    html:not(.frame) #sheet-wrap.open #sheet { transform: none; }
}
body.rm .heart-pop, body.rm #call.pulse, body.rm #fan .fan-b.wish { animation: none; }

/* Adoptionsstempel, Zähmungs-Vignette */
.adopt-stamp { position: fixed; left: 50%; top: 40%; z-index: 45; transform: translate(-50%, -50%) rotate(-12deg) scale(2.4); opacity: 0; font: 700 44px var(--f-title); color: var(--coral); border: 6px solid var(--coral); border-radius: 14px; padding: 6px 22px; background: rgba(255, 250, 240, 0.85); animation: stamp 0.35s cubic-bezier(.2, 1.4, .5, 1) forwards; pointer-events: none; }
.adopt-stamp.out { opacity: 0; transition: opacity 0.4s; }
@keyframes stamp { to { transform: translate(-50%, -50%) rotate(-12deg) scale(1); opacity: 1; } }
body.vignette::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 5; background: radial-gradient(ellipse at center, transparent 45%, rgba(27, 20, 30, 0.55) 100%); }
.postcards .tile { min-height: 120px; }

/* ── Daumenleiste: Raum-Aktionen über dem Dock (Einhand-Bedienung) ── */
#actbar { position: fixed; left: 0; right: 0; bottom: calc(96px + var(--safe-b)); z-index: 19; display: flex; gap: 8px; padding: 6px 14px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
#actbar::-webkit-scrollbar { display: none; }
#actbar .act { flex: none; scroll-snap-align: start; height: 46px; padding: 0 16px; border-radius: 23px; border: 2px solid var(--linen); background: rgba(255, 250, 240, 0.95); box-shadow: 0 3px 0 var(--linen-deep), var(--shadow); font: 600 15px var(--f-title); color: var(--cocoa); white-space: nowrap; cursor: pointer; }
#actbar .act.big { background: var(--amber); border-color: var(--amber-deep); box-shadow: 0 3px 0 var(--amber-deep), var(--shadow); }
#actbar .act:active { transform: translateY(2px); }
body:not(.ingame) #actbar, body.care-mode #actbar, body.build-mode #actbar { display: none; }
@media (max-width: 760px), (orientation: portrait) {
    .hs { height: 40px; min-width: 40px; padding: 0 4px; margin: -20px 0 0 -20px; }
    .hs .l { display: none; }
    .hs .i { width: 28px; }
    #medal .name { font-size: 16px; }
    .game-pad { bottom: calc(150px + var(--safe-b)); width: min(360px, 92vw); }
}
html.frame .hs { height: 40px; min-width: 40px; padding: 0 4px; margin: -20px 0 0 -20px; }
html.frame .hs .l { display: none; }
html.frame .hs .i { width: 28px; }
html.frame #medal .name { font-size: 16px; }
html.frame .game-pad { bottom: calc(150px + var(--safe-b)); width: min(360px, 92%); }
html.frame #zettels, html.frame .care-meter { width: min(342px, 92%); }

/* ── Pflege-Modus: Streicheln & Bad ── */
body.care-mode #topbar, body.care-mode #dock, body.care-mode #placebar, body.care-mode #hotspots, body.care-mode #coin-badge,
body.build-mode #dock, body.build-mode #placebar, body.build-mode #hotspots, body.build-mode #topbar { display: none !important; }
body.race-mode #dock, body.race-mode #placebar, body.race-mode #hotspots, body.race-mode #actbar { display: none !important; }
.care-back { position: fixed; z-index: 32; left: calc(14px + var(--safe-l)); top: calc(14px + var(--safe-t)); width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--linen); background: rgba(255, 250, 240, 0.95); box-shadow: 0 3px 0 var(--linen-deep), var(--shadow); font: 700 30px/1 var(--f-title); color: var(--cocoa); cursor: pointer; padding: 0 0 4px; }
.care-hand { position: fixed; z-index: 31; left: 0; top: 0; margin: -30px 0 0 -22px; font-size: 44px; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3)); }
.care-meter { position: fixed; z-index: 31; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%); width: min(360px, 92vw); padding: 10px 16px 12px; border-radius: 22px; background: rgba(255, 250, 240, 0.94); border: 2px solid var(--linen); box-shadow: var(--shadow); text-align: center; pointer-events: none; }
.care-meter .hearts { display: flex; justify-content: center; gap: 8px; }
.care-meter .hearts i { width: 30px; height: 30px; font-style: normal; transition: transform 0.2s; }
.care-meter .hearts i::before { content: '♥'; font: 30px/30px sans-serif; color: #E3D3C0; }
.care-meter .hearts i.on::before { color: var(--coral); }
.care-meter .hearts i.on { transform: scale(1.15); }
.care-meter small { display: block; margin-top: 4px; font: 13px var(--f-label); color: var(--latte); }
.bath-foam { position: fixed; z-index: 31; left: calc(76px + var(--safe-l)); right: 14px; top: calc(16px + var(--safe-t)); display: flex; gap: 6px; }
.bath-foam span { flex: 1; position: relative; overflow: hidden; border-radius: 14px; padding: 6px 8px 10px; background: rgba(255, 250, 240, 0.94); border: 2px solid var(--linen); text-align: center; }
.bath-foam b { font: 700 13px var(--f-title); color: var(--cocoa); }
.bath-foam em { display: block; font: 700 15px var(--f-title); font-style: normal; color: var(--cocoa); }
.bath-foam i { position: absolute; left: 0; bottom: 0; height: 6px; width: 0; background: #8fd0e8; transition: width 0.2s; }
.bath-foam span.full { border-color: #7FA77A; }
.bath-foam span.full b::after { content: ' ✓'; color: #5f8f5a; }
.bath-tools { position: fixed; z-index: 31; left: 0; right: 0; bottom: 0; height: calc(88px + var(--safe-b)); padding: 0 8px var(--safe-b); display: flex; align-items: center; justify-content: space-around; background: linear-gradient(#9a6644, #8A5A3B); border-top: 3px solid #6E4630; border-radius: 24px 24px 0 0; }
.bath-tools button { width: 50px; height: 56px; border-radius: 14px; border: 2px solid #6E4630; background: #C99A5B; box-shadow: 0 3px 0 #6E4630; font-size: 24px; line-height: 1; display: grid; place-items: center; align-content: center; padding: 0; cursor: pointer; position: relative; }
.bath-tools button small { font: 9px var(--f-label); color: var(--cocoa); white-space: nowrap; }
.bath-tools button.mid { width: 72px; height: 72px; margin-top: -34px; border-radius: 50%; border: 3px solid var(--amber-deep); background: var(--amber); box-shadow: 0 5px 0 var(--amber-deep), var(--shadow); font-size: 30px; }
.bath-tools button.on { background: #FFF3D6; border-color: var(--amber-deep); transform: translateY(-4px); }
.bath-tools button.off { opacity: 0.4; filter: saturate(0.3); }
.bath-tools button.wish { animation: breathe 1.6s ease-in-out infinite; }
.bath-arrows { position: fixed; z-index: 31; right: calc(10px + var(--safe-r)); top: 42%; display: grid; gap: 10px; }
.bath-arrows button { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--linen); background: rgba(255, 250, 240, 0.92); font-size: 24px; box-shadow: var(--shadow); cursor: pointer; padding: 0; }

/* ── Bau-Modus ── */
.build-band { position: fixed; z-index: 31; left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); top: calc(12px + var(--safe-t)); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 99px; background: rgba(255, 250, 240, 0.95); border: 2px solid var(--amber); box-shadow: var(--shadow); }
.build-band b { font: 600 16px var(--f-title); color: var(--cocoa); white-space: nowrap; }
.build-band small { flex: 1; font: 12px var(--f-label); color: var(--latte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.build-bar { position: fixed; z-index: 31; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(12px + var(--safe-b)); background: rgba(251, 243, 228, 0.97); border-top: 3px solid #D9A86C; border-radius: 22px 22px 0 0; box-shadow: 0 -6px 18px rgba(74, 52, 66, 0.2); }
.build-bar .sel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.build-bar .sel button { height: 44px; padding: 0 14px; border-radius: 22px; border: 2px solid var(--linen); background: var(--oat); font: 600 14px var(--f-title); color: var(--cocoa); cursor: pointer; }
.build-bar .sel button[data-a="ok"] { background: var(--amber); border-color: var(--amber-deep); min-width: 52px; }
.build-bar .sel em { flex-basis: 100%; font: 13px var(--f-label); color: var(--coral); font-style: normal; }
.build-bar .sel em:empty { display: none; }
.build-bar .tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.build-bar .tabs button { height: 36px; padding: 0 14px; border-radius: 18px; border: 2px solid var(--linen); background: transparent; font: 600 14px var(--f-title); color: var(--latte); cursor: pointer; }
.build-bar .tabs button.on { background: var(--amber); border-color: var(--amber-deep); color: var(--cocoa); }
.build-bar .tray { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; min-height: 88px; align-items: stretch; }
.build-bar .tray::-webkit-scrollbar { display: none; }
.build-bar .tray .dim { margin: auto 0; font: 14px var(--f-text); }
.tile-s { flex: none; width: 92px; padding: 6px 6px 8px; border-radius: 16px; border: 2px solid var(--linen); background: #fff; box-shadow: 0 3px 0 var(--linen-deep); display: grid; justify-items: center; gap: 2px; cursor: pointer; color: var(--cocoa); }
.tile-s span { font-size: 26px; line-height: 1.1; }
.tile-s b { font: 600 12px/1.15 var(--f-title); text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-s small { font: 11px var(--f-label); color: var(--latte); }
.tile-s:active { transform: translateY(2px); }
body.raw canvas { filter: sepia(0.5) saturate(0.55) brightness(0.95); transition: filter 0.4s; }

/* ── Gassi: Hasenbau & Aufheben ── */
.game-pad .holes { gap: 14px; }
.game-pad .hole { width: 84px; height: 84px; border-radius: 50%; border: 3px solid #6E4630; background: #8A5A3B; font-size: 38px; cursor: pointer; padding: 0; transition: transform 0.12s, background 0.12s; }
.game-pad .hole.up { background: #9fd08a; border-color: #5f8f5a; transform: translateY(-8px) scale(1.08); }
.pick { position: fixed; z-index: 22; left: calc(16px + var(--safe-l)); bottom: calc(118px + var(--safe-b)); height: 56px; padding: 0 20px; border-radius: 28px; border: 3px solid var(--amber-deep); background: var(--amber); box-shadow: 0 5px 0 var(--amber-deep), var(--shadow); font: 600 17px var(--f-title); color: var(--cocoa); cursor: pointer; animation: breathe 1.6s ease-in-out infinite; }
body.no-dock #actbar { bottom: calc(12px + var(--safe-b)); }

/* ── Handy zuerst (iPhone): Monitor zeigt das Spiel im Handy-Hochformat ── */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-touch-callout: none; }
@media (min-aspect-ratio: 4/5) and (min-width: 600px) {
    html.frame { background: radial-gradient(ellipse at 50% 40%, #27305e 0%, #0b0f26 70%); }
    html.frame body {
        --fh: min(calc(100dvh - 32px), 932px);
        position: relative; margin: max(16px, calc((100dvh - var(--fh)) / 2)) auto 0; height: var(--fh);
        width: clamp(340px, calc(var(--fh) * 0.4615), 430px); max-width: calc(100vw - 32px);
        transform: translateZ(0); overflow: hidden; border-radius: 38px; background: #0b0f26;
        box-shadow: 0 0 0 9px #11162f, 0 0 0 11px #3a4270, 0 28px 70px rgba(0, 0, 0, 0.55);
    }
}

/* Dock-Mitte: Rufen im Wohnzimmer, sonst Heimweg */
#call { color: var(--cocoa); padding: 0; }
#call span { font-size: 34px; line-height: 1; display: grid; place-items: center; }
#call.home { align-content: center; gap: 0; }
#call.home span { font-size: 30px; }
#call small { font: 600 11px var(--f-label); margin-top: 1px; }

/* Kuschel-Herzen: eigenes Symbol, aus = blass */
.care-meter .hearts i.ic { width: 30px; height: 30px; filter: grayscale(1) opacity(0.35); transition: transform 0.2s, filter 0.2s; }
.care-meter .hearts i.ic::before { content: none; }
.care-meter .hearts i.ic.on { filter: none; transform: scale(1.15); }

/* ── Pfoten-Menü: alle Aktionen des Raums im Daumenbereich ── */
body.ingame:not(.no-dock):not(.pins) #hotspots, #actbar { display: none !important; }
body.no-dock .hs .l { display: inline !important; }
#fan { position: absolute; left: 50%; bottom: 46px; width: 0; height: 0; padding: 0; z-index: 2; }
#fan .fan-b { left: -32px; top: -29px; width: 64px; height: 58px; border-radius: 18px; gap: 3px; }
#fan .fan-b span { font-size: 25px; }
#fan .fan-b small { position: static; top: auto; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cocoa); text-shadow: none; font: 600 9.5px/1.1 var(--f-label); }
#fan .fan-b.way { background: #E9C58F; border-color: #A8683C; box-shadow: 0 4px 0 #8A5A3B, var(--shadow); }
#call.open { background: #FFF3D6; }
#door.home { background: #E9B65C; }
#door span { font-size: 26px; }

/* ── iPhone-Ränder im Monitor-Rahmen: Statusleiste, Dynamic Island, Home-Leiste ── */
@media (min-aspect-ratio: 4/5) and (min-width: 600px) {
    html.frame { --safe-t: 50px; --safe-b: 24px; }
    html.frame body::before {
        content: '9:41'; position: fixed; z-index: 90; left: 0; right: 0; top: 0; height: 50px; padding: 16px 0 0 34px; box-sizing: border-box;
        font: 600 15px -apple-system, "SF Pro Text", system-ui, sans-serif; color: #1d1d1f; pointer-events: none;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 68 13'%3E%3Cg fill='%231d1d1f'%3E%3Crect x='0' y='8' width='3' height='4' rx='1'/%3E%3Crect x='4.5' y='6' width='3' height='6' rx='1'/%3E%3Crect x='9' y='3.5' width='3' height='8.5' rx='1'/%3E%3Crect x='13.5' y='1' width='3' height='11' rx='1'/%3E%3C/g%3E%3Cpath d='M24 5.5a9 9 0 0 1 12 0M26.5 8a5 5 0 0 1 7 0' stroke='%231d1d1f' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3Ccircle cx='30' cy='10.5' r='1.4' fill='%231d1d1f'/%3E%3Crect x='42' y='1' width='22' height='11' rx='3' fill='none' stroke='%231d1d1f' stroke-opacity='.45'/%3E%3Crect x='44' y='3' width='16' height='7' rx='1.5' fill='%231d1d1f'/%3E%3Crect x='65' y='4.5' width='1.8' height='4' rx='.9' fill='%231d1d1f' fill-opacity='.45'/%3E%3C/svg%3E") right 26px top 18px / 68px 13px no-repeat;
    }
    html.frame body::after { content: ''; position: fixed; z-index: 91; top: 11px; left: 50%; width: 112px; height: 32px; margin-left: -56px; border-radius: 20px; background: #000; pointer-events: none; }
    html.frame #hud::after { content: ''; position: fixed; z-index: 91; bottom: 8px; left: 50%; width: 128px; height: 5px; margin-left: -64px; border-radius: 3px; background: #1d1d1f; opacity: 0.8; pointer-events: none; }
}
body.ingame #version { display: none; }
#dock { z-index: 3; }
#bubbles { z-index: 1; }

/* Napf-Uhr: eine Zeile, Napf-Symbol + Restzeit bis zum Ende des Fütterungstags */
#clock { width: auto; height: 40px; padding: 0 12px 0 8px; border-radius: 20px; display: flex; align-items: center; gap: 5px; }
#clock .ci { font-size: 20px; line-height: 1; }
#clock b { font-size: 16px; }
#clock small { display: none; }

/* Kopfleiste kompakt: Name bleibt lesbar, Uhr/Wetter/Glocke rücken zusammen */
#topbar { gap: 6px; padding-left: 10px; padding-right: 10px; }
#medal { gap: 6px; padding: 4px 2px; }
#medal .face { width: 42px; height: 42px; font-size: 22px; }
#medal .name { min-width: 42px; }
#wx, #bell { width: 38px; height: 38px; }
#clock { padding: 0 10px 0 7px; gap: 4px; }

/* ── Lesbarkeit auf dem Handy: kräftigere, größere Schrift; nichts steht über ── */
#dock { padding-left: 14px; padding-right: 14px; }
#basket, #door { width: 84px; height: 66px; gap: 2px; }
#basket small, #door small { font: 700 12.5px/1.1 var(--f-label); white-space: nowrap; color: var(--cocoa); }
#placebar { padding: 6px 16px; }
#placebar b { font-size: 17px; font-weight: 700; }
#fan .fan-b { left: -38px; top: -33px; width: 76px; height: 66px; border-radius: 19px; }
#fan .fan-b span { font-size: 27px; }
#fan .fan-b small { max-width: 72px; white-space: normal; text-align: center; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font: 700 11.5px/1.2 var(--f-label); }
.bath-tools button { width: 56px; height: 60px; }
.bath-tools button small { font: 700 10.5px/1.05 var(--f-label); }
.bath-tools button.mid { width: 70px; height: 70px; }
.tile-s small, .care-meter small { font-size: 12.5px; font-weight: 600; }
.tile small { font-size: 13px; }
.build-bar .sel button, .build-bar .tabs button { font-weight: 700; }
/* Stadtplan: Stecknadel mit kurzem Namen darunter */
body.pins .hs { margin: -20px 0 0 -44px; width: 88px; height: auto; min-width: 0; padding: 0; background: none; border: 0; box-shadow: none; display: flex; flex-direction: column; align-items: center; gap: 3px; }
body.pins .hs .i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: rgba(255, 250, 240, 0.96); border: 2px solid var(--linen); box-shadow: 0 3px 0 var(--linen-deep), var(--shadow); }
body.pins .hs .l { display: block !important; max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 7px; border-radius: 9px; background: rgba(62, 42, 30, 0.84); color: #FFF8EC; font: 700 12px/1.25 var(--f-label); }

/* Reiter in Blättern: umbrechen statt seitlich abgeschnitten – alle Bereiche sofort sichtbar */
#sheet .tabs { flex-wrap: wrap; overflow: visible; row-gap: 6px; }
#sheet .tab { padding: 5px 11px; font: 700 13.5px var(--f-title); }
.tile-s.on { border-color: var(--amber); background: #FFF3D6; }

/* Raumname antippbar: Info zum Ort */
#placebar { pointer-events: auto; cursor: pointer; }
#placebar .pi { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 4px; border-radius: 50%; background: var(--amber); color: var(--cocoa); font: 800 13px/1 var(--f-title); vertical-align: 2px; }
.room-info { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.room-info li { background: #FFFAF0; border-radius: 10px; padding: 7px 10px; font: 600 14px/1.3 var(--f-text); }
.room-info li span { font-weight: 500; font-size: 13px; color: var(--latte); }
/* Karte bleibt im Bildschirm (auch im Monitor-Rahmen, wo vw nicht die Handybreite ist) und unter Notch/Statusleiste */
#card { width: min(342px, calc(100% - 28px)); max-height: calc(100% - var(--safe-t, 0px) - var(--safe-b, 0px) - 48px); }
.room-legend { margin-top: 10px; }
.room-legend summary { cursor: pointer; font: 700 14px/1.3 var(--f-text); color: var(--amber-deep); padding: 6px 2px; }
/* Raumname: Info-Punkt immer sichtbar, lange Namen kleiner und nie über der Münzanzeige */
#placebar { display: flex; align-items: center; gap: 6px; max-width: calc(100% - 150px - var(--safe-l) - var(--safe-r)); }
#placebar b { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#placebar .pi { flex: none; margin-left: 0; }
#placebar.long b { font-size: 14px; }
/* Bau-Leiste: Möbel im Raster statt einer langen Reihe – alle erreichbar, senkrecht scrollbar */
.build-bar .tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; max-height: 172px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y; padding-bottom: 4px; }
.build-bar .tray .tile-s { width: auto; padding: 4px 4px 6px; }
.build-bar .tray .tile-s span { font-size: 22px; }
.build-bar .tray .dim { grid-column: 1 / -1; }
/* Stadtplan als Karte: Marker mit Spitze auf dem Dach, Name darüber; weit weg nur die Marker */
body.pins .hs { margin: -66px 0 0 -44px; flex-direction: column-reverse; gap: 2px; }
body.pins .hs .i { position: relative; width: 36px; height: 36px; font-size: 19px; }
body.pins .hs .i::after { content: ''; position: absolute; left: 50%; bottom: -9px; margin-left: -7px; border-style: solid; border-width: 9px 7px 0; border-color: var(--linen) transparent transparent; }
body.pins .hs .l { transition: opacity 0.25s, transform 0.25s; }
body.pins.map-far .hs .l { opacity: 0; transform: translateY(5px); pointer-events: none; }
body.pins .hs:hover .l, body.pins .hs:focus-visible .l { opacity: 1; transform: none; }
#mapzoom { position: fixed; right: calc(12px + var(--safe-r)); bottom: calc(150px + var(--safe-b)); z-index: 18; display: grid; gap: 8px; }
#mapzoom button { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--linen); background: rgba(255, 250, 240, 0.96); color: var(--cocoa); font: 800 26px/1 var(--f-title); box-shadow: 0 3px 0 var(--linen-deep); cursor: pointer; display: grid; place-items: center; padding: 0; }
#mapzoom button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--linen-deep); }
#mapzoom button.home { font-size: 20px; }
body.care-mode #mapzoom, body.build-mode #mapzoom { display: none; }
/* Gassi: Leckerli-Zähler und schlanke Spiel-Leiste (der Hund bleibt sichtbar) */
.treat-chip { position: fixed; left: 50%; top: calc(118px + var(--safe-t)); transform: translateX(-50%); z-index: 18; padding: 4px 14px; border-radius: 99px; background: rgba(255, 250, 240, 0.92); border: 2px solid var(--linen); box-shadow: var(--shadow); font: 700 16px var(--f-title); color: var(--cocoa); pointer-events: none; }
.treat-chip.pop { animation: treatpop 0.35s ease-out; }
@keyframes treatpop { 0% { transform: translateX(-50%) scale(1); } 40% { transform: translateX(-50%) scale(1.25); } 100% { transform: translateX(-50%) scale(1); } }
.game-pad.slim { padding: 8px 12px; bottom: calc(112px + var(--safe-b)); }
.game-pad.slim b { font-size: 15px; margin-bottom: 4px; }
.game-pad.slim .big-tap { width: 86px; height: 86px; font-size: 34px; }
.game-pad.slim .meter { margin: 4px 0 8px; }
.game-pad.slim.top { top: calc(150px + var(--safe-t)); bottom: auto; }
/* Ruheplatz: Zzz über dem schlafenden Hund, beim Kraulen ein Wach-Balken */
.nap-meter { position: fixed; left: 0; top: 0; translate: -50% -100%; display: grid; justify-items: center; gap: 3px; pointer-events: none; }
.nap-meter span { font-size: 22px; animation: napz 2.4s ease-in-out infinite; filter: drop-shadow(0 2px 0 rgba(74, 52, 38, 0.25)); }
.nap-meter i { display: none; width: 56px; height: 9px; border-radius: 6px; background: rgba(255, 250, 240, 0.95); border: 2px solid var(--linen); overflow: hidden; }
.nap-meter.rub i { display: block; }
.nap-meter i b { display: block; height: 100%; width: 0; background: var(--amber); border-radius: 4px; transition: width 0.18s; }
@keyframes napz { 0%, 100% { transform: translate(0, 0) rotate(-6deg); opacity: 0.85; } 50% { transform: translate(6px, -8px) rotate(6deg); opacity: 1; } }
/* Bau-Modus: Korb als Schublade mit Griff; Knöpfe schweben als Blase über dem gewählten Möbel */
.build-bar { padding-top: 0; transition: transform 0.3s cubic-bezier(0.3, 1.3, 0.5, 1); }
.build-bar .grip { display: block; width: 100%; height: 30px; margin: 0 0 2px; padding: 0; border: 0; background: transparent; cursor: grab; touch-action: none; }
.build-bar .grip i { display: block; width: 52px; height: 6px; margin: 11px auto 0; border-radius: 3px; background: #D9A86C; transition: width 0.2s; }
.build-bar .grip:active i { width: 70px; }
.build-bar.mini .tray { display: none; }
.build-bar.mini .tabs { margin-bottom: 0; }
.build-bar.away { transform: translateY(calc(100% - 34px)); }
.build-fab { position: fixed; left: 0; top: 0; z-index: 32; translate: -50% -100%; display: grid; justify-items: center; gap: 6px; pointer-events: none; transition: opacity 0.15s; }
.build-fab[hidden] { display: none; }
.build-fab em { max-width: 240px; padding: 4px 12px; border-radius: 99px; background: rgba(255, 250, 240, 0.96); border: 2px solid var(--linen); font: 700 13px var(--f-title); font-style: normal; color: var(--cocoa); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 0 var(--linen-deep); }
.build-fab.why em { color: #fff; background: var(--coral); border-color: #c95f46; }
.build-fab .acts { display: flex; gap: 8px; pointer-events: auto; animation: fabpop 0.28s cubic-bezier(0.3, 1.5, 0.5, 1); }
.build-fab.dragging .acts { display: none; }
.build-fab .acts button { width: 54px; display: grid; justify-items: center; gap: 1px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.build-fab .acts button[hidden] { display: none; }
.build-fab .acts span { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: rgba(255, 250, 240, 0.97); border: 2px solid var(--linen); box-shadow: 0 3px 0 var(--linen-deep); }
.build-fab .acts button:active span { transform: translateY(2px); box-shadow: 0 1px 0 var(--linen-deep); }
.build-fab .acts button.ok span { background: var(--amber); border-color: var(--amber-deep); box-shadow: 0 3px 0 var(--amber-deep); color: var(--cocoa); font-weight: 800; }
.build-fab .acts small { font: 700 11px var(--f-label); color: var(--cocoa); text-shadow: 0 1px 0 rgba(255, 250, 240, 0.9), 0 0 4px rgba(255, 250, 240, 0.9); }
@keyframes fabpop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
/* Bau-Blase: nur die runden Knöpfe fangen Finger ab; bei offener Karte treten die Bau-Leisten zurück */
.build-fab .acts, .build-fab .acts button { pointer-events: none; }
.build-fab .acts button span { pointer-events: auto; }
body.build-modal .build-band, body.build-modal .build-bar { pointer-events: none; opacity: 0.45; }
/* Turnier-Kino (E8): Vorhang, Titelkarte, Countdown, Namensschilder, Kommentatoren-Leiste mit Popcorn-Tüte, Bahn-Schienen – Kino-Glas & Bernstein */
.race-ui { position: fixed; inset: 0; z-index: 12; pointer-events: none; overflow: hidden; }
.race-ui::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 85% 70% at 50% 45%, transparent 55%, rgba(18, 15, 12, 0.55)); opacity: 0; transition: opacity 0.4s; }
.race-ui.slow::before { opacity: 1; }
.race-curtain { position: absolute; top: 0; bottom: 0; width: 51%; z-index: 6; background: linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 16%, transparent 82%, rgba(0, 0, 0, 0.32)), repeating-linear-gradient(90deg, #8E2F3A 0 16px, #A23A47 16px 22px, #7A2632 22px 34px); animation: racecurtainL 1.25s 0.35s cubic-bezier(0.6, 0, 0.3, 1) forwards; }
.race-curtain.l { left: 0; border-right: 3px solid #F59E0B; }
.race-curtain.r { right: 0; border-left: 3px solid #F59E0B; animation-name: racecurtainR; }
@keyframes racecurtainL { to { transform: translateX(-104%); } }
@keyframes racecurtainR { to { transform: translateX(104%); } }
.race-title { position: absolute; left: 50%; top: 30%; z-index: 3; transform: translate(-50%, -50%) scale(1.2); display: grid; justify-items: center; gap: 1px; padding: 8px 18px 9px; border-radius: 20px; background: rgba(18, 15, 12, 0.88); border: 2px solid rgba(245, 158, 11, 0.55); color: #FFF3D6; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); transition: top 0.7s cubic-bezier(0.3, 1.2, 0.4, 1), transform 0.7s cubic-bezier(0.3, 1.2, 0.4, 1); }
.race-ui.top .race-title { top: calc(86px + var(--safe-t)); transform: translate(-50%, -50%) scale(0.86); }
.race-title b { font: 700 17px var(--f-title); color: #FFE8A3; }
.race-title small { font: 600 11px var(--f-label); opacity: 0.85; }
.race-count { position: absolute; left: 50%; top: 44%; z-index: 4; transform: translate(-50%, -50%); display: grid; justify-items: center; font: 900 84px/1 var(--f-title); color: #FFF3D6; text-shadow: 0 5px 0 #8E2F3A, 0 0 26px rgba(245, 158, 11, 0.7); white-space: nowrap; opacity: 0; }
.race-count.long { font-size: 58px; }
.race-count small { font: 800 22px/1.3 var(--f-title); color: #FFE8A3; text-shadow: 0 2px 0 #8E2F3A, 0 0 12px rgba(245, 158, 11, 0.6); }
.race-count.pop { animation: racepop 1.1s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
@keyframes racepop { 0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; } 25% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } 70% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -60%) scale(0.9); opacity: 0; } }
.race-hint, .race-slow { position: absolute; left: 50%; top: calc(122px + var(--safe-t)); z-index: 3; transform: translateX(-50%); white-space: nowrap; opacity: 0; }
.race-hint { padding: 3px 10px; border-radius: 99px; background: rgba(18, 15, 12, 0.62); font: 700 11px var(--f-label); color: #FFF3D6; }
.race-hint.show { animation: racehint 5.5s ease both; }
@keyframes racehint { 0%, 100% { opacity: 0; transform: translate(-50%, -4px); } 8%, 86% { opacity: 1; transform: translate(-50%, 0); } }
.race-slow { padding: 3px 11px 3px 9px; border-radius: 99px; background: rgba(142, 47, 58, 0.92); border: 1px solid rgba(255, 232, 163, 0.5); font: 800 10px var(--f-label); letter-spacing: 0.14em; text-transform: uppercase; color: #FFF3D6; transition: opacity 0.3s; }
.race-slow::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #FFE8A3; box-shadow: 0 0 6px #F59E0B; }
.race-ui.slow .race-slow { opacity: 1; }
.race-tag { position: absolute; left: 0; top: 0; translate: -50% -100%; pointer-events: auto; display: flex; align-items: center; gap: 3px; max-width: 92px; padding: 2px 8px 2px 2px; border-radius: 99px; background: var(--c); border: 2px solid #FFF8EC; font: 800 11px/1.2 var(--f-text); color: #3B2A1E; white-space: nowrap; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); cursor: pointer; transition: scale 0.2s; }
.race-tag::after { content: ''; position: absolute; inset: -10px -4px; }
.race-tag span { overflow: hidden; text-overflow: ellipsis; }
.race-tag em { flex: none; min-width: 18px; height: 18px; padding: 0 3px; border-radius: 9px; display: grid; place-items: center; background: #FFF8EC; font: 800 11px var(--f-title); font-style: normal; }
.race-tag.me { border-color: #F59E0B; scale: 1.1; z-index: 2; }
.race-tag.on { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.55), 0 2px 0 rgba(0, 0, 0, 0.25); }
.race-tag.lead::before { content: ''; position: absolute; left: 50%; top: -12px; width: 18px; height: 11px; margin-left: -9px; background: linear-gradient(#FFE8A3, #F59E0B 70%); clip-path: polygon(0 100%, 0 25%, 25% 62%, 50% 0, 75% 62%, 100% 25%, 100% 100%); animation: racecrown 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes racecrown { from { transform: translateY(6px) scale(0.4); opacity: 0; } }
.race-tag.in em { background: #FFE8A3; }
.race-tag em.m1 { background: #E9B949; }
.race-tag em.m2 { background: #C9CED6; }
.race-tag em.m3 { background: #C07A44; color: #FFF8EC; }
.race-bar { position: absolute; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); z-index: 3; padding: 6px 12px 10px; border-radius: 20px; background: rgba(18, 15, 12, 0.86); border: 2px solid rgba(245, 158, 11, 0.45); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); color: #FFF3D6; transition: opacity 0.5s, transform 0.5s; }
.race-bar.off { opacity: 0; transform: translateY(24px); }
.race-talk { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-height: 42px; margin: 8px 0 7px; }
.race-talk p { margin: 0; font: 700 14px/1.3 var(--f-text); animation: racetalk 0.35s cubic-bezier(0.3, 1.4, 0.5, 1) backwards; transition: opacity 0.4s; }
.race-talk p:not(:last-child) { opacity: 0.5; font-size: 12px; }
.race-talk p.out { opacity: 0; }
.race-talk b { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 5px; background: linear-gradient(#C98E5A, #A8683C); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2); font: 800 9px/16px var(--f-label); letter-spacing: 0.06em; text-transform: uppercase; color: #FFF3D6; vertical-align: 1px; }
.race-talk b.K { background: linear-gradient(#A8414E, #8E2F3A); }
@keyframes racetalk { from { opacity: 0; transform: translateY(8px); } }
.race-track { position: relative; display: grid; gap: 7px; margin: 0 26px 0 2px; padding: 3px 0; }
.race-track b { position: relative; display: block; height: 3px; }
.race-track b::before { content: ''; position: absolute; inset: 0; border-radius: 2px; background: var(--c); opacity: 0.45; }
.race-track span { position: absolute; top: 50%; left: 0; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--c); border: 2px solid #FFF8EC; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.race-track span.me { width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; border-color: #F59E0B; z-index: 2; }
.race-track .flag { position: absolute; right: -24px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 3px; background: conic-gradient(#2B2320 25%, #FFF8EC 0 50%, #2B2320 0 75%, #FFF8EC 0) 0 0 / 8px 8px; border: 2px solid #FFF8EC; }
.race-pop { position: absolute; left: 50%; top: -25px; width: 30px; height: 34px; margin-left: -15px; }
.race-pop::before { content: ''; position: absolute; left: 1px; right: 1px; top: 0; height: 13px; background: radial-gradient(circle at 18% 72%, #FFF3D6 0 4px, transparent 4.6px), radial-gradient(circle at 50% 48%, #FFE8A3 0 5px, transparent 5.6px), radial-gradient(circle at 82% 72%, #FFF3D6 0 4px, transparent 4.6px), radial-gradient(circle at 33% 30%, #FFF3D6 0 3.6px, transparent 4.2px), radial-gradient(circle at 67% 28%, #FFF8EC 0 3.6px, transparent 4.2px); }
.race-pop i { position: absolute; left: 0; right: 0; top: 9px; bottom: 0; clip-path: polygon(0 0, 100% 0, 84% 100%, 16% 100%); background: repeating-linear-gradient(90deg, #E2483D 0 5px, #FFF8EC 5px 10px); }
.race-pop.hop { animation: racehop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes racehop { 40% { transform: translateY(-5px) scale(1.08, 0.92); } }
.race-pop b { position: absolute; left: 50%; top: 2px; width: 9px; height: 8px; margin-left: -4.5px; border-radius: 50% 50% 45% 45%; background: radial-gradient(circle at 35% 35%, #FFFDF5, #FFF3D6 60%, #E9C98A); animation: racekern 1.1s cubic-bezier(0.2, 0.7, 0.4, 1) both; }
@keyframes racekern { 0% { transform: translate(0, 4px) scale(0.6); opacity: 0; } 12% { opacity: 1; } 50% { transform: translate(calc(var(--dx) * 0.7), var(--dy)) rotate(170deg) scale(1.15); } 100% { transform: translate(var(--dx), 6px) rotate(330deg); opacity: 0; } }
.race-board { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(330px, calc(100% - 32px)); max-height: 62%; overflow: auto; pointer-events: auto; padding: 12px 12px 8px; border-radius: 22px; background: rgba(18, 15, 12, 0.9); border: 2px solid rgba(245, 158, 11, 0.55); color: #FFF3D6; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.race-board > b { display: block; text-align: center; font: 700 17px var(--f-title); color: #FFE8A3; margin-bottom: 6px; }
.race-board ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.race-board li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; background: rgba(35, 54, 92, 0.55); animation: raceflip 0.4s ease-out both; transform-origin: top; }
.race-board li.me { background: rgba(245, 158, 11, 0.3); color: #FFE8A3; }
.race-board li em { width: 26px; text-align: center; font: 800 15px var(--f-title); font-style: normal; }
.race-board li span { flex: 1; font: 800 13px var(--f-text); display: grid; }
.race-board li small { font: 600 10px var(--f-label); opacity: 0.75; }
.race-board li i { font: 800 12px var(--f-text); font-style: normal; color: #FFE8A3; }
@keyframes raceflip { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
/* Gassi-Anzeige oben: Knochen x/y · Reststrecke, dünner Fortschritt darunter */
.treat-chip { display: flex; align-items: center; gap: 10px; overflow: hidden; padding: 5px 14px 8px; }
.treat-chip > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.treat-chip > span + span { padding-left: 10px; border-left: 2px solid var(--linen); font-size: 14px; }
.treat-chip .bar { position: absolute; left: 12px; right: 12px; bottom: 3px; height: 3px; border-radius: 2px; background: rgba(110, 70, 48, 0.15); }
.treat-chip .bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: #F59E0B; transition: width 0.4s; }
/* Mini-Spiele beim Gassi: jederzeit „Weiterlaufen“ */
.game-pad .skip { display: block; margin: 8px auto 0; min-height: 40px; padding: 8px 18px; border-radius: 99px; border: 2px solid var(--linen); background: rgba(255, 255, 255, 0.75); font: 700 14px var(--f-text); color: var(--cocoa); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.game-pad .skip:active { transform: scale(0.96); }
.game-pad .skip:disabled { opacity: 0.5; }
/* Mengenwahl im Laden: groß genug für den Daumen */
.qty { margin: 6px 0 2px; text-align: center; }
.qty-row { display: flex; align-items: center; justify-content: center; gap: 18px; }
.qty-row button { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--linen-deep, #d9c3a0); background: #fffaf0; font: 800 26px/1 var(--f-main); color: var(--cocoa); cursor: pointer; }
.qty-row b { min-width: 64px; font: 800 30px/1 var(--f-main); color: var(--cocoa); }
.qty-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.qty-chips button { min-height: 40px; padding: 6px 14px; border-radius: 99px; border: 2px solid var(--linen-deep, #d9c3a0); background: #fffaf0; font: 700 14px var(--f-main); color: var(--cocoa); cursor: pointer; }
.qty-row button:active, .qty-chips button:active { transform: scale(0.94); }
.qty-info { margin: 10px 0 0; }
.btn.locked { opacity: 0.55; filter: saturate(0.4); }
/* Kisten und Funde: eigene Stufenfarben; Rolle in Schmiede-Farben (Weltbuch C7: Werkbank, Messing, Glut) */
.lt1 { --tier: #7FB069; } .lt2 { --tier: #2FA39A; } .lt3 { --tier: #F59E0B; } .lt4 { --tier: #3E4F8C; } .lt5 { --tier: #8A5FB8; }
.tile.lt1, .tile.lt2, .tile.lt3, .tile.lt4 { --rar: var(--tier); }
.tile.lt5 { border-left-color: transparent; background: linear-gradient(var(--oat), var(--oat)) padding-box, linear-gradient(180deg, #E2483D, #C77B3E, #D9A441, #5F9A5A, #2F6FBA, #8A5FB8) border-box; }
.tile .ti img.thumb { display: block; width: 46px; height: 46px; }
img[data-thumb] { opacity: 0; transition: opacity 0.22s; }
img[data-thumb].in { opacity: 1; }
i.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--tier); margin-right: 5px; vertical-align: -1px; }
i.dot.lt5 { background: conic-gradient(#E2483D, #C77B3E, #D9A441, #5F9A5A, #2F6FBA, #8A5FB8, #E2483D); }
.crates { display: grid; gap: 8px; margin: 10px 0 2px; text-align: left; }
.crate-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px; padding: 7px 8px 7px 12px; border-radius: 16px; background: var(--paper); border: 2px solid var(--linen); }
.crate-row.up { grid-template-columns: 1fr auto; }
.crate-row.off { opacity: 0.62; }
.crate-row b { font: 800 14px/1.2 var(--f-main); color: var(--cocoa); }
.crate-row small { display: block; font: 600 12px/1.3 var(--f-main); color: var(--latte); }
.crate-row .btn { min-height: 40px; padding: 6px 12px; font-size: 13px; }
.odds { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; margin: 6px 0 0; font: 700 12px var(--f-main); color: var(--latte); }
.roll { position: fixed; inset: 0; z-index: 42; display: grid; place-items: center; padding: 0 16px; background: rgba(58, 42, 51, 0.82); opacity: 0; transition: opacity 0.22s; touch-action: none; }
.roll.in { opacity: 1; }
.roll-box { width: 100%; max-width: 420px; min-width: 0; text-align: center; }
.roll-box h3 { margin: 0 0 12px; font: 800 20px var(--f-main); color: var(--oat); }
.roll-win { position: relative; height: 152px; overflow: hidden; border-radius: 22px; background: #5A3B28; border: 3px solid #D9A84E; box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.35); }
.roll-strip { display: flex; gap: 8px; padding: 14px 0; transform: translateX(0px); will-change: transform; }
.rt { flex: 0 0 104px; height: 118px; box-sizing: border-box; display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; padding: 4px 4px 3px; border-radius: 14px; background: var(--oat); border: 2px solid var(--linen); border-bottom: 7px solid var(--tier); }
.rt.lt5 { border-bottom-color: transparent; background: linear-gradient(var(--oat), var(--oat)) padding-box, linear-gradient(90deg, #E2483D, #C77B3E, #D9A441, #5F9A5A, #2F6FBA, #8A5FB8) border-box; }
.rt img { width: 72px; height: 72px; }
.rt b { font: 700 11px/1.15 var(--f-main); color: var(--cocoa); max-height: 3.5em; overflow: hidden; }
.rt.won { position: relative; z-index: 1; animation: won 0.6s ease-out both; box-shadow: 0 0 0 3px var(--tier), 0 0 24px var(--tier); }
@keyframes won { 45% { transform: scale(1.1); } to { transform: scale(1.05); } }
.roll-mark { position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; margin-left: -2px; border-radius: 2px; background: #FF7A2B; box-shadow: 0 0 10px #FFC15A; pointer-events: none; }
.roll-mark::before, .roll-mark::after { content: ''; position: absolute; left: 50%; margin-left: -9px; border: 9px solid transparent; }
.roll-mark::before { top: 0; border-top-color: #FF7A2B; }
.roll-mark::after { bottom: 0; border-bottom-color: #FF7A2B; }
.roll-hint { margin: 12px 0 0; font: 700 13px var(--f-main); color: rgba(255, 250, 240, 0.72); }
.find { display: grid; justify-items: center; gap: 8px; margin: 2px 0 10px; }
.find img { width: 132px; height: 132px; border-radius: 22px; background: radial-gradient(circle, #FFFFFF 0%, var(--paper) 72%); box-shadow: 0 0 0 3px var(--tier), 0 0 26px var(--tier); }
.find b { padding: 4px 14px; border-radius: 99px; font: 800 15px var(--f-main); color: #FFFFFF; background: var(--tier); }
.find.lt1 b, .find.lt3 b { color: var(--cocoa); }
.find.lt5 b { background: linear-gradient(90deg, #E2483D, #C77B3E, #D9A441, #5F9A5A, #2F6FBA, #8A5FB8); }
.find.lt5 img { box-shadow: 0 0 0 3px #D9A441, 0 0 28px #8A5FB8; }
.col-book h4 { margin: 14px 0 6px; font: 800 14px var(--f-main); color: var(--cocoa); }
.col-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }   /* lange Namen sprengen keine Spalte */
.col-grid figure { margin: 0; padding: 4px 4px 5px; border-radius: 12px; background: var(--paper); border: 2px solid var(--linen); border-bottom: 5px solid var(--tier); text-align: center; }
.col-grid img { display: block; width: 100%; aspect-ratio: 1; }
.col-grid figcaption { font: 700 10.5px/1.15 var(--f-main); color: var(--cocoa); overflow-wrap: anywhere; hyphens: auto; }
/* Stadtplan: Namen nie gekürzt; Nadeln stapeln sich nur innerhalb ihrer Ebene */
#hotspots { isolation: isolate; }
body.pins .hs .l { max-width: 124px; }
/* Vorschaubilder im Bau-Modus und Drehbühne beim Kaufen */
.tile-s span img.thumb { display: block; width: 54px; height: 54px; }
.look { display: grid; justify-items: center; gap: 4px; margin: 2px 0 8px; }
.look canvas { width: 200px; height: 200px; border-radius: 22px; background: radial-gradient(circle, #FFFFFF 0%, var(--paper) 72%); box-shadow: inset 0 0 0 2px var(--linen); touch-action: none; cursor: grab; }
.look small { font: 600 12px var(--f-main); color: var(--latte); }
.tile .ti img.thumb.dog { width: 76px; height: 76px; }   /* Ur-Hunde: Porträt statt Einheitssymbol */
.list-txt { display: block; width: 100%; box-sizing: border-box; margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--linen); background: #fffaf0; font: 600 14px var(--f-main); color: var(--cocoa); }
.qty-chips button.on { background: var(--amber); border-color: var(--amber-deep); color: #FFFFFF; }
.tile .ti img.thumb.room { width: 72px; height: 72px; }   /* Tapete/Boden: kleine Raumecke */

/* ── Anmeldung (nur online) ── */
#login { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: var(--night); font-family: var(--f-main); color: var(--cocoa); }
#login .cushion-card { width: min(360px, 100%); }
#login label { display: block; font-weight: 700; font-size: 15px; margin: 12px 4px 0; }
#login input { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font: 600 17px var(--f-main); color: var(--cocoa); background: var(--milk); border: 2px solid var(--linen); border-radius: 14px; }
#login input:focus { outline: none; border-color: var(--amber); }
#login .err { min-height: 1.3em; margin: 10px 4px 0; color: #B3261E; font-weight: 700; }
#login .dim { font-size: 13px; color: var(--latte); margin: 14px 4px 0; }
#login form.wait { opacity: 0.6; pointer-events: none; }
#settings .acct b { font-size: 16px; }
#card textarea { width: 100%; margin-top: 8px; padding: 10px; font: 500 16px var(--f-main); color: var(--cocoa); background: var(--milk); border: 2px solid var(--linen); border-radius: 12px; resize: vertical; }
#basket.locked, #door.locked { opacity: 0.45; filter: grayscale(0.8); box-shadow: none; }   /* erst mit dem ersten Hund */
.used { opacity: 0.28; filter: grayscale(1); }   /* verbrauchte Gassi-Pfoten */
#card .bug-pics { display: block; margin-top: 12px; font-weight: 700; font-size: 15px; color: var(--cocoa); }
#card .bug-pics input { display: block; margin-top: 6px; max-width: 100%; font: 500 14px var(--f-main); }
/* lange Karten scrollen: der gestrichelte Rand ist ein Umriss am Kartenrand statt einer mitlaufenden Ebene */
#card.cushion-card::before, #settings.cushion-card::before { content: none; }
#card.cushion-card, #settings.cushion-card { outline: 1.5px dashed rgba(191, 165, 127, 0.7); outline-offset: -10px; }
