/* Sonnenhof – Querformat, Lack-Holz und Washi-Papier */
:root { --lack: #24160f; --lack2: #3a2418; --gold: #c9a45c; --gold2: #e8cc8a; --washi: #f5eddb; --washi2: #e9dcc0; --ink: #2a1a10; --red: #c8382c; --indigo: #26365e;
  --sl: env(safe-area-inset-left); --sr: env(safe-area-inset-right); --sb: env(safe-area-inset-bottom); --st: env(safe-area-inset-top); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #10140e; color: var(--ink);
  font: 600 15px/1.35 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; touch-action: none; }
.px, .clock, .slot b, .act-wrap, .panel h2, .tab, .btn, .night, .toast { font-family: "DotGothic16", ui-rounded, system-ui, sans-serif; font-weight: 400; }
#game { position: fixed; left: 0; top: 0; display: block; image-rendering: pixelated; image-rendering: crisp-edges; image-rendering: pixelated; }
#touch { position: fixed; inset: 0; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { image-rendering: pixelated; }

/* Lack-Rahmen */
.clock, .panel-btn, .bar, .energy, .eat, .cycle, .talk { background: linear-gradient(#3e2a1c, var(--lack)); border: 2px solid var(--gold); border-radius: 10px;
  box-shadow: inset 0 0 0 2px #120a06, inset 0 2px 0 3px rgba(255,220,160,.12), 0 3px 0 rgba(0,0,0,.45); color: var(--washi); }

.hud-top { position: fixed; top: calc(var(--st) + 8px); left: calc(var(--sl) + 10px); right: calc(var(--sr) + 10px); display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.panel-btn { width: 46px; height: 42px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 0 12px; }
.panel-btn span { display: block; height: 3px; background: var(--gold2); border-radius: 2px; }
.clock { padding: 4px 12px 6px; min-width: 176px; }
.clock .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.clock #date { font-size: 15px; color: var(--gold2); }
.clock #wx { width: 24px; height: 24px; }
.clock #time { font-size: 24px; letter-spacing: 1px; }
.money { display: flex; align-items: center; gap: 4px; font-size: 18px; color: #ffd86a; }
.money img { width: 20px; height: 20px; }

.hud-right { position: fixed; right: calc(var(--sr) + 14px); bottom: calc(var(--sb) + 12px); display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.hud-right > * { pointer-events: auto; }
.energy { position: fixed; right: calc(var(--sr) + 14px); top: calc(var(--st) + 82px); width: 26px; height: 116px; padding: 4px; display: flex; align-items: flex-end; }
.energy i { display: block; width: 100%; border-radius: 4px; transition: height .3s; }
.energy em { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-style: normal; font-size: 12px; color: var(--gold2); text-shadow: 0 1px 0 #000; }
.eat { padding: 8px 14px; font-family: "DotGothic16", system-ui; }
.eat small { color: #9be05a; }
.act-wrap { position: relative; width: 96px; height: 96px; }
.act { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--gold); background: radial-gradient(circle at 40% 35%, #e0503c, var(--red) 55%, #7a1c16);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.25), inset 0 4px 0 4px rgba(255,200,160,.18), 0 5px 0 rgba(0,0,0,.45); display: grid; place-items: center; touch-action: none; }
.act img { width: 56px; height: 56px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
.act.special { background: radial-gradient(circle at 40% 35%, #4a64a0, var(--indigo) 55%, #121a30); }
.act.down { transform: translateY(3px); box-shadow: inset 0 0 0 3px rgba(0,0,0,.3), 0 2px 0 rgba(0,0,0,.45); }
.cycle { position: absolute; left: -46px; top: -6px; width: 42px; height: 42px; border-radius: 50%; font-size: 20px; display: grid; place-items: center; touch-action: none; }

.hud-bottom { position: fixed; left: 0; right: 0; bottom: calc(var(--sb) + 8px); display: flex; justify-content: center; pointer-events: none; }
.bar { pointer-events: auto; display: flex; gap: 3px; padding: 4px; max-width: calc(100vw - var(--sl) - var(--sr) - 300px); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.bar::-webkit-scrollbar { display: none; }
.slot { position: relative; flex: 0 0 auto; width: 46px; height: 46px; padding: 0; border: 2px solid #6a4a2a; border-radius: 6px; background: linear-gradient(#f3e6c8, #dcc79c); }
.slot.empty { background: rgba(243,230,200,.35); }
.slot .ico { width: 38px; height: 38px; display: block; margin: auto; }
.slot b { position: absolute; right: 2px; bottom: -1px; font-size: 13px; color: #fff; text-shadow: 1px 1px 0 #2a1a10, -1px 0 0 #2a1a10, 0 -1px 0 #2a1a10; }
.slot.sel { border-color: var(--red); box-shadow: 0 0 0 2px #ffd86a; background: linear-gradient(#fff7e0, #f0dcae); }
.slot .lvl { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 4px; background: rgba(0,0,0,.4); border-radius: 2px; overflow: hidden; }
.slot .lvl i { display: block; height: 100%; background: #5ab0e8; }

.stick { position: fixed; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .15s;
  background: radial-gradient(circle, rgba(255,240,210,.12), rgba(255,240,210,.22) 68%, rgba(201,164,92,.55) 70%, rgba(201,164,92,0) 74%); }
.stick.on { opacity: 1; }
.stick i { position: absolute; left: 36px; top: 36px; width: 48px; height: 48px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff4dc, #d8b878 60%, #8a6a3a); box-shadow: 0 3px 6px rgba(0,0,0,.35); }

.toast { position: fixed; left: 50%; top: calc(var(--st) + 12px); transform: translate(-50%, -10px); opacity: 0; transition: .25s; pointer-events: none;
  background: rgba(36,22,15,.92); border: 1px solid var(--gold); color: var(--washi); padding: 7px 14px; border-radius: 10px; max-width: 60vw; text-align: center; font-size: 15px; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Fenster */
.sheet, .night, .rotate { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; background: rgba(16,10,6,.5); }
[hidden] { display: none !important; }
.panel { width: min(520px, 94vw); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); display: flex; flex-direction: column; background: var(--washi);
  border: 3px solid var(--lack); outline: 2px solid var(--gold); outline-offset: -7px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: pop .18s ease-out; }
.panel.wide { width: min(760px, 94vw); }
@keyframes pop { from { transform: scale(.96); opacity: .4; } }
.panel header { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px 4px; border-bottom: 2px solid var(--washi2); }
.panel h2 { margin: 0; font-size: 22px; color: var(--ink); }
.panel h2::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--red); border-radius: 50%; margin-right: 10px; vertical-align: 2px; }
.x { border: 0; background: none; font-size: 20px; padding: 4px 8px; }
.body { overflow-y: auto; padding: 8px 18px 16px; -webkit-overflow-scrolling: touch; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; }
.tab { padding: 6px 14px; border: 2px solid var(--lack2); border-radius: 8px; background: var(--washi2); font-size: 15px; }
.tab.on { background: var(--lack2); color: var(--gold2); }
.tabs .purse { margin-left: auto; font-family: "DotGothic16", system-ui; }
.purse { margin: 4px 0 8px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 0 18px; }
.panel.wide .grid { grid-template-columns: 1fr 1fr; }
.item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #cdb98e; }
.item .ico { width: 40px; height: 40px; flex: 0 0 auto; }
.txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.txt small { font-weight: 500; color: #6a4a30; font-size: 12.5px; }
.need span { margin-right: 6px; white-space: nowrap; }
.miss { color: #b03a2a; }
.mini { width: 18px; height: 18px; vertical-align: -4px; margin-right: 2px; }
.buy { display: flex; gap: 5px; }
.btn { padding: 7px 12px; border: 2px solid var(--lack2); border-radius: 8px; background: #f0dfb8; box-shadow: 0 2px 0 var(--lack2); font-size: 15px; }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.primary { background: var(--red); color: #fff4e0; border-color: #6a1a14; box-shadow: 0 2px 0 #6a1a14; }
.btn.danger { background: #e8b0a0; }
.btn[disabled] { opacity: .4; }
.btn.big { font-size: 20px; padding: 10px 26px; margin-top: 12px; }
.row-btns { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.col-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.note { color: #6a4a30; font-weight: 500; font-size: 13.5px; }
.small { font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip { border: 2px solid var(--lack2); border-radius: 20px; background: #fff6e2; padding: 3px 10px 3px 6px; }
.help { padding-left: 18px; font-weight: 500; columns: 2; column-gap: 26px; } .help li { margin: 0 0 8px; break-inside: avoid; }
.omikuji { text-align: center; padding: 6px 10px; background: #fffaf0; border: 2px solid var(--red); border-radius: 8px; }
.omikuji .big { font-size: 18px; font-family: "DotGothic16", system-ui; }

.night { background: radial-gradient(circle at 70% 20%, #2a3a6e, #0e1226 70%); color: var(--washi); }
.night-box { width: min(460px, 92vw); max-height: 94vh; overflow-y: auto; text-align: center; padding: 14px; }
.moon { font-size: 28px; margin: 0 0 8px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.moon img { width: 40px; height: 40px; }
.night h3 { margin: 12px 0 4px; font-size: 18px; color: #ffd86a; font-weight: 400; }
.night ul { list-style: none; padding: 0; margin: 0; text-align: left; }
.night li { display: flex; align-items: center; gap: 6px; padding: 3px 0; border-bottom: 1px solid rgba(245,237,219,.15); }
.night li span { margin-left: auto; color: #ffd86a; }
.total { font-size: 18px; } .season { color: #b8f0a0; }

.rotate { background: #120c08; color: var(--washi); text-align: center; z-index: 20; }
.rotate .phone { width: 46px; height: 76px; border: 4px solid var(--gold); border-radius: 9px; margin: 0 auto 18px; animation: turn 2s ease-in-out infinite; }
@keyframes turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
.rotate p { font-family: "DotGothic16", system-ui; font-size: 20px; margin: 6px 20px; }
.rotate .small { font-size: 14px; opacity: .7; }
.rotate .btn { margin-top: 18px; }

@media (max-height: 380px) {
  .act-wrap { width: 84px; height: 84px; } .act img { width: 48px; height: 48px; }
  .slot { width: 42px; height: 42px; } .slot .ico { width: 34px; height: 34px; }
  .energy { height: 92px; }
}

/* Zuhause und Ankleide */
.home { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.home-btn { text-align: left; padding: 14px; border: 2px solid var(--lack2); border-radius: 10px; background: #fff6e2; display: flex; flex-direction: column; gap: 4px; }
.home-btn b { font-family: "DotGothic16", system-ui; font-weight: 400; font-size: 18px; }
.home-btn small { color: #6a4a30; font-weight: 500; }
.dress { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.mirror { padding: 10px 18px; border-radius: 50% 50% 12px 12px / 18% 18% 12px 12px; border: 4px solid #b08a4a; outline: 2px solid var(--lack); background: linear-gradient(#e6dccb, #c9b896 70%, #a88a5e); box-shadow: inset 0 0 18px rgba(255,255,255,.6); }
#dress-cv { display: block; height: min(64vh, 300px); width: auto; aspect-ratio: 1 / 2; image-rendering: pixelated; }
.dress-opts h4 { margin: 8px 0 4px; font-family: "DotGothic16", system-ui; font-weight: 400; color: var(--ink); }
.sws { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border: 2px solid #cdb98e; border-radius: 20px; background: #fffaf0; font-size: 14px; }
.sw i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.3); }
.sw.on { border-color: var(--red); background: #ffe8e0; }
.sl { display: grid; grid-template-columns: 90px 52px 1fr 52px; align-items: center; gap: 6px; margin: 10px 0; font-size: 14px; }
.sl small { color: #6a4a30; text-align: center; }
.sl input { width: 100%; accent-color: var(--red); }

/* Sonnenhaus */
.left-btns { display: flex; gap: 8px; }
.panel-btn.shop { width: auto; padding: 0 14px; flex-direction: row; font-family: "DotGothic16", system-ui; color: var(--gold2); font-size: 16px; }
.clock #time { font-size: 20px; }
.cozy { color: #ffd86a; font-family: "DotGothic16", system-ui; }
.cycle.rot { top: 40px; left: -50px; }
.talk { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--sb) + 70px); width: min(620px, 72vw); display: flex; gap: 12px; align-items: center; padding: 10px 12px; z-index: 9; }
#talk-face { width: 72px; height: 72px; image-rendering: pixelated; background: #f5eddb; border-radius: 8px; border: 2px solid var(--gold); flex: 0 0 auto; }
.talk-body { flex: 1; min-width: 0; }
.talk-name { font-family: "DotGothic16", system-ui; color: var(--gold2); font-size: 17px; }
.hearts { color: #f07a8a; margin-left: 6px; letter-spacing: 1px; }
#talk-text { margin: 4px 0 0; color: var(--washi); font-weight: 500; }
.tabs.scroll { overflow-x: auto; scrollbar-width: none; }
.cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; background: #fffaf0; border: 2px solid #dcc59a; border-radius: 10px; text-align: center; }
.card img { height: 64px; max-width: 100%; object-fit: contain; image-rendering: pixelated; }
.card small { color: #6a4a30; font-weight: 500; }
.card.locked { opacity: .55; } .lock { font-size: 12px; color: #8a2a24; }
.sw img.mini { width: 22px; height: 22px; border-radius: 4px; }
.wl { text-align: left; }
.panel.still { animation: none; }
