/* CHRONO WING — Basislayout: Canvas füllt das gesamte Fenster */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a12;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: default;
  image-rendering: pixelated;
  touch-action: none;          /* verhindert Scrollen/Zoomen durch Spielgesten */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  overscroll-behavior: none;   /* kein Pull-to-Refresh auf Mobilgeräten */
}

.noscript {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e8e8f0;
  font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;
  font-size: 18px;
  text-align: center;
  padding: 24px;
}

/* Reduzierte Bewegung auf Systemebene respektieren:
   Das Spiel selbst bietet zusätzlich Optionen für Shake/Blitze/Partikel. */
@media (prefers-reduced-motion: reduce) {
  #game { image-rendering: auto; }
}

/* Werbefeld: standardmäßig unsichtbar, wird nur im Hauptmenü und nur bei
   gültiger Konfiguration (js/config.js -> AD_CONFIG) eingeblendet */
#ad-container {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: calc(100vw - 24px);
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: rgba(8, 10, 20, 0.35);
  border-radius: 4px;
  overflow: hidden;
}


/* Anklickbare Projekt- und Rechtshinweise. Nur im Hauptmenü sichtbar. */
#site-links {
  display: none;
  position: fixed;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  gap: 0.55rem;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 24px);
  padding: 5px 9px;
  color: #c8d0dc;
  background: rgba(8, 10, 20, 0.58);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 4px;
  font: 500 12px ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;
  white-space: nowrap;
}

#site-links.visible { display: flex; }
#site-links a, #site-links button {
  color: #e8ecf4;
  text-decoration: none;
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
#site-links a:hover, #site-links a:focus-visible,
#site-links button:hover, #site-links button:focus-visible {
  color: #ffe86a;
  text-decoration: underline;
  outline: none;
}

/* Lokale Lizenzansicht: bewusst nahe an der Spiel-UI, ohne externe Ressourcen. */
#license-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(900px, calc(100vw - 32px));
  max-height: min(86vh, 820px);
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 6px;
  padding: 22px 24px 20px;
  color: #e8ecf4;
  background: rgba(10,12,24,0.97);
  box-shadow: 0 18px 70px rgba(0,0,0,0.58);
  font: 500 13px/1.55 ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;
}
#license-dialog::backdrop { background: rgba(4,6,14,0.72); }
.license-head { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.license-head h2 { flex: 1; margin: 0; color: #fff; font-size: 20px; }
.license-close-icon {
  width: 34px; height: 34px; border: 1px solid rgba(255,255,255,0.26); border-radius: 4px;
  color: #c8d0dc; background: rgba(255,255,255,0.04); font: 700 20px/1 ui-monospace, monospace; cursor: pointer;
}
.license-intro { margin: 0 0 16px; color: #c8d0dc; }
#license-dialog details { margin: 12px 0; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 10px; }
#license-dialog summary { cursor: pointer; color: #ffe86a; font-weight: 700; }
.license-text {
  margin: 12px 0 0; padding: 14px; max-height: 48vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  color: #d9dfeb; background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.10); border-radius: 4px;
  font: 500 11px/1.55 ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;
}
.license-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.license-actions button {
  min-width: 110px; padding: 8px 14px; border: 1px solid rgba(255,255,255,0.34); border-radius: 4px;
  color: #e8ecf4; background: rgba(255,255,255,0.06); font: 600 12px ui-monospace, monospace; cursor: pointer;
}
#license-dialog button:hover, #license-dialog button:focus-visible, #license-dialog summary:focus-visible {
  color: #ffe86a; border-color: rgba(255,232,106,0.65); outline: none;
}


@media (max-width: 480px), (max-height: 420px) {
  #site-links { font-size: 10px; gap: 0.35rem; padding: 4px 7px; }
}

@media (max-width: 560px), (max-height: 520px) {
  #license-dialog { width: calc(100vw - 18px); max-height: 92vh; padding: 16px; font-size: 12px; }
  .license-head h2 { font-size: 17px; }
  .license-text { font-size: 10px; max-height: 52vh; }
}
