/* ============================
   🌽 TreckerRadar – Kolbenhagel Layout (Container-Version)
   ============================ */

/* === 🎨 Farben & Basis === */
:root {
  --green: #1a7f37;
  --bg: #0a0f08;
  --panel: #1b1b1b;
  --text: #e6ffe6;
  --danger: #ff4d4d;
  --vh: 1vh; /* per JS dynamisch gesetzt */
}

/* === Basis-Setup === */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-text-size-adjust: none;
}

/* === Hauptcontainer (90 vh) === */
.game-wrap90 {
  width: 100%;
  height: calc(var(--vh, 1vh) * 100);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}

/* === Header === */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  color: #fff;
  z-index: 5;
}

.game-header .header-left,
.game-header .header-center,
.game-header .header-right {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.game-header .logo {
  height: 42px;
  cursor: pointer;
}

.scoreboard {
  font-weight: 600;
  text-align: right;
  line-height: 1.3;
  color: #fff;
}

/* === Spielfeld / Canvas === */
.game-stage {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* === Overlays === */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10;
}
.overlay.hidden { display: none; }

.panel {
  background: var(--panel);
  border: 2px solid #333;
  border-radius: 12px;
  padding: 20px 18px;
  width: min(90%, 420px);
  max-height: 95%;
  overflow-y: auto;
  color: var(--text);
  box-sizing: border-box;
  overscroll-behavior: contain;
  text-align: center;
}
.panel h2 { margin-top: 0; }

/* === Buttons === */
button {
  background: var(--green);
  color: #fff;
  border: none;
  border-bottom: 3px solid #0c5b25;
  padding: 7px 13px;
  margin: 6px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
  gap: 10px; 
}
button:hover {
  background: #1fb94f;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.35);
}
button:active {
  transform: scale(0.95);
  border-bottom-width: 2px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 2px solid #333;
  background: #111;
  color: var(--text);
  margin-top: 8px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

/* === Steuerzone (Teil des Containers, nicht fixed) === */
#controlZone {
  width: 100%;
  height: 100px;
  border-top: 2px solid #124812;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  touch-action: none;
}

.grass-area {
  background: linear-gradient(#138a13 0%, #0e5f0e 100%);
  width: 100%;
  height: 20px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-top: 2px solid #1a7f37;
  box-shadow: inset 0 4px 8px rgba(0,0,0,0.2);
}

#tractor {
  font-size: 3.2rem;
  text-shadow: 0 0 10px rgba(0,0,0,0.4);
  margin-bottom: 4px;
  transition: transform 0.1s linear;
  pointer-events: none;
  z-index: 9; /* 🚜 immer ganz oben */
}
#controlZone .arrows {
  font-size: 2.2rem;
  color: #ffd54d;
  text-shadow: 0 0 8px rgba(255,213,77,0.6);
  font-weight: 700;
  text-align: center;
  width: 100%;
  margin-top: 6px;
  user-select: none;
}

/* === Soundbutton === */
.sound-btn {
  background: none;
  border: none;
  color: #ffd54d;
  font-size: 1.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  filter: drop-shadow(0 0 3px rgba(255,213,77,0.6));
}
.sound-btn.active {
  color: #ffffff;
  transform: scale(1.1);
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.9));
}
.sound-btn:active { transform: scale(0.9); }

/* === Level-Up Text === */
#levelUpText {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  font-weight: 900;
  color: #00ff66;
  text-shadow: 0 0 25px #00ff66, 0 0 45px #00ff66;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  text-align: center;
  white-space: nowrap;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#levelUpText.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.2);
  animation: levelUpBlink 0.9s ease;
}
@keyframes levelUpBlink {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  50% { opacity: 1; }
  80% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}

/* === Tabellen / Highscore === */
.styled-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  font-size: 15px;
}
.styled-table thead {
  background: #eaffea;
  color: #1a7f37;
  font-weight: 600;
}
.styled-table th,
.styled-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #ddd;
}
.styled-table tbody tr:last-child td { border-bottom: none; }
.styled-table td:first-child {
  text-align: center;
  font-weight: 600;
  color: #1a7f37;
}
