    /* ============================================
   SHOOTING DUCK 3D - Stylesheet
   Theme: bright mustard yellow + dark brown +
   wood brown + cream + black + white.
   Red is reserved for shooting targets and error
   feedback only.
   ============================================ */

:root {
  /* Brand */
  --mustard: #F2C230;
  --mustard-dark: #D9A900;
  --mustard-light: #FFD95A;
  --cream: #FFF8DF;
  --brown: #5A4300;
  --wood: #8B5A2B;
  --black: #111111;
  --white: #FFFFFF;

  /* Support */
  --gray: #7A6A45;
  --gray-light: #FBF4DF;
  --gray-mid: #EADFBE;
  --red: #E53935;
  --green: #22A447;
  --blue: #1687FF;

  --bronze: #CD7F32;
  --silver: #C0C0C0;
  --gold: #FFD700;
  --diamond: #B9F2FF;

  --shadow-sm: 0 2px 8px rgba(90, 67, 0, 0.10);
  --shadow-md: 0 6px 18px rgba(90, 67, 0, 0.16);
  --shadow-lg: 0 14px 40px rgba(90, 67, 0, 0.28);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--black);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ===== Background Pattern ===== */
.bg-pattern {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(242, 194, 48, 0.22) 0%, transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(139, 90, 43, 0.16) 0%, transparent 45%),
    repeating-linear-gradient(90deg, rgba(139, 90, 43, 0.045) 0 2px, transparent 2px 26px),
    linear-gradient(180deg, var(--cream) 0%, #FFF3D0 100%);
  z-index: -1;
}

/* ===== Container ===== */
.container {
  max-width: 520px;
  margin: 0 auto;
  padding: 22px 18px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ===== Brand Header ===== */
.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.logo-mark {
  width: 62px;
  height: 62px;
  flex-shrink: 0;
  border-radius: 16px;
  background: var(--white);
  border: 3px solid var(--mustard);
  box-shadow: var(--shadow-md);
  object-fit: contain;
  padding: 3px;
}

.brand-tagline {
  color: var(--brown);
  font-size: 13px;
  font-weight: 600;
}

.brand-tagline small {
  display: block;
  color: var(--gray);
  font-weight: 500;
  font-size: 11px;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 10px 0 4px;
}

.hero-title {
  font-size: clamp(29px, 8.2vw, 52px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -1px;
  color: var(--brown);
  text-wrap: balance;
  max-width: 100%;
  overflow-wrap: break-word;
}

.title-accent {
  color: var(--mustard-dark);
  text-shadow: 3px 3px 0 rgba(90, 67, 0, 0.18);
  -webkit-text-stroke: 1.5px var(--brown);
}

.hero-sub {
  margin-top: 12px;
  color: var(--brown);
  font-size: 14px;
  font-weight: 500;
  padding: 0 10px;
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--gray-mid);
}

.card-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--brown);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title.small {
  font-size: 15px;
  margin-bottom: 12px;
}

.secondary-card {
  padding: 12px;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* ===== Form ===== */
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--brown);
}

.optional {
  color: var(--gray);
  font-weight: 400;
  font-size: 12px;
}

.form-group input,
.admin-login input {
  padding: 13px 15px;
  border: 2px solid var(--gray-mid);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  background: var(--gray-light);
  transition: all 0.2s ease;
  color: var(--black);
  width: 100%;
}

.form-group input:focus,
.admin-login input:focus {
  outline: none;
  border-color: var(--mustard-dark);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(242, 194, 48, 0.28);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--mustard-light) 0%, var(--mustard) 55%, var(--mustard-dark) 100%);
  color: var(--brown);
  box-shadow: 0 6px 0 var(--mustard-dark), var(--shadow-md);
}

.btn-primary:hover, .btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 4px 0 var(--mustard-dark), var(--shadow-md);
}

.btn-outline {
  background: var(--white);
  color: var(--brown);
  border: 2px solid var(--mustard-dark);
}

.btn-outline:hover, .btn-outline:active {
  background: var(--mustard);
  color: var(--brown);
}

.btn-dark {
  background: var(--brown);
  color: var(--cream);
  box-shadow: 0 5px 0 #3A2A08;
}

