/* =========================================================================
   Neeles Geburtstags-Quest – Minecraft/Retro-Look
   ========================================================================= */

:root {
  --grass: #7cb342;
  --grass-dark: #5a8f2f;
  --dirt: #8b5a2b;
  --dirt-dark: #6b4423;
  --stone: #8c8c8c;
  --stone-dark: #5f5f5f;
  --sky: #8ecbff;
  --sky-2: #c7ecff;
  --diamond: #4aedd9;
  --gold: #ffcf3f;
  --ink: #24331a;
  --panel: #f4efe1;
  --panel-line: #cdbf9a;
  --shadow: rgba(0, 0, 0, 0.28);

  --pixel: "Press Start 2P", "Courier New", monospace;
  --body: "VT323", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky-2) 38%, var(--grass) 100%);
  background-attachment: fixed;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.pixel {
  font-family: var(--pixel);
  line-height: 1.5;
  letter-spacing: 0.5px;
}

/* Chunky Minecraft-Button --------------------------------------------------*/
.mc-btn {
  font-family: var(--pixel);
  font-size: 13px;
  color: #fff;
  background: var(--grass);
  border: 3px solid #1c1c1c;
  border-radius: 4px;
  padding: 14px 18px;
  cursor: pointer;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.28),
    inset 4px 4px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.05s ease, filter 0.1s ease;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
.mc-btn:hover {
  filter: brightness(1.06);
}
.mc-btn:active {
  transform: translateY(2px);
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.28),
    inset 2px 2px 0 rgba(255, 255, 255, 0.28);
}

/* =========================================================================
   Passwort-Sperre
   ========================================================================= */
.lock-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: calc(20px + env(safe-area-inset-top));
  background: radial-gradient(circle at 50% 30%, #3a4a2a, #1a2113 80%);
  z-index: 50;
}
.lock-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
  background: var(--panel);
  border: 4px solid #1c1c1c;
  border-radius: 6px;
  padding: 26px 22px 30px;
  box-shadow: 0 10px 0 var(--shadow), 0 14px 30px rgba(0, 0, 0, 0.5);
}
.lock-emoji {
  font-size: 46px;
  margin-bottom: 6px;
}
.lock-card h1 {
  font-family: var(--pixel);
  font-size: 20px;
  line-height: 1.6;
  color: var(--dirt-dark);
  margin: 6px 0 10px;
}
.lock-sub {
  font-size: 20px;
  color: #6a6350;
  margin: 0 0 18px;
}
.lock-hint {
  font-size: 21px;
  background: #fff7d6;
  border: 3px dashed var(--gold);
  border-radius: 4px;
  padding: 10px 12px;
  color: #6a5a1a;
  margin: 0 0 16px;
}

/* Inputs: >=16px, damit iOS beim Fokus nicht reinzoomt ---------------------*/
input[type="password"],
input[type="text"],
input[type="number"] {
  width: 100%;
  font-family: var(--body);
  font-size: 22px;
  padding: 12px 14px;
  border: 3px solid #1c1c1c;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  margin-bottom: 14px;
  box-shadow: inset 3px 3px 0 rgba(0, 0, 0, 0.08);
  -webkit-appearance: none;
  appearance: none;
}
input:focus {
  outline: none;
  border-color: var(--grass-dark);
  box-shadow: inset 3px 3px 0 rgba(0, 0, 0, 0.08), 0 0 0 3px rgba(124, 179, 66, 0.4);
}

.msg {
  font-size: 20px;
  min-height: 1.4em;
  margin: 12px 0 0;
}
.msg.err {
  color: #c0392b;
}
.msg.ok {
  color: var(--grass-dark);
}

