* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2b3a1f;
  font-family: "Roboto", "Segoe UI", Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  padding: 16px;
}

.game {
  width: min(100%, 640px, calc((100vh - 110px) * 17 / 15));
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

/* ---------- Kopfzeile ---------- */
.bar {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
  padding: 0 22px;
  background: #4a752c;
  color: #fff;
  font-size: 24px;
  font-weight: 500;
}

.stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon {
  width: 30px;
  height: 30px;
}

.icon.big {
  width: 44px;
  height: 44px;
}

/* ---------- Spielfeld ---------- */
.board-wrap {
  position: relative;
  background: #578a34;
  padding: 0;
}

#board {
  display: block;
  width: 100%;
  aspect-ratio: 17 / 15;
}

/* ---------- Start-Hinweis ---------- */
.ready-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 16px;
  pointer-events: none;
  animation: fade 1.4s ease-in-out infinite alternate;
}

.ready-hint[hidden] { display: none; }

.keys {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 2px;
  border: 2px solid #fff;
  border-radius: 6px;
  font-size: 14px;
}

@keyframes fade {
  from { opacity: 1; }
  to   { opacity: 0.55; }
}

/* ---------- Overlay (Start / Game Over) ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  transition: opacity 0.25s;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: min(80%, 340px);
  padding: 28px 24px 22px;
  border-radius: 14px;
  background: #4dc1f9;
  color: #fff;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card-scores {
  display: flex;
  gap: 40px;
  font-size: 34px;
  font-weight: 500;
}

.card-scores[hidden] { display: none; }

.card-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.card h1 {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

#playBtn {
  padding: 12px 42px;
  border: none;
  border-radius: 6px;
  background: #1155cc;
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 3px 0 #0b3d91;
  transition: transform 0.08s, background 0.15s;
}

#playBtn:hover  { background: #1a64e6; }
#playBtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #0b3d91; }

.hint {
  font-size: 13px;
  opacity: 0.9;
}

@media (max-width: 480px) {
  .bar { height: 52px; font-size: 20px; gap: 20px; padding: 0 16px; }
  .icon { width: 24px; height: 24px; }
  .card h1 { font-size: 28px; }
  .card-scores { font-size: 28px; }
}
