/* styles.css – Punch Run global styles */

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

:root {
  --bg: #d0eaf8;
  --text: #2d4a1e;
  --muted: #6aad3a;
  --font: 'Share Tech Mono', monospace;
}

html,
body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
}

/* ── Canvas wrapper ─────────────────────────────────────────────────────── */
#game-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#gameCanvas {
  display: block;
  background: #87CEEB;
  border: 3px solid #3d7022;
  border-radius: 6px;
  box-shadow: 0 6px 32px rgba(61, 112, 34, 0.25), 0 2px 8px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  image-rendering: pixelated;
  max-width: 100%;
}

/* ── Leaderboard panel ───────────────────────────────────────────────────── */
.lb-panel {
  position: fixed;
  bottom: 12px;
  right: 12px;
  background: rgba(10, 10, 30, 0.95);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 14px 18px;
  min-width: 210px;
  z-index: 10;
  box-shadow: 0 0 20px #22d3ee22;
}

.lb-panel h3 {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
  text-align: center;
}

.lb-panel ol {
  list-style: decimal inside;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text);
}

.lb-panel #lb-clear {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  border: 1px solid var(--muted);
  color: var(--muted);
  border-radius: 4px;
  padding: 4px;
  font-family: var(--font);
  font-size: 10px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.lb-panel #lb-clear:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.hidden {
  display: none !important;
}

/* ── Name-entry modal ─────────────────────────────────────────────────────── */
.name-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 5, 0.82);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.name-card {
  background: #1a2310;
  border: 2px solid #3b4a1f;
  border-radius: 12px;
  padding: 28px 32px 24px;
  min-width: 300px;
  max-width: 360px;
  width: 90vw;
  text-align: center;
  box-shadow: 0 0 40px rgba(85, 107, 47, 0.35);
  font-family: var(--font);
}

.name-card-header {
  color: #8b9a6b;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: bold;
  margin-bottom: 10px;
}

.name-card-score {
  color: #c8d8a0;
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 2px;
}

.name-card-label {
  color: #6b8050;
  font-size: 10px;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
  margin-top: 6px;
}

.name-card input {
  width: 100%;
  background: #0d1208;
  border: 1px solid #556b2f;
  border-radius: 6px;
  color: #c8d8a0;
  font-family: var(--font);
  font-size: 16px;
  padding: 10px 12px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.name-card input:focus {
  border-color: #8b9a6b;
  box-shadow: 0 0 8px rgba(139, 154, 107, 0.25);
}

.name-card input::placeholder {
  color: #3b4a1f;
}

.name-card-btns {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.name-card-btns button {
  flex: 1;
  font-family: var(--font);
  font-size: 11px;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  padding: 10px 8px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: opacity 0.2s, transform 0.1s;
}

.name-card-btns button:hover {
  opacity: 0.85;
}

.name-card-btns button:active {
  transform: scale(0.97);
}

#name-submit {
  background: #3b4a1f;
  color: #c8d8a0;
  border: 1px solid #556b2f;
}

#name-skip {
  background: #0d1208;
  color: #556b2f;
  border: 1px solid #2d3a10;
  flex: 0 0 72px;
}

/* ── Embed mode ──────────────────────────────────────────────────────────── */
body.embed-mode {
  background: transparent;
  justify-content: center;
  align-items: center;
}

body.embed-mode #lb-panel {
  display: none !important;
}

/* ── Mobile tap feedback ─────────────────────────────────────────────────── */
#gameCanvas:active {
  opacity: 0.97;
}

/* ── Scrollbar hide ──────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  display: none;
}