/* ===== Game Header ===== */

/* Push lives widget below header; reset during gameplay */
#lw-hud { top: 96px !important; transition: top 0.2s; }
.in-game #lw-hud { top: 86px !important; }

/* Push coin pill below header; reset during gameplay */


/* ===== Canvas ===== */
#gameCanvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ===== HUD ===== */
#hud {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  /* right padding reserves space for the coin + retry pills */
  padding:   16px 28px 16px 20px;
  z-index: 10;
  pointer-events: none;
  transition: top 0.2s;
}
.in-game #hud { top: 0; }

#score-display {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#score-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

#score-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 20px rgba(255,255,255,0.4);
  transition: transform 0.1s ease;
}

#score-value.pop {
  transform: scale(1.3);
}

/* ===== Level HUD ===== */
#level-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 16px;
}

#level-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

#level-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: #a78bfa;
  text-shadow: 0 0 14px rgba(167,139,250,0.5);
}

/* ===== Combo ===== */
#combo-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  animation: fadeIn 0.2s ease;
}

#combo-value {
  font-size: 28px;
  font-weight: 700;
  color: #ffd700;
  text-shadow: 0 0 16px rgba(255, 215, 0, 0.7);
}

#combo-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255, 215, 0, 0.7);
}

.hidden { display: none !important; }

/* ===== Overlay Screens ===== */
#ui-overlay {
  position: fixed;
  top: 48px;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  pointer-events: none;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  pointer-events: auto;
  margin: auto 0;
  flex-shrink: 0;
  padding: 24px 0;
  width: 100%;
  animation: slideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.screen.active {
  display: flex;
}

/* ===== Start Screen ===== */
.title {
  font-size: clamp(40px, 12vw, 72px);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #a78bfa, #60a5fa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(167, 139, 250, 0.5));
}

.subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
}

.high-score-display {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
}

