* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #0f2a26;
  color: #f3f0e6;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  touch-action: none;
}

header {
  text-align: center;
  padding: 10px 8px 4px;
}

h1 {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: 0.08em;
  color: #5fe0c8;
  text-shadow: 3px 3px 0 #e8875b;
}

.hud {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 6px;
  font-size: 1.1rem;
}

.hud b { color: #ffd166; }

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
}

.board {
  position: relative;
  width: 100%;
  max-width: 672px;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 0 0 4px #1e4a43, 0 10px 30px rgba(0, 0, 0, 0.5);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  background: rgba(10, 30, 27, 0.85);
  border-radius: 14px;
}

.overlay.hidden { display: none; }

.overlay h2 {
  margin: 0 0 8px;
  font-size: 2rem;
  color: #5fe0c8;
}

.overlay p { margin: 6px 0; }

.overlay .hint {
  font-size: 0.9rem;
  opacity: 0.75;
}

button {
  font: inherit;
  cursor: pointer;
}

#start-btn {
  margin: 12px 0;
  padding: 10px 28px;
  font-size: 1.3rem;
  border: none;
  border-radius: 999px;
  background: #e8875b;
  color: #10241f;
  font-weight: bold;
  box-shadow: 0 4px 0 #a9573a;
}

#start-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #a9573a;
}

.countdown {
  position: fixed;
  top: 10px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #1e4a43;
  font-size: 1.2rem;
  z-index: 10;
}

.countdown[hidden] { display: none; }

.countdown b { color: #ffd166; font-size: 1.5rem; }

.countdown.knapp b { color: #ff5c8a; }

#zurueck-btn {
  padding: 4px 10px;
  font-size: 0.85rem;
  border: none;
  border-radius: 999px;
  background: #5fe0c8;
  color: #10241f;
}

.touch-pad {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.touch-pad div { display: flex; gap: 6px; }

.touch-pad button {
  width: 64px;
  height: 64px;
  font-size: 1.6rem;
  border: none;
  border-radius: 16px;
  background: #1e4a43;
  color: #5fe0c8;
}

.touch-pad button:active { background: #2b6b61; }

@media (hover: none) and (pointer: coarse) {
  .touch-pad { display: flex; }
}
