/* ==========================================================================
   Hourdle - Modern UI/UX Stylesheet (style_new.css)
   ========================================================================== */

/* --- Design System Variables --- */
:root {
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --bg-body: #f8fafc;
  --bg-header: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;

  --tile-empty-border: #d3d6da;
  --tile-filled-border: #878a8c;
  --tile-bg-empty: transparent;
  --tile-text-color: #0f172a;

  --color-correct: #6aaa64;
  --color-present: #c9b458;
  --color-absent: #787c7e;

  --key-bg: #d3d6da;
  --key-text: #1a1a1b;
  --key-hover: #c4c7cb;
  --key-active: #a8abb0;

  --pill-bg: #f1f5f9;
  --pill-border: #e2e8f0;
  --pill-text: #334155;

  --modal-bg: #ffffff;
  --modal-border: #e2e8f0;
  --modal-header-border: #f1f5f9;

  --shadow-subtle: 0 1px 3px 0 rgba(0, 0, 0, 0.07), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-toast: 0 12px 30px -5px rgba(0, 0, 0, 0.35), 0 6px 12px -3px rgba(0, 0, 0, 0.2);
}

body.dark-mode {
  --bg-body: #121213;
  --bg-header: #121213;
  --bg-card: #18181b;
  --text-primary: #f8fafc;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-color: #27272a;
  --border-strong: #3f3f46;

  --tile-empty-border: #3a3a3c;
  --tile-filled-border: #565758;
  --tile-bg-empty: transparent;
  --tile-text-color: #ffffff;

  --color-correct: #538d4e;
  --color-present: #b59f3b;
  --color-absent: #3a3a3c;

  --key-bg: #818384;
  --key-text: #ffffff;
  --key-hover: #939597;
  --key-active: #6e7071;

  --pill-bg: #1e1e24;
  --pill-border: #2e2e36;
  --pill-text: #d4d4d8;

  --modal-bg: #18181b;
  --modal-border: #27272a;
  --modal-header-border: #27272a;

  --shadow-subtle: 0 1px 3px 0 rgba(0, 0, 0, 0.5);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-toast: 0 12px 30px -5px rgba(0, 0, 0, 0.7), 0 6px 12px -3px rgba(0, 0, 0, 0.4);
}

/* --- Global Resets & Typography --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-family: var(--font-main);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.noselect {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* --- App Container --- */
#app_container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 8px;
  position: relative;
}

/* --- App Header --- */
header.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  min-height: 52px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 4px;
  background-color: var(--bg-header);
  position: relative;
  z-index: 10;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.app-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.16rem;
  color: var(--text-primary);
  margin: 0;
  line-height: 1;
  transition: color 0.25s ease;
}

.hourly-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
  background: linear-gradient(135deg, #538d4e, #6aaa64);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 9999px;
  vertical-align: middle;
}

/* Header Action Buttons */
.icon-btn {
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  outline: none;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.icon-btn:hover {
  background-color: var(--pill-bg);
  color: var(--text-primary);
}

.icon-btn:active {
  transform: scale(0.92);
}

/* Header Live Countdown Pill */
.header-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background-color: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-correct);
  cursor: pointer;
  letter-spacing: 0.02rem;
  transition: all 0.15s ease;
}

.header-timer-pill:hover {
  border-color: var(--color-correct);
}

.header-timer-pill .timer-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-correct);
  animation: pulse 1.8s infinite;
}

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

/* --- Status Bar / Subtitle Area --- */
#subtitle_wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px;
  gap: 6px;
  margin-top: 2px;
  z-index: 5;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--pill-text);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.stat-pill:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-subtle);
}

.stat-pill strong, .stat-pill span.bold-val {
  font-weight: 700;
  color: var(--color-correct);
}

.username-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(106, 170, 100, 0.12);
  border: 1px solid rgba(106, 170, 100, 0.25);
  color: var(--color-correct);
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  cursor: pointer;
}

/* --- Game Board & Tiles --- */
#board_wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  min-height: 0;
}

#word_grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 auto;
  padding: 0;
}

.game-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 0;
}

