/* ============================================================
   DATE QUEST — Retro Arcade / Pixel-Art Styling
   ============================================================ */

:root {
  --bg0: #1a1030;
  --bg1: #2a1a4a;
  --ink: #fdf6e3;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  /* overflow hidden, damit das fliehende NEIN das Layout nicht zerschiesst */
  overflow: hidden;
  color: var(--ink);
  background-color: var(--bg0);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(138, 79, 255, 0.35), transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(63, 208, 232, 0.30), transparent 45%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  image-rendering: pixelidated;
  -webkit-font-smoothing: none;
  font-smooth: never;
  letter-spacing: 0.5px;
}

/* CRT-Scanlines */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0.18) 3px
  );
  mix-blend-mode: multiply;
}

/* ---------- Layout-Rahmen ---------- */
.game-frame {
  position: relative;
  z-index: 1;
  width: min(680px, 94vw);
  margin: 0 auto;
  height: 100vh;
  max-height: 100vh;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  overflow-y: auto;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink);
  background: #000;
  border: 4px solid #000;
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 1);
  background: linear-gradient(90deg, #2a1a4a, #3a2a5a);
  padding: 10px 12px;
}

.mute-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  filter: drop-shadow(1px 1px 0 #000);
}
.mute-btn.off {
  opacity: 0.5;
}

/* ---------- Steps ---------- */
.step {
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: pop 0.25s steps(4, end);
}
.step.active {
  display: flex;
}

@keyframes pop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ---------- Dialog-Box (JRPG) ---------- */
.dialog-box {
  position: relative;
  background: #0d0b1a;
  border: 4px solid #000;
  box-shadow:
    0 0 0 4px #6c5ce7,
    8px 8px 0 0 rgba(0, 0, 0, 1);
  padding: 16px 16px 18px;
}
.dialog-name {
  position: absolute;
  top: -14px;
  left: 10px;
  background: #6c5ce7;
  color: #000;
  font-size: 9px;
  padding: 4px 8px;
  border: 3px solid #000;
}
.dialog-text {
  font-size: 12px;
  line-height: 1.8;
  margin: 6px 0 0;
}

/* Blinkender Cursor */
.cursor {
  color: var(--hexgold, #f0c14b);
  animation: blink 1s steps(1) infinite;
}
.blink {
  color: #ff4d9d;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

.crit {
  color: #ffec5c;
  text-shadow: 2px 2px 0 #e23d5a;
}

/* ---------- Charaktere ---------- */
.char-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.avatar-wrap {
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
  image-rendering: pixelated;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.6));
  animation: bob 2.2s ease-in-out infinite;
}
.avatar-wrap.big {
  width: 120px;
  height: 120px;
}
.avatar-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* Vi-Punch */
.punch {
  animation: punch 0.5s steps(3) 2, bob 2.2s ease-in-out infinite;
}
@keyframes punch {
  0%   { transform: translateX(0) rotate(0); }
  30%  { transform: translateX(-14px) rotate(-8deg); }
  60%  { transform: translateX(18px) rotate(10deg) scale(1.1); }
  100% { transform: translateX(0) rotate(0); }
}

/* ---------- Buttons (Arcade) ---------- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 4px;
}
.arcade-btn {
  font-family: '"Press Start 2P"', monospace;
  font-size: 12px;
  color: #000;
  padding: 14px 18px;
  border: 4px solid #000;
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 1);
  cursor: pointer;
  transition: transform 0.05s, box-shadow 0.05s, filter 0.1s;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.25);
}
.arcade-btn:active:not([disabled]) {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 1);
}
.arcade-btn[disabled] {
  filter: grayscale(0.8) brightness(0.6);
  cursor: not-allowed;
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 1);
}
.arcade-green  { background: #46d160; }
.arcade-green:hover:not([disabled])  { filter: brightness(1.12); }
.arcade-red    { background: #ff5252; }
.arcade-gold   { background: #f0c14b; }
.arcade-blue   { background: #3fd0e8; }
.arcade-purple { background: #a06bff; }

/* Fliehendes NEIN */
#btn-no.fleeing {
  position: fixed;
  z-index: 50;
  margin: 0;
}

.hint {
  text-align: center;
  font-size: 9px;
  opacity: 0.7;
  margin: 2px 0 0;
}

/* ---------- Inputs ---------- */
.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 480px) {
  .field-grid { grid-template-columns: 1fr 1fr; }
}
.field-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 10px;
  color: var(--hexgold, #f0c14b);
}
.retro-input {
  font-family: '"Press Start 2P"', monospace;
  font-size: 12px;
  color: #fff;
  background: #0d0b1a;
  border: 4px solid #000;
  box-shadow: inset 0 0 0 3px #3fd0e8, 4px 4px 0 0 rgba(0, 0, 0, 1);
  padding: 12px;
  width: 100%;
}
.retro-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}
.retro-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 3px #ff4d9d, 4px 4px 0 0 rgba(0, 0, 0, 1);
}

/* ---------- Quest-Tiles ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.quest-tile {
  font-family: '"Press Start 2P"', monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 10px;
  color: #fff;
  background: #0d0b1a;
  border: 4px solid #000;
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 1);
  cursor: pointer;
  transition: transform 0.05s, box-shadow 0.05s;
}
.quest-tile:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 1);
}
.tile-icon {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.6));
}
.tile-text {
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}
.quest-tile.selected {
  background: #2a1a4a;
  box-shadow: 0 0 0 4px #46d160, 4px 4px 0 0 rgba(0, 0, 0, 1);
}
.quest-tile.selected::after {
  content: '✓ AKTIV';
  font-size: 8px;
  color: #46d160;
}

/* ---------- Victory ---------- */
.victory-title {
  text-align: center;
  font-size: clamp(20px, 6vw, 34px);
  line-height: 1.3;
  color: #ffec5c;
  text-shadow:
    3px 3px 0 #e23d5a,
    6px 6px 0 rgba(0, 0, 0, 0.8);
  animation: shake 0.5s steps(2) 3;
  margin: 0;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.summary {
  font-size: 10px;
  line-height: 1.9;
  background: #0d0b1a;
  border: 4px solid #000;
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 1);
  padding: 12px 14px;
  color: var(--hextech, #3fd0e8);
}
.summary b { color: #fff; }

.send-status {
  text-align: center;
  font-size: 10px;
  line-height: 1.7;
  min-height: 1.2em;
  margin: 4px 0 0;
}
.send-status.ok  { color: #46d160; }
.send-status.err { color: #ff5252; }
.send-status.pending { color: #f0c14b; }

/* Sehr kleine Screens */
@media (max-width: 380px) {
  .avatar-wrap { width: 64px; height: 64px; }
  .dialog-text { font-size: 10px; }
  .arcade-btn { font-size: 10px; padding: 12px; }
}