/* Wackel-Animation bei falscher Eingabe ------------------------------------*/
.shake {
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* =========================================================================
   Haupt-App
   ========================================================================= */
.app {
  max-width: 620px;
  margin: 0 auto;
  padding: 14px 14px 40px;
  padding-top: calc(14px + env(safe-area-inset-top));
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.topbar-title {
  font-size: 15px;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
  margin: 0;
  line-height: 1.5;
}
.icon-btn {
  font-size: 22px;
  background: rgba(255, 255, 255, 0.7);
  border: 3px solid #1c1c1c;
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
  line-height: 1;
  flex: 0 0 auto;
}

/* Fortschritts-Blöcke ------------------------------------------------------*/
.track {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.35);
  border: 3px solid #1c1c1c;
  border-radius: 6px;
  margin-bottom: 16px;
}
.block {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pixel);
  font-size: 11px;
  color: #fff;
  border: 3px solid #1c1c1c;
  border-radius: 3px;
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.25),
    inset 3px 3px 0 rgba(255, 255, 255, 0.25);
}
.block.done {
  background: var(--grass);
}
.block.current {
  background: var(--gold);
  color: #4a3a00;
  animation: pulse 1.2s infinite;
}
.block.locked {
  background: var(--stone-dark);
  color: #d8d8d8;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* Rätsel-Karte -------------------------------------------------------------*/
.stage {
  display: block;
}
.card {
  --accent: var(--grass);
  background: var(--panel);
  border: 4px solid #1c1c1c;
  border-radius: 8px;
  padding: 22px 20px 24px;
  box-shadow: 0 8px 0 var(--shadow), 0 12px 26px rgba(0, 0, 0, 0.28);
  animation: pop 0.28s ease;
}
@keyframes pop {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.card-top {
  height: 10px;
  margin: -22px -20px 16px;
  background: var(--accent);
  border-bottom: 3px solid #1c1c1c;
  border-radius: 4px 4px 0 0;
}
.card-emoji {
  font-size: 54px;
  text-align: center;
  line-height: 1;
  margin-bottom: 8px;
}
.card h2 {
  font-family: var(--pixel);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
  color: var(--dirt-dark);
  margin: 0 0 14px;
}
.q {
  font-size: 23px;
  line-height: 1.35;
  white-space: pre-line;
  text-align: center;
  margin: 0 0 20px;
  color: #33301f;
}

.answer-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.answer-row input {
  margin-bottom: 0;
  flex: 1 1 auto;
}
.answer-row .mc-btn {
  width: auto;
  flex: 0 0 auto;
  font-size: 11px;
  padding: 0 16px;
}

.hint-wrap {
  text-align: center;
  margin-top: 14px;
}
.link-btn {
  background: none;
  border: none;
  color: var(--dirt-dark);
  font-family: var(--body);
  font-size: 20px;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px;
}
.hint-text {
  margin-top: 10px;
  font-size: 21px;
  background: #fff7d6;
  border: 3px dashed var(--gold);
  border-radius: 4px;
  padding: 10px 12px;
  color: #6a5a1a;
}

.feedback {
  text-align: center;
  font-size: 22px;
  min-height: 1.4em;
  margin: 14px 0 0;
  font-weight: bold;
}
.feedback.ok { color: var(--grass-dark); }
.feedback.err { color: #c0392b; }

/* Theme-Akzente ------------------------------------------------------------*/
.theme-creeper  { --accent: #5aa832; }
.theme-diamond  { --accent: var(--diamond); }
.theme-nether   { --accent: #b3402a; }
.theme-zelda    { --accent: #2e7d32; }
.theme-pokemon  { --accent: #f6c744; }
.theme-cozy     { --accent: #e58aa0; }
.theme-arcade   { --accent: #7b5cff; }
.theme-birthday { --accent: #ff7ac0; }

/* Finale -------------------------------------------------------------------*/
.finale {
  text-align: center;
  background: linear-gradient(160deg, #fff, #ffe9f4);
  border: 4px solid #1c1c1c;
  border-radius: 10px;
  padding: 30px 22px 34px;
  box-shadow: 0 8px 0 var(--shadow), 0 14px 30px rgba(0, 0, 0, 0.35);
  animation: pop 0.4s ease;
}
.finale .big-emoji {
  font-size: 66px;
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}
.finale h2 {
  font-family: var(--pixel);
  font-size: 20px;
  line-height: 1.7;
  color: #d6337f;
  margin: 14px 0;
}
.finale p {
  font-size: 24px;
  line-height: 1.4;
  color: #4a2036;
  margin: 12px 0;
}
.finale .cake {
  font-size: 40px;
  letter-spacing: 6px;
  margin: 18px 0;
}

.foot {
  text-align: center;
  margin-top: 26px;
  opacity: 0.75;
}

/* Konfetti-Canvas ----------------------------------------------------------*/
.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

/* Geschicklichkeitsspiele --------------------------------------------------*/
.game-area {
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.45);
  border: 3px solid #1c1c1c;
  border-radius: 6px;
  padding: 14px;
  text-align: center;
}
.hit-token {
  position: absolute;
  width: 52px;
  height: 52px;
  font-size: 34px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  animation: pop 0.15s ease;
  touch-action: manipulation;
}
.hit-token:active {
  transform: scale(0.9);
}
.timing-bar {
  position: relative;
  height: 42px;
  background: #e9e2cf;
  border: 3px solid #1c1c1c;
  border-radius: 5px;
  overflow: hidden;
}
.timing-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(90, 168, 50, 0.55);
  border-left: 2px solid #3f7a22;
  border-right: 2px solid #3f7a22;
}
.timing-marker {
  position: absolute;
  top: -3px;
  width: 6px;
  height: 48px;
  background: #c0392b;
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px #1c1c1c;
}

/* Diamanten fangen */
.catch-basket {
  position: absolute;
  bottom: 6px;
  height: 40px;
  font-size: 34px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.catch-item {
  position: absolute;
  font-size: 30px;
  line-height: 1;
  pointer-events: none;
}

/* Angeln */
.fish-scene {
  font-size: 70px;
  line-height: 1;
  margin: 6px 0 2px;
}
.fish-scene.bite {
  animation: bob 0.35s ease-in-out infinite;
}

/* Redstone-Merkspiel (Simon) */
.simon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 260px;
  margin: 4px auto 0;
}
.simon-pad {
  height: 80px;
  border: 3px solid #1c1c1c;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.5;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.22);
  transition: opacity 0.08s ease, filter 0.08s ease;
  touch-action: manipulation;
}
.simon-pad.lit {
  opacity: 1;
  filter: brightness(1.3);
}

/* Parkour-Hüpfer */
.parkour-canvas {
  display: block;
  width: 100%;
  height: 180px;
  background: #8ecbff;
  border: 3px solid #1c1c1c;
  border-radius: 5px;
  touch-action: none;
}

[hidden] {
  display: none !important;
}

@media (max-width: 400px) {
  .lock-card h1 { font-size: 17px; }
  .topbar-title { font-size: 12px; }
  .card h2 { font-size: 11px; }
  .block { width: 32px; height: 32px; font-size: 10px; }
}