.btn-dark:hover, .btn-dark:active {
  transform: translateY(1px);
  box-shadow: 0 3px 0 #3A2A08;
}

.btn-large {
  padding: 17px 22px;
  font-size: 17px;
  font-weight: 800;
}

.btn-full {
  width: 100%;
}

.btn-small {
  padding: 9px 14px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

/* ===== Info List ===== */
.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.info-list li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 13.5px;
  color: var(--black);
}

.dot {
  width: 9px;
  height: 9px;
  background: var(--mustard-dark);
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(242, 194, 48, 0.3);
}

.target-legend {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #111;
  flex-shrink: 0;
  margin-right: 4px;
  vertical-align: -1px;
}

/* ===== Prize Grid ===== */
.prize-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.prize-tier {
  padding: 13px 10px;
  border-radius: var(--radius-md);
  text-align: center;
  background: var(--gray-light);
  border: 2px solid transparent;
  transition: transform 0.2s ease;
}

.prize-tier:hover {
  transform: translateY(-2px);
}

.prize-tier.bronze { border-color: var(--bronze); }
.prize-tier.silver { border-color: var(--silver); }
.prize-tier.gold { border-color: var(--gold); }
.prize-tier.diamond { border-color: var(--diamond); }

.prize-medal { font-size: 26px; margin-bottom: 2px; }

.prize-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--brown);
}

.prize-score {
  font-size: 12px;
  color: var(--gray);
  font-weight: 600;
  margin-bottom: 3px;
}

.prize-desc {
  font-size: 11px;
  color: var(--black);
  font-weight: 500;
  line-height: 1.3;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 16px 0 4px;
  color: var(--gray);
  font-size: 12.5px;
}

.footer strong { color: var(--brown); font-weight: 700; }

.footer-small { font-size: 11px; margin-top: 3px; opacity: 0.75; }

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 20, 0, 0.65);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  max-width: 520px;
  width: 100%;
  max-height: 84vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--mustard);
  animation: modalSlideUp 0.3s ease;
  -webkit-overflow-scrolling: touch;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: var(--gray-light);
  border: 2px solid var(--gray-mid);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--brown);
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--brown);
  padding-right: 30px;
}

/* ===== Leaderboard ===== */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--gray-light);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.leaderboard-item.top-1 { background: linear-gradient(90deg, #FFE9A8 0%, #FFF6DC 100%); border-color: var(--mustard-dark); }
.leaderboard-item.top-2 { background: linear-gradient(90deg, #EDEDED 0%, #FAFAFA 100%); border-color: var(--silver); }
.leaderboard-item.top-3 { background: linear-gradient(90deg, #E5B17F 0%, #F3DCC4 100%); border-color: var(--bronze); }

.lb-rank {
  font-weight: 800;
  font-size: 17px;
  width: 34px;
  text-align: center;
  color: var(--brown);
  flex-shrink: 0;
}

.lb-name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}

.lb-level {
  font-size: 10px;
  font-weight: 800;
  color: var(--brown);
  background: var(--mustard);
  border-radius: 999px;
  padding: 1px 7px;
}

.lb-date {
  font-size: 9.5px;
  color: var(--gray);
  font-weight: 500;
}

.lb-score {
  font-weight: 800;
  font-size: 16px;
  color: var(--mustard-dark);
  min-width: 52px;
  text-align: right;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  color: var(--gray);
  padding: 28px 16px;
  font-size: 14px;
}

/* ============================================
   GAME PAGE
   ============================================ */

body.page-game {
  background: #1E1208;
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
}

#game-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: none;
  display: block;
}

/* Top scrim so the HUD stays readable over the 3D board */
.game-header-row {
  position: fixed;
  top: clamp(8px, 2vh, 16px);
  left: 0;
  right: 0;
  z-index: 10;
  padding: 0 14px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: clamp(8px, 2vw, 16px);
  pointer-events: none;
}

.game-header-row .hud-panel,
.title-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: clamp(58px, 8vh, 76px);
}

.hud-panel {
  background: rgba(255, 248, 223, 0.95);
  border: 2px solid var(--mustard-dark);
  border-radius: var(--radius-md);
  padding: 7px 13px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  min-width: 78px;
  text-align: center;
}

.hud-panel.center { min-width: 96px; }

.hud-label {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--brown);
  text-transform: uppercase;
  letter-spacing: 1.1px;
}

.hud-value {
  font-size: 21px;
  font-weight: 800;
  color: var(--black);
  line-height: 1.05;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

.hud-value.score { color: var(--mustard-dark); }
.hud-value.warning { color: var(--wood); animation: pulse 0.6s infinite alternate; }
.hud-value.danger { color: var(--red); animation: pulse 0.35s infinite alternate; }

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}

@keyframes bumpAnim {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

.hud-value.bump, .hud-panel.bump { animation: bumpAnim 0.28s ease-out; }

.level-bar {
  height: 5px;
  margin-top: 6px;
  background: rgba(90, 67, 0, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.level-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--mustard) 0%, var(--mustard-dark) 100%);
  border-radius: 999px;
  transition: width 0.2s linear;
}

/* Bottom target-colour bar */
.target-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  padding: 24px 14px 14px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(20, 12, 0, 0.78) 0%, rgba(20, 12, 0, 0.3) 60%, transparent 100%);
}