.tile, .dark-tile,
.tile-correct, .dark-tile-correct,
.tile-correct-position, .dark-tile-correct-position,
.tile-incorrect, .dark-tile-incorrect {
  width: 58px;
  height: 58px;
  border: 2px solid var(--tile-empty-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--tile-text-color);
  background-color: transparent;
  line-height: 1;
  box-sizing: border-box;
  transition: transform 0.15s ease, border-color 0.15s ease;
  perspective: 1000px;
}

/* Tile States */
.tile-correct, .dark-tile-correct {
  background-color: var(--color-present) !important;
  border-color: var(--color-present) !important;
  color: #ffffff !important;
}

.tile-correct-position, .dark-tile-correct-position {
  background-color: var(--color-correct) !important;
  border-color: var(--color-correct) !important;
  color: #ffffff !important;
}

.tile-incorrect, .dark-tile-incorrect {
  background-color: var(--color-absent) !important;
  border-color: var(--color-absent) !important;
  color: #ffffff !important;
}

/* --- Animations --- */
.popin {
  animation: PopIn 120ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes PopIn {
  0% { transform: scale(0.85); opacity: 0.7; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.flipin {
  animation: FlipIn 220ms ease-in forwards;
}

@keyframes FlipIn {
  0% { transform: rotateX(0deg); }
  100% { transform: rotateX(-90deg); }
}

.flipout {
  animation: FlipOut 220ms ease-out forwards;
}

@keyframes FlipOut {
  0% { transform: rotateX(-90deg); }
  100% { transform: rotateX(0deg); }
}

.invalid {
  animation: Shake 500ms ease-in-out;
}

@keyframes Shake {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-4px); }
  30%, 60%, 85% { transform: translateX(4px); }
}

.win {
  animation: VictoryBounce 900ms ease forwards;
}

@keyframes VictoryBounce {
  0%, 20% { transform: translateY(0); }
  40% { transform: translateY(-24px); }
  50% { transform: translateY(4px); }
  60% { transform: translateY(-12px); }
  80% { transform: translateY(2px); }
  100% { transform: translateY(0); }
}

/* --- On-screen Keyboard --- */
#keyboard {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  touch-action: manipulation;
}

.keyboard-row {
  display: flex;
  width: 100%;
  justify-content: center;
  gap: 5px;
}

.letter, .dark-letter,
.letter-correct, .dark-letter-correct,
.letter-correct-position, .dark-letter-correct-position,
.letter-incorrect, .dark-letter-incorrect,
.action_button {
  flex: 1;
  height: 52px;
  background-color: var(--key-bg);
  color: var(--key-text);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  border: none;
  margin: 0;
  padding: 0;
  line-height: 1;
  text-transform: uppercase;
  transition: background-color 0.15s ease, transform 0.08s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.action_button {
  flex: 1.5;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02rem;
}

.letter:hover, .dark-letter:hover, .action_button:hover {
  background-color: var(--key-hover);
}

.letter:active, .dark-letter:active, .action_button:active {
  background-color: var(--key-active);
  transform: scale(0.93);
}

/* Evaluated Key States */
.letter-correct, .dark-letter-correct {
  background-color: var(--color-present) !important;
  color: #ffffff !important;
}

.letter-correct-position, .dark-letter-correct-position {
  background-color: var(--color-correct) !important;
  color: #ffffff !important;
}

.letter-incorrect, .dark-letter-incorrect {
  background-color: var(--color-absent) !important;
  color: #ffffff !important;
  opacity: 0.65;
}

/* Definition Card Display (Post-Game) */
.definition-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  box-shadow: var(--shadow-subtle);
  animation: PopIn 250ms ease;
}

.def-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-correct);
  letter-spacing: 0.05rem;
  margin-bottom: 4px;
}

.def-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}

.def-phonetic {
  font-size: 14px;
  font-style: italic;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 6px;
}

.def-content {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Post-Game Actions */
#ai_wrapper {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 6px 0;
}

