:root {
  --bg: #050816;
  --bg-card: #0f172a;
  --bg-elevated: #111827;
  --primary: #00c853;
  --primary-dark: #2e7d32;
  --text-main: #f5f5f5;
  --text-muted: #9ca3af;
  --danger: #ff5252;
  --radius-card: 16px;
  --radius-pill: 12px;
  --transition-fast: 150ms ease-out;
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1b1b1b 0, #050816 55%, #000 100%);
  color: var(--text-main);
}

.app-shell {
  max-width: 960px;
  margin: 32px auto;
  padding: 0 16px 32px;
}

.db-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* HEADER */

.db-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 24px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(18px);
}

.db-logo {
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 13px;
}

.db-header-actions {
  display: flex;
  gap: 6px;
}

.db-icon-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 999px;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.db-icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  transform: translateY(-1px);
}

/* SEARCH */
.db-search-bar {
  position: relative;
  z-index: 10;   /* low enough for modals to sit above */
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 999px;
  padding: 8px 10px 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
}

.db-search-icon {
  font-size: 16px;
  opacity: 0.8;
}

#guess-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 16px; /* 16px prevents iOS auto-zoom on focus */
  outline: none;
}

#guess-input::placeholder {
  color: var(--text-muted);
}

.db-guess-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
  box-shadow: 0 10px 24px rgba(0, 200, 83, 0.45);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.db-guess-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 14px 32px rgba(0, 200, 83, 0.6);
}

.db-guess-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(0, 200, 83, 0.4);
}

.suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s ease;
}

.suggestion-item:hover {
  background: #0f172a;
}

/* SHAKE */

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.3s ease;
}

/* PLAYER CARD (RECENT GUESS) */

.player-profile {
  width: 100%;
}

.db-player-card {
  width: 100%;
  background: radial-gradient(circle at top left, #1f2a22 0, #020617 55%);
  border-radius: var(--radius-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.75);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: cardIn 220ms ease-out;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.db-player-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.db-player-photo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.8);
}

.db-player-name {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

/* FIELDS */

.db-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.db-field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

/* PILLS */

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
}

/* TWO-COLUMN ATTRIBUTES */

.db-two-col {
  display: flex;
  gap: 18px;
}

.db-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* STATE + GLOW */

.state-green {
  background: rgba(0, 200, 83, 0.18);
  border-color: rgba(0, 200, 83, 0.8);
  color: #b9f6ca;
}

.state-yellow {
  background: rgba(255, 214, 0, 0.16);
  border-color: rgba(255, 214, 0, 0.8);
  color: #fff59d;
}

.state-grey {
  opacity: 0.7;
}

.glow-green {
  animation: glowGreen 1.2s ease-out;
}

.glow-yellow {
  animation: glowYellow 1.2s ease-out;
}

.glow-grey {
  animation: glowGrey 0.8s ease-out;
}

@keyframes glowGreen {
  0%   { box-shadow: 0 0 0px rgba(0,255,120,0.0); }
  40%  { box-shadow: 0 0 18px rgba(0,255,120,0.6); }
  100% { box-shadow: 0 0 0px rgba(0,255,120,0.0); }
}

@keyframes glowYellow {
  0%   { box-shadow: 0 0 0px rgba(255,220,0,0.0); }
  40%  { box-shadow: 0 0 18px rgba(255,220,0,0.6); }
  100% { box-shadow: 0 0 0px rgba(255,220,0,0.0); }
}

@keyframes glowGrey {
  0%   { opacity: 1; }
  50%  { opacity: 0.5; }
  100% { opacity: 1; }
}

/* CORRECT FLASH + CARD SHAKE */

.correct-flash {
  animation: correctFlash 1.4s ease-out;
}

@keyframes correctFlash {
  0%   { box-shadow: 0 0 0px rgba(0,255,120,0); }
  30%  { box-shadow: 0 0 40px rgba(0,255,120,0.8); }
  100% { box-shadow: 0 0 0px rgba(0,255,120,0); }
}

.card-shake {
  animation: shake 0.35s ease;
}

/* HISTORY (PREVIOUS GUESSES) */

