/* Startbildschirm "Frucht-Racer" - HTML-Ebene ueber dem Phaser-Canvas.
   Alles ist fuer eine feste Buehne von 1280x720 gestaltet; menu.js skaliert sie
   aufs Fenster (wie Phaser.Scale.FIT), damit das Layout ueberall gleich aussieht. */

:root {
  --gruen-dunkel: #07190f;
  --gruen-karte: #143820;
  --mint: #34d399;
  --mint-hell: #a7f3d0;
  --gelb: #facc15;
  --gelb-hell: #fde047;
  --orange-schatten: #b45309;
  --holz-1: #24170d;
  --holz-2: #3c2616;
  --holz-rand: #633f24;
  --schrift: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --schrift-arcade: 'Fredoka One', 'Arial Rounded MT Bold', 'Segoe UI', sans-serif;
  --schrift-sniglet: 'Sniglet', 'Arial Rounded MT Bold', 'Segoe UI', sans-serif;
}

#menu {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background-color: var(--gruen-dunkel);
  background-image:
    radial-gradient(circle at 50% 20%, #174e2d 0%, transparent 60%),
    radial-gradient(circle at 10% 80%, #113820 0%, transparent 50%),
    radial-gradient(circle at 90% 90%, #0d2d1a 0%, transparent 50%);
  font-family: var(--schrift); color: #fff;
  user-select: none; overflow: hidden;
}
#menu[hidden] { display: none; }

#menu-stage {
  position: relative; width: 1280px; height: 720px; flex: none;
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 40px 8px; box-sizing: border-box;
  transform-origin: center center;
}

/* Fallende Fruechte im Hintergrund */
#menu-blaetter { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#menu-blaetter span {
  position: absolute; top: 0; font-size: 26px; opacity: 0;
  animation: blattFall linear infinite;
}
@keyframes blattFall {
  0% { transform: translateY(-40px) rotate(0deg); opacity: 0; }
  15% { opacity: .45; } 85% { opacity: .45; }
  100% { transform: translateY(760px) rotate(360deg); opacity: 0; }
}

