/* Shared styling for Festival mini-games */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: #0b0d14; color: #e5e7eb;
  font-family: 'Cinzel', serif; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
#game-root, canvas { position: fixed; inset: 0; }
canvas { display: block; width: 100%; height: 100%; }

/* HUD */
#hud { position: fixed; top: 14px; left: 0; right: 0; z-index: 10; pointer-events: none;
  display: flex; justify-content: space-between; padding: 0 18px; gap: 10px; }
.hud-box { background: rgba(15,17,23,0.62); border: 1px solid rgba(99,102,241,0.35); border-radius: 10px;
  padding: 7px 13px; backdrop-filter: blur(4px); }
.hud-label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: #818cf8; }
.hud-value { font-size: 21px; font-weight: 900; color: #fff; line-height: 1; }

/* Overlays */
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 24px; overflow-y: auto;
  background: radial-gradient(ellipse at center, rgba(20,16,40,0.72), rgba(11,13,20,0.93)); backdrop-filter: blur(3px); }
.overlay.hidden { display: none; }
.title { font-family: 'Cinzel Decorative', serif; font-size: clamp(1.9rem, 7vw, 3.6rem); color: #fff;
  text-shadow: 0 0 30px rgba(129,140,248,0.6); margin-bottom: 6px; }
.subtitle { color: #c7b3ff; letter-spacing: 0.22em; text-transform: uppercase; font-size: 12px; margin-bottom: 22px; }
.hint { margin-top: 18px; color: #9ca3af; font-size: 13px; line-height: 1.7; max-width: 360px; }
.final-score { font-size: 20px; color: #fbbf24; margin-bottom: 6px; }
.final-best { font-size: 14px; color: #9ca3af; margin-bottom: 8px; }

.btn { pointer-events: auto; cursor: pointer; background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff;
  border: none; border-radius: 12px; padding: 13px 32px; font-family: 'Cinzel', serif; font-weight: 700;
  font-size: 17px; letter-spacing: 0.05em; box-shadow: 0 8px 30px rgba(99,102,241,0.5); transition: transform 0.12s;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { transform: scale(1.04); }
.btn-ghost { background: rgba(99,102,241,0.12); box-shadow: none; border: 1px solid rgba(129,140,248,0.5); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }

/* Leaderboard */
.lb { width: 280px; max-width: 86vw; background: rgba(15,17,23,0.5); border: 1px solid rgba(99,102,241,0.3);
  border-radius: 12px; padding: 12px 14px 10px; }
.lb h3 { font-family: 'Cinzel Decorative', serif; font-size: 13px; letter-spacing: 0.12em; color: #c7b3ff;
  text-align: center; margin-bottom: 8px; text-transform: uppercase; }
.lb ul { list-style: none; }
.lb-row { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 6px; font-size: 13px; line-height: 1.2; }
.lb-row + .lb-row { border-top: 1px solid rgba(99,102,241,0.12); }
.lb-me { background: rgba(99,102,241,0.22); }
.lb-pos { width: 20px; text-align: center; flex: none; }
.lb-rank { color: #6b7280; font-size: 12px; }
.lb-name { flex: 1; color: #e5e7eb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.lb-score { color: #fbbf24; font-weight: 700; flex: none; }
.lb-empty { color: #9ca3af; font-size: 12px; text-align: center; padding: 8px 0; list-style: none; }

#back-link { position: fixed; top: 13px; left: 50%; transform: translateX(-50%); z-index: 11; color: #6b7280;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; }
#back-link:hover { color: #818cf8; }
