/* Abenteuer: HUD, Dialogbox, Einleitung, Startkarte. Grundstile kommen aus style.css. */
#advHud { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#advHud a, #advHud button { pointer-events: auto; }
#advMe { position: absolute; top: 14px; left: 14px; min-width: 170px; }
#advMe .portrait { width: 190px; height: 104px; }
#advMe .row { display: flex; align-items: center; gap: 8px; font-size: 15px; }
#advMe .sub { font-size: 13px; color: #55684a; margin-top: 4px; }
#advQuest { position: absolute; top: 14px; right: 14px; max-width: min(340px, 46vw); }
#advQuest .title { font-weight: 800; font-size: 13px; letter-spacing: .3px; color: #6a7d5c; margin-bottom: 4px; }
.stam { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 13px; }
.stamBar { flex: 1; height: 8px; border-radius: 99px; background: rgba(40, 60, 20, .14); overflow: hidden; }
#advStamFill { height: 100%; transform-origin: left center; background: linear-gradient(90deg, #e89a2a, #f6d34a); transition: background .3s; }
.stam.tired #advStamFill { background: #c8bba4; }
#questText { font-size: 15px; font-weight: 600; line-height: 1.35; }
#questProgress { font-size: 13px; color: #55684a; margin-top: 4px; }
#questProgress:empty { display: none; }
#advHint { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-size: 13px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.6); white-space: nowrap; }
#advBack { position: absolute; left: 14px; bottom: 14px; padding: 9px 14px; border-radius: 14px; background: rgba(255, 251, 238, .85); color: #24331b; font-weight: 700; text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
#talkHint { position: absolute; left: 50%; bottom: 58px; transform: translateX(-50%); padding: 8px 14px; border-radius: 99px; background: rgba(255, 251, 238, .9); font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }

#dialog { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(760px, calc(100vw - 32px)); display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 20px; border-radius: 22px; background: rgba(255, 251, 238, .95); box-shadow: 0 14px 44px rgba(20, 40, 10, .38); z-index: 6; cursor: pointer; animation: dlgIn .25s ease-out; }
@keyframes dlgIn { from { transform: translate(-50%, 20px); opacity: 0; } }
#dlgPortrait { flex: none; width: 76px; height: 76px; border-radius: 18px; background: #e9e1c6; display: flex; align-items: center; justify-content: center; font-size: 46px; box-shadow: inset 0 0 0 3px rgba(0,0,0,.06); }
.dlgBody { flex: 1; min-width: 0; }
#dlgName { font-weight: 800; font-size: 15px; color: #6b4a2a; margin-bottom: 4px; }
#dlgText { font-size: 17px; line-height: 1.45; min-height: 3em; }
#dialog.narration #dlgText { font-style: italic; color: #4a5a3e; }
#dialog.narration #dlgPortrait { background: #efe6cc; }
#dlgMore { font-size: 12px; color: #8a9a7c; text-align: right; margin-top: 6px; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .35; } }

#banner { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); padding: 18px 30px; border-radius: 22px; background: rgba(255, 251, 238, .93);
  font-size: 26px; font-weight: 800; color: #2f5d1e; text-align: center; box-shadow: 0 14px 44px rgba(20, 40, 10, .35); z-index: 5; animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
#banner small { display: block; font-size: 15px; font-weight: 600; color: #55684a; margin-top: 6px; }
#fade { position: fixed; inset: 0; background: #0b1408; z-index: 7; pointer-events: none; opacity: 0; transition: opacity .9s; }