.target-color-box {
  --target-color: #1687FF;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 248, 223, 0.96);
  border: 3px solid var(--mustard-dark);
  border-radius: 999px;
  padding: 8px 22px 8px 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.target-color-box.flash { animation: targetFlash 0.45s ease-out; }

@keyframes targetFlash {
  0% { transform: scale(1); box-shadow: 0 0 0 0 var(--target-color); }
  35% { transform: scale(1.09); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.target-color-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: var(--brown);
  text-transform: uppercase;
  line-height: 1.1;
}

.target-color-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--black);
  line-height: 1.1;
}

.target-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid #111;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

/* Audio toggles */
.audio-controls {
  position: fixed;
  right: 12px;
  bottom: 92px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audio-btn {
  pointer-events: auto;
  cursor: pointer;
  background: rgba(255, 248, 223, 0.92);
  border: 2px solid var(--mustard-dark);
  color: var(--brown);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  font-family: inherit;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.audio-btn.off {
  background: rgba(60, 45, 20, 0.85);
  color: var(--gray-mid);
  border-color: rgba(255, 248, 223, 0.35);
}

/* ===== Title header =====
   One box holding the game title with the Chocomania branding directly
   underneath it. Plain flow layout (no absolute offsets) so the title,
   the logo and the wordmark can never collide at any viewport size. */
/* ===== Title header ===== */
.title-header {
  position: relative;
  flex: 1 1 auto;
  left: auto;
  transform: none;
  z-index: 11;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 24px);
  padding: clamp(6px, 1vh, 10px) clamp(14px, 3vw, 28px);
  max-width: none;
  text-align: center;
  background: linear-gradient(180deg, #FFFDF4 0%, var(--cream) 58%, #F7E9C2 100%);
  border: 2px solid var(--mustard-dark);
  border-radius: clamp(10px, 1.2vw, 16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  pointer-events: none;
  white-space: nowrap;
}

.title-header-title {
  margin: 0;
  font-size: clamp(20px, 2.8vw, 36px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: 0.2px;
  color: #241703;
  white-space: nowrap;
}

/* Logo + wordmark read as one branding group under the title. */
.title-header-brand {
  display: none;
}

.title-header-logo {
  width: auto;
  height: clamp(26px, 3.6vh, 38px);
  max-width: 120px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 8px;
  background: var(--white);
  border: 2px solid rgba(90, 67, 0, 0.28);
}

.title-header-brand-name {
  font-size: clamp(12px, 1.6vh, 16px);
  font-weight: 800;
  letter-spacing: 1.4px;
  color: var(--brown);
}

/* Very short landscape screens: keep the header, shrink it. */
@media (max-height: 520px) {
  .title-header { top: auto; padding: 6px 16px; gap: 8px; }
  .title-header-title { font-size: 20px; }
  .title-header-logo { height: 22px; }
  .title-header-brand-name { font-size: 10px; }
}

/* ===== Reticle (pistol target sight) ===== */
#reticle {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  width: 58px;
  height: 58px;
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

#reticle.hidden { display: none; }

.ret-ring {
  position: absolute;
  inset: 8px;
  border: 3px solid var(--mustard);
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.85), inset 0 0 0 2px rgba(17, 17, 17, 0.7);
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.ret-ring::after {
  content: '';
  position: absolute;
  inset: 20%;
  border: 2px dotted rgba(242, 194, 48, 0.85);
  border-radius: 50%;
}

.ret-tick {
  position: absolute;
  background: var(--mustard);
  box-shadow: 0 0 0 1.5px rgba(17, 17, 17, 0.8);
}

.ret-tick.t, .ret-tick.b { width: 3px; height: 12px; left: 50%; margin-left: -1.5px; }
.ret-tick.l, .ret-tick.r { height: 3px; width: 12px; top: 50%; margin-top: -1.5px; }
.ret-tick.t { top: -2px; }
.ret-tick.b { bottom: -2px; }
.ret-tick.l { left: -2px; }
.ret-tick.r { right: -2px; }

.ret-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px #111;
}

#reticle.hot .ret-ring { border-color: var(--red); transform: scale(0.88); }
#reticle.hot .ret-tick { background: var(--red); }
#reticle.hot .ret-dot { background: var(--mustard-light); }

#reticle.recoil { animation: recoil 0.18s ease-out; scale: 1; }

@keyframes recoil {
  0% { scale: 1; }
  35% { scale: 0.7; }
  100% { scale: 1; }
}

#reticle.touch { width: 74px; height: 74px; opacity: 0.92; }

/* Muzzle flash */
#muzzle-flash {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 39;
  width: 90px;
  height: 90px;
  margin: -45px 0 0 -45px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 240, 190, 0.95) 0%, rgba(242, 194, 48, 0.55) 28%, rgba(242, 194, 48, 0) 68%);
  border-radius: 50%;
}

