/* ==========================================================================
   Kiosk Hochwacht — Burger-Endgegner Engine (Auftrag 2)
   Design-System: Dark Espresso, Messing, Pergament, Ketchup & Gurken-Grün
   60 FPS Canvas-Engine, Spring-Physics, Touch-Targets >= 50px
   ========================================================================== */

:root {
  --bg-dark: #0f0e0d;
  --bg-card: #191816;
  --pergament: #f6eedb;
  --messing: #c89d66;
  --messing-glow: rgba(200, 157, 102, 0.35);
  --ketchup: #b91c1c;
  --gurke: #2d6a4f;
  --chalk: #f4f3ee;
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: Impact, "Arial Black", "Arial Narrow Bold", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.endgegner-body {
  background: var(--bg-dark);
  color: var(--chalk);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Screen Shake Effect */
body.screen-shake {
  animation: endgegner-shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes endgegner-shake {
  10%, 90% { transform: translate3d(-3px, 1px, 0); }
  20%, 80% { transform: translate3d(4px, -2px, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 3px, 0); }
  40%, 60% { transform: translate3d(6px, -3px, 0); }
}

/* Subtiles Paper Grain */
.grain-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  z-index: 100;
}

/* Saucen-Splatter Canvas Overlay */
#splatter-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
}

/* Header & Nav */
.endgegner-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(15, 14, 13, 0.95);
  border-bottom: 2px solid var(--messing);
  z-index: 50;
}

.endgegner-logo {
  font-family: var(--font-display, "Arial Narrow", sans-serif);
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--chalk);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.endgegner-motto-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--messing);
  text-transform: uppercase;
}

.nav-actions {
  display: flex;
  gap: 8px;
}

.btn-nav-tool {
  background: #252422;
  border: 1px solid var(--messing);
  color: var(--chalk);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 50px;
}

.btn-nav-tool:hover {
  background: var(--messing);
  color: var(--bg-dark);
}

/* Cockpit HUD */
.cockpit-hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #181614 0%, #121110 100%);
  border-bottom: 1.5px solid rgba(200, 157, 102, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  z-index: 40;
}

.hud-tile {
  background: #1e1d1a;
  border: 1px solid rgba(200, 157, 102, 0.25);
  border-radius: 6px;
  padding: 8px 10px;
  text-align: center;
}

.hud-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--messing);
  display: block;
  margin-bottom: 2px;
}

.hud-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--pergament);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.hud-sub {
  font-size: 0.66rem;
  color: #9eb1a5;
  display: block;
  margin-top: 2px;
}

/* Banner für Spitzname & Sprüche-Feuerwerk */
.spitzname-bar {
  background: #201e1a;
  border-bottom: 1px solid rgba(200, 157, 102, 0.2);
  padding: 8px 14px;
  text-align: center;
}

.spitzname-title {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--messing);
}

.spitzname-spruch {
  font-size: 0.82rem;
  color: #d1d6ce;
  margin-top: 3px;
  line-height: 1.35;
}

/* Haupt-Bühne mit Physik-Canvas */
.burger-stage-wrapper {
  position: relative;
  flex: 1;
  min-height: 380px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 50% 65%, #1a1815 0%, #0f0e0d 80%);
  overflow: hidden;
}

#burger-canvas {
  display: block;
  width: 100%;
  max-width: 480px;
  height: 100%;
  /* Die Bühne hat keine Wisch-Gesten: senkrecht wischen muss die Seite scrollen (am Handy blockierte touch-action: none das Scrollen über dem ganzen Burger) */
  touch-action: pan-y pinch-zoom;
}

