/* ── Reset & Fullscreen ────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Courier New', ui-monospace, Menlo, Consolas, monospace; font-weight: 700;
  overscroll-behavior: none;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ── Ladebildschirm ────────────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #06030e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  z-index: 999;
  transition: opacity 0.7s ease;
}
#loading-screen.hidden { opacity: 0; pointer-events: none; }
#loading-screen.weg { display: none; }

.skull {
  font-size: 80px;
  filter: drop-shadow(0 0 32px #7a20cf);
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-14px)} }

#loading-title {
  font-size: 36px;
  color: #c080ff;
  letter-spacing: 8px;
  text-shadow: 0 0 30px #7a20cf, 0 0 80px #4a10af;
}
#loading-sub {
  font-size: 8px;
  color: #7a5a9a;
  letter-spacing: 2px;
  text-align: center;
  max-width: 480px;
  line-height: 2.2;
}
#loading-hint {
  font-size: 10px;
  color: #a070df;
  animation: pulse 1.2s ease-in-out infinite;
  letter-spacing: 4px;
}
@keyframes pulse { 0%,100%{opacity:0.2} 50%{opacity:1} }

/* ── Spielcontainer (Fullscreen) ───────────────────────────── */
#game-wrap {
  position: fixed;
  inset: 0;
}

#game {
  position: absolute;
  top: 0; left: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  outline: none;
}

/* ── Dialogue-Box ──────────────────────────────────────────── */
#dbox {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 130px;
  background: rgba(6, 3, 14, 0.97);
  border-top: 3px solid #6a30af;
  padding: 12px max(22px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  color: #ffffff;
  z-index: 50;
}
#dbox.hidden { display: none; }

#dbox-name {
  font-size: 14px;
  color: #c080ff;
  margin-bottom: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
#dbox-text {
  font-size: clamp(15px, 1.5vw, 20px);
  line-height: 1.6;
  color: #ffffff;
  min-height: 52px;
}

noscript {
  color: #e8d8ff;
  font-size: 12px;
  line-height: 1.8;
  padding: 24px;
  text-align: center;
}

@media (max-width: 700px) {
  #dbox { height: 150px; }
  #dbox-name { font-size: 7px; }
}
#dbox-arrow {
  position: absolute;
  bottom: 12px;
  right: 20px;
  color: #a050df;
  font-size: 10px;
  animation: blink 0.65s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── Steuerungshinweis ─────────────────────────────────────── */
#controls-hint {
  position: fixed;
  top: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 6px;
  color: rgba(200,180,255,0.35);
  letter-spacing: 1px;
  pointer-events: none;
  z-index: 10;
}

/* ── Touch-Steuerung (Handy) ───────────────────────────────── */
#touch { display: none; }
body.touch #touch { display: block; position: fixed; inset: 0; pointer-events: none; z-index: 20; user-select: none; -webkit-user-select: none; touch-action: none; }
#t-stick { position: absolute; left: max(18px, env(safe-area-inset-left)); bottom: max(74px, env(safe-area-inset-bottom)); width: 116px; height: 116px; border-radius: 50%; background: rgba(120, 60, 200, .18); border: 2px solid rgba(200, 150, 255, .4); pointer-events: auto; touch-action: none; }
#t-stick i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(210, 170, 255, .6); }
#t-akt { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(74px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 58px 58px; gap: 8px; justify-items: center; align-items: center; pointer-events: auto; }
#t-menu { position: absolute; right: max(10px, env(safe-area-inset-right)); top: 118px; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
#touch button { width: 58px; height: 58px; border-radius: 50%; border: 2px solid rgba(200, 150, 255, .45); background: rgba(20, 8, 40, .55); color: #e8d8ff; font: 700 22px/1 system-ui, sans-serif; touch-action: none; -webkit-tap-highlight-color: transparent; }
#touch button.kl, #t-menu button { width: 42px; height: 42px; font-size: 17px; }
#touch button.hau { background: rgba(160, 40, 60, .6); }
#touch button.zau { background: rgba(110, 40, 200, .6); }
#touch button.an { background: rgba(255, 220, 90, .85); color: #1a0e2a; }/* Handy hochkant: das Spiel braucht Querformat */
@media (pointer: coarse) and (orientation: portrait) {
  body.touch::after { content: '📱 Bitte das Handy quer halten'; position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; background: #06030e; color: #c080ff; font-size: 18px; text-align: center; padding: 24px; }
}
/* ── Antwortauswahl im Gespräch ────────────────────────────── */
#dbox { height: auto; min-height: 130px; max-height: 70vh; overflow-y: auto; }
#dbox-wahl { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; max-width: 760px; }
#dbox-wahl.hidden { display: none; }
.dwahl { text-align: left; font: 700 clamp(14px, 1.35vw, 18px)/1.35 'Courier New', ui-monospace, Menlo, Consolas, monospace; color: #f0e4ff; background: #1a0e2a; border: 2px solid #5a2a8a; border-radius: 6px; padding: 7px 12px; cursor: pointer; }
.dwahl:hover, .dwahl:focus-visible { border-color: #ffe040; background: #2a1840; outline: none; }
.dwahl.gnade { border-left: 6px solid #80d0ff; }
.dwahl.furcht { border-left: 6px solid #ff6060; }

/* Rechtliches: sichtbar auf dem Titelbild und im Pausemenü */
#nk-recht { display: none; position: fixed; left: 0; right: 0; bottom: max(6px, env(safe-area-inset-bottom)); z-index: 30; text-align: center; font-size: 12px; color: #6a5a8a; }
#nk-recht a { color: #a080d0; text-decoration: none; padding: 4px 6px; }
#nk-recht a:hover, #nk-recht a:focus-visible { color: #ffe040; }
body.nk-menue #nk-recht { display: block; }