#muzzle-flash.hidden { display: none; }
#muzzle-flash.fire { animation: muzzle 0.18s ease-out; }

@keyframes muzzle {
  0% { opacity: 0.95; transform: scale(0.35); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* ===== Popups ===== */
#popup-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  overflow: hidden;
}

.score-popup {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 800;
  font-size: 26px;
  pointer-events: none;
  text-shadow: 0 2px 0 #111, 0 0 12px rgba(0, 0, 0, 0.7);
  animation: scorePopup 0.95s ease-out forwards;
  white-space: nowrap;
}

.score-popup.positive { color: var(--mustard-light); }
.score-popup.negative { color: var(--red); }

@keyframes scorePopup {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  22% { transform: translate(-50%, -60%) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%, -130%) scale(0.95); opacity: 0; }
}

/* ===== Combo ===== */
.combo-indicator {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  font-size: 34px;
  font-weight: 800;
  color: var(--mustard-light);
  text-shadow: 0 3px 0 var(--brown), 0 0 18px rgba(242, 194, 48, 0.8);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
}

.combo-indicator.show { animation: comboShow 1.1s ease-out forwards; }

@keyframes comboShow {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
  100% { transform: translate(-50%, -110%) scale(1); opacity: 0; }
}

/* ===== Banner (level up etc) ===== */
.hud-banner {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 22;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  padding: 14px 30px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, #FFFDF4 0%, #FBEBC4 100%);
  border: 3px solid var(--mustard-dark);
  box-shadow: 0 10px 0 rgba(90, 67, 0, 0.35), 0 16px 30px rgba(0, 0, 0, 0.45);
}

.hud-banner.show { animation: bannerShow 1.4s ease-out forwards; }

.hud-banner-main {
  font-size: 20px;
  font-weight: 800;
  color: #111111;
  letter-spacing: 3px;
  line-height: 1.1;
}

.hud-banner-sub {
  font-size: 52px;
  font-weight: 800;
  color: #5A4300;
  line-height: 1.05;
  margin-top: 2px;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
}