.db-section-title {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.db-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guess-card {
  width: 100%;
  background: #020617;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guess-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.guess-photo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
}

.guess-name {
  font-size: 18px;
  font-weight: 600;
}

.guess-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guess-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.guess-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.guess-two-col {
  display: flex;
  gap: 14px;
}

.guess-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* SHARE BUTTON */

.db-share-btn {
  margin-top: 8px;
  align-self: flex-start;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: #000;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 200, 83, 0.45);
  transition: 0.2s ease;
}

.db-share-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

/* FOOTER */

.db-footer {
  margin-top: 28px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.8;
}

/* RESPONSIVE */

@media (max-width: 720px) {
  .db-player-header {
    align-items: flex-start;
  }

  .db-two-col,
  .guess-two-col {
    flex-direction: column;
  }
}
#suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid #333;
  padding: 8px 0;
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
  border-radius: 0 0 12px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

#suggestions::-webkit-scrollbar {
  width: 4px;
}

#suggestions::-webkit-scrollbar-track {
  background: transparent;
}

#suggestions::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

.suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
}

.suggestion-item:hover {
  background: var(--bg-elevated);
}

#player-profile {
  display: none;
}
.section-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 20px 0 10px;
    letter-spacing: 0.5px;
}

.current-header {
    color: #4ade80; /* green accent */
}

.previous-header {
    color: #9ca3af; /* grey accent */
}
.player-card.current-guess {
    border: 2px solid #4ade80;
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
    transform: scale(1.02);
    transition: 0.2s ease;
}
.player-card.previous-guess {
    opacity: 0.85;
    transform: scale(0.92);
    padding: 10px 14px;
}

.player-card.previous-guess img {
    width: 48px;
    height: 48px;
}
.previous-guess {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 12px;
    margin-bottom: 12px;
}
.hidden {
    display: none;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 50;
}

.db-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1f1f1f;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 380px;
  z-index: 60;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
}

.db-modal-content h2 {
  margin-top: 0;
  color: #4ade80;
}

.close-modal {
  margin-top: 20px;
  width: 100%;
  padding: 10px;
  background: #333;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
}
/* ============================
   STATS MODAL
============================= */

.stats-content {
  background: #1e1e1e;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  color: white;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.stat-box {
  background: #2a2a2a;
  padding: 12px;
  border-radius: 8px;
}

.stat-number {
  font-size: 28px;
  font-weight: bold;
}

.stat-label {
  font-size: 12px;
  opacity: 0.7;
}

#guess-distribution {
  margin: 20px 0;
  text-align: left;
}

.guess-bar {
  display: flex;
  align-items: center;
  margin: 6px 0;
}

.guess-bar-label {
  width: 20px;
}

.guess-bar-fill {
  height: 20px;
  background: #4caf50;
  border-radius: 4px;
  margin-left: 10px;
  min-width: 10px;
}

.share-btn {
  background: #4caf50;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  color: white;
  font-size: 16px;
  margin-top: 20px;
  cursor: pointer;
}

.close-modal {
  margin-top: 15px;
  background: #333;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  color: white;
  cursor: pointer;
}


.hidden {
  display: none;
}
.calendar-container {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 15px;
}

.calendar-day {
  padding: 10px;
  background: #2a2a2a;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  color: #e5e5e5;
  font-size: 0.9rem;
}

.calendar-day:hover {
  background: #3a3a3a;
}

.calendar-day.today {
  border: 2px solid #4ade80;
}

.calendar-day.completed {
  background: #1f3d1f;
  color: #4ade80;
}

.calendar-day.locked {
  background: #1a1a1a;
  color: #555;
  cursor: not-allowed;
}

.calendar-day.selected {
  background: #4ade80;
  color: black;
}
.correct-celebration {
  animation: pop 0.6s ease-out forwards;
}

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}
.share-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: #22c55e;
  color: #000;
  padding: 20px 28px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
  cursor: pointer;
  max-width: 92%;
  white-space: pre-line;
  line-height: 1.6;
  letter-spacing: 0.05em;
}