.btn-game-primary {
  background: linear-gradient(135deg, #538d4e, #6aaa64);
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(83, 141, 78, 0.35);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-game-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(83, 141, 78, 0.45);
  color: #ffffff;
}

.btn-game-primary:active {
  transform: translateY(1px);
}

.btn-game-secondary {
  background-color: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-game-secondary:hover {
  background-color: var(--border-color);
  color: var(--text-primary);
}

/* ==========================================================================
   Toast Notification System (Self-Contained & Centered)
   ========================================================================== */
#snackbar, #snackbar2 {
  visibility: hidden;
  position: fixed;
  left: 50%;
  bottom: 25%;
  transform: translateX(-50%);
  margin: 0;
  width: max-content;
  min-width: 140px;
  max-width: 88vw;
  height: auto;
  box-sizing: border-box;
  background-color: #0f172a;
  color: #f8fafc;
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  box-shadow: var(--shadow-toast);
  z-index: 10000;
  pointer-events: none;
  white-space: pre-line;
  opacity: 0;
  transition: none;
}

body.dark-mode #snackbar {
  background-color: #f8fafc;
  color: #0f172a;
}

#snackbar2 {
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  color: #ffffff;
}

#snackbar.show {
  visibility: visible;
  opacity: 1;
  animation: toast_float_up 3.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#snackbar2.show {
  visibility: visible;
  opacity: 1;
  animation: toast_float_up2 3.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toast_float_up {
  0% {
    bottom: 25%;
    opacity: 0;
    transform: translateX(-50%) scale(0.85);
  }
  12% {
    bottom: 68%;
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  82% {
    bottom: 68%;
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  100% {
    bottom: 75%;
    opacity: 0;
    transform: translateX(-50%) scale(0.95);
  }
}

@keyframes toast_float_up2 {
  0% {
    bottom: 15%;
    opacity: 0;
    transform: translateX(-50%) scale(0.85);
  }
  12% {
    bottom: 40%;
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  82% {
    bottom: 40%;
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  100% {
    bottom: 46%;
    opacity: 0;
    transform: translateX(-50%) scale(0.95);
  }
}

/* ==========================================================================
   Modals Engine (100% Pure CSS - Zero Bootstrap Dependency)
   ========================================================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1050;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal.show {
  display: flex !important;
  opacity: 1 !important;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: auto;
  pointer-events: auto;
  box-sizing: border-box;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 32px);
}

.form-control {
  display: block;
  width: 100%;
  padding: 8px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 20px;
  outline: none;
  box-sizing: border-box;
}

.modal-content {
  background-color: var(--modal-bg) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--modal-border) !important;
  border-radius: 20px !important;
  box-shadow: var(--shadow-card) !important;
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid var(--modal-header-border) !important;
  padding: 16px 20px !important;
  background-color: var(--modal-bg) !important;
}

.modal-title {
  font-weight: 800 !important;
  font-size: 18px !important;
  letter-spacing: 0.05rem !important;
  color: var(--text-primary) !important;
  margin: 0 !important;
  width: 100%;
  text-align: center;
}

.modal-header .close {
  position: absolute;
  right: 16px;
  top: 14px;
  color: var(--text-secondary) !important;
  font-size: 24px !important;
  font-weight: 300 !important;
  opacity: 0.7;
  outline: none;
  border: none;
  background: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.modal-header .close:hover {
  opacity: 1;
}

.modal-body {
  padding: 20px !important;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.modal-footer {
  border-top: 1px solid var(--modal-header-border) !important;
  padding: 14px 20px !important;
  background-color: var(--modal-bg) !important;
}

/* Segmented Period Tabs */
.period-tabs {
  display: flex;
  background-color: var(--pill-bg);
  padding: 3px;
  border-radius: 12px;
  gap: 3px;
  margin-bottom: 16px;
}

.period-tab-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 7px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.period-tab-btn.active {
  background-color: var(--bg-card);
  color: var(--color-correct);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Statistics Cards */
#statistics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 20px;
  text-align: center;
}

.statistic-container {
  background-color: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 12px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.statistic-container .statistic {
  font-size: 20px !important;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.statistic-container .label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.02rem;
  margin-top: 2px;
}

/* Guess Distribution Bars */
#guess-distribution {
  width: 100%;
  margin: 0 auto 20px auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.graph-container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.graph-container .guess {
  width: 14px;
  color: var(--text-primary);
  text-align: center;
}

.graph-container .graph {
  flex: 1;
  background-color: var(--pill-bg);
  border-radius: 4px;
  overflow: hidden;
  height: 20px;
}

.graph-bar {
  height: 100%;
  background-color: var(--color-absent);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  transition: width 0.4s ease;
}

.graph-bar.highlight {
  background-color: var(--color-correct) !important;
}

.graph-bar .num-guesses {
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

/* Leaderboard Table */
#rank_container {
  padding: 0;
}

.leaderboard-header {
  display: grid;
  grid-template-columns: 35px 2fr 1fr 1fr 1fr 1.2fr;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--modal-header-border);
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 35px 2fr 1fr 1fr 1fr 1.2fr;
  padding: 6px 8px;
  font-size: 12px;
  align-items: center;
  border-bottom: 1px solid var(--modal-header-border);
  transition: background-color 0.15s ease;
}

.leaderboard-row:hover {
  background-color: var(--pill-bg);
}

.medal-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 auto;
}

.medal-gold { background: linear-gradient(135deg, #f59e0b, #d97706); }
.medal-silver { background: linear-gradient(135deg, #94a3b8, #64748b); }
.medal-bronze { background: linear-gradient(135deg, #d97706, #b45309); }

/* Chat Modal Elements */
#chat-wrapper {
  border-radius: 12px;
  background-color: var(--pill-bg);
  border: 1px solid var(--pill-border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg-bubble {
  background-color: var(--bg-card);
  border: 1px solid var(--pill-border);
  border-radius: 10px;
  padding: 8px 12px;
}

.chat-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 3px;
}

.chat-user {
  font-weight: 700;
  color: var(--color-correct);
}

.chat-time {
  color: var(--text-muted);
}

.chat-text {
  font-size: 13px;
  color: var(--text-primary);
  margin: 0;
}

/* Menu Modal Items */
.menu-item-row,
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-primary) !important;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.15s ease;
  background-color: transparent !important;
  text-decoration: none !important;
}

.menu-item-row:hover,
.dropdown-item:hover {
  background-color: var(--pill-bg) !important;
  color: var(--text-primary) !important;
  transform: translateX(3px);
}

.menu-item-row span,
.dropdown-item span {
  color: var(--text-primary) !important;
  font-weight: 600;
}

.menu-item-row svg,
.dropdown-item svg {
  width: 22px;
  height: 22px;
  fill: currentColor !important;
  color: var(--color-correct) !important;
  flex-shrink: 0;
}

/* Modal Dark Mode Text Overrides */
body.dark-mode .modal-content,
body.dark-mode .modal-header,
body.dark-mode .modal-body,
body.dark-mode .modal-footer {
  color: var(--text-primary) !important;
  background-color: var(--modal-bg) !important;
}

body.dark-mode .modal-title {
  color: var(--text-primary) !important;
}

body.dark-mode .menu-item-row,
body.dark-mode .menu-item-row span,
body.dark-mode .dropdown-item,
body.dark-mode .dropdown-item span {
  color: var(--text-primary) !important;
}

body.dark-mode .menu-item-row svg,
body.dark-mode .dropdown-item svg {
  color: var(--color-correct) !important;
  fill: currentColor !important;
}

/* Spinner */
#custom-spinner {
  display: none;
}

/* Night Owl Achievement & Badges */
.night-owl-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  cursor: help;
  transition: transform 0.15s ease;
  filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.4));
}
.night-owl-tag:hover {
  transform: scale(1.2);
}

.night-owl-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 12px 0 8px 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.25));
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15); }
  50% { box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35); }
}

.night-owl-badge-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}

.night-owl-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.night-owl-title {
  font-size: 13px;
  font-weight: 800;
  color: #f59e0b;
  letter-spacing: 0.03rem;
}

.night-owl-desc {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.night-owl-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

