:root {
  --primary-color: #ff5722;
  --secondary-color: #ffc107;
  --text-color: #212121;
  --panel-color: rgba(255, 255, 255, 0.85);
  --font-family: 'Segoe UI', sans-serif;
  --bg-gradient: linear-gradient(180deg, #87ceeb, #e0f7fa);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  color: var(--text-color);
}

#game-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: var(--bg-gradient);
  touch-action: none;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 24px;
  z-index: 10;
}

.hidden { display: none !important; }

#game-logo {
  max-width: 160px;
  max-height: 160px;
}

#game-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary-color);
  margin: 0;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

#org-name {
  font-size: 1.1rem;
  opacity: 0.8;
  margin: 0;
}

.btn {
  padding: 14px 36px;
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  background: var(--primary-color);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease;
}

.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); }

.btn.secondary {
  background: var(--secondary-color);
  color: var(--text-color);
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  z-index: 5;
  pointer-events: none;
}

.hud-pill {
  background: var(--panel-color);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.1rem;
  backdrop-filter: blur(4px);
}

#hud-combo {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--secondary-color);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

#hud-combo.combo-active {
  animation: pulse 0.3s ease infinite alternate;
}

@keyframes pulse {
  from { transform: translateX(-50%) scale(1); }
  to { transform: translateX(-50%) scale(1.15); }
}

.panel {
  background: var(--panel-color);
  padding: 32px 40px;
  border-radius: 24px;
  backdrop-filter: blur(6px);
  max-width: 420px;
}

#final-score {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary-color);
}

#reward-badge {
  max-width: 100px;
  display: none;
}

#coupon-code {
  font-family: monospace;
  font-size: 1.1rem;
  background: rgba(0, 0, 0, 0.08);
  padding: 6px 14px;
  border-radius: 8px;
  display: inline-block;
}

.end-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

#leaderboard-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

#leaderboard-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  font-size: 1rem;
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  background: #fff;
  color: var(--text-color);
  text-align: center;
}

#leaderboard-form input:focus { outline: none; border-color: var(--primary-color); }

#leaderboard-form .btn { width: 100%; }

.lb-error {
  color: #c62828;
  font-size: 0.85rem;
  min-height: 1em;
  margin: 0;
}

#view-leaderboard-link {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 4px;
}
