/* ===== Grundlayout ===== */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Trebuchet MS", sans-serif;
  background: linear-gradient(#fff6e0, #ffe3c2);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  flex-direction: column;
  padding: 2vmin;
  gap: 2vmin;
}

button { font: inherit; cursor: pointer; border: none; }

@keyframes puls { 50% { transform: scale(1.08); } }

/* ===== Startbildschirm ===== */
#start {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: #ffe3c2;
}
#start.weg { display: none; }
#startKnopf {
  width: 40vmin; height: 40vmin; border-radius: 50%;
  background: #ffb347; color: #fff; font-size: 18vmin;
  box-shadow: 0 0 60px #ffb347;
  animation: puls 1.6s ease-in-out infinite;
}

/* ===== Obere Leiste ===== */
header {
  flex: 0 0 auto;
  height: 16vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2vmin;
}

#home {
  width: 11vmin; height: 11vmin; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .06);
  font-size: 6vmin; text-decoration: none;
}

.modi { display: flex; gap: 3vmin; height: min(100%, 22vw); }
.modus {
  height: 100%; aspect-ratio: 1;
  border-radius: 3vmin;
  background: #fff;
  opacity: .45;
  box-shadow: 0 .8vmin 0 rgba(0, 0, 0, .08);
  transition: opacity .3s, transform .3s, box-shadow .3s;
}
.modus svg { width: 100%; height: 100%; }
.modus.aktiv {
  opacity: 1;
  transform: scale(1.06);
  box-shadow: 0 0 0 .8vmin #ffb347, 0 .8vmin 0 rgba(0, 0, 0, .08);
}

.levels { display: flex; align-items: center; gap: 1.5vmin; }
.levels button {
  width: 11vmin; height: 11vmin; border-radius: 50%;
  background: #9ec5ff; color: #1d3a6a; font-size: 6vmin;
  transition: opacity .3s;
}
.levels button:disabled { opacity: .25; cursor: default; }
.punkte { display: flex; gap: 1vmin; }
.punkt {
  width: 2.5vmin; height: 2.5vmin; border-radius: 50%;
  background: #c9b8a0;
}
.punkt.aktiv { background: #ff7a3d; }

/* ===== Level 3: Gegenstand auswählen ===== */
#motive { display: none; flex: 0 0 auto; height: 10vh; justify-content: center; gap: 2vmin; }
body.level3 #motive { display: flex; }
.motiv {
  height: 100%; aspect-ratio: 1; border-radius: 2vmin;
  background: #fff; opacity: .45; padding: .8vmin;
  box-shadow: 0 .6vmin 0 rgba(0, 0, 0, .08);
  transition: opacity .3s, transform .3s, box-shadow .3s;
}
.motiv svg { width: 100%; height: 100%; }
.motiv.aktiv {
  opacity: 1; transform: scale(1.08);
  box-shadow: 0 0 0 .6vmin #ffb347, 0 .6vmin 0 rgba(0, 0, 0, .08);
}

/* ===== Spielfeld: 5 Spalten, oben Gegenstände, unten Zahlen ===== */
#feld {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: 2fr 1fr;
  gap: 2vmin;
}

.zelle {
  position: relative;
  border-radius: 3vmin;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 1vmin 0 rgba(0, 0, 0, .1);
  transition: transform .25s, box-shadow .25s, background .25s;
}

.ding { background: #fff; }
.ding svg { width: 92%; height: 92%; }

/* Hochformat (Handy): Spalten sind schmal, Gegenstände dürfen höher werden */
@media (orientation: portrait) {
  .ding svg { width: 100%; height: auto; aspect-ratio: 1; }
}

.zahl {
  color: #fff;
  font-size: min(16vh, 13vw);
  font-weight: bold;
  text-shadow: 0 .6vmin 0 rgba(0, 0, 0, .15);
}

/* Aufleuchten */
.zelle.leuchtet {
  transform: scale(1.06);
  box-shadow: 0 0 0 1vmin #ffd23f, 0 0 5vmin #ffd23f;
  z-index: 1;
}
.ding.leuchtet { background: #fffbe0; }

/* Schwer: richtig gefunden */
.ding.richtig {
  background: #e3f9d6;
  box-shadow: 0 0 0 1vmin #6cc24a, 0 0 5vmin #6cc24a;
  animation: huepfen .5s ease-out 2;
}
@keyframes huepfen { 40% { transform: translateY(-3vmin) scale(1.05); } }

/* Schwer: falsch */
.zelle.falsch { animation: schuetteln .1s linear 5 alternate; }
@keyframes schuetteln {
  from { transform: translateX(-1.5vmin); }
  to   { transform: translateX(1.5vmin); }
}

/* Schwer: schon gefundene Paare bekommen einen Stern */
.zelle.erledigt::after {
  content: "⭐";
  position: absolute; top: .5vmin; right: 1vmin;
  font-size: 5vmin;
}

/* Hinweis "zuerst eine Zahl": die Zahlenreihe wackelt kurz */
#feld.zahlenWackeln .zahl { animation: puls .3s ease-in-out 2; }