/* Zahnstocher-Retter Alarm Button */
.zahnstocher-alarm {
  position: absolute;
  top: 16px;
  right: 16px;
  background: linear-gradient(135deg, #e63946 0%, #b91c1c 100%);
  color: #fff;
  border: 2px solid #ffccd5;
  border-radius: 30px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(230, 57, 70, 0.85);
  animation: zahnstocher-blink 0.8s ease-in-out infinite alternate;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
}

@keyframes zahnstocher-blink {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(230, 57, 70, 0.6); }
  100% { transform: scale(1.08); box-shadow: 0 0 25px rgba(230, 57, 70, 1); }
}

/* Arcade Action Bar (Bite, Shuffle, Reset, Bauschein, Undo) */
.arcade-action-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  padding: 8px 8px;
  background: #141312;
  border-top: 1px solid rgba(200, 157, 102, 0.25);
  border-bottom: 1px solid rgba(200, 157, 102, 0.25);
}

.btn-arcade {
  min-height: 52px;
  background: #23211e;
  color: var(--chalk);
  border: 1.5px solid var(--messing);
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: transform 0.12s var(--ease-spring), background 0.12s ease;
  touch-action: manipulation;
}

.btn-arcade:active {
  transform: scale(0.95);
  background: var(--messing);
  color: var(--bg-dark);
}

.btn-arcade.btn-chaos {
  border-color: #f5b800;
  color: #f5b800;
}
.btn-arcade.btn-chaos:active {
  background: #f5b800;
  color: #000;
}

.btn-arcade.btn-bite {
  border-color: var(--ketchup);
  color: #ff8585;
}
.btn-arcade.btn-bite:active {
  background: var(--ketchup);
  color: #fff;
}

/* Zutaten & Basis Auswahlbereich */
.zutaten-konsole {
  background: #121110;
  padding: 12px 14px 24px;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--messing);
  margin-bottom: 8px;
  display: block;
}

.basen-auswahl {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.btn-basis {
  min-height: 52px;
  background: #1c1a17;
  border: 1.5px solid rgba(200, 157, 102, 0.3);
  border-radius: 8px;
  color: var(--chalk);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-basis.is-active {
  background: rgba(200, 157, 102, 0.2);
  border-color: var(--messing);
  box-shadow: 0 0 10px rgba(200, 157, 102, 0.3);
}

.btn-basis .basis-preis {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--messing);
}

.zutaten-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.btn-zutat {
  min-height: 50px;
  background: #1d1b18;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--chalk);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: transform 0.1s var(--ease-spring), border-color 0.15s ease;
  touch-action: manipulation;
}

.btn-zutat:active {
  transform: scale(0.96);
}

.btn-zutat.is-selected {
  background: rgba(45, 106, 79, 0.25);
  border-color: #5ed693;
  color: #fff;
}

.btn-zutat .zutat-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--messing);
}

.btn-zutat.is-selected .zutat-badge {
  background: #5ed693;
  color: #121110;
}

/* Bauschein Modal */
.bauschein-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.bauschein-modal.is-open {
  display: flex;
}

.bauschein-card {
  background: var(--pergament);
  color: #1a1816;
  max-width: 380px;
  width: 100%;
  border-radius: 12px;
  padding: 20px 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
  position: relative;
  font-family: var(--font-mono);
}

.bauschein-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.4rem;
  font-weight: 800;
  color: #1a1816;
  cursor: pointer;
}

.bauschein-header {
  text-align: center;
  border-bottom: 2px dashed #8c8270;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.bauschein-header h3 {
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bauschein-stempel {
  border: 3px solid var(--ketchup);
  color: var(--ketchup);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 6px 10px;
  text-transform: uppercase;
  display: inline-block;
  transform: rotate(-5deg);
  margin: 12px 0;
  border-radius: 4px;
}

.bauschein-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.btn-bauschein-action {
  flex: 1;
  min-height: 50px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-bauschein-action.primary {
  background: var(--bg-dark);
  color: var(--pergament);
  border: 1px solid var(--bg-dark);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  body.screen-shake {
    animation: none !important;
  }
  .zahnstocher-alarm {
    animation: none !important;
  }
}