#intro { position: fixed; inset: 0; z-index: 8; background: radial-gradient(ellipse at center, rgba(20,30,12,.55), rgba(5,10,3,.92)); display: flex; align-items: center; justify-content: center; }
#introText { max-width: min(720px, calc(100vw - 48px)); color: #f4ecd6; font-size: clamp(19px, 2.6vw, 27px); line-height: 1.55; text-align: center; text-shadow: 0 2px 12px rgba(0,0,0,.6); transition: opacity .8s; }
#intro.chapter { background: radial-gradient(ellipse at center, rgba(40, 70, 20, .72), rgba(6, 14, 3, .95)); }
#introText.title { font-size: clamp(30px, 5vw, 46px); font-weight: 800; color: #f6d38a; letter-spacing: .3px; }
#introSkip { position: absolute; right: 22px; bottom: 22px; border: 0; padding: 10px 16px; border-radius: 14px; background: rgba(255, 251, 238, .85); font-weight: 700; cursor: pointer; }

#advStart { position: fixed; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(255,255,255,0) 30%, rgba(20,50,10,.4)); }
#advStart .card { width: min(600px, 100%); background: rgba(255, 251, 238, .93); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 28px; padding: 28px 30px; box-shadow: 0 20px 60px rgba(20, 50, 10, .35); }
#advStart h1 { margin: 0; font-size: 44px; color: #2f5d1e; }
#advStart h1 span { color: #e07a2a; }
#advStart .subtitle { font-weight: 700; color: #6a7d5c; margin: 2px 0 14px; }
#advStart p { line-height: 1.5; }
#advStart .buttons { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
#advStart .buttons button { border: 0; padding: 14px 20px; border-radius: 16px; font-size: 17px; font-weight: 800; cursor: pointer; background: #5aa83a; color: #fff; box-shadow: 0 6px 18px rgba(40, 90, 20, .35); }
#advStart .buttons button#btnContinue { background: #e07a2a; box-shadow: 0 6px 18px rgba(140, 70, 20, .35); }
#advStart .controls { font-size: 13px; color: #55684a; }
#advStart .back { font-size: 14px; color: #6a7d5c; }