.share-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.share-toast-sub {
  font-size: 14px;
  font-weight: 500;
  margin-top: 6px;
  opacity: 0.85;
}
.rolling-ball {
  position: fixed;
  bottom: 20%;
  left: -120px; /* start off-screen */
  font-size: 80px;
  z-index: 9998;
  opacity: 0;
  transform: rotate(0deg);
  transition: opacity 0.2s ease;
}

.rolling-ball.show {
  opacity: 1;
  animation: rollAcross 2.2s ease-out forwards;
}

@keyframes rollAcross {
  0% {
    left: -120px;
    transform: rotate(0deg);
  }
  70% {
    left: calc(100% + 120px);
    transform: rotate(720deg);
  }
  100% {
    left: calc(100% + 120px);
    transform: rotate(720deg);
  }
}
.guess-counter {
  text-align: center;
  font-size: 14px;
  color: #9ca3af;
  margin-top: 6px;
}
#title {
  font-family: 'Bungee', sans-serif;
  font-size: 42px;
  letter-spacing: 2px;
  color: #ffffff;
  text-align: center;
  margin-top: 10px;
  margin-bottom: 10px;

  /* Optional: subtle glow */
  text-shadow: 0 0 8px rgba(0, 255, 128, 0.4);
}
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  margin-bottom: 12px;
}
/* HEADER LAYOUT */
.db-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 16px;
}

/* Left + right sides */
.db-header-side {
  display: flex;
  align-items: center;
}

.db-header-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

/* Centre container */
.db-header-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* DAILYBALL LOGO */
.db-logo {
  font-family: 'Changa', sans-serif;
  font-size: 42px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 4px; /* tighter spacing */
  user-select: none;

  text-transform: none !important; /* ensure Title Case */
  letter-spacing: 0 !important;    /* remove forced spacing */

  text-shadow: 0 0 4px rgba(0, 255, 128, 0.25);
}

.ball-icon {
  font-size: 30px;
  line-height: 1;
}
#game-over-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#game-over-overlay.active {
  opacity: 1;
  pointer-events: all;
}

#game-over-banner {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: white;
  padding: 20px 40px;
  border-radius: 12px;
  font-size: 1.8rem;
  font-weight: 700;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#game-over-banner.show {
  opacity: 1;
}
.top-icon-btn {
  background: #1a1a1a;
  border: none;
  color: white;
  font-size: 1.4rem;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s ease;
}

.top-icon-btn:hover {
  background: #2a2a2a;
  transform: scale(1.05);
}


/* ============================
   GAME OVER — FAIL STATE
============================= */

/* Card turns red-tinted and desaturated */
.game-over-fail {
  border: 2px solid rgba(255, 82, 82, 0.8) !important;
  box-shadow: 0 0 32px rgba(255, 82, 82, 0.35), 0 22px 40px rgba(0, 0, 0, 0.75) !important;
  filter: saturate(0.4) brightness(0.75);
  position: relative;
  animation: failShudder 0.5s ease-out;
}

/* Diagonal "GAME OVER" stamp across the card */
.game-over-fail::after {
  content: "GAME OVER";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: rgba(255, 82, 82, 0.55);
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

@keyframes failShudder {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-6px) rotate(-1deg); }
  30%  { transform: translateX(6px) rotate(1deg); }
  45%  { transform: translateX(-4px); }
  60%  { transform: translateX(4px); }
  75%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

/* Fail-specific game over banner — red instead of default grey */
#game-over-banner.fail {
  background: linear-gradient(135deg, #7f1d1d, #450a0a);
  border: 1px solid rgba(255, 82, 82, 0.5);
  box-shadow: 0 0 40px rgba(255, 82, 82, 0.3);
  color: #fca5a5;
  font-size: 1.5rem;
  padding: 24px 48px;
  text-align: center;
  line-height: 1.4;
}

#game-over-banner.fail .banner-sub {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.75;
  margin-top: 6px;
}

/* ============================
   RESPONSIVE — MOBILE & TABLET
============================= */

