:root { --cream: #f7e8d4; --ink: #3b2f4a; --muted: #7d6c8c; --purple: #8a5cf0; --line: rgba(59, 47, 74, .22);
  --font: ui-rounded, "Nunito", "Quicksand", "Segoe UI", system-ui, -apple-system, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #c9b6f2; font-family: var(--font); color: var(--ink); }
canvas#c { display: block; width: 100vw; height: 100vh; touch-action: none; }
.hidden { display: none !important; }
button { font: inherit; color: var(--ink); cursor: pointer; }

/* Karten im Pino-Stil: cremefarben, weich, dunkler Rand */
#stats, #panel, #clock, #menu, #pill, #minimap, #menu-btn, #sheet, #dock button { background: var(--cream); border: 2px solid var(--ink); box-shadow: 0 3px 0 rgba(59, 47, 74, .85); }

#stats { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); padding: 14px 18px 10px; border-radius: 20px; max-width: calc(100vw - 24px); }
#stats .tag { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); padding: 1px 10px; font-size: 12px; font-weight: 700; background: var(--cream); border: 2px solid var(--ink); border-radius: 12px; }
.barrow { display: grid; gap: 6px 16px; }
.barrow { width: 584px; }
.barrow.n3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 8px; padding-bottom: 8px; border-bottom: 2px dashed var(--line); }
.barrow.n5 { grid-template-columns: repeat(5, 1fr); }
#moodrow { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 13px; }
#mood { font-weight: 800; white-space: nowrap; }
#moodrow small { color: var(--muted); white-space: nowrap; }
.mtrack { position: relative; width: 150px; height: 10px; flex: none; border-radius: 6px; background: #fff7ec; border: 2px solid var(--ink); overflow: hidden; }
.mtrack::after { content: ''; position: absolute; left: calc(50% - 1px); top: 0; bottom: 0; width: 2px; background: var(--ink); }
#mfill { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; transition: all .6s; }
.sdot.sd { width: 17px; height: 17px; display: inline-grid; place-items: center; font-size: 13px; font-weight: 900; font-style: normal; color: #fff; line-height: 1; }
.stat { min-width: 0; }
.slabel { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.sdot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--ink); display: inline-block; }
.track { height: 9px; border-radius: 6px; background: #fff7ec; border: 2px solid var(--ink); overflow: hidden; }
.fill { height: 100%; width: 0; transition: width .6s; }
.stat.low .fill { animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .35; } }

#topright { position: fixed; top: 14px; right: 14px; display: flex; gap: 10px; align-items: center; }
#clock { padding: 8px 14px; border-radius: 20px; font-weight: 700; font-variant-numeric: tabular-nums; background: #9fd3f0; }
#menu-btn { width: 40px; height: 40px; border-radius: 50%; font-size: 20px; line-height: 1; }
#menu { z-index: 9; position: fixed; top: 64px; right: 14px; width: 230px; padding: 12px; border-radius: 16px; display: flex; flex-direction: column; gap: 8px; }
#menu button { padding: 8px 12px; border-radius: 12px; background: #fff7ec; border: 2px solid var(--ink); font-weight: 600; }
#menu button:hover { background: #fde0b8; }
#menu button.on { background: #c9b6f2; }
.hint { margin: 2px 2px 0; font-size: 12px; color: var(--muted); }

#panel { position: fixed; top: 166px; left: 14px; width: 310px; max-height: calc(100vh - 310px); overflow: auto; padding: 12px 16px 14px; border-radius: 18px; }
#panel header { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
#panel header .live { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); }
#toggle { margin-left: auto; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid var(--ink); background: #fff7ec; line-height: 1; }
#nowtitle { margin: 6px 0 4px; font-size: 18px; line-height: 1.2; }
#nowwhy { margin: 0 0 4px; font-size: 13.5px; line-height: 1.4; font-style: italic; color: #54466a; }
#nowwhy:empty { display: none; }
#body { margin-top: 8px; padding-top: 8px; border-top: 2px dashed var(--line); }
#panel.min #body { display: none; }
#ziel { margin: 0 0 8px; font-size: 13px; line-height: 1.4; }
#ziel:empty { display: none; }
#body h3 { margin: 0 0 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#feed { list-style: none; margin: 0; padding: 0; font-size: 13px; }
#feed li { padding: 5px 0; border-top: 1px dashed var(--line); line-height: 1.35; }
#feed li:first-child { border-top: 0; }
#feed time { color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }
#feed .act { font-weight: 700; margin-right: 2px; }
#feed .why { display: block; color: #54466a; font-style: italic; }

#minimap { position: fixed; left: 14px; bottom: 14px; width: 124px; height: 124px; border-radius: 50%; border-style: dashed; }
#pill { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 340px); padding: 8px 18px 8px 10px; border-radius: 26px; }
#pill i { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--ink); background: var(--purple); }
#pill p { margin: 0; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#bubble { position: fixed; max-width: 260px; padding: 8px 12px; font-size: 13px; line-height: 1.35; color: var(--ink); background: var(--cream); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 0 3px 0 rgba(59, 47, 74, .85); pointer-events: none; }
#bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
#banner { position: fixed; left: 50%; top: 162px; transform: translateX(-50%); padding: 8px 14px; border-radius: 12px; background: #8a2c4c; color: #fff; font-size: 14px; z-index: 5; }
#modal { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; background: rgba(20, 14, 40, .9); cursor: zoom-out; text-align: center; z-index: 10; }
#modal img { max-width: min(92vw, 1100px); max-height: 80vh; border-radius: 10px; border: 3px solid var(--cream); background: #fff; }
#modal iframe { width: min(92vw, 640px); height: min(78vh, 640px); border-radius: 10px; border: 3px solid var(--cream); background: #fff; }
#modal p { margin: 0; max-width: 640px; color: #eadff7; font-size: 14px; }


/* Menü-Leiste rechts und Seitenleiste */
#dock { z-index: 8; position: fixed; top: 66px; right: 14px; display: flex; flex-direction: column; gap: 8px; }
#dock button { display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 9px; border-radius: 16px; font-weight: 700; font-size: 13px; transition: transform .12s, background .12s; }
#dock button:hover { background: #fde0b8; transform: translateX(-2px); }
#dock button.on { background: #c9b6f2; }
#dock .ic { font-size: 16px; line-height: 1; }
#sheet { position: fixed; top: 166px; right: 150px; bottom: 90px; width: min(400px, calc(100vw - 170px)); padding: 12px 14px; border-radius: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 4; }
#sheet header { display: flex; align-items: center; }
#sheet h2 { margin: 0; flex: 1; font-size: 18px; }
#sheet-close { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--ink); background: #fff7ec; line-height: 1; }
#sheet-filter { width: 100%; padding: 7px 12px; border-radius: 12px; border: 2px solid var(--ink); background: #fff7ec; font: inherit; color: var(--ink); }
#sheet-body { flex: 1; overflow: auto; padding-right: 2px; }
.item { padding: 7px 0; border-top: 1px dashed var(--line); font-size: 13.5px; line-height: 1.4; }
.item:first-child { border-top: 0; }
.item time { display: block; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item p { margin: 0; }
.item .sub { color: var(--muted); font-style: italic; font-size: 12.5px; }
.item.click { cursor: pointer; border-radius: 10px; padding: 7px 8px; }
.item.click:hover { background: #fde0b8; }
.item.erfüllt .main { text-decoration: line-through; text-decoration-color: var(--muted); }
.sec { margin: 12px 0 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sec:first-child { margin-top: 0; }
.note { margin: 0 0 4px; font-size: 14px; line-height: 1.45; }
.empty { margin: 8px 0; color: var(--muted); font-size: 13px; font-style: italic; }
.drive { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0; text-transform: capitalize; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 6px; }
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 2px solid var(--ink); border-radius: 10px; cursor: zoom-in; background: #fff; }

@media (max-width: 900px) {
  #dock { top: auto; bottom: 66px; left: 104px; right: 10px; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding: 2px 2px 5px; gap: 6px; scrollbar-width: none; }   /* eine Reihe, seitlich wischbar */
  #dock button { flex: none; }
  #dock .lb { display: none; }
  #dock button { padding: 8px 10px; }
  #sheet { top: 196px; left: 10px; right: 10px; bottom: 112px; width: auto; }
  #topright { top: 10px; right: 10px; }
  #stats { top: 56px; padding: 12px 10px 8px; width: calc(100vw - 20px); }
  .barrow.n3 { gap: 6px 10px; }
  .barrow.n5 { gap: 6px 8px; }
  .slabel { font-size: 11px; gap: 4px; }
  .sdot { width: 10px; height: 10px; }
  #panel { left: 10px; width: min(310px, calc(100vw - 20px)); max-height: calc(100vh - 360px); }
  #minimap { width: 84px; height: 84px; left: 10px; bottom: 10px; }
  #pill { max-width: calc(100vw - 110px); left: auto; right: 10px; transform: none; bottom: 14px; }
  #menu { top: 56px; right: 10px; }
  .barrow { width: auto; }
  #moodrow small { display: none; }
  #panel { top: 230px; padding: 8px 14px 10px; }
  #panel #nowwhy { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 2px 0 0; font-size: 13px; }
  #panel #nowtitle { font-size: 17px; margin: 2px 0 0; }
  #panel.min #nowwhy { display: none; }   /* eingeklappt nur die Überschrift */
}
.gem { margin: 0; }
.gem figcaption { font-size: 12px; text-align: center; margin-top: 3px; overflow-wrap: anywhere; }
.projimg { display: block; width: 140px; margin-top: 6px; border: 2px solid var(--ink); border-radius: 8px; cursor: zoom-in; background: #fff; }
#inv-btn { flex: none; padding: 3px 10px; border-radius: 14px; border: 2px solid var(--ink); background: #fff7ec; font-weight: 700; font-size: 13px; }
#inv-btn[aria-expanded="true"] { background: #f0a23c; }
#seen { margin: 0; font-size: 13px; white-space: nowrap; }
#brain { position: fixed; right: 14px; bottom: 16px; margin: 0; padding: 6px 12px; font-size: 12px; font-weight: 700; white-space: nowrap;
  border-radius: 14px; background: var(--cream); border: 2px solid var(--ink); box-shadow: 0 3px 0 rgba(59, 47, 74, .85); }
@media (max-width: 900px) { #brain { bottom: auto; top: 14px; right: auto; left: 10px; font-size: 11px; padding: 4px 9px; } }
#seen:empty { display: none; }
#inv-pop { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); width: min(320px, calc(100vw - 32px)); padding: 12px 14px; border-radius: 18px; background: var(--cream); border: 2px solid var(--ink); box-shadow: 0 3px 0 rgba(59, 47, 74, .85); z-index: 6; }
#inv-pop h3 { margin: 0 0 8px; font-size: 14px; }
#inv-pop .slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#inv-pop .slot { min-height: 64px; padding: 6px 4px; border-radius: 12px; border: 2px dashed var(--line); background: #fff7ec; text-align: center; font-size: 11px; line-height: 1.2; }
#inv-pop .slot.full { border: 2px solid var(--ink); }
#inv-pop .slot b { display: block; font-size: 24px; line-height: 1.2; }
#inv-pop .slot small { display: block; color: var(--muted); }
#inv-pop .coins { margin: 8px 0 0; font-size: 13px; font-weight: 700; }
#status-mood { flex: none; margin: 0; font-size: 13px; font-weight: 700; white-space: nowrap; }
#status-mood:empty { display: none; }
#sheet.wide { right: 50%; transform: translateX(50%); top: 166px; width: min(880px, calc(100vw - 32px)); z-index: 7; }
.archiv-card { margin: 0 0 14px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 14px; background: #fff7ec; }
.archiv-desc { margin: 4px 0 8px; font-style: italic; }
.archiv-entry { margin: 6px 0; line-height: 1.45; }
.archiv-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
@media (max-width: 900px) { #sheet.wide { left: 10px; right: 10px; width: auto; transform: none; top: 90px; } }
.playbtn { margin-top: 6px; padding: 4px 12px; border-radius: 12px; border: 2px solid var(--ink); background: #fff7ec; font-weight: 700; }
.ghlink { display: inline-block; margin: 2px 0 8px; font-weight: 700; color: var(--purple); }
.archiv-card summary { cursor: pointer; list-style: none; }
.archiv-card summary::after { content: '▸ antippen zum Lesen'; font-size: 0.8em; opacity: 0.6; }
.archiv-card[open] summary::after { content: '▾ zuklappen'; }
@media (min-width: 901px) and (max-width: 1150px) {      /* mittlere Breite: Leiste schmaler, Karte weicht dem Menü */
  .barrow { width: 470px; } .barrow.n5 { gap: 6px 10px; } .slabel { font-size: 12px; }
  body.sheet-open #panel { display: none; }
}
.vol { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
.vol input { width: 100%; accent-color: var(--purple); }
@media (max-width: 480px) { #status-mood { display: none; } }