/* Kopf */
.m-kopf { position: relative; text-align: center; animation: titelSchweben 4s ease-in-out infinite; }
@keyframes titelSchweben {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}
.m-badge {
  display: inline-block; padding: 4px 16px; border-radius: 999px;
  background: rgba(2, 44, 34, .8); border: 1px solid rgba(16, 185, 129, .4);
  color: #6ee7b7; font-size: 13px; font-weight: 900; letter-spacing: .2em;
}
.m-titel {
  margin: 2px 0 0; font-family: var(--schrift-arcade); font-weight: normal;
  font-size: 64px; line-height: 1; letter-spacing: .04em; color: var(--gelb-hell);
  -webkit-text-stroke: 3px #0f391b;
  text-shadow: 4px 4px 0 #064e3b, 7px 7px 0 rgba(0,0,0,.6);
}
.m-titel-deko { position: absolute; font-size: 42px; }
.m-titel-deko.flagge { top: 6px; right: -54px; animation: huepfen 1s infinite; }
.m-titel-deko.affe { bottom: -6px; left: -56px; }
@keyframes huepfen { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.m-untertitel { margin: 2px 0 0; color: var(--mint-hell); font-size: 15px; font-weight: 800; opacity: .9; }

/* Spieleranzahl */
.m-anzahl { display: flex; align-items: center; gap: 16px; margin-top: 6px; }
.m-label { font-family: var(--schrift-sniglet); color: var(--gelb-hell); font-size: 17px; letter-spacing: .03em; }
.m-holz {
  background: linear-gradient(145deg, var(--holz-1), var(--holz-2));
  border: 4px solid var(--holz-rand);
  box-shadow: inset 0 2px 5px rgba(255,255,255,.1), 0 10px 20px rgba(0,0,0,.5);
}
.m-anzahl-knoepfe { display: inline-flex; gap: 8px; padding: 6px; border-radius: 18px; }
.m-anzahl-knoepfe button {
  font-family: var(--schrift-arcade); font-size: 19px; padding: 6px 20px;
  border-radius: 12px; border: 2px solid transparent; cursor: pointer;
  background: transparent; color: #6ee7b7;
}
.m-anzahl-knoepfe button:hover { color: var(--gelb-hell); background: rgba(6, 78, 59, .5); }
.m-anzahl-knoepfe button.aktiv { background: var(--gelb); color: #022c22; border-color: #fef08a; }
.m-taste {
  display: inline-block; min-width: 1.4em; padding: 0 .35em; border-radius: 6px;
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.25);
  font-family: var(--schrift); font-size: .8em; font-weight: 900; line-height: 1.5;
  text-align: center; color: #d1fae5;
}

/* Spielerkarten */
.m-karten { display: flex; gap: 22px; justify-content: center; margin-top: 10px; height: 270px; }
.m-karte {
  width: 330px; box-sizing: border-box; padding: 11px 18px; border-radius: 24px;
  display: flex; flex-direction: column; gap: 7px;
  background: linear-gradient(180deg, rgba(20,56,32,.92) 0%, rgba(11,35,20,.96) 100%);
  border: 3px solid var(--mint); box-shadow: 0 10px 25px rgba(0,0,0,.4);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.m-karte.bereit {
  border-color: var(--gelb);
  box-shadow: 0 0 25px rgba(250,204,21,.45), inset 0 0 15px rgba(250,204,21,.15);
  transform: translateY(-3px);
}
.m-karte-kopf {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 8px; border-bottom: 1px solid rgba(16,185,129,.3);
}
.m-karte-kopf small { display: block; font-size: 10px; font-weight: 900; letter-spacing: .15em; color: #6ee7b7; }
.m-karte-kopf strong { font-family: var(--schrift-sniglet); font-size: 21px; color: var(--gelb-hell); }
.m-p { font-weight: 900; font-size: 13px; padding: 2px 9px; border-radius: 999px; background: rgba(0,0,0,.35); border: 1px solid rgba(110,231,183,.4); }
.m-steuerung {
  text-align: center; font-size: 13px; font-weight: 800; padding: 6px; border-radius: 12px;
  background: rgba(2,44,34,.6); border: 1px solid rgba(16,185,129,.25);
}
.m-auto {
  position: relative; height: 104px; border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.25); box-shadow: inset 0 -20px 30px rgba(0,0,0,.15);
}
.m-auto-bild { height: 66px; display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 6px 4px rgba(0,0,0,.35)); }
.m-auto-bild .sprite { background-repeat: no-repeat; }
.m-auto-bild .emoji { font-size: 64px; line-height: 1; }
.m-auto-name {
  margin-top: 4px; font-family: var(--schrift-arcade); font-size: 22px; color: #fff;
  -webkit-text-stroke: 1px rgba(0,0,0,.45); text-shadow: 2px 2px 0 rgba(0,0,0,.35);
}
.m-pfeil {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--gelb);
  background: rgba(2,44,34,.85); color: var(--gelb); font-size: 18px; font-weight: 900;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.m-pfeil:hover { background: var(--gelb); color: #022c22; }
.m-pfeil.links { left: 10px; } .m-pfeil.rechts { right: 10px; }
.m-karte.bereit .m-pfeil { opacity: .25; pointer-events: none; }
.m-bereit {
  margin-top: auto; padding: 8px; border-radius: 16px; cursor: pointer;
  font-family: var(--schrift-arcade); font-size: 20px; letter-spacing: .03em;
  background: #0f6b4a; color: var(--gelb-hell); border: none;
  box-shadow: 0 6px 0 #064e3b, 0 8px 15px rgba(0,0,0,.4); transition: transform .1s, box-shadow .1s;
}
.m-bereit:hover { transform: translateY(-2px); }
.m-bereit:active { transform: translateY(4px); box-shadow: 0 2px 0 #064e3b; }
.m-karte.bereit .m-bereit { background: var(--gelb); color: #022c22; box-shadow: 0 6px 0 #a16207, 0 8px 15px rgba(0,0,0,.4); }

/* Strecke + Runden */
.m-strecke {
  display: flex; align-items: center; gap: 16px; margin-top: 10px; width: 1034px;
  box-sizing: border-box; padding: 6px 16px; border-radius: 22px;
}
.m-strecke-bild {
  width: 78px; height: 50px; border-radius: 12px; flex: none;
  border: 3px solid var(--gelb); background: center / cover no-repeat;
}
.m-strecke-text small { font-size: 11px; font-weight: 900; letter-spacing: .15em; color: var(--gelb); }
.m-strecke-text strong { display: block; font-family: var(--schrift-sniglet); font-size: 22px; color: var(--gelb-hell); }
.m-strecke-text span { font-size: 13px; font-weight: 800; color: #6ee7b7; }
.m-runden {
  margin-left: auto; display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  border-radius: 16px; background: rgba(2,44,34,.7); border: 1px solid rgba(16,185,129,.3);
  font-family: var(--schrift-sniglet); font-size: 16px; color: var(--mint-hell);
}
.m-runden button {
  width: 36px; height: 36px; border-radius: 10px; border: none; cursor: pointer;
  background: #f59e0b; color: #fff; font-size: 22px; font-weight: 900; line-height: 1;
  box-shadow: 0 4px 0 var(--orange-schatten);
}
.m-runden button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--orange-schatten); }
.m-runden output { width: 30px; text-align: center; font-family: var(--schrift-arcade); font-size: 28px; color: var(--gelb-hell); }

/* Top 3 der Bestenliste in der Streckenleiste (anklickbar, oeffnet die ganze Liste) */
.m-top3 {
  margin-left: auto; width: 250px; padding: 4px 12px; border-radius: 14px; cursor: pointer;
  display: flex; flex-direction: column; gap: 0; text-align: left;
  background: rgba(2,44,34,.7); border: 1px solid rgba(250,204,21,.45); color: #d1fae5;
  font-family: var(--schrift);
}
.m-top3:hover { border-color: var(--gelb); box-shadow: 0 0 12px rgba(250,204,21,.4); }
.m-top3 small { font-size: 9px; font-weight: 900; letter-spacing: .15em; color: var(--gelb); }
.m-top-zeile { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 900; line-height: 1.25;
  font-variant-numeric: tabular-nums; }
.m-top-zeile i { font-style: normal; font-size: 12px; }
.m-top-zeile b { font-family: var(--schrift-arcade); font-weight: normal; letter-spacing: .08em; color: var(--gelb-hell); width: 52px; }
.m-top-zeile em { font-style: normal; font-size: 12px; }
.m-top-zeile span { margin-left: auto; color: var(--mint-hell); }
.m-top-leer { font-size: 12px; font-weight: 800; color: rgba(167,243,208,.75); line-height: 1.3; padding: 4px 0; }
.m-runden { margin-left: 0; }

/* Volle Bestenliste als Overlay ueber dem Startbildschirm */
.m-liste { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center;
  background: rgba(3,15,8,.75); }
.m-liste[hidden] { display: none; }
.m-liste-box { width: 760px; max-height: 620px; display: flex; flex-direction: column; border-radius: 26px; padding: 16px 22px; }
.m-liste-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
  font-family: var(--schrift-arcade); font-size: 24px; color: var(--gelb-hell); letter-spacing: .03em; }
.m-liste-zu { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--gelb); cursor: pointer;
  background: rgba(2,44,34,.85); color: var(--gelb); font-size: 16px; font-weight: 900; }
.m-liste-zu:hover { background: var(--gelb); color: #022c22; }
.m-liste-tabelle { overflow-y: auto; border-radius: 14px; background: rgba(0,0,0,.25); }
.m-liste-tabelle table { width: 100%; border-collapse: collapse; font-size: 16px; font-weight: 800; }
.m-liste-tabelle th { position: sticky; top: 0; background: #2b1b10; text-align: left; padding: 8px 12px;
  font-size: 11px; letter-spacing: .15em; color: #6ee7b7; font-weight: 900; text-transform: uppercase; }
.m-liste-tabelle td { padding: 6px 12px; border-top: 1px solid rgba(255,255,255,.08); font-variant-numeric: tabular-nums; }
.m-liste-tabelle td.platz { width: 60px; font-family: var(--schrift-arcade); color: var(--mint-hell); }
.m-liste-tabelle td.name { font-family: var(--schrift-arcade); letter-spacing: .1em; color: var(--gelb-hell); }
.m-liste-tabelle td.zeit { color: #fff; }
.m-liste-tabelle td.datum { color: rgba(167,243,208,.7); font-size: 13px; }
.m-liste-tabelle tr.top td { background: rgba(250,204,21,.08); }
.m-liste-leer { margin: 30px; text-align: center; font-size: 17px; font-weight: 800; color: var(--mint-hell); line-height: 1.6; }
.m-liste-ort { margin-top: 8px; text-align: center; font-size: 12px; font-weight: 800; color: rgba(167,243,208,.7); }
.m-liste-fuss { margin-top: 10px; text-align: center; font-size: 13px; font-weight: 800; color: var(--mint-hell); }

/* Start */
.m-start {
  margin-top: 10px; padding: 6px 60px; border-radius: 20px; border: 3px solid #fef08a;
  font-family: var(--schrift-arcade); font-size: 30px; letter-spacing: .03em; cursor: pointer;
  background: linear-gradient(180deg, #fde047, #f59e0b); color: #422006;
  box-shadow: 0 8px 0 var(--orange-schatten), 0 10px 20px rgba(0,0,0,.5);
  animation: startPuls 1.8s ease-in-out infinite;
}
.m-start:disabled {
  animation: none; cursor: default; opacity: .45; filter: saturate(.5);
}
@keyframes startPuls {
  0%, 100% { box-shadow: 0 0 20px rgba(234,179,8,.6), 0 8px 0 var(--orange-schatten); transform: scale(1); }
  50% { box-shadow: 0 0 35px rgba(250,204,21,.9), 0 8px 0 var(--orange-schatten); transform: scale(1.03); }
}
.m-status {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 16px; border-radius: 999px; font-size: 15px; font-weight: 900;
  background: rgba(2,44,34,.75); border: 1px solid rgba(16,185,129,.35); color: var(--gelb-hell);
}
.m-status i { width: 11px; height: 11px; border-radius: 50%; background: #ca8a04; }
.m-status.alle i { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.m-fuss { margin-top: auto; font-size: 12px; font-weight: 800; color: rgba(167,243,208,.75); }
.m-fuss > span + span::before { content: '•'; margin: 0 10px; } /* nur zwischen den Hinweisen, nicht zwischen Tasten */

/* Ladebildschirm (ladebildschirm.js) - nutzt .m-badge und .m-titel von oben */
#laden {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background-color: var(--gruen-dunkel);
  background-image:
    radial-gradient(circle at 50% 30%, #174e2d 0%, transparent 60%),
    radial-gradient(circle at 10% 80%, #113820 0%, transparent 50%),
    radial-gradient(circle at 90% 90%, #0d2d1a 0%, transparent 50%);
  font-family: var(--schrift); color: #fff; user-select: none;
  transition: opacity .4s ease;
}
#laden.weg { opacity: 0; pointer-events: none; }
#laden-stage {
  width: 1280px; height: 720px; flex: none; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transform-origin: center center; text-align: center;
}
#laden .m-titel { font-size: 96px; margin: 0; animation: titelSchweben 4s ease-in-out infinite; }
.l-strecke { position: relative; width: 640px; height: 64px; margin-top: 26px; }
.l-balken {
  position: absolute; left: 0; right: 0; top: 34px; height: 22px; border-radius: 999px; overflow: hidden;
  background: linear-gradient(145deg, var(--holz-1), var(--holz-2)); border: 3px solid var(--holz-rand);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.5);
}
.l-fuellung {
  height: 100%; width: 0; border-radius: 999px; transition: width .2s ease-out;
  background: repeating-linear-gradient(45deg, #fde047 0 14px, #facc15 14px 28px);
  box-shadow: 0 0 12px rgba(250,204,21,.6);
}
.l-auto {
  position: absolute; top: -2px; left: 0; font-size: 40px; margin-left: -24px; /* zentriert, ohne transform (das nutzt huepfen) */
  transition: left .2s ease-out; animation: huepfen .45s infinite;
  filter: drop-shadow(0 4px 3px rgba(0,0,0,.4));
}
.l-ziel { position: absolute; top: 0; right: -46px; font-size: 38px; }
.l-text { margin: 0; font-family: var(--schrift-sniglet); font-size: 22px; color: var(--mint-hell); }
.l-text b { color: var(--gelb-hell); }
.l-start {
  margin-top: 8px; padding: 14px 44px; border-radius: 20px; border: 3px solid #fef08a; cursor: pointer;
  font-family: var(--schrift-arcade); font-size: 28px; letter-spacing: .02em;
  background: linear-gradient(180deg, #fde047, #f59e0b); color: #422006;
  animation: startPuls 1.8s ease-in-out infinite;
}
.l-start[hidden] { display: none; }
#laden.bereit .l-auto { animation: none; }
.l-hinweis { margin: 6px 0 0; font-size: 14px; font-weight: 800; color: rgba(167,243,208,.6); }