.hud-banner-hint {
  font-size: 12px;
  font-weight: 700;
  color: #7A6234;
  letter-spacing: 0.6px;
  margin-top: 4px;
}

@keyframes bannerShow {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(0.98); }
}

/* ===== Countdown ===== */
.countdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(4px);
}

.countdown-overlay.hidden { display: none; }

.countdown-text {
  font-size: 120px;
  font-weight: 800;
  color: var(--mustard-light);
  text-shadow: 0 6px 0 var(--brown), 0 0 40px rgba(242, 194, 48, 0.8);
  animation: countdownPop 0.9s ease-out;
}

@keyframes countdownPop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== Game Over ===== */
.game-over-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(6px);
  padding: 16px;
  overflow-y: auto;
}

.game-over-overlay.hidden { display: none; }

.game-over-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 3px solid var(--mustard);
  padding: 26px 20px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.4s ease;
  margin: auto;
}

.game-over-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--brown);
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.game-over-sub {
  color: var(--gray);
  font-size: 13px;
  margin-bottom: 16px;
}

.final-score-display {
  background: linear-gradient(135deg, var(--mustard-light) 0%, var(--mustard) 50%, var(--mustard-dark) 100%);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 14px;
  color: var(--brown);
  border: 2px solid var(--brown);
}

.final-score-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-weight: 800;
}

.final-score-number {
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.result-tier {
  font-size: 13px;
  font-weight: 800;
  color: var(--brown);
  margin-bottom: 12px;
}

.result-prize {
  font-size: 11.5px;
  color: var(--gray);
  font-weight: 500;
  margin-top: -8px;
  margin-bottom: 12px;
}

.final-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px 8px;
  background: var(--gray-light);
  border-radius: var(--radius-md);
}

.stat-item { text-align: center; }