/* ===== Buttons ===== */
.tap-btn {
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  color: #fff;
  box-shadow: 0 4px 24px rgba(167, 139, 250, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.tap-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 12px rgba(167, 139, 250, 0.3);
}

.tap-btn.pulse {
  animation: pulse 2s infinite;
}

.share-btn {
  padding: 10px 28px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  background: transparent;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.15s;
}

.share-btn:active {
  transform: scale(0.95);
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

/* Ghost/secondary button */
.ghost-btn {
  padding: 8px 24px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  background: transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.ghost-btn:active {
  transform: scale(0.95);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

/* ===== Game Over Screen ===== */
.gameover-title {
  font-size: clamp(32px, 10vw, 56px);
  font-weight: 900;
  color: #f87171;
  text-shadow: 0 0 30px rgba(248, 113, 113, 0.5);
}

/* Retry counter strip */
.retry-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 4px;
}
.retry-label { font-weight: 500; }
.retry-pips {
  display: flex;
  gap: 4px;
}
.retry-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  transition: background 0.25s, transform 0.25s;
}
.retry-pip.used {
  background: rgba(255,255,255,0.12);
  transform: scale(0.75);
}
.retry-count { font-weight: 700; color: #fff; }

/* Coin-gated retry button */
.coin-retry-btn {
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #000;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.coin-retry-btn:active { transform: scale(0.95); opacity: 0.85; }
.coin-retry-btn.hidden { display: none; }
.coin-retry-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Retry counter pill — fixed below coin widget pill. Hidden for casual play;
   shown by JS only when ?contest=1 is present in the URL. */
/* ===== Contest Banner (in-game HUD strip) ===== */
.contest-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px 5px 12px;
  background: linear-gradient(90deg, rgba(99,102,241,0.18), rgba(34,211,238,0.12));
  border: 1px solid rgba(99,102,241,0.35);
  border-top: none;
  border-radius: 0 0 14px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #a5b4fc;
  letter-spacing: 0.04em;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.contest-banner.hidden { display: none; }

/* ===== Contest badge on start screen ===== */
.contest-start-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 6px auto 0;
  padding: 5px 14px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.4);
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #a5b4fc;
  letter-spacing: 0.03em;
}
.contest-start-badge.hidden { display: none; }

#retry-hud {
  position: fixed;
  top: 52px;
  right: 14px;
  z-index: 8999;
  display: none;   /* game.js sets display:flex in contest mode */
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(15,15,30,0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #34d399;
  pointer-events: none;
  transition: color 0.3s, border-color 0.3s;
}
#retry-hud.exhausted {
  color: #f59e0b;
  border-color: rgba(245,158,11,0.35);
}

/* ===== Instructions Screen ===== */
.instr-title {
  font-size: clamp(26px, 8vw, 40px);
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.instr-text {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
  max-width: 300px;
}

.instr-text .green { color: #34d399; font-weight: 600; }

.instr-hints {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px 20px;
}

.hint {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.hint-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== Leaderboard ===== */
#leaderboard {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 12px 20px;
  min-width: 220px;
  max-width: 300px;
  width: 100%;
}

.lb-title {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 8px;
  text-align: center;
}

#lb-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#lb-list li {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

#lb-list li:last-child { border-bottom: none; }
#lb-list li.lb-top { color: #ffd700; font-weight: 700; }

#lb-list .lb-rank { color: rgba(255,255,255,0.3); margin-right: 8px; }
#lb-list .lb-pts  { color: #a78bfa; font-weight: 600; }

.score-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 20px 40px;
  min-width: 220px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
}

.score-row .label {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

.score-row .value {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
}

.score-row .value.highlight {
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

/* ===== Animations ===== */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(167, 139, 250, 0.45); transform: scale(1); }
  50%       { box-shadow: 0 4px 40px rgba(167, 139, 250, 0.8); transform: scale(1.04); }
}

/* ===== Responsive ===== */
@media (max-width: 400px) {
  #hud { padding: 12px 14px; }
  #score-value { font-size: 28px; }
  .score-block { padding: 16px 28px; }
  .instr-text { font-size: 13px; }
  #leaderboard { padding: 10px 14px; }
}

/* ===== User Display ===== */
.user-display {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  padding: 6px 14px;
}

.ghost-btn-sm {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  background: transparent;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.ghost-btn-sm:active { color: #fff; border-color: rgba(255,255,255,0.5); }

/* Resume button */
#resume-btn {
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 4px 24px rgba(52,211,153,0.4);
}
#resume-btn:active { box-shadow: 0 2px 12px rgba(52,211,153,0.3); }

/* ===== HUD Right (timer + combo) ===== */
#hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

#timer-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#timer-label {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

#timer-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: #60a5fa;
  text-shadow: 0 0 12px rgba(96,165,250,0.5);
}

/* ===== Modals ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal.hidden { display: none; }

.modal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.35s cubic-bezier(0.22,1,0.36,1);
}

.modal-title {
  font-size: clamp(20px, 6vw, 26px);
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.golden-title {
  background: linear-gradient(135deg, #ffd700, #ffed4a) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

.modal-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
  max-width: 280px;
}

.modal-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}
.modal-input::placeholder { color: rgba(255,255,255,0.3); }
.modal-input:focus { border-color: rgba(167,139,250,0.5); }

/* ===== Contest Card ===== */
.contest-trophy {
  font-size: 44px;
  line-height: 1;
}

.contest-box {
  width: 100%;
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contest-fee {
  font-size: 15px;
  color: rgba(255,255,255,0.8);
}

.fee-highlight {
  color: #ffd700;
  font-weight: 800;
  font-size: 19px;
}

.upi-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.upi-label {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

.upi-id {
  font-size: 14px;
  font-weight: 700;
  color: #a78bfa;
  background: rgba(167,139,250,0.1);
  padding: 2px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  user-select: all;
}

.contest-note {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  line-height: 1.6;
  max-width: 280px;
}

.golden-btn {
  background: linear-gradient(135deg, #ffd700, #f59e0b) !important;
  color: #1a0f00 !important;
  box-shadow: 0 4px 24px rgba(255,215,0,0.4) !important;
}
.golden-btn:active { box-shadow: 0 2px 10px rgba(255,215,0,0.25) !important; }

/* ===== Ad Banner ===== */
.ad-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15,12,30,0.96);
  border: 1px solid rgba(255,215,0,0.35);
  border-radius: 50px;
  padding: 10px 14px 10px 14px;
  max-width: 360px;
  width: calc(100% - 40px);
  box-shadow: 0 4px 30px rgba(255,215,0,0.18);
  animation: slideUp 0.4s cubic-bezier(0.22,1,0.36,1);
}
.ad-banner.hidden { display: none; }

.ad-close {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.75);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
.ad-close:active { background: rgba(255,255,255,0.3); }

.ad-icon { font-size: 22px; flex-shrink: 0; }

.ad-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1px;
  min-width: 0;
}
.ad-text strong { font-size: 13px; color: #ffd700; font-weight: 700; }
.ad-text span   { font-size: 11px; color: rgba(255,255,255,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ad-cta {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: linear-gradient(135deg, #ffd700, #f59e0b);
  color: #1a0f00;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.ad-cta:active { transform: scale(0.95); }

/* ===== Persistent Contest Pill ===== */
.contest-pill {
  position: fixed;
  bottom: 24px;
  right: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1.5px solid rgba(255,215,0,0.7);
  border-radius: 50px;
  background: rgba(15,12,30,0.93);
  color: #ffd700;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 18px rgba(255,215,0,0.22);
  pointer-events: all;
  animation: pillPulse 2.8s ease-in-out infinite;
  transition: transform 0.15s;
}
.contest-pill:active { transform: scale(0.92); }
.contest-pill.hidden { display: none !important; }

@keyframes pillPulse {
  0%, 100% { box-shadow: 0 2px 18px rgba(255,215,0,0.22); }
  50%       { box-shadow: 0 2px 28px rgba(255,215,0,0.5); border-color: rgba(255,215,0,1); }
}

/* ===== Prize Rows (inside contest-box) ===== */
.prize-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.prize-rank {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
}
.prize-value {
  font-size: 14px;
  font-weight: 700;
  color: #ffd700;
}
.contest-divider {
  height: 1px;
  background: rgba(255,215,0,0.2);
  margin: 6px 0 4px;
}

.pay-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  margin-top: 4px;
}
.pay-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.12);
  white-space: nowrap;
}
.intl-badge {
  color: #60a5fa;
  border-color: rgba(96,165,250,0.3);
  background: rgba(96,165,250,0.08);
}

/* ===== User Avatar ===== */
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
  display: none;
}

/* ===== Auth Buttons (social login) ===== */
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.auth-btn:active { opacity: 0.85; transform: scale(0.97); }

.google-btn {
  background: #fff;
  color: #3c4043;
  box-shadow: 0 1px 6px rgba(0,0,0,0.35);
}

.facebook-btn {
  background: #1877F2;
  color: #fff;
}

