@font-face { font-family: 'PS2P'; src: url('../assets/fonts/press-start-2p-latin-400-normal.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/fraunces-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'frances'; src: url('../../fonts/Fraunces72ptSuperSoft-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Noto Sans'; src: url('../assets/fonts/noto-sans-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Noto Sans'; src: url('../assets/fonts/noto-sans-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
:root { --ink: #14131f; --green: #0F6A6E; --green2: #044B4E; --accent: #ffd24a; --muted: #9a97b3; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--green); color: #fff; font-family: 'Noto Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; -webkit-tap-highlight-color: transparent; }
#app { position: relative; height: 100%; height: 100dvh; display: flex; flex-direction: column; background: var(--green); padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#top { flex: 0 0 auto; padding: clamp(18px, 5vh, 44px) 16px clamp(16px, 4.2vh, 38px); text-align: center; }
#top h1 { margin: 0; font-family: 'frances', 'Fraunces', Georgia, serif; font-weight: 600; font-size: 30px; line-height: 40px; color: #fff; }
@media (max-width: 984px) { #top h1 { font-size: 26px; line-height: 34px; } }
@media (min-width: 1461px) { #top h1 { font-size: 40px; line-height: 50px; } }
#top h1 span { color: var(--accent); }
#stagebox { position: relative; flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#c { display: block; image-rendering: pixelated; touch-action: pan-y; cursor: grab; }
#c:active { cursor: grabbing; }
#stage, #live, #hint { display: none !important; }

#ctrl { position: relative; flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: clamp(10px, 2.4vh, 20px) 12px; }
#ctrl .left, #ctrl .right { display: flex; gap: 8px; align-items: center; }
button, .btn { font: inherit; font-size: 14px; font-weight: 600; padding: .6em 1em; border-radius: 6px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.06); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: rgba(255,255,255,.14); }
button.icon { width: 40px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
button.icon svg { width: 22px; height: 22px; }
#btn-sound .w { display: none; } #btn-sound.on .w { display: inline; } #btn-sound.on .m { display: none; }
#btn-fs .out { display: none; } body.fs #btn-fs .out { display: inline; } body.fs #btn-fs .in { display: none; }
body.nofs #btn-fs { display: none; }
.primary { background: var(--accent) !important; color: var(--ink) !important; border-color: var(--accent) !important; }
#btn-sound.on { border-color: var(--accent); color: var(--accent); }
#btn-brief.hungry { animation: hungry 1.2s infinite; }
@keyframes hungry { 0%, 100% { transform: none; box-shadow: 0 0 0 0 rgba(255,210,74,.6); } 10% { transform: rotate(-3deg); } 20% { transform: rotate(3deg); } 30% { transform: none; box-shadow: 0 0 0 8px rgba(255,210,74,0); } }
body.filming #btn-brief { display: none; }

.modal { position: absolute; inset: 0; z-index: 8; display: none; align-items: center; justify-content: center; background: rgba(6,24,28,.78); backdrop-filter: blur(3px); padding: 12px; }
.modal.show { display: flex; animation: up .25s ease; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
.box { position: relative; background: #0B2F36; border: 1px solid #1d5a60; border-radius: 8px; padding: 22px 24px; width: min(860px, 100%); max-height: 100%; font-family: 'Noto Sans', system-ui, sans-serif; overflow: auto; }
.kick { font-family: 'PS2P'; font-size: 10px; color: var(--accent); margin-bottom: 10px; line-height: 1.5; }
.box h2 { margin: 0 0 14px; font-size: clamp(20px, 2.6vw, 32px); line-height: 1.1; }
.box p { margin: 0 0 12px; color: #d9d6ea; font-size: 16px; line-height: 1.45; }
.box .claim { color: #fff; font-weight: 600; }
.x { position: absolute; top: 8px; right: 8px; padding: .2em .55em; font-size: 20px; line-height: 1; }
#brief-words { font: inherit; font-size: 15px; width: 100%; padding: .7em .85em; border-radius: 4px; border: 1px solid #4a4766; background: rgba(255,255,255,.07); color: #fff; outline: none; margin-bottom: 12px; }
#brief-words:focus { border-color: var(--accent); }
.kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kind { text-align: left; padding: 14px; display: flex; flex-direction: column; gap: 4px; background: rgba(255,255,255,.05); }
.kind b { font-size: 16px; }
.kind span { font-size: 13px; font-weight: 400; color: var(--muted); }
.kind:hover { border-color: var(--accent); background: rgba(255,210,74,.08); }
#e-words { font-size: 14px; color: var(--muted); margin-bottom: 6px; font-style: italic; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
#loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: rgba(255,255,255,.6); background: var(--green); }

/* Flacher Streifen (Einbettung): alles kompakter */
@media (max-height: 420px) {
  .box { padding: 12px 16px; }
  .box h2 { font-size: 18px; margin-bottom: 8px; }
  .box p { font-size: 13px; margin-bottom: 6px; }
  .kick { font-size: 8px; margin-bottom: 6px; }
  #brief-words { font-size: 13px; padding: .45em .7em; margin-bottom: 8px; }
  .kind { padding: 8px 10px; } .kind b { font-size: 13px; } .kind span { font-size: 11px; }
  button, .btn { font-size: 12px; padding: .5em .8em; }
  

}
@media (max-width: 760px) { .kinds { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .kinds { grid-template-columns: 1fr 1fr; }

}

/* Sprechblasen: scharfe Ebene über dem Pixelbild, gut lesbare Pixelschrift */
#bubbles { position: absolute; inset: 0; pointer-events: none; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; font-weight: 650; z-index: 2; -webkit-font-smoothing: antialiased; }
.bub { --bg: #fffdf5; position: absolute; transform: translateY(-100%); max-width: 16em; background: var(--bg); color: #14131f; line-height: 1.22; letter-spacing: -.005em; padding: .4em .65em .45em; border: 2px solid #1a1a2e; box-shadow: 3px 3px 0 rgba(0,0,0,.35); border-radius: 2px; }
.bub i { position: absolute; bottom: -9px; width: 12px; height: 9px; margin-left: -6px; background: #1a1a2e; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.bub i::after { content: ''; position: absolute; left: 2px; top: 0; width: 8px; height: 6px; background: var(--bg); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.bub.bot { --bg: #dffaff; } .bub.hot { --bg: #ffe3dc; }

#btn-special { font-size: 13px; }
#btn-special.busy { opacity: .45; }
#btn-special.nope { animation: nope .35s; }
@keyframes nope { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
body.filming #btn-special { display: none; }
@media (max-width: 560px) { #btn-special { font-size: 11px; padding: .5em .7em; } }

/* Special-Event-Auswahl */
#evmenu { position: absolute; right: 12px; bottom: calc(100% + 4px); display: none; flex-direction: column; gap: 2px; background: #0B2F36; border: 1px solid #1d5a60; border-radius: 8px; padding: 6px; z-index: 6; box-shadow: 0 10px 30px rgba(0,0,0,.35); min-width: 200px; }
#evmenu.show { display: flex; animation: up .18s ease; overflow-y: auto; overscroll-behavior: contain; }
#evmenu button { text-align: left; border: 0; background: transparent; font-size: 14px; padding: .55em .8em; border-radius: 5px; white-space: nowrap; }
#evmenu button:hover, #evmenu button:focus-visible { background: rgba(255,255,255,.1); outline: none; }
#btn-special.open { background: rgba(255,255,255,.16); }

/* sehr flache Einbettung: Leisten schlank */
@media (max-height: 360px) { #top { padding: 10px 12px 8px; } #top h1 { font-size: 15px; } #ctrl { padding: 5px 10px; } button.icon { width: 32px; height: 30px; } button.icon svg { width: 18px; height: 18px; } }
@media (max-width: 560px) { #ctrl .right button { font-size: 12.5px; padding: .6em .75em; } #top h1 span { display: block; } }
@media (max-width: 380px) { #ctrl { padding-left: 8px; padding-right: 8px; } #ctrl .left, #ctrl .right { gap: 6px; } button.icon { width: 36px; } #btn-special { font-size: 0 !important; padding: .6em .7em !important; } #btn-special::before { content: '★ Events'; font-size: 12.5px; } #ctrl .right button { font-size: 12.5px; } }

/* Hochformat (Smartphone): Headline und Knöpfe rücken an den Film */
body.portrait #top { flex: 1 1 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 18px; }
body.portrait #top h1 { font-size: 26px; line-height: 34px; }
body.portrait #ctrl { flex: 1 1 0; align-items: flex-start; padding-top: 16px; }
body.portrait #evmenu { left: 12px; right: 12px; min-width: 0; padding: 4px; }
body.portrait #evmenu.show { display: grid; grid-template-columns: 1fr 1fr; }
body.portrait #evmenu button { font-size: 13px; padding: .45em .5em; white-space: normal; }


/* Vollbild / Kino: keine Headline, Knöpfe liegen im Film und blenden sich aus */
body.fs #top { display: none; }
body.fs #ctrl { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 28px 14px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(4,20,24,.62), rgba(4,20,24,0)); transition: opacity .35s ease, transform .35s ease; }
body.fs.ui-hidden #ctrl { opacity: 0; transform: translateY(14px); pointer-events: none; }
body.fs.ui-hidden { cursor: none; }
body.fs #ctrl button:not(.primary) { background: rgba(10,30,34,.55); }
body.fs.portrait #evmenu { left: 12px; right: 12px; }
body.fs #app { justify-content: center; }

/* Kleine Flächen (Handy, flacher Streifen): Briefing- und End-Fenster kompakt, damit alles ohne Scrollen passt */
@media (max-width: 560px), (max-height: 700px) {
  .modal { padding: 8px; }
  .box { padding: 14px 14px 12px; border-radius: 10px; }
  .kick { font-size: 8px; margin-bottom: 6px; }
  .box h2 { font-size: 19px; margin-bottom: 10px; padding-right: 26px; }
  .box p { font-size: 14px; line-height: 1.4; margin-bottom: 8px; }
  #brief-words { font-size: 14px; padding: .55em .7em; margin-bottom: 8px; }
  .kinds { gap: 6px; }
  .kind { padding: 8px 10px; gap: 2px; }
  .kind b { font-size: 14px; line-height: 1.2; }
  .kind span { font-size: 11.5px; line-height: 1.25; }
  .x { top: 6px; right: 6px; }
  .btns .btn, .btns button { font-size: 13px; }
}
@media (max-width: 560px) and (max-height: 520px), (max-height: 430px) { .kind span { display: none; } .kind { padding: 9px 10px; } }
@media (max-height: 430px) and (min-width: 561px) { .kinds { grid-template-columns: repeat(4, 1fr); } }
@media (max-height: 520px) { #evmenu.show { display: grid; grid-template-columns: 1fr 1fr; gap: 0 4px; } #evmenu button { padding: .42em .7em; font-size: 13px; } }

/* Raumnamen (dezent, oben links im jeweiligen Raum) */
#rooms { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
#rooms span { position: absolute; font: 600 12px/1 'Noto Sans', system-ui, sans-serif; color: #fff; background: rgba(11,47,54,.72); padding: 4px 7px 5px; border-radius: 4px; white-space: nowrap; transition: opacity .4s; }
#rooms span.dim { opacity: .45; }
/* Kopfzeile während des Briefing-Films: welcher Schritt gerade passiert */
#filmhead { display: none; text-align: center; }
body.filming #top h1 { display: none; }
body.filming #filmhead { display: block; }
.fh-kick { font-size: clamp(11px, 1.3vw, 14px); color: rgba(255,255,255,.75); margin-bottom: 2px; }
.fh-kick b { color: #fff; }
.fh-title { font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: clamp(18px, 2.4vw, 30px); line-height: 1.15; }
#fh-step { color: var(--accent); }
.fh-cap { font-size: clamp(12px, 1.4vw, 16px); color: rgba(255,255,255,.88); margin-top: 3px; }
.fh-bar { display: flex; gap: 5px; justify-content: center; margin-top: 8px; }
.fh-bar i { width: clamp(28px, 5vw, 56px); height: 5px; border-radius: 3px; background: rgba(255,255,255,.22); transition: background .4s; }
.fh-bar i.done { background: rgba(255,255,255,.75); }
.fh-bar i.on { background: var(--accent); }
@media (max-height: 360px) { .fh-cap { display: none; } .fh-bar { margin-top: 4px; } }
/* im Vollbild: Schritt-Anzeige als Einblendung oben im Film */
body.fs.filming #top { display: block; position: absolute; top: 0; left: 0; right: 0; z-index: 3; padding: 10px 12px 26px; background: linear-gradient(rgba(4,20,24,.72), rgba(4,20,24,0)); pointer-events: none; }

/* Auftrag per E-Mail: fährt von unten ins Bild */
#mail { position: absolute; left: 50%; bottom: 12px; z-index: 3; width: min(92%, 440px); display: flex; gap: 12px; align-items: flex-start;
  background: #fffdf7; color: #14252a; border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transform: translate(-50%, calc(100% + 30px)); opacity: 0; transition: transform .6s cubic-bezier(.2,.9,.25,1.1), opacity .4s; pointer-events: none; }
#mail.show { transform: translate(-50%, 0); opacity: 1; }
#mail .m-ico { flex: 0 0 34px; height: 34px; border-radius: 50%; background: #0F6A6E; color: #fff; display: grid; place-items: center; font-size: 17px; }
#mail .m-from { font-size: 11px; opacity: .6; }
#mail .m-subj { font-weight: 700; font-size: 15px; margin: 1px 0 3px; }
#mail .m-body { font-size: 13px; line-height: 1.35; }
@media (max-width: 560px) { #mail { padding: 9px 11px; gap: 9px; } #mail .m-subj { font-size: 14px; } #mail .m-body { font-size: 12px; } }

/* Filmende: „Projekt fertig.“ mit Rakete */
#end .box.done { width: min(560px, 100%); }
#end .donehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
#end .donehead h2 { margin: 0 0 4px; font-family: 'Fraunces', Georgia, serif; font-size: clamp(26px, 3.4vw, 40px); }
#end #e-words { font-style: italic; color: #9fc3c4; font-size: 14px; }
#end .rocket { flex: 0 0 auto; width: clamp(56px, 9vw, 84px); height: auto; animation: lift 1.6s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
#end .rocket .flame { animation: flame .18s steps(2) infinite; transform-origin: 32px 48px; }
@keyframes lift { 0%, 100% { transform: translateY(2px) rotate(8deg); } 50% { transform: translateY(-6px) rotate(8deg); } }
@keyframes flame { 50% { transform: scaleY(1.35); } }
#end .btns { margin-top: 6px; }
@media (max-width: 560px) { #end .donehead h2 { font-size: 26px; } #end .rocket { width: 54px; } }
#end .real { color: #fff; font-weight: 600; font-size: 16px; margin: 0 0 4px; }
@media (max-width: 560px) { #end .real { font-size: 14px; } }
