* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1330;
  font-family: "Courier New", ui-monospace, monospace;
  color: #fff;
}

.wrap { width: min(960px, 96vw); text-align: center; }

h1 {
  margin: 0 0 4px;
  font-size: clamp(20px, 3.4vw, 30px);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.sub { margin: 0 0 14px; color: #c9b8f0; font-size: 13px; }

.stage {
  position: relative;
  border: 4px solid #2f2450;
  overflow: hidden;
  background: #fdf3e7;
}
canvas { display: block; width: 100%; height: auto; }

/* ---------- Quest-Box ---------- */
.questbox {
  position: absolute;
  top: 10px; left: 10px;
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(26, 19, 48, 0.85);
  border-left: 4px solid #c77dff;
  padding: 8px 12px 8px 8px;
  max-width: 46%;
  text-align: left;
}
.questbox.hidden { display: none; }
.quest-icon { font-size: 26px; line-height: 1; }
.quest-title { font-size: 14px; font-weight: bold; letter-spacing: 1px; text-transform: uppercase; }
.quest-sub { font-size: 12px; color: #c9b8f0; margin: 2px 0 6px; }
.quest-bar { height: 6px; background: #2f2450; width: 100%; }
.quest-fill { height: 100%; width: 0%; background: #c77dff; transition: width 0.2s; }

/* ---------- Banner (Klingel etc.) ---------- */
.banner {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  background: #ffd166;
  color: #1a1330;
  font-weight: bold;
  letter-spacing: 2px;
  padding: 6px 18px;
  font-size: 18px;
  animation: blink 0.7s step-end infinite;
  white-space: nowrap;
}
.banner.hidden { display: none; }
@keyframes blink { 50% { opacity: 0.35; } }

/* ---------- Overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(26, 19, 48, 0.88);
  padding: 20px;
}
.overlay.hidden { display: none; }
.overlay-title { font-size: clamp(24px, 5vw, 40px); font-weight: bold; letter-spacing: 3px; }
.overlay-sub { font-size: 18px; color: #ffd166; }

.story { max-width: 520px; font-size: 14px; line-height: 1.6; color: #e6dcf8; }
.story b { color: #c77dff; }

.controls-hint { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.controls-hint .p1 { color: #ff4d6d; }
.controls-hint .p2 { color: #2dd4bf; }
.warn { color: #ffd166; font-size: 13px; }

.btn {
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: #ffd166;
  color: #1a1330;
  border: none;
  padding: 12px 26px;
  cursor: pointer;
}
.btn:hover { background: #ffb84d; }

/* ---------- HUD ---------- */
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 13px;
}
.controls { display: flex; gap: 18px; flex-wrap: wrap; }
.p1 { color: #ff4d6d; }
.p2 { color: #2dd4bf; }
.mood { color: #c9b8f0; }
.timer { font-size: 17px; font-weight: bold; color: #ffd166; }
