/* Neubau M0: bewusst schmal. Farben aus docs/ART-DIRECTION.md (UI-Akzente bleiben kräftig). */
:root { --ink: #211a51; --pink: #ff4fa3; --cyan: #5ce1e6; --yellow: #ffd23f; --mint: #7be495; --glass: rgba(24, 19, 62, .72); color-scheme: light; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #caf0fe; font: 14px/1.4 system-ui, sans-serif; color: #fff; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
[hidden] { display: none !important; }

.hud { position: fixed; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; z-index: 5; pointer-events: none; }
.hud > * { flex: none; white-space: nowrap; pointer-events: auto; } /* Phase F: lieber eine zweite Reihe als zweizeilige Pillen */
.hud strong, .pill { padding: 7px 12px; border-radius: 999px; background: var(--glass); font-weight: 800; }

.shift { position: fixed; top: calc(max(12px, env(safe-area-inset-top)) + var(--hud-h, 36px) + 8px); left: max(12px, env(safe-area-inset-left)); padding: 7px 12px; border-radius: 12px; background: rgba(22, 163, 163, .88); font-weight: 800; z-index: 5; max-width: min(420px, calc(100vw - 24px)); }
.actions { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column-reverse; gap: 8px; z-index: 6; }
.actions button { min-height: 48px; padding: 0 18px; border: 0; border-radius: 16px; color: var(--ink); background: var(--yellow); font: inherit; font-weight: 900; box-shadow: 0 2px 0 #989389; cursor: pointer; }
.actions button:disabled { opacity: .6; }
.actions button kbd { margin-right: 8px; padding: 1px 6px; border-radius: 6px; background: rgba(33, 26, 81, .15); font: inherit; }
.actions-more { display: none; }
body.touch-device .actions:not(.is-expanded) button:not(:first-child):not(.actions-more) { display: none; } /* auf dem Finger nur die erste */
body.touch-device .actions .actions-more { display: block; min-height: 44px; background: rgba(255, 255, 255, .85); font-size: 13px; }
body.touch-device .actions { bottom: max(76px, calc(env(safe-area-inset-bottom) + 52px)); } /* über dem Wischhinweis */
body.touch-device .actions kbd { display: none; }

.toast { position: fixed; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + var(--hud-h, 36px) + 12px); transform: translate(-50%, -10px); padding: 10px 16px; border-radius: 999px; background: rgba(24, 19, 62, .9); font-weight: 800; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; z-index: 8; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
body:has(#shift:not([hidden])) .toast { top: calc(max(12px, env(safe-area-inset-top)) + var(--hud-h, 36px) + 68px); }
.banner { position: fixed; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + var(--hud-h, 36px) + 12px); transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; background: rgba(122, 26, 52, .92); font-weight: 800; z-index: 8; }

.dialog { border: 0; border-radius: 20px; padding: 24px; width: min(360px, calc(100vw - 32px)); color: #fff; background: rgba(24, 19, 62, .94); }
.dialog::backdrop { background: rgba(10, 8, 30, .35); }
.dialog h1, .dialog h2 { margin: 0 0 4px; font-size: 22px; }
.dialog label { display: grid; gap: 4px; margin: 14px 0 8px; font-weight: 700; }
.dialog input { padding: 10px 12px; border: 0; border-radius: 10px; font: inherit; }
.dialog button { width: 100%; min-height: 44px; margin-top: 10px; border: 0; border-radius: 12px; color: var(--ink); background: var(--yellow); font: inherit; font-weight: 900; cursor: pointer; }
.muted { opacity: .7; margin: 0; }
.error { min-height: 1.2em; color: #ffb3cf; margin: 4px 0 0; }
.colors { display: flex; gap: 8px; border: 0; padding: 0; margin: 8px 0; }
.colors legend { font-weight: 700; margin-bottom: 6px; }
.colors button { width: 36px; height: 36px; min-height: 0; margin: 0; border-radius: 50%; border: 3px solid transparent; }
.colors button[aria-pressed="true"] { border-color: #fff; }
.colors { flex-wrap: wrap; }
.colors-small button { width: 30px; height: 30px; }
.colors button.choice-text, .look-row button.choice-text { width: auto; min-width: 44px; padding: 0 12px; border-radius: 18px; background: rgba(255, 255, 255, .88); color: #211a51; font-weight: 800; }
.colors button.choice-text[aria-pressed="true"], .look-row button.choice-text[aria-pressed="true"] { background: var(--yellow); border-color: #fff; }
.look-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 10px; }
.look-row button { width: 32px; height: 32px; min-height: 0; margin: 0; border-radius: 50%; border: 3px solid transparent; }
.look-row button[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px #211a51; }
.look-label { font-size: 12px; font-weight: 700; opacity: .8; margin: 6px 0 2px; }
.code { display: block; margin: 12px 0; padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, .1); font: 700 15px ui-monospace, monospace; word-break: break-all; user-select: all; }
details { margin-top: 14px; opacity: .85; }

/* Wischsteuerung (client/input/move-circle.js), unverändert aus dem alten Stil übernommen. */
.touch-layer { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.move-circle { position: absolute; left: 0; top: 0; width: 160px; height: 160px; border: 2px solid rgba(255,255,255,.55); border-radius: 50%; background: rgba(255,255,255,.06); opacity: 0; visibility: hidden; transform: translate(-50%, -50%) scale(.75); pointer-events: none; }
.move-circle__dot { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.92); transform: translate(-50%, -50%); }
.jump-circle { position: absolute; left: 0; top: 0; width: 100px; height: 100px; border-radius: 50%; background: rgba(255,255,255,.15); opacity: 0; transform: translate(-50%, -50%) scale(0); pointer-events: none; }
.jump-circle.is-active { animation: jump-circle .5s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes jump-circle { 0% { opacity: 1; transform: translate(-50%, -50%) scale(.2); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }
.move-hint { position: absolute; left: 50%; bottom: 34px; margin: 0; padding: 7px 13px; border-radius: 999px; color: rgba(255,255,255,.72); background: rgba(24,19,62,.42); font-size: 10px; font-weight: 900; text-transform: uppercase; transform: translateX(-50%); transition: opacity .5s; pointer-events: none; }
body:not(.touch-device) .move-hint { display: none; }

/* Einblendung bei jeder Buchung (M1-Paket 4). */
.pill-delta { position: absolute; top: 100%; transform: translateX(-50%); margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(22, 163, 74, .92); font-size: 12px; font-weight: 800; white-space: nowrap; pointer-events: none; animation: pill-delta 1.6s ease-out forwards; }
.pill-delta.is-negative { background: rgba(185, 28, 28, .92); }
@keyframes pill-delta { 0% { opacity: 0; translate: 0 -6px; } 15% { opacity: 1; translate: 0 0; } 70% { opacity: 1; } 100% { opacity: 0; translate: 0 8px; } }

/* Lautstärketaste der Musik (M1-Paket 6). */
.pill-button { border: 0; color: inherit; font: inherit; cursor: pointer; pointer-events: auto; }

/* 2.0 Phase C: Aufgabe, Schicht, Jobbrett, Gespräch. */
.quest { position: fixed; top: calc(max(12px, env(safe-area-inset-top)) + var(--hud-h, 36px) + 8px); left: max(12px, env(safe-area-inset-left)); max-width: min(440px, calc(100vw - 24px)); padding: 7px 12px; border-radius: 12px; background: rgba(33, 26, 81, .78); font-weight: 700; font-size: 13px; z-index: 5; }
.job { position: fixed; right: max(12px, env(safe-area-inset-right)); top: calc(max(12px, env(safe-area-inset-top)) + var(--hud-h, 36px) + 8px); width: min(330px, calc(100vw - 24px)); padding: 12px; border-radius: 16px; background: rgba(24, 19, 62, .9); z-index: 6; }
.job-head { margin-bottom: 8px; }
.job-order { margin: 0 0 4px; font-size: 17px; font-weight: 900; color: var(--yellow); }
.job-recipe, .job-picked { margin: 0 0 8px; font-size: 13px; }
.job-picked { min-height: 1.2em; color: var(--cyan); font-weight: 800; }
.job-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.job-chip, .job-undo, .job-done, .job-stop, .board-go { min-height: 40px; border: 0; border-radius: 10px; font: inherit; font-weight: 800; cursor: pointer; color: var(--ink); background: #fff; }
.job-chip:disabled { opacity: .5; }
.job-undo, .job-done { margin-top: 8px; width: 100%; background: rgba(255, 255, 255, .75); }
.job-done { background: var(--mint); }
.job-stop { margin-top: 10px; width: 100%; background: rgba(255, 255, 255, .18); color: #fff; }
.job-card { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 6px 0 10px; }
.job-card dt { opacity: .7; } .job-card dd { margin: 0; font-weight: 800; }
.dialog-wide { width: min(560px, calc(100vw - 24px)); max-height: 82vh; overflow: auto; }
.board h3 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.board-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.board-row p { margin: 2px 0 0; font-size: 12px; }
.board-go { width: auto; min-height: 36px; margin: 0; padding: 0 12px; background: var(--yellow); flex: none; }
.talk p { margin: 8px 0; }
body.touch-device .job { top: auto; bottom: max(140px, calc(env(safe-area-inset-bottom) + 120px)); }
/* Einblendungen unter die Aufgabenzeile; Jobbrett: Text breit, Knopf schmal (Browserbilder Phase C). */
body:has(#quest:not([hidden])) .toast { top: calc(max(12px, env(safe-area-inset-top)) + var(--hud-h, 36px) + 56px); }
.board-row > div { flex: 1; min-width: 0; }
.dialog .board-go { width: auto; margin: 0; }

/* 2.0 Phase D: Eigentum und Crew. */
.estate-tabs { display: flex; gap: 6px; margin: 10px 0 4px; }
.dialog .estate-tabs button { width: auto; flex: 1; margin: 0; background: rgba(255, 255, 255, .15); color: #fff; }
.dialog .estate-tabs button.is-on { background: var(--yellow); color: var(--ink); }
.estate-card { margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .07); }
.estate-card h3 { margin: 0 0 6px; text-transform: none; letter-spacing: 0; font-size: 15px; opacity: 1; }
.estate-card p { margin: 2px 0; }
.estate-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.estate-line > span { min-width: 90px; font-weight: 800; }
.dialog .estate-btn, .dialog .estate-chip { width: auto; min-height: 34px; margin: 0; padding: 0 10px; background: rgba(255, 255, 255, .85); }
.dialog .estate-btn.is-on { background: var(--yellow); }
.estate-palette { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.estate-line input { flex: 1; min-width: 120px; padding: 8px 10px; border: 0; border-radius: 10px; font: inherit; }

/* Phase E: Kleidung. */
.wardrobe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.dialog .wardrobe-item { display: grid; grid-template-columns: 18px 1fr; gap: 2px 8px; align-items: center; width: auto; min-height: 48px; margin: 0; padding: 6px 8px; text-align: left; background: rgba(255, 255, 255, .88); font-size: 12px; }
.dialog .wardrobe-item.is-on { background: var(--yellow); }
.wardrobe-item small { grid-column: 2; opacity: .7; }
.wardrobe-swatch { grid-row: span 2; width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); }

/* Phase F: Chat, Gesten, Person, Rangliste. */
.chat { position: fixed; left: max(12px, env(safe-area-inset-left)); bottom: max(24px, env(safe-area-inset-bottom)); width: min(340px, calc(100vw - 24px)); z-index: 6; pointer-events: none; }
.chat > * { pointer-events: auto; }
.chat-log { margin: 0 0 6px; padding: 0; list-style: none; display: grid; gap: 3px; }
.chat-line { padding: 4px 10px; border-radius: 10px; background: rgba(24, 19, 62, .62); font-size: 13px; overflow-wrap: anywhere; }
.chat-name { padding: 0; border: 0; background: none; color: var(--cyan); font: inherit; font-weight: 800; cursor: pointer; }
.chat-form { display: flex; gap: 6px; }
.chat-form input { flex: 1; min-width: 0; padding: 10px 12px; border: 0; border-radius: 12px; font: inherit; }
.chat-form button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--yellow); color: var(--ink); font: inherit; font-weight: 900; }
.chat-gestures { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chat-gesture { width: 40px; height: 40px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .88); font-size: 20px; cursor: pointer; }
body.touch-device .chat { bottom: max(140px, calc(env(safe-area-inset-bottom) + 120px)); width: min(300px, calc(100vw - 24px)); }
body.touch-device .chat:not(.is-open) .chat-line:nth-last-child(n+4) { display: none; } /* auf dem Telefon nur drei Zeilen */
.dialog select { padding: 10px 12px; border: 0; border-radius: 10px; font: inherit; }
.dialog button.is-quiet { background: rgba(255, 255, 255, .18); color: #fff; }
.ranking-list { margin: 0; padding-left: 22px; }
.ranking-list li { padding: 4px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.ranking-list li span { display: inline-block; min-width: 60%; }
.ranking-list li.is-you { color: var(--yellow); font-weight: 800; }
.ranking-previous { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(255, 210, 63, .15); font-size: 13px; }
/* Lange Terminzeile (Uhrzeit · Happy Hour …) nie über den Rand: kürzen statt abschneiden (Telefonbild Phase F). */
.hud > #hud-time { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* Menüs schließen und scrollen auf Handy und Tablet (client/ui/dialogs.js). */
.dialog { overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.dialog .dialog-x { position: sticky; top: -12px; float: right; z-index: 2; width: 44px; min-height: 44px; height: 44px; margin: -12px -12px 0 8px; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 26px; line-height: 1; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