/* --- Tablet (max 768px) --- */
@media (max-width: 768px) {
  .app-shell {
    margin: 16px auto;
    padding: 0 12px 24px;
  }

  /* Header */
  .db-header {
    padding: 10px 12px;
    border-radius: 16px;
  }

  .db-logo {
    font-size: 28px;
  }

  .ball-icon {
    font-size: 22px;
  }

  .db-icon-btn {
    font-size: 18px;
    padding: 6px;
  }

  /* Search bar */
  .db-search-bar {
    padding: 6px 8px 6px 12px;
    gap: 6px;
  }

  #guess-input {
    font-size: 13px;
  }

  .db-guess-btn {
    padding: 7px 14px;
    font-size: 12px;
  }

  .guess-counter {
    font-size: 12px;
  }

  /* Player card */
  .db-player-card {
    padding: 14px 14px 12px;
    gap: 12px;
  }

  .db-player-photo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  .db-player-name {
    font-size: 18px;
  }

  /* Two-col layout stacks */
  .db-two-col,
  .guess-two-col {
    flex-direction: column;
    gap: 10px;
  }

  /* Pills */
  .pill {
    font-size: 12px;
    padding: 5px 10px;
  }

  /* Section headers */
  .section-header {
    font-size: 0.95rem;
    margin: 14px 0 8px;
  }

  /* Guess history cards */
  .guess-card {
    padding: 10px 12px;
    gap: 8px;
  }

  .guess-photo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .guess-name {
    font-size: 15px;
  }

  /* Modals */
  .db-modal {
    width: 95%;
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-number {
    font-size: 22px;
  }

  /* Game over banner */
  #game-over-banner {
    width: 88%;
    font-size: 1.2rem;
    padding: 16px 20px;
  }

  #game-over-banner.fail {
    font-size: 1.1rem;
    padding: 16px 20px;
  }

  /* Share toast */
  .share-toast {
    font-size: 16px;
    padding: 16px 20px;
    width: 88%;
  }

  /* Game over fail stamp */
  .game-over-fail::after {
    font-size: 32px;
  }
}

/* --- Mobile (max 480px) --- */
@media (max-width: 480px) {
  .app-shell {
    margin: 8px auto;
    padding: 0 8px 20px;
  }

  /* Header — tighter on small phones */
  .db-header {
    padding: 8px 10px;
    border-radius: 12px;
    margin-bottom: 14px;
  }

  .db-logo {
    font-size: 22px;
  }

  .ball-icon {
    font-size: 18px;
  }

  .db-header-actions {
    gap: 4px;
  }

  .db-icon-btn {
    font-size: 16px;
    padding: 4px 5px;
  }

  /* Search */
  .db-search-bar {
    padding: 5px 6px 5px 10px;
  }

  #guess-input {
    font-size: 12px;
  }

  .db-guess-btn {
    padding: 6px 12px;
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  /* Player card */
  .db-player-photo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }

  .db-player-name {
    font-size: 16px;
  }

  .db-field-label,
  .guess-label {
    font-size: 10px;
  }

  .pill {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 8px;
  }

  .pill-row,
  .guess-pill-row {
    gap: 4px;
  }

  /* History */
  .guess-photo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .guess-name {
    font-size: 14px;
  }

  /* Stats grid — 2 cols on small phones */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-number {
    font-size: 20px;
  }

  .stat-label {
    font-size: 11px;
  }

  /* Game over */
  #game-over-banner {
    width: 92%;
    font-size: 1rem;
    padding: 14px 16px;
    top: 15%;
  }

  .share-toast {
    font-size: 14px;
    padding: 14px 16px;
    width: 92%;
  }

  .game-over-fail::after {
    font-size: 26px;
  }

  /* Footer */
  .db-footer {
    font-size: 11px;
  }
}

/* --- Prevent horizontal scroll on all screen sizes --- */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* --- Suggestions dropdown full width on mobile --- */
@media (max-width: 480px) {
  #suggestions {
    left: -10px;
    right: -10px;
  }
}

/* ============================
   HOW TO PLAY MODAL
============================= */
.help-content {
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.help-content h2 {
  margin-top: 0;
  color: #4ade80;
}

.help-intro {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.help-section {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.help-section:last-of-type {
  border-bottom: none;
}

.help-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--text-main);
}

.help-section p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0;
  line-height: 1.6;
}

.help-note {
  font-size: 12px !important;
  font-style: italic;
  opacity: 0.7;
}

.help-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.help-desc {
  font-size: 13px;
  color: var(--text-muted);
}