/* =============================================================
 * chickengame.dungeonsanddice.de — Spielfeld-Ansicht
 * Für ein iPad im Querformat gebaut (Kiosk-Betrieb bei einer Messe).
 * Kein Scrollen, kein Zoom, kein Text markieren.
 * ============================================================= */

:root {
  --gruen-hell: #3fa34d;
  --gruen-dunkel: #2f8a3d;
  --linie: rgba(255, 255, 255, 0.85);
  --de-schwarz: #1a1a1a;
  --de-gold: #d4af37;
  --it-gruen: #0f7a3d;
  --it-rot: #c8102e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
  overflow: hidden;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: #111;
  color: #fff;
  /* Tiefe für die 3D-Drehung des fliegenden Eis (siehe .ei weiter unten) */
  perspective: 900px;
}

#kopf {
  flex: 0 0 auto;
  text-align: center;
  padding: clamp(6px, 1.2vh, 16px) 0;
  background: #0c0c0c;
}

#kopf h1 {
  margin: 0;
  font-size: clamp(18px, 3vh, 32px);
  letter-spacing: 0.02em;
}

#feld {
  flex: 1 1 auto;
  display: flex;
  position: relative;
  min-height: 0;
}

.haelfte {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.5vh, 18px);
  border: none;
  overflow: hidden;
  cursor: pointer;
  color: #fff;
  background-image: repeating-linear-gradient(
    90deg,
    var(--gruen-hell) 0,
    var(--gruen-hell) 10%,
    var(--gruen-dunkel) 10%,
    var(--gruen-dunkel) 20%
  );
  transition: filter 0.15s ease, transform 0.15s ease;
}

.haelfte:active {
  filter: brightness(1.25);
}

/* Mittellinie */
.haelfte-de { border-right: 3px solid var(--linie); }

/* Mittelkreis: nur die Innenhälfte je Spielfeldhälfte sichtbar */
.haelfte::after {
  content: "";
  position: absolute;
  top: 50%;
  width: clamp(120px, 22vh, 260px);
  height: clamp(120px, 22vh, 260px);
  border: 3px solid var(--linie);
  border-radius: 50%;
  transform: translateY(-50%);
}
.haelfte-de::after { right: -1px; transform: translate(50%, -50%); }
.haelfte-it::after  { left: -1px;  transform: translate(-50%, -50%); }

/* Tor + Torraum am Außenrand (aus den Bogenformen der Skizze) */
.haelfte::before {
  content: "";
  position: absolute;
  top: 50%;
  width: clamp(70px, 14vh, 150px);
  height: clamp(160px, 34vh, 340px);
  border: 4px solid var(--linie);
  transform: translateY(-50%);
}
.haelfte-de::before { left: -4px; border-left: none; border-radius: 0 40% 40% 0; }
.haelfte-it::before  { right: -4px; border-right: none; border-radius: 40% 0 0 40%; }

.huhn {
  font-size: clamp(48px, 12vh, 120px);
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
  pointer-events: none;
}

.label {
  font-size: clamp(16px, 3vh, 30px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.haelfte-de .label { color: var(--de-gold); }
.haelfte-it .label { color: #fff; }

.zaehler {
  font-size: clamp(56px, 16vh, 160px);
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* Sperre während des Cooldowns nach einem Tipp */
#feld.gesperrt .haelfte {
  pointer-events: none;
  filter: brightness(0.85);
}

/* --- Admin-Overlay ------------------------------------------------ */
#admin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#admin-overlay[hidden] { display: none; }

.admin-box {
  background: #1c1c1c;
  border-radius: 20px;
  padding: clamp(20px, 3vh, 36px);
  width: min(90vw, 480px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.admin-box h2 {
  margin: 0 0 4px;
  font-size: clamp(20px, 3vh, 28px);
  text-align: center;
}

.admin-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: clamp(16px, 2.4vh, 20px);
}

.admin-buttons { display: flex; gap: 10px; }

.admin-box button {
  font: inherit;
  font-size: clamp(16px, 2.4vh, 22px);
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid #444;
  background: #2a2a2a;
  color: #fff;
  cursor: pointer;
}

.admin-box button:active { background: #3a3a3a; }

.admin-reset {
  margin-top: 8px;
  border-color: #7a2d2d !important;
  background: #4a1c1c !important;
}

.admin-close {
  border-color: #2d5a7a !important;
  background: #1c3a4a !important;
}

/* --- Fliegendes Ei (Fußball-Optik, echte CSS-3D-Drehung) ----------- */
.ei {
  position: fixed;
  top: 0;
  left: 0;
  width: 42px;
  height: 54px;
  z-index: 50;
  pointer-events: none;
  transform-style: preserve-3d;
  will-change: transform;
}

.ei::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Ei-Form: oben spitzer, unten runder */
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(
    circle at 32% 24%,
    #ffffff 0%,
    #f2f2f2 42%,
    #d9d9d9 75%,
    #b7b7b7 100%
  );
  /* Glanzlicht + Schlagschatten geben der Fläche einen 3D-Kugel-Eindruck */
  box-shadow:
    inset -7px -9px 12px rgba(0, 0, 0, 0.35),
    inset 4px 4px 7px rgba(255, 255, 255, 0.65),
    0 6px 10px rgba(0, 0, 0, 0.4);
  backface-visibility: hidden;
}

/* Schwarze Fünfecke wie bei einem klassischen Fußball, auf die Eiform verteilt */
.ei .fleck {
  position: absolute;
  width: 11px;
  height: 11px;
  background: #1a1a1a;
  clip-path: polygon(50% 0%, 95% 35%, 78% 92%, 22% 92%, 5% 35%);
  opacity: 0.92;
}
.ei .f1 { top: 5px;  left: 15px; transform: scale(0.85); }
.ei .f2 { top: 18px; left: 3px;  transform: scale(0.68) rotate(18deg); }
.ei .f3 { top: 18px; left: 27px; transform: scale(0.68) rotate(-18deg); }
.ei .f4 { top: 32px; left: 10px; transform: scale(0.78) rotate(205deg); }
.ei .f5 { top: 32px; left: 23px; transform: scale(0.6) rotate(155deg); }