.stat-label {
  font-size: 9px;
  color: var(--gray);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 19px;
  font-weight: 800;
  color: var(--brown);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.game-over-buttons {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* ============================================
   REWARD PAGE
   ============================================ */

body.page-reward {
  background: linear-gradient(160deg, var(--cream) 0%, #FFF0C4 100%);
}

.reward-hero { text-align: center; padding: 20px 16px 10px; }

.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  font-size: 52px;
  margin: 0 auto 12px;
  box-shadow: var(--shadow-lg);
  animation: badgeBounce 0.6s ease-out;
  border: 3px solid var(--brown);
}

.tier-badge.bronze { background: linear-gradient(135deg, #CD7F32 0%, #E5B17F 100%); }
.tier-badge.silver { background: linear-gradient(135deg, #C0C0C0 0%, #F0F0F0 100%); }
.tier-badge.gold { background: linear-gradient(135deg, #FFD700 0%, #FFF0A8 100%); }
.tier-badge.diamond { background: linear-gradient(135deg, #B9F2FF 0%, #EAFBFF 100%); }

@keyframes badgeBounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.tier-title { font-size: 30px; font-weight: 800; color: var(--brown); margin-bottom: 4px; }
.tier-subtitle { font-size: 15px; color: var(--gray); font-weight: 500; }

.qr-card { text-align: center; }

.qr-container {
  background: var(--white);
  padding: 14px;
  border-radius: var(--radius-md);
  display: inline-block;
  margin: 14px 0;
  border: 3px dashed var(--mustard-dark);
}

#qrcode-canvas { display: block; }

.qr-instruction { font-size: 12.5px; color: var(--gray); margin-top: 6px; font-weight: 500; }

.prize-detail {
  background: linear-gradient(135deg, var(--mustard-light) 0%, var(--mustard) 55%, var(--mustard-dark) 100%);
  color: var(--brown);
  padding: 18px;
  border-radius: var(--radius-md);
  margin: 14px 0;
  text-align: center;
  border: 2px solid var(--brown);
}

.prize-detail-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.4px; font-weight: 800; }
.prize-detail-name { font-size: 19px; font-weight: 800; margin-top: 4px; }

.player-info-display {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  background: var(--gray-light);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.info-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.info-row .label { color: var(--gray); font-weight: 500; }
.info-row .value { color: var(--brown); font-weight: 700; font-family: 'Courier New', monospace; }

/* ============================================
   ADMIN PAGE
   ============================================ */

body.page-admin { background: linear-gradient(180deg, #FFFDF5 0%, var(--cream) 100%); }

body.page-admin .container { max-width: 720px; }

.admin-title { font-size: 25px; font-weight: 800; color: var(--brown); margin-bottom: 4px; }
.admin-subtitle { color: var(--gray); font-size: 13.5px; margin-bottom: 6px; }

.admin-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--gray-mid);
}

.admin-section h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--brown);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.admin-section h3 .accent {
  width: 4px;
  height: 18px;
  background: var(--mustard-dark);
  border-radius: 2px;
  display: inline-block;
}

/* Admin nav: sticky section jump links + logout, same shape as the
   catcher admin so the two panels feel identical to operate. */
.admin-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 2px solid var(--gray-mid);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.admin-nav a {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--gray-light);
  border: 1px solid var(--gray-mid);
  color: var(--brown);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.admin-nav a:hover {
  background: var(--mustard);
  border-color: var(--mustard-dark);
  color: var(--brown);
}

.admin-nav .btn { flex: 0 0 auto; margin-left: auto; }

.admin-section { scroll-margin-top: 78px; }

.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.admin-field { display: flex; flex-direction: column; gap: 5px; }

.admin-field label { font-size: 12px; font-weight: 700; color: var(--brown); }

.admin-field .hint { font-size: 10.5px; color: var(--gray); font-weight: 400; line-height: 1.3; }

.admin-field input[type="number"],
.admin-field input[type="text"],
.admin-field select {
  padding: 10px 12px;
  border: 2px solid var(--gray-mid);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  background: var(--gray-light);
  color: var(--black);
  width: 100%;
}

.admin-field input:focus,
.admin-field select:focus {
  outline: none;
  border-color: var(--mustard-dark);
  background: var(--white);
}

.admin-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--gray-light);
  border: 2px solid var(--gray-mid);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.admin-switch input { transform: scale(1.25); accent-color: var(--mustard-dark); }
.admin-switch span { font-size: 12.5px; font-weight: 700; color: var(--brown); }
.admin-switch small { display: block; font-size: 10.5px; font-weight: 400; color: var(--gray); }

.tier-edit {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.tier-edit .tier-label { font-size: 12px; font-weight: 800; color: var(--brown); }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.config-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  min-width: 420px;
}

.config-table th {
  font-size: 10px;
  font-weight: 800;
  text-align: left;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 8px 4px;
}

.config-table td {
  background: var(--gray-light);
  padding: 7px 8px;
  vertical-align: middle;
}

.config-table tr td:first-child { border-radius: 10px 0 0 10px; }
.config-table tr td:last-child { border-radius: 0 10px 10px 0; }

.config-table input[type="number"],
.config-table input[type="text"] {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--gray-mid);
  border-radius: 8px;
  background: var(--white);
  font-size: 13px;
  font-family: inherit;
  text-align: center;
  color: var(--black);
}

.row-name { font-size: 12.5px; font-weight: 700; color: var(--brown); display: flex; align-items: center; gap: 7px; }
.row-sub { font-size: 10px; color: var(--gray); font-weight: 500; }

.swatch {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #111;
  flex-shrink: 0;
  display: inline-block;
}

.toggle { display: flex; justify-content: center; }
.toggle input { transform: scale(1.25); accent-color: var(--mustard-dark); }

.badge-pill {
  display: inline-block;
  font-size: 9px;
  background: var(--mustard);
  color: var(--brown);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.admin-actions .btn { flex: 1; min-width: 140px; }

.admin-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  background: var(--brown);
  color: var(--cream);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: transform 0.35s ease;
  max-width: 90vw;
  text-align: center;
}

.admin-toast.show { transform: translateX(-50%) translateY(0); }
.admin-toast.success { background: var(--green); }
.admin-toast.error { background: var(--red); }

/* Admin login gate */
.admin-login-wrap {
  max-width: 380px;
  margin: 40px auto;
}

.admin-login {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 3px solid var(--mustard);
  box-shadow: var(--shadow-lg);
  padding: 26px 22px;
  text-align: center;
}

.admin-login h2 { font-size: 20px; color: var(--brown); margin-bottom: 4px; }
.admin-login p { font-size: 12.5px; color: var(--gray); margin-bottom: 16px; }
.admin-login input { text-align: center; letter-spacing: 3px; font-size: 20px; }
.admin-login .btn { margin-top: 12px; }
.admin-login-error { color: var(--red); font-size: 12.5px; font-weight: 700; margin-top: 10px; min-height: 18px; }

.admin-link { display: inline-flex; align-items: center; gap: 4px; color: var(--gray); text-decoration: none; font-size: 12px; font-weight: 600; }
.admin-link:hover { color: var(--brown); }

/* Leaderboard admin view */
.admin-lb-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

.stat-chip {
  background: var(--gray-light);
  border: 2px solid var(--gray-mid);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brown);
}

.stat-chip b { color: var(--mustard-dark); }

.filter-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-row input {
  padding: 9px 12px;
  border: 2px solid var(--gray-mid);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: inherit;
  background: var(--gray-light);
  width: 100%;
}

.filter-row input:focus { outline: none; border-color: var(--mustard-dark); background: var(--white); }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
  .container { padding: 16px 14px 30px; }
  .card { padding: 18px 14px; }
  .admin-grid-2, .admin-grid-3 { grid-template-columns: 1fr; }
  .tier-edit { grid-template-columns: 1fr 1fr; }
  .tier-edit > div:last-child { grid-column: span 2; }
  .filter-row { grid-template-columns: 1fr 1fr; }
  .logo-mark { width: 52px; height: 52px; }

  /* Admin nav wraps on phones: keep the logout button tappable on
     its own full-width row instead of squeezing it off-screen. */
  .admin-nav { gap: 6px; padding: 8px; }
  .admin-nav a { padding: 7px 10px; font-size: 11px; }
  .admin-nav .btn {
    flex: 1 1 100%;
    margin-left: 0;
    width: 100%;
    min-height: 40px;
  }
  .admin-section { scroll-margin-top: 132px; }

  /* Game HUD on phones */
  .title-header { top: auto; padding: 6px 12px; gap: 6px; }
  .title-header-title { font-size: clamp(16px, 4.2vw, 20px); }
  .title-header-logo { height: 20px; }
  .title-header-brand-name { font-size: 9.5px; letter-spacing: 0.8px; }
  .game-header-row .hud-panel { min-height: clamp(52px, 7vh, 64px); }
  .game-header-row { top: 6px; padding: 0 8px; gap: 6px; }
  .hud-panel { min-width: 62px; padding: 5px 9px; border-radius: 10px; }
  .hud-panel.center { min-width: 76px; }
  .hud-value { font-size: 16px; }
  .hud-label { font-size: 8px; letter-spacing: 0.6px; }
  .target-bar { padding: 20px 10px 10px; }
  .target-color-box { padding: 6px 16px 6px 12px; gap: 9px; }
  .target-color-name { font-size: 16px; }
  .target-dot { width: 21px; height: 21px; }
  .countdown-text { font-size: 88px; }
  .combo-indicator { font-size: 26px; }
  .hud-banner { padding: 10px 22px 12px; border-radius: 16px; }
  .hud-banner-main { font-size: 15px; letter-spacing: 2px; }
  .hud-banner-sub { font-size: 38px; }
  .hud-banner-hint { font-size: 10.5px; }
  .score-popup { font-size: 21px; }
  .audio-controls { bottom: 78px; right: 8px; }
  .audio-btn { padding: 5px 9px; font-size: 9px; }
  .game-over-card { padding: 20px 14px; }
  .game-over-title { font-size: 25px; }
  .final-score-number { font-size: 42px; }
  .stat-value { font-size: 16px; }
}

@media (max-height: 460px) {
  .game-hud { padding: 6px 8px 14px; }
  .target-bar { padding: 12px 10px 8px; }
  .audio-controls { bottom: 62px; }
}

@media (min-width: 900px) {
  .container { max-width: 560px; }
  .prize-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (hover: none) {
  #reticle { opacity: 0.85; }
}
