/* ── Game Shell — Shared platform styles v1.3.0 ──────────────────────────
   All Games for Bored Humans games link this BEFORE their own style.css.
   theme.css provides: CSS vars, .btn, .card, .hidden, .gl-*, .title-ladder-*
   game-shell.css provides: the rest of the shared game scaffold.
   Each game's style.css then adds ONLY game-specific styles.
──────────────────────────────────────────────────────────────────────────── */

/* ── App container ────────────────────────────────────────────────────────── */
#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  padding-bottom: 80px;
}

/* ── Screen ───────────────────────────────────────────────────────────────── */
.screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 12px 16px;
  gap: 12px;
  animation: fadeUp 0.3s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

/* ── Ad placeholder ───────────────────────────────────────────────────────── */
.ad-placeholder {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text2);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Game header ──────────────────────────────────────────────────────────── */
.game-header { text-align: center; padding: 12px 0 4px; }

.back-link {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text2);
  text-decoration: none;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: color var(--t), background var(--t);
}
.back-link:hover { color: var(--accent); background: var(--border); }

.game-title {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), #fd79a8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-subtitle {
  color: var(--text2);
  font-size: 0.88rem;
  margin-top: 3px;
}

/* ── Utility buttons row ──────────────────────────────────────────────────── */
.settings-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-top: 12px;
}

.icon-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition:
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.18s ease,
    background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.icon-btn:hover { transform: scale(1.14); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.icon-btn:active {
  transform: scale(0.88);
  transition: transform 0.07s ease;
}

/* ── Theme cycle button — split-circle ────────────────────────────────────── */
#theme-btn, .theme-btn {
  background: rgba(108,92,231,0.08);
  border: 1.5px solid rgba(108,92,231,0.22);
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.12);
  transition:
    transform 0.2s cubic-bezier(0.34,1.56,0.64,1),
    box-shadow 0.18s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
#theme-btn:hover, .theme-btn:hover {
  background: rgba(108,92,231,0.15);
  border-color: rgba(108,92,231,0.4);
  box-shadow: 0 0 14px rgba(108,92,231,0.28), 0 2px 8px rgba(0,0,0,0.1);
  transform: scale(1.1);
}
#theme-btn:active, .theme-btn:active {
  transform: scale(0.92);
}

/* Sepia state */
#theme-btn[data-theme-state="sepia"],
.theme-btn[data-theme-state="sepia"] {
  background: rgba(139,94,60,0.1);
  border-color: rgba(196,144,96,0.32);
  color: #b87840;
  box-shadow: 0 2px 10px rgba(139,94,60,0.08), inset 0 1px 0 rgba(255,255,255,0.1);
}
#theme-btn[data-theme-state="sepia"]:hover,
.theme-btn[data-theme-state="sepia"]:hover {
  background: rgba(139,94,60,0.18);
  box-shadow: 0 0 14px rgba(196,144,96,0.32), 0 2px 8px rgba(0,0,0,0.1);
}

/* B&W state */
#theme-btn[data-theme-state="bw"],
.theme-btn[data-theme-state="bw"] {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.2);
  color: #333333;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.5);
}
#theme-btn[data-theme-state="bw"]:hover,
.theme-btn[data-theme-state="bw"]:hover {
  background: rgba(0,0,0,0.1);
  box-shadow: 0 0 14px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
}

/* Dark mode adjustments for theme button states */
body.dark #theme-btn[data-theme-state="bw"],
body.dark .theme-btn[data-theme-state="bw"] {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.85);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.08);
}
body.dark #theme-btn[data-theme-state="bw"]:hover,
body.dark .theme-btn[data-theme-state="bw"]:hover {
  box-shadow: 0 0 16px rgba(255,255,255,0.15), 0 2px 8px rgba(0,0,0,0.2);
}

/* ── Mode grid ────────────────────────────────────────────────────────────── */
.mode-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text2);
  margin-bottom: 10px;
}