@media (max-width: 640px) { #advQuest { max-width: 52vw; } #dlgPortrait { width: 54px; height: 54px; font-size: 32px; } #dlgText { font-size: 15px; } #advHint { display: none; } }

/* Sprechblase über dem sprechenden Tier (main.js placeBubble): groß, mit Zipfel; Position kommt per left/top */
#dialog.bubble { bottom: auto; width: clamp(340px, 42vw, 1200px); max-width: calc(100vw - 20px); transform: translate(-50%, -100%); animation: bubIn .22s ease-out; border-radius: 26px; padding: 18px 22px; background: rgba(255, 252, 242, .97); }
#dialog.bubble::after { content: ""; position: absolute; left: var(--tail, 50%); bottom: -17px; margin-left: -15px; border: 15px solid transparent; border-bottom: 0; border-top: 18px solid rgba(255, 252, 242, .97); filter: drop-shadow(0 5px 4px rgba(20, 40, 10, .18)); }
#dialog.bubble #dlgText { font-size: clamp(20px, 1.7vw, 42px); line-height: 1.4; min-height: 2.8em; }
#dialog.bubble #dlgName { font-size: clamp(15px, 1.1vw, 26px); }
#dialog.bubble #dlgMore { font-size: clamp(12px, .8vw, 18px); }
#dialog.bubble #dlgPortrait { width: clamp(60px, 5vw, 120px); height: clamp(60px, 5vw, 120px); font-size: clamp(36px, 3vw, 72px); }
@keyframes bubIn { from { opacity: 0; } }
#btnVoice { position: absolute; left: 112px; bottom: 14px; width: 40px; height: 38px; border: 0; border-radius: 14px; font-size: 18px; background: rgba(255, 251, 238, .85); box-shadow: 0 4px 14px rgba(0,0,0,.18); cursor: pointer; }
@media (max-width: 640px) { #dialog.bubble #dlgText { font-size: 17px; } }

/* Abenteuerübersicht (overview.js) */
#btnOverview { position: absolute; left: 158px; bottom: 14px; width: 40px; height: 38px; border: 0; border-radius: 14px; font-size: 18px; background: rgba(255, 251, 238, .85); box-shadow: 0 4px 14px rgba(0,0,0,.18); cursor: pointer; }
#advStart .buttons button#btnOvStart { background: #fff8e0; color: #2f5d1e; box-shadow: 0 6px 18px rgba(60, 60, 20, .2); }
#overview { position: fixed; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 24, 6, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.ov-card { width: min(1180px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: rgba(255, 252, 242, .97); border-radius: 26px; padding: 24px 28px; box-shadow: 0 24px 70px rgba(10, 30, 5, .5); touch-action: pan-y; }
.ov-head h2 { font-size: 28px; color: #2f5d1e; }
.ov-life { margin: 10px 0 18px; font-size: 14px; color: #4a5a3e; }
.ov-bar { height: 14px; border-radius: 99px; background: rgba(40, 60, 20, .12); overflow: hidden; margin-bottom: 6px; }
.ov-bar div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #5aa83a, #9fd14f 60%, #e8c64a); }
.ov-cols { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 22px; }
.ov-cols h3 { font-size: 13px; letter-spacing: .5px; text-transform: uppercase; color: #6a7d5c; margin-bottom: 8px; }
.ov-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ov-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(90, 168, 58, .1); }
.ov-list li div { flex: 1; min-width: 0; }
.ov-list b { display: block; font-size: 14px; }
.ov-list small { display: block; font-size: 12px; line-height: 1.3; color: #55684a; }
.ov-list em { font-style: normal; font-size: 11px; font-weight: 700; white-space: nowrap; color: #3c7a24; }
.ov-ic { flex: none; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 22px; border-radius: 10px; background: rgba(255, 255, 255, .7); }
.ov-list li.ov-cur { background: rgba(232, 198, 74, .28); box-shadow: inset 0 0 0 2px rgba(224, 122, 42, .45); }
.ov-list li.ov-cur em { color: #b05a12; }
.ov-list li.ov-lock, .ov-list li.ov-plan { background: rgba(0, 0, 0, .045); }
.ov-list li.ov-lock b, .ov-list li.ov-plan b { color: #6f7868; }
.ov-list li.ov-lock em, .ov-list li.ov-plan em { color: #8a9a7c; }
.ov-list li.ov-plan { opacity: .75; }
.ov-list li.ov-lock .ov-ic, .ov-list li.ov-plan .ov-ic { filter: grayscale(1); opacity: .7; }
.ov-foot { margin-top: 14px; font-size: 12px; color: #8a9a7c; text-align: center; }
@media (max-width: 980px) { .ov-cols { grid-template-columns: 1fr; } }
#sideQuest { font-size: 13px; color: #6b4a2a; margin-top: 8px; padding-top: 7px; border-top: 1px dashed rgba(60, 80, 40, .25); line-height: 1.35; }
#sideQuest:empty { display: none; }

/* Startbildschirm: Titel groß unten links über dem Garten, kein Kasten in der Bildmitte */
#advStart { align-items: flex-end; justify-content: flex-start; padding: 0; background: linear-gradient(20deg, rgba(8, 22, 4, .82) 0%, rgba(8, 22, 4, .45) 38%, rgba(8, 22, 4, 0) 66%); }
#advStart .card { width: min(680px, 100%); background: none; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; border-radius: 0; padding: clamp(20px, 5vw, 64px); color: #f4ecd6; animation: lobbyIn .7s cubic-bezier(.2, 1, .3, 1); }
#advStart .eyebrow { font-size: 14px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: #f6d38a; margin-bottom: 6px; }
#advStart h1 { font-size: clamp(48px, 8vw, 96px); line-height: .95; color: #fffbe8; text-shadow: 0 6px 30px rgba(0, 0, 0, .45); }
#advStart h1 span { color: #f0a050; }
#advStart .story { margin: 18px 0 0; font-size: clamp(15px, 1.25vw, 19px); line-height: 1.55; color: #e9e3cc; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); max-width: 34em; }
#advProgress { margin-top: 18px; max-width: 420px; font-size: 14px; color: #dfe9d2; }
#advProgress .ov-bar { background: rgba(255, 255, 255, .18); }
#advStart .buttons { margin: 22px 0 16px; }
#advStart .buttons button { font-size: 19px; padding: 16px 24px; transition: transform .12s; }
#advStart .buttons button:hover { transform: translateY(-2px); }
#advStart .buttons button#btnNew { background: rgba(255, 251, 238, .92); color: #2f5d1e; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
#advStart .buttons button#btnContinue { background: linear-gradient(180deg, #f39a45, #e07a2a); }
#advStart .buttons button#btnOvStart { background: rgba(255, 255, 255, .16); color: #fffbe8; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); }
#advStart .controls { color: #c9d6b6; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
#advStart .back { color: #c9d6b6; }

/* Spielstand-Code (savecode.js): Anzeige in der Übersicht, Eingabe auf dem Startbildschirm */
.ov-code { margin-top: 18px; padding: 12px 14px; border-radius: 16px; background: rgba(232, 198, 74, .2); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: #4a4a20; }
.ov-code code { font: 800 20px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; padding: 8px 12px; border-radius: 10px; background: #fff; color: #2f5d1e; -webkit-user-select: all; user-select: all; }
.ov-code button { border: 0; padding: 9px 14px; border-radius: 12px; font-weight: 800; cursor: pointer; background: #5aa83a; color: #fff; }
.ov-code small { flex-basis: 100%; font-weight: 500; font-size: 12px; color: #6a6a40; }
#codeForm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
#codeInput { width: 19em; max-width: 100%; padding: 10px 12px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .35); background: rgba(0, 0, 0, .35); color: #fffbe8; font: 700 14px ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .05em; text-transform: uppercase; -webkit-user-select: text; user-select: text; }
#codeInput::placeholder { color: rgba(255, 251, 232, .5); text-transform: none; letter-spacing: 0; }
#codeForm button { border: 0; padding: 11px 14px; border-radius: 12px; font-weight: 800; cursor: pointer; background: rgba(255, 255, 255, .16); color: #fffbe8; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); }
#codeMsg { font-size: 13px; color: #ffd0b0; }

/* Porträtfoto der Figur (faces.js) statt Emoji */
#dlgPortrait.photo { overflow: hidden; padding: 0; box-shadow: 0 0 0 3px #fff, 0 3px 10px rgba(0, 0, 0, .2); border-radius: 50%; }
#dlgPortrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
#dialog.bubble #dlgPortrait.photo { width: clamp(72px, 6vw, 140px); height: clamp(72px, 6vw, 140px); }

/* Tasten-Hilfe im Abenteuer */
#btnKeys { position: absolute; left: 204px; bottom: 14px; width: 40px; height: 38px; border: 0; border-radius: 14px; font-size: 18px; background: rgba(255, 251, 238, .85); box-shadow: 0 4px 14px rgba(0,0,0,.18); cursor: pointer; }
#keyOverlay { position: fixed; inset: 0; z-index: 13; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 24, 6, .6); cursor: pointer; }
#keyOverlay .ov-card { width: min(clamp(560px, 46vw, 1100px), 100%); text-align: center; cursor: default; }
#keyOverlay .kb { --k: clamp(26px, 2.3vw, 52px); }
#keyOverlay .kb-list { gap: clamp(8px, .8vw, 16px); margin-top: 18px; }
#keyOverlay .kb-list b { font-size: clamp(15px, 1.25vw, 26px); } #keyOverlay .kb-list small { font-size: clamp(14px, 1.05vw, 22px); }
#keyOverlay .kb-cap { font-size: clamp(15px, 1.2vw, 26px); min-width: clamp(52px, 4.4vw, 96px); }
#keyOverlay h2 { font-size: 26px; color: #2f5d1e; margin-bottom: 14px; }
.linkish { border: 0; background: none; padding: 0; margin-bottom: 12px; font: 700 15px inherit; font-family: inherit; color: #f6d38a; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; display: block; }
