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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0F0D1A;
  color: #EDE9F7;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Prevent iOS bounce/pull-to-refresh and text selection on the game surface. */
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  /* Faint CRT scanline atmosphere behind the letterboxed canvas. */
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.02) 0px,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 3px
    ),
    #0F0D1A;
}

#game-canvas {
  display: block;
  touch-action: none;
  border-radius: 4px;
}

#loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 13px "Courier New", monospace;
  color: #8C87A8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------------------------------------------------------
   v1.49.0 — "Meine Vokabeln" (DOM-Overlay über dem Canvas, weil nur
   echte <input>-Felder eine Tastatur auf dem Handy öffnen).
   --------------------------------------------------------------- */
#mv-root,
#ad-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #0F0D1A;
  color: #EDE9F7;
  -webkit-user-select: text;
  user-select: text;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.mv-wrap { max-width: 520px; margin: 0 auto; padding: 12px 14px 96px; }
.mv-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.mv-top h1 { flex: 1; font: 900 18px "Courier New", monospace; color: #FFD35C; }
.mv-chip { font-size: 13px; padding: 5px 10px; border-radius: 14px; background: #211C38; white-space: nowrap; }
.mv-btn {
  appearance: none; border: 1px solid #211C38; background: #171428; color: #EDE9F7;
  font: 600 14px system-ui, sans-serif; padding: 11px 14px; border-radius: 12px; min-height: 44px;
}
.mv-btn:active { transform: scale(0.98); }
.mv-btn.primary { background: #FFD35C; color: #12081F; border-color: #FFD35C; }
.mv-btn.ok { background: #1E7B4D; border-color: #1E7B4D; }
.mv-btn.bad { background: #8A2F3D; border-color: #8A2F3D; }
.mv-btn.on { border-color: #FFD35C; color: #FFD35C; }
.mv-btn.small { padding: 6px 10px; min-height: 36px; font-size: 13px; }
.mv-btn[disabled] { opacity: 0.4; }
.mv-card { background: #171428; border: 1px solid #211C38; border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.mv-row { display: flex; align-items: center; gap: 8px; }
.mv-grow { flex: 1; min-width: 0; }
.mv-dim { color: #8C87A8; font-size: 12px; }
.mv-title { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.mv-input {
  width: 100%; min-width: 0; background: #0F0D1A; color: #EDE9F7; border: 1px solid #2A2446;
  border-radius: 10px; padding: 10px; font-size: 16px; /* 16px verhindert iOS-Zoom */
}
.mv-input:focus { outline: none; border-color: #FFD35C; }
.mv-pair { display: grid; grid-template-columns: 1fr 1fr 28px 34px; gap: 6px; align-items: center; margin-bottom: 6px; }
.mv-status { text-align: center; font-size: 15px; }
.mv-x { background: none; border: none; color: #8C87A8; font-size: 18px; min-height: 36px; }
.mv-hint { background: #2B2110; border: 1px solid #6B5320; border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; font-size: 13px; }
.mv-hint .mv-row { margin-top: 6px; }
.mv-seg { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.mv-seg .mv-btn { flex: 1 1 30%; padding: 9px 6px; font-size: 13px; }
.mv-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, #0F0D1A 70%, transparent); }
.mv-bar-inner { max-width: 520px; margin: 0 auto; display: flex; gap: 8px; }
.mv-bar .mv-btn { flex: 1; }
.mv-prompt { text-align: center; font-size: 30px; font-weight: 800; margin: 26px 0 8px; overflow-wrap: anywhere; }
.mv-dir { text-align: center; }
.mv-progress { height: 6px; background: #211C38; border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.mv-progress > div { height: 100%; background: #5CFFA0; transition: width 0.2s; }
.mv-choices { display: grid; gap: 10px; margin-top: 18px; }
.mv-choice { font-size: 17px; min-height: 58px; }
.mv-choice.right { background: #1E7B4D; border-color: #5CFFA0; }
.mv-choice.wrong { background: #8A2F3D; border-color: #FF5C5C; }
.mv-fb { text-align: center; margin: 14px 0; font-size: 16px; min-height: 24px; }
.mv-fb.good { color: #5CFFA0; } .mv-fb.near { color: #FFC857; } .mv-fb.bad { color: #FF7A8A; }
.mv-big { font-size: 22px; font-weight: 800; text-align: center; margin: 14px 0; }
.mv-msg { font-size: 13px; margin: 8px 0; color: #FFC857; overflow-wrap: anywhere; }
.mv-ta { min-height: 140px; font-size: 16px; }