.mode-start-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text2);
  margin-top: 10px;
  font-style: italic;
}

.mode-grid {
  display: grid;
  gap: 8px;
  /* column count defined per game */
}

.mode-btn {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 6px;
  text-align: center;
  cursor: pointer;
  transition:
    transform 0.24s cubic-bezier(0.34, 1.4, 0.64, 1),
    box-shadow 0.2s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
  color: var(--text);
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
.mode-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--accent) 38%, transparent);
}
.mode-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.97);
  transition: transform 0.07s ease;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 20%, transparent);
}
.mode-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.mode-emoji { font-size: 1.5rem; }
.mode-name  { font-size: 0.82rem; font-weight: 800; }
.mode-desc  { font-size: 0.7rem; color: var(--text2); }
.mode-btn:hover:not(:disabled) .mode-desc,
.mode-btn:active:not(:disabled) .mode-desc { color: rgba(255,255,255,0.75); }

/* ── How to play ──────────────────────────────────────────────────────────── */
.how-to-play {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.75;
  text-align: center;
  padding: 14px 18px;
}

/* ── HUD ──────────────────────────────────────────────────────────────────── */
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hud-lives  { font-size: 1.1rem; letter-spacing: 2px; }
.hud-score  { font-size: 0.92rem; font-weight: 700; text-align: right; }
.hud-score strong { color: var(--accent); }
.hud-streak { font-size: 0.82rem; min-width: 44px; text-align: right; }
.hud-mode   { font-size: 0.72rem; color: var(--text2); margin-top: 2px; }
.hud-mid    { flex: 1; padding: 0 12px; }

.progress-wrap {
  height: 4px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
  width: 100%;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #fd79a8);
  border-radius: 99px;
  transition: width 0.4s ease;
  width: 0%;
}
.round-counter {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text2);
  margin-top: 4px;
  letter-spacing: 0.3px;
  text-align: center;
}

/* ── Game over ────────────────────────────────────────────────────────────── */
.over-title { font-size: 1.7rem; font-weight: 900; margin-bottom: 4px; }
.over-sub   { color: var(--text2); font-size: 0.88rem; margin-bottom: 4px; }

.player-title-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  padding: 8px 20px;
  border-radius: 99px;
  letter-spacing: 0.3px;
  margin: 4px auto 12px;
  animation: fadeUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.stats-grid {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  /* column count defined per game */
}
.stat-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  text-align: center;
}
.stat-value {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--accent);
  display: block;
  line-height: 1.1;
}
.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
  display: block;
}

/* ── Most missed callout ──────────────────────────────────────────────────── */
#most-missed {
  display: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--text2);
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
  border-left: 3px solid var(--accent-lt);
}

/* ── Version label ────────────────────────────────────────────────────────── */
#version-label {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text2);
  padding: 4px 0;
  opacity: 0.4;
}

/* ── iPhone notch safe area ───────────────────────────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #app { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ── Responsive: tablet ───────────────────────────────────────────────────── */
@media (min-width: 500px) {
  body { padding-top: 20px; }
  #app { border-radius: 24px; box-shadow: var(--shadow-lg); overflow: hidden; background: var(--bg); }
}

@media (min-width: 600px) {
  #app { max-width: 560px; }
  .screen { padding: 14px 20px; gap: 14px; }
}

