/* ============================================================
   Blitzsehen | Stylesheet
   ============================================================ */

/* --- Reset & Basis --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f0f0f0;
  color: #333;
  user-select: none;
  -webkit-user-select: none;
}

/* ============================================================
   Modus-Menü
   ============================================================ */
#menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 36px;
  padding: 24px;
}

#menu.hidden {
  display: none;
}

#menu-title {
  font-size: 28px;
  font-weight: 600;
  color: #888;
  letter-spacing: 0.02em;
}

#menu-cards {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

/* --- Einzelne Modus-Kachel --- */
.menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px 36px 22px;
  border: 2px solid #d0d0d0;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  font-family: inherit;
  min-width: 220px;
}

.menu-card:hover,
.menu-card:focus-visible {
  border-color: #999;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.menu-card:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Zuletzt gewählter Modus: dezente Markierung */
.menu-card.last-used {
  border-color: #a0bfd8;
  background: #f7fafd;
}

.menu-preview {
  width: 160px;
  height: 120px;
  object-fit: contain;
  pointer-events: none;
  border-radius: 6px;
}

.menu-label {
  font-size: 20px;
  font-weight: 500;
  color: #444;
}

/* Responsiv: auf schmalen Screens untereinander */
@media (max-width: 540px) {
  #menu-cards {
    flex-direction: column;
    gap: 20px;
  }
  .menu-card {
    min-width: 0;
    width: 100%;
    max-width: 300px;
    padding: 20px 24px 16px;
  }
  .menu-preview {
    width: 120px;
    height: 90px;
  }
}

/* ============================================================
   Top-Leiste: Menü-Button + Modus-Label
   ============================================================ */
#btn-menu {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 100;
  font-size: 15px;
  color: #888;
  background: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}

#btn-menu:hover {
  color: #444;
  border-color: #999;
}

#btn-menu.hidden {
  display: none;
}

#mode-label {
  position: fixed;
  top: 15px;
  left: 100px;
  z-index: 100;
  font-size: 14px;
  color: #aaa;
}

#mode-label.hidden {
  display: none;
}

/* ============================================================
   Einstellungen (Zahnrad) – unverändert
   ============================================================ */
#settings-toggle {
  position: fixed;
  top: 12px;
  right: 16px;
  font-size: 28px;
  cursor: pointer;
  z-index: 100;
  color: #999;
  transition: color 0.2s;
  line-height: 1;
}

#settings-toggle:hover {
  color: #555;
}

#settings-panel {
  position: fixed;
  top: 50px;
  right: 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px 20px;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  font-size: 14px;
}

#settings-panel.hidden {
  display: none;
}

#settings-panel label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

#duration-slider {
  width: 180px;
  cursor: pointer;
}

/* ============================================================
   Rundenanzeige
   ============================================================ */
#round-counter {
  position: fixed;
  top: 40px;
  left: 16px;
  font-size: 14px;
  color: #aaa;
  z-index: 100;
}

#round-counter.hidden {
  display: none;
}

/* ============================================================
   Stage (zentrale Klick-/Touchfläche) – unverändert
   ============================================================ */
#stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  cursor: pointer;
  outline: none;
  position: relative;
}

#stage.hidden {
  display: none;
}

/* Dezenter Rahmen zur Kennzeichnung der Klickfläche */
#stage::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px dashed #d5d5d5;
  border-radius: 16px;
  pointer-events: none;
  transition: border-color 0.2s;
}

#stage:hover::before {
  border-color: #bbb;
}

/* --- Hinweistext --- */
#hint-text {
  font-size: 22px;
  color: #bbb;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.15s;
}

#hint-text.hidden {
  opacity: 0;
}

/* --- Flash-Bild --- */
#flash-image {
  display: none;
  max-width: 85vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
}

#flash-image.visible {
  display: block;
  opacity: 1;
}

#flash-image.fade-out {
  opacity: 0;
}

/* ============================================================
   Steuerungsbuttons – unverändert
   ============================================================ */
#controls {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 50;
  transition: opacity 0.15s;
}

#controls.hidden {
  display: none;
}

#controls button {
  padding: 14px 32px;
  font-size: 20px;
  border: 2px solid #ccc;
  border-radius: 12px;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  font-family: inherit;
}

#controls button:hover:not(:disabled) {
  background: #e8e8e8;
  border-color: #aaa;
}

#controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.key-hint {
  font-size: 13px;
  color: #aaa;
  margin-left: 2px;
}

/* --- Zustandsklasse: Stage während Blitz nicht klickbar --- */
#stage.flashing {
  cursor: default;
}