@media (min-width: 900px) {
  body { padding-top: 36px; }
  #app { max-width: 640px; border: 1px solid var(--border); }
  .screen { padding: 16px 28px; gap: 16px; }
  .hud { padding: 12px 20px; flex-wrap: nowrap; }
  .game-title { font-size: 2rem; }
  .mode-btn { padding: 18px 10px; }
  .mode-emoji { font-size: 1.8rem; }
  .mode-name  { font-size: 0.9rem; }
  .stat-value { font-size: 2rem; }
  /* Stats grid — 4-col on result screens */
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  /* Mode grid — 3-col where games define 2-col */
  .mode-grid  { grid-template-columns: repeat(3, 1fr); }
  /* Game-over card — full width, roomier padding */
  #game-over-screen .card { max-width: none; padding: 32px; }
  /* Play-next card spacing */
  .play-next-card { padding: 24px; }
  .play-next-grid { gap: 16px; }
  .play-next-item { padding: 20px 16px; }
  /* Stat items hover on desktop */
  .stat-item { transition: transform 0.18s ease, box-shadow 0.18s ease; cursor: default; }
  .lb-block { padding: 20px; }
  .lb-replay-btn:hover { opacity: 0.88; transform: translateY(-1px); }
  /* Back link larger hit area on desktop */
  .back-link { padding: 6px 14px; font-size: 0.85rem; }
  /* Play-next hover */
  .play-next-item { transition: transform 0.18s ease, border-color 0.18s ease; }
}

@media (hover: hover) and (min-width: 900px) {
  .stat-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
  .play-next-item:hover { transform: translateY(-2px); border-color: var(--accent); }
}

@media (min-width: 1200px) {
  #app { max-width: 780px; }
  .screen { padding: 20px 36px; }
  /* Tighten uppercase label tracking on large screens */
  .mode-section-title { letter-spacing: 0.3px; }
  .lb-block-label     { letter-spacing: 0.3px; }
  .hud-label          { letter-spacing: 0.2px; }
}

/* ── Tiny screens ─────────────────────────────────────────────────────────── */
@media (max-width: 360px) {
  .game-title { font-size: 1.45rem; }
}

/* ── Leaderboard block (game-over) ──────────────────────────────────────────── */
.lb-block {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), color-mix(in srgb, var(--orange) 6%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  margin-top: 12px;
}
.lb-block-label {
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text2);
  margin-bottom: 8px;
}
.lb-pct-text {
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 12px;
}
.lb-replay-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 0.85rem;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease;
}
.lb-replay-btn:active { transform: scale(0.94); }

/* ── Homepage top players ─────────────────────────────────────────────────── */
.lb-top-list { display: flex; flex-direction: column; gap: 6px; }
.lb-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.lb-top-rank  { font-size: 1rem; flex-shrink: 0; }
.lb-top-badge { font-size: 1.1rem; flex-shrink: 0; }
.lb-top-info  { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.lb-top-title { font-size: 0.78rem; font-weight: 900; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-top-game  { font-size: 0.65rem; font-weight: 700; color: var(--text2); }
.lb-top-score { font-size: 0.85rem; font-weight: 900; color: var(--accent); flex-shrink: 0; }

/* ── Daily Rewards overlay ─────────────────────────────────────────────────── */
.dr-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  animation: drFadeIn 0.22s ease both;
}

/* ── Popup card ─────────────────────────────────────────────────────────────── */
.dr-popup {
  background: var(--surface);
  border-radius: 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  position: relative;
  overflow: visible;            /* lets calendar scroll without clipping */
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
  animation: drSlideUp 0.3s cubic-bezier(0.34,1.38,0.64,1) both;
}

/* Top gradient glow strip */
.dr-popup-glow {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 80px;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--orange) 10%, transparent));
  pointer-events: none;
}

/* ── Hero section ─────────────────────────────────────────────────────────── */
.dr-popup-hero {
  padding: 28px 22px 16px;
  position: relative;
}
.dr-hero-icon {
  font-size: 3.4rem;
  line-height: 1;
  margin-bottom: 10px;
  display: block;
  animation: drIconPop 0.55s cubic-bezier(0.34,1.56,0.64,1) 0.08s both;
}
.dr-hero-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 4px;
}
.dr-hero-streak {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text2);
}

/* ── Reward badge ─────────────────────────────────────────────────────────── */
.dr-reward-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-h, #a29bfe));
  color: #fff;
  font-size: 1.25rem;
  font-weight: 900;
  padding: 8px 24px;
  border-radius: 99px;
  margin: 0 22px 18px;
  animation: drBadgePop 0.45s cubic-bezier(0.34,1.56,0.64,1) 0.2s both;
}

/* ── Calendar wrapper (scrollable on tiny screens) ──────────────────────── */
.dr-cal-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 4px;
  scrollbar-width: none;
}
.dr-cal-wrap::-webkit-scrollbar { display: none; }

.dr-calendar {
  display: flex;
  align-items: flex-start;
  gap: 0;
  width: max-content;
  min-width: 100%;
  justify-content: center;
  padding: 4px 0 8px;
}

/* ── Connector line (sits between nodes, vertically centered to circles) ─── */
.dr-connector {
  width: 14px;
  height: 2px;
  background: var(--border);
  border-radius: 99px;
  flex-shrink: 0;
  margin-top: 19px;          /* aligns with center of 40px circle */
  transition: background 0.3s ease;
}
.dr-conn-done { background: var(--green); }

/* ── Reward node ─────────────────────────────────────────────────────────── */
.dr-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 42px;
  flex-shrink: 0;
}

.dr-node-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}
.dr-node-label {
  font-size: 0.58rem;
  font-weight: 900;
  color: var(--text2);
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
.dr-node-reward {
  font-size: 0.55rem;
  font-weight: 800;
  color: var(--text2);
  opacity: 0.7;
  white-space: nowrap;
  max-width: 42px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* State variants */
.dr-node.dr-claimed .dr-node-circle {
  background: color-mix(in srgb, var(--green) 15%, transparent);
  border-color: var(--green);
  color: var(--green);
  font-size: 0.9rem;           /* checkmark fits better smaller */
}
.dr-node.dr-claimed .dr-node-label { color: var(--green); }

.dr-node.dr-today .dr-node-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
  animation: drNodePulse 1.3s ease-in-out infinite;
}
.dr-node.dr-today .dr-node-label  { color: var(--accent); font-weight: 900; }
.dr-node.dr-today .dr-node-reward { color: var(--accent); opacity: 1; }

.dr-node.dr-future .dr-node-circle { opacity: 0.35; }
.dr-node.dr-future .dr-node-label  { opacity: 0.35; }
.dr-node.dr-future .dr-node-reward { opacity: 0.25; }

/* ── Close button ──────────────────────────────────────────────────────────── */
.dr-close-btn {
  display: block;
  width: calc(100% - 44px);
  margin: 12px 22px 22px;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, opacity 0.1s ease;
}
.dr-close-btn:active { transform: scale(0.97); opacity: 0.9; }

/* ── Homepage reward card ──────────────────────────────────────────────────── */
.dr-hp-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
}
.dr-hp-unclaimed {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), color-mix(in srgb, var(--orange) 5%, transparent));
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}
.dr-hp-claimed {
  background: color-mix(in srgb, var(--green) 6%, transparent);
  border-color: color-mix(in srgb, var(--green) 18%, transparent);
}
.dr-hp-left       { display: flex; flex-direction: column; gap: 3px; }
.dr-hp-streak     { font-size: 0.72rem; font-weight: 900; color: var(--text2); }
.dr-hp-reward-preview { font-size: 0.88rem; font-weight: 900; color: var(--accent); }
.dr-hp-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 900;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease;
}
.dr-hp-btn:active { transform: scale(0.95); }
.dr-hp-check        { font-size: 1.1rem; flex-shrink: 0; }
.dr-hp-claimed-text { font-size: 0.82rem; font-weight: 700; color: var(--text2); }

/* ── In-game nav (shared across all games) ────────────────────────────────── */
.in-game-nav {
  display: flex;
  align-items: center;
  padding: 2px 0 0;
  min-height: 28px;
}
.in-game-back-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text2);
  cursor: pointer;
  padding: 5px 10px 5px 2px;
  border-radius: 8px;
  opacity: 0.5;
  letter-spacing: 0.2px;
  transition: opacity 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  font-family: inherit;
}
.in-game-back-btn:hover  { opacity: 0.85; }
.in-game-back-btn:active { opacity: 1; transform: scale(0.92); }

/* ── Canonical difficulty badge (shared across all games) ──────────────────── */
.diff-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
  flex-shrink: 0;
  line-height: 1.2;
}
.diff-badge.diff-easy   { background: color-mix(in srgb, #00b894 12%, transparent); color: #00b894; border-color: color-mix(in srgb, #00b894 28%, transparent); }
.diff-badge.diff-medium { background: color-mix(in srgb, #fdcb6e 15%, transparent); color: #e67e22; border-color: color-mix(in srgb, #fdcb6e 30%, transparent); }
.diff-badge.diff-hard   { background: color-mix(in srgb, #e17055 12%, transparent); color: #e17055; border-color: color-mix(in srgb, #e17055 28%, transparent); }

/* ── Daily Rewards animations ─────────────────────────────────────────────── */
@keyframes drFadeIn   { from { opacity: 0; }                   to { opacity: 1; } }
@keyframes drSlideUp  { from { transform: translateY(24px) scale(0.96); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes drIconPop  { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes drBadgePop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes drNodePulse {
  0%,100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent); }
  50%     { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 35%, transparent), 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent); }
}

/* ── Social Layer v1 — Challenge banner ─────────────────────────────────── */
.social-challenge-banner {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 8%, var(--surface)),
    color-mix(in srgb, #fd79a8 5%, var(--surface)));
  border: 1.5px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  animation: fadeUp 0.3s ease both;
}
.scb-inner { display: flex; align-items: center; gap: 12px; }
.scb-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.scb-icon  { font-size: 1.4rem; flex-shrink: 0; }
.scb-text  { flex: 1; min-width: 0; }
.scb-title { font-size: 0.85rem; font-weight: 900; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scb-sub   { font-size: 0.72rem; color: var(--text2); margin-top: 2px; }
.scb-btn {
  flex-shrink: 0;
  background: var(--accent); color: #fff;
  border: none; border-radius: 99px;
  padding: 8px 16px; font-size: 0.8rem; font-weight: 800;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.scb-btn:active { transform: scale(0.95); }

/* ── Social Layer v1 — Reddit CTA button ─────────────────────────────────── */
.btn-reddit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; background: var(--surface); color: var(--text2);
  border: 1.5px solid rgba(255,69,0,0.2); border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 700; cursor: pointer;
  font-family: inherit; text-decoration: none; width: 100%;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-reddit:hover { border-color: rgba(255,69,0,0.5); background: rgba(255,69,0,0.04); }
.btn-reddit:active { transform: scale(0.97); }

/* ── Social Layer v1 — Username editor ───────────────────────────────────── */
.username-edit-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.username-edit-label { font-size: 0.72rem; font-weight: 700; color: var(--text2); white-space: nowrap; }
.username-edit-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 0.9rem; font-weight: 800; color: var(--text);
  font-family: inherit; min-width: 0;
}
.username-edit-input::placeholder { color: var(--text2); font-weight: 600; }
.username-save-btn {
  background: var(--accent); color: #fff;
  border: none; border-radius: 99px;
  padding: 5px 12px; font-size: 0.75rem; font-weight: 800;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.username-save-btn:active { transform: scale(0.95); }
.username-hint { font-size: 0.68rem; color: var(--text2); opacity: 0.7; margin-top: 4px; }

/* ── Universal Game Feel Utilities ──────────────────────────────────────────
   All prefixed .gfbh-* — safe to use in any game without conflicts.
   Apply via JS: el.classList.add('gfbh-pop'); remove on animationend.
─────────────────────────────────────────────────────────────────────────── */

/* Spring pop entrance */
@keyframes gfbhPop {
  from { transform: scale(0.62) translateY(6px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.gfbh-pop { animation: gfbhPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* Score float (place near scored element, auto-removes) */
@keyframes gfbhScoreFloat {
  0%   { transform: translateY(0) scale(0.8); opacity: 1; }
  55%  { transform: translateY(-36px) scale(1.1); opacity: 1; }
  100% { transform: translateY(-58px) scale(0.85); opacity: 0; }
}
.gfbh-score-float {
  position: fixed;
  pointer-events: none;
  z-index: 9990;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 2px 6px rgba(0,0,0,0.12);
  animation: gfbhScoreFloat 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.gfbh-score-float.green { color: var(--green); }
.gfbh-score-float.gold  { color: #f59e0b; }
.gfbh-score-float.fire  { color: #ef4444; font-size: 1.55rem; }

/* Wrong shake */
@keyframes gfbhShake {
  0%, 100% { transform: translateX(0); }
  18%  { transform: translateX(-8px); }
  36%  { transform: translateX(8px); }
  54%  { transform: translateX(-5px); }
  72%  { transform: translateX(5px); }
  90%  { transform: translateX(-2px); }
}
.gfbh-shake { animation: gfbhShake 0.44s ease both; }

/* Correct ring burst */
@keyframes gfbhCorrectRing {
  0%   { box-shadow: 0 0 0 0 rgba(0,184,148,0.55); transform: scale(1); }
  45%  { transform: scale(1.04); box-shadow: 0 0 0 16px rgba(0,184,148,0); }
  100% { transform: scale(1); box-shadow: none; }
}
.gfbh-correct-ring { animation: gfbhCorrectRing 0.52s ease forwards; }

/* Streak ring burst (fire/hot) */
@keyframes gfbhStreakRing {
  0%   { box-shadow: 0 0 0 0 rgba(253,203,110,0.8); transform: scale(1); }
  40%  { transform: scale(1.07); }
  70%  { box-shadow: 0 0 0 16px rgba(253,203,110,0); }
  100% { transform: scale(1); box-shadow: none; }
}
.gfbh-streak-ring { animation: gfbhStreakRing 0.58s ease forwards; }

/* Stat/count number pop (apply on element containing score text) */
@keyframes gfbhCountPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.22); }
  65%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}
.gfbh-count-pop { animation: gfbhCountPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* Streak text pulse */
@keyframes gfbhStreakPulse {
  0%   { transform: scale(1); filter: none; }
  40%  { transform: scale(1.28); filter: drop-shadow(0 0 6px rgba(253,203,110,0.8)); }
  100% { transform: scale(1); filter: none; }
}
.gfbh-streak-pop { animation: gfbhStreakPulse 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* Tap ripple (for buttons that want extra tactile feedback) */
@keyframes gfbhTapRipple {
  0%   { box-shadow: 0 0 0 0 rgba(108,92,231,0.4); }
  70%  { box-shadow: 0 0 0 14px rgba(108,92,231,0); }
  100% { box-shadow: none; }
}
.gfbh-tap-ripple { animation: gfbhTapRipple 0.45s ease forwards; }

/* Level-up flash (whole card) */
@keyframes gfbhLevelFlash {
  0%   { box-shadow: var(--shadow); }
  25%  { box-shadow: 0 0 0 4px rgba(108,92,231,0.5), 0 12px 40px rgba(108,92,231,0.3); transform: scale(1.015); }
  75%  { transform: scale(1.005); }
  100% { box-shadow: var(--shadow); transform: scale(1); }
}
.gfbh-level-flash { animation: gfbhLevelFlash 0.65s cubic-bezier(0.34, 1.26, 0.64, 1) forwards; }

/* Gentle heartbeat for "play again" CTAs */
@keyframes gfbhHeartbeat {
  0%, 100% { transform: scale(1); }
  14%  { transform: scale(1.04); }
  28%  { transform: scale(1); }
  42%  { transform: scale(1.02); }
}
.gfbh-heartbeat { animation: gfbhHeartbeat 1.4s ease 0.8s 3; }
