/* Basic reset and body styling */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: var(--page-bg, #faf8ef);
  color: var(--page-fg, #111);
}

body.booting {
  overflow: hidden;
  background: #d7f5f1;
}

#boot-loading-shell {
  position: fixed;
  inset: 0;
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  background: #d7f5f1;
  z-index: 20000;
}

body.booting #boot-loading-shell {
  display: block;
}

body.mobile-mode.booting #boot-loading-shell {
  display: block !important;
}

:root {
  --page-bg: #faf8ef;
  --page-fg: #111;
  --panel-surface: #fff;
  --panel-surface-2: #fefefe;
  --panel-border: rgba(0, 0, 0, 0.18);
  --wordle-cell-size: 45px;
  --wordle-cell-gap: 5px;
  --wordle-feedback-green: #6aaa64;
  --wordle-feedback-yellow: #c9b458;
  --wordle-feedback-gray: #787c7e;
  --wordle-surface-bg: #fff;
  --wordle-neutral-bg: #fff;
  --wordle-neutral-fg: #000;
  --desktop-header-h: 0px;
  --desktop-header-item: 56px;
  --desktop-2048-pane-w: 500px;
  --desktop-wordle-pane-w: 520px;
  --desktop-pane-gap: 2px;
  --desktop-game-total-w: calc(var(--desktop-2048-pane-w) + var(--desktop-wordle-pane-w) + var(--desktop-pane-gap));
  --mobile-header-item: 41px;  /* 34px * 1.2 */
  --ui-message-font-size: 21px;
  --zoable-vowel-outline-w: 1px;
  --zoable-vowel-fill-overlap: 0px;
}

body.high-contrast-mode {
  --wordle-feedback-green: #f5793a;
  --wordle-feedback-yellow: #85c0f9;
}

body.dark-theme {
  --page-bg: #121213;
  --page-fg: #f5f5f5;
  --panel-surface: #1d1f21;
  --panel-surface-2: #232527;
  --panel-border: rgba(255, 255, 255, 0.14);
  --wordle-surface-bg: #121213;
  --wordle-neutral-bg: #1d1f21;
  --wordle-neutral-fg: #f5f5f5;
  background-color: #121213;
  color: #f5f5f5;
}

body.dark-theme .boot-loading-card {
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

body.thick-vowel-outlines {
  --zoable-vowel-outline-w: 3px;
  --zoable-vowel-fill-overlap: 2px;
}

body.mobile-mode.thick-vowel-outlines {
  --zoable-vowel-outline-w: 2px;
  --zoable-vowel-fill-overlap: 1px;
}

/* Mobile UX: reduce browser gesture interference (e.g., double-tap zoom) on the main UI.
   The 2048 grid keeps `touch-action: none` to reserve swipes for moves. */
body.mobile-mode,
body.mobile-mode #mobile-header,
body.mobile-mode .game-container,
body.mobile-mode button,
body.mobile-mode .win-share-button {
  touch-action: manipulation;
}

/* Mobile: keep Wordle grid sizing consistent with the plan-input ("search") tiles. */
body.mobile-mode {
  --wordle-cell-size: 49px;
  --ui-message-font-size: 17px;
}

/* Wordle-only (2048 disabled): never allow the page to scroll in mobile-mode. */
body.mobile-mode.disable-2048,
body.mobile-mode.disable-2048 .game-container {
  touch-action: none;
}
body.mobile-mode.disable-2048 button,
body.mobile-mode.disable-2048 a {
  touch-action: manipulation;
}

body:not(.mobile-mode) {
  /* Match the 2048 board height (445px) with 6 Wordle rows: 6*70 + 5*5 = 445 */
  --wordle-cell-size: 70px;
  --ui-message-font-size: 21px;
}

body.dark-theme #tutorialBar,
body.dark-theme #mobile-menu-dropdown,
body.dark-theme #desktop-menu-dropdown,
body.dark-theme .modal-content,
body.dark-theme #progress-info-float,
body.dark-theme #history-tooltip-float,
body.dark-theme #header-money-tooltip {
  background: var(--panel-surface) !important;
  color: #f5f5f5 !important;
  border-color: var(--panel-border) !important;
}

body.dark-theme #mobile-header-inner {
  background: var(--page-bg) !important;
  color: var(--page-fg) !important;
}

body.dark-theme .desktop-menu-item,
body.dark-theme .mobile-menu-item,
body.dark-theme .modal-header,
body.dark-theme .modal-scroll,
body.dark-theme .header-money,
body.dark-theme .settings-modal-row,
body.dark-theme .close-button,
body.dark-theme .close-button-history,
body.dark-theme .close-button-share,
body.dark-theme .close-button-faq,
body.dark-theme .close-button-language,
body.dark-theme .close-button-settings,
body.dark-theme .close-button-win {
  color: #f5f5f5 !important;
}

body.dark-theme #gameWordle,
body.dark-theme .guess-wrapper,
body.dark-theme .checker-cell,
body.dark-theme .word-checker-bar .checker-cell .key-letter-container {
  background-color: var(--wordle-surface-bg) !important;
  color: var(--wordle-neutral-fg) !important;
  border-color: rgba(255, 255, 255, 0.82) !important;
}

body.dark-theme .modal,
body.dark-theme #walkthroughModal,
body.dark-theme #faqModal,
body.dark-theme #historyModal,
body.dark-theme #sharePuzzleModal,
body.dark-theme #confirmModal,
body.dark-theme #streakProtectorModal,
body.dark-theme #winModal {
  background-color: rgba(0, 0, 0, 0.78) !important;
}

body.dark-theme .modal-content,
body.dark-theme .modal-header,
body.dark-theme .modal-scroll,
body.dark-theme .history-toggle-bar,
body.dark-theme .faq-awesome-cost-table,
body.dark-theme .faq-awesome-cost-table th,
body.dark-theme .faq-awesome-cost-table td,
body.dark-theme .history-hist-yaxis,
body.dark-theme .history-hist-yaxis-tick,
body.dark-theme .history-hist-yaxis-unit {
  background-color: var(--panel-surface) !important;
  color: var(--page-fg) !important;
  border-color: var(--panel-border) !important;
}

body.dark-theme .special-pattern-pane {
  background: var(--panel-surface) !important;
  color: var(--page-fg) !important;
  border-color: var(--panel-border) !important;
}

body.dark-theme .special-pattern-question-btn,
body.dark-theme .special-pattern-pane-close {
  background: var(--panel-surface-2) !important;
  color: var(--page-fg) !important;
  border-color: var(--panel-border) !important;
}

body.dark-theme #historyModal #historyToggleButton.history-toggle-bar,
body.dark-theme .settings-modal-row {
  background: var(--panel-surface-2) !important;
}

body.dark-theme #mobile-header,
body.dark-theme #mobile-header-bar,
body.dark-theme #tutorialBar,
body.dark-theme .game-container,
body.dark-theme #dailyResultsContainer,
body.dark-theme #zoable-footer {
  color: var(--page-fg) !important;
}

body.dark-theme .close-button,
body.dark-theme #mobile-menu-button,
body.dark-theme .desktop-header-action,
body.dark-theme .header-brand,
body.dark-theme .header-brand-text,
body.dark-theme .header-daily-index {
  color: #fff !important;
}

body.mobile-mode.dark-theme #mobile-menu-button {
  color: #000 !important;
  border-color: rgba(0, 0, 0, 0.35) !important;
}

body.dark-theme .desktop-header-action {
  border-color: #fff !important;
}

body.dark-theme .desktop-header-action:hover,
body.dark-theme .desktop-header-action:focus-visible {
  background: var(--page-bg) !important;
  background-color: var(--page-bg) !important;
}

body.dark-theme .desktop-header-action::after {
  background: rgba(245, 245, 245, 0.98);
  color: #111;
}

body.dark-theme.mobile-mode.desktop-mobile-layout .mobile-header-action[data-tooltip]::after {
  background: rgba(245, 245, 245, 0.98);
  color: #111;
}

body.dark-theme .search-key-enter,
body.dark-theme .search-key-backspace,
body.dark-theme .search-key-enter .key-content,
body.dark-theme .search-key-backspace .key-content,
body.dark-theme .search-key-enter .key-content.key-content-single,
body.dark-theme .search-key-backspace .key-content.key-content-single,
body.dark-theme .search-key-enter .key-letter-container,
body.dark-theme .search-key-backspace .key-letter-container,
body.dark-theme .legend-action-btn {
  background: var(--wordle-neutral-bg) !important;
  color: var(--wordle-neutral-fg) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

body.dark-theme .search-key-enter .key-letter,
body.dark-theme .search-key-backspace .key-letter,
body.dark-theme .legend-action-btn .zoable-icon {
  color: var(--wordle-neutral-fg) !important;
}

body.dark-theme .history-stats-title,
body.dark-theme .history-stat-label,
body.dark-theme .history-stat-value,
body.dark-theme .history-hist-frac,
body.dark-theme #historyModal h3,
body.dark-theme #historyDailyShareStatus,
body.dark-theme #historyPracticeShareStatus,
body.dark-theme #endModalShareStatus {
  color: var(--page-fg) !important;
}

body.dark-theme #historyModal table,
body.dark-theme #historyModal th,
body.dark-theme #historyModal td {
  border-color: var(--panel-border) !important;
}

body.dark-theme .wordle-cell2[style*="#6aaa64"],
body.high-contrast-mode .wordle-cell2[style*="#6aaa64"] {
  background: var(--wordle-feedback-green) !important;
  color: #fff !important;
}

body.dark-theme .wordle-cell2[style*="#c9b458"],
body.high-contrast-mode .wordle-cell2[style*="#c9b458"] {
  background: var(--wordle-feedback-yellow) !important;
  color: #fff !important;
}

body.dark-theme .wordle-cell2[style*="#787c7e"],
body.high-contrast-mode .wordle-cell2[style*="#787c7e"] {
  background: var(--wordle-feedback-gray) !important;
  color: #fff !important;
}

body.dark-theme .wordle-cell2[style*="background:#fff"],
body.high-contrast-mode .wordle-cell2[style*="background:#fff"] {
  background: var(--wordle-neutral-bg) !important;
  color: var(--wordle-neutral-fg) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

body.dark-theme #game2048 {
  background: #24170f;
}

body.dark-theme .grid-cell {
  background: #3a2a20;
}

body.dark-theme .search-key {
  border-color: rgba(255, 255, 255, 0.72) !important;
}

body.dark-theme .legend-letter,
body.dark-theme .legend-tile {
  border-color: rgba(255, 255, 255, 0.72) !important;
}

body.dark-theme .legend-letter:not(.legend-letter-revealed),
body.dark-theme .legend-letter.legend-letter-revealed:not([style*="#6aaa64"]):not([style*="#c9b458"]):not([style*="#787c7e"]) {
  background: var(--wordle-neutral-bg) !important;
  color: var(--wordle-neutral-fg) !important;
}

body.dark-theme .legend-letter.legend-letter-revealed[style*="#6aaa64"],
body.high-contrast-mode .legend-letter.legend-letter-revealed[style*="#6aaa64"] {
  background: var(--wordle-feedback-green) !important;
  color: #fff !important;
}

body.dark-theme .legend-letter.legend-letter-revealed[style*="#c9b458"],
body.high-contrast-mode .legend-letter.legend-letter-revealed[style*="#c9b458"] {
  background: var(--wordle-feedback-yellow) !important;
  color: #fff !important;
}

body.dark-theme .legend-letter.legend-letter-revealed[style*="#787c7e"],
body.high-contrast-mode .legend-letter.legend-letter-revealed[style*="#787c7e"] {
  background: var(--wordle-feedback-gray) !important;
  color: #fff !important;
}

body.dark-theme .wordle-cell.plan-input-cell,
body.dark-theme .wordle-cell.plan-input-cell .key-letter-container,
body.dark-theme .wordle-cell.plan-input-cell .key-number-container,
body.dark-theme .checker-cell .key-letter-container,
body.dark-theme .checker-cell .key-number-container {
  border-color: rgba(255, 255, 255, 0.82) !important;
}

body.dark-theme .wordle-cell.plan-input-cell .key-letter-container,
body.dark-theme .checker-cell .key-letter-container {
  background: var(--wordle-surface-bg) !important;
  color: var(--wordle-neutral-fg) !important;
}

body.dark-theme .wordle-cell.plan-input-cell .key-number-container,
body.dark-theme .checker-cell .key-number-container {
  background: #baa081 !important;
}

body.dark-theme .wordle-cell {
  border-color: rgba(255, 255, 255, 0.82) !important;
}

body.dark-theme .wordle-cell:not([data-feedback-status]) {
  background-color: var(--wordle-surface-bg) !important;
  color: var(--wordle-neutral-fg) !important;
}

body.dark-theme a.dict-link {
  color: #8ab4f8;
}

/* Main game container:
   - On large screens, the panes appear side-by-side.
   - On screens narrower than 800px, they stack vertically.
*/
/* Container for the progress bar – make sure there is barely any gap */
#progress-bar-container {
  width: 100%;
  height: 20px;
  background-color: #bbada0;
  border: 1px solid #aaa;
  box-sizing: border-box;
  position: relative;
  margin: 0; /* Remove extra margin */
  overflow: hidden;
  border-radius: 8px;
}

body:not(.mobile-mode) #progress-bar-container {
  max-width: none;
  height: 30px;
}

#progress-bar-container.progress-bar-structured {
  background: transparent;
  border: none;
  overflow: hidden;
}

#progress-bar-container .progress-bar-row {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #bbada0;
  border: 1px solid #aaa;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 8px;
}

#progress-bar-container.progress-bar-compare-mode {
  height: 40px;
}

body:not(.mobile-mode) #progress-bar-container.progress-bar-compare-mode {
  height: 64px;
}

/* The fill element: its height will be updated dynamically */
#progress-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;   /* updated via JavaScript */
  height: 100%;
  background-color: #00aa00; /* default color; will be changed according to progress */
  z-index: 1;
  transition: height 220ms ease-out, width 220ms ease-out, background-color 180ms linear;
  will-change: height, width;
  border-radius: 8px;
}

#progress-bar-fill.progress-bar-fill-compare-primary {
  height: 50%;
  border-radius: 0 !important;
}

.progress-bar-fill-secondary {
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 50%;
  z-index: 1;
  transition: height 220ms ease-out, width 220ms ease-out, background-color 180ms linear;
  will-change: height, width;
  border-radius: 0;
}

@keyframes progress-fill-pulse {
  0% { filter: brightness(1); }
  45% { filter: brightness(1.22); }
  100% { filter: brightness(1); }
}

#progress-bar-fill.progress-pulse {
  animation: progress-fill-pulse 320ms ease-out;
}

/* Progress-bar click overlay (emoji legend + encoded cost). */
#progress-info-float {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-9999px, -9999px);
  max-width: min(760px, 94vw);
  min-width: min(520px, 94vw);
  white-space: pre-wrap;
  background: rgba(20, 20, 20, 0.95);
  color: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.25;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 5200;
}

#progress-info-float.visible {
  opacity: 1;
}

/* Mobile: tap-to-show tooltips (replacement for hover on touch devices). */
#tap-tooltip-float {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-9999px, -9999px);
  max-width: min(760px, 94vw);
  min-width: min(360px, 94vw);
  white-space: pre-wrap;
  background: rgba(20, 20, 20, 0.95);
  color: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.25;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 5200;
}

#tap-tooltip-float.visible {
  opacity: 1;
}

/* Segmented overlay (6 × 500-cost blocks) */
#progress-bar-segments {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: row; /* segment 0 at left */
  z-index: 6;
  pointer-events: none;
}

.progress-segment {
  flex: 1 1 0;
  position: relative;
  border-right: 1px solid rgba(0, 0, 0, 0.22);
}
.progress-segment:last-child {
  border-right: none;
}

.progress-segment.segment-earned {
  background: rgba(255, 255, 255, 0.08);
}

.progress-segment.segment-active {
  background: rgba(255, 255, 255, 0.12);
}

.segment-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", emoji, sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

body.mobile-mode .segment-emoji {
  font-size: 14px;
}

/* Markers for specific thresholds */
#progress-bar-markers {
  display: none;
}
#progress-bar-markers .marker {
  position: absolute;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 10px;
  color: #000;
}

#progress-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.1;
  z-index: 7;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

#progress-bar-text.progress-bar-text-compare {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  z-index: 8;
  white-space: normal;
}

.progress-bar-compare-line {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 8px;
  position: relative;
}

.progress-bar-compare-label,
.progress-bar-compare-value {
  color: #fff;
  font-weight: 800;
}

.progress-bar-compare-value {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  min-width: max-content;
}

.progress-bar-compare-value.is-winning {
  color: #edc22e;
}

body.mobile-mode #progress-bar-text {
  font-size: 12px;
  line-height: 1.1;
}

body:not(.mobile-mode) #progress-bar-text {
  font-size: 23px;
  line-height: 1.05;
}

body.mobile-mode .progress-bar-compare-line {
  padding: 0 6px;
}

/* --- Mobile layout (vertical stack + touch) --- */
body.mobile-mode {
  padding-top: 0; /* set dynamically in JS to match tutorial bar height */
  overflow: hidden;
  height: 100vh;
  overscroll-behavior: none;
}

html body.mobile-mode {
  overflow: hidden;
}

/* Mobile boot: avoid showing partially-initialized 2048/progress bar while JS is still booting. */
body.mobile-mode.booting #mobile-header {
  display: none !important;
}
body.mobile-mode.booting .game-container {
  padding-top: 8px !important;
}
body.mobile-mode.booting #game2048,
body.mobile-mode.booting #dailyResultsContainer,
body.mobile-mode.booting #mobile-legend-overlay {
  display: none !important;
}

body.mobile-mode .game-container {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
  padding: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  /* Leave room for fixed header (set dynamically via --mobile-header-h; includes safe area). */
  padding-top: var(--mobile-header-h, calc(env(safe-area-inset-top, 0px) + 76px));
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Reduce browser/OS gesture interference on the 2048 grid area. */
body.mobile-mode #game2048 .board-container,
body.mobile-mode #game2048 .grid-container,
body.mobile-mode #game2048 .grid-cells {
  touch-action: none;
}

body.mobile-mode #tutorialBar {
  flex-wrap: wrap;
  justify-content: center;
}

body.mobile-mode #tutorialBar {
  display: none !important;
}

body.mobile-mode #modeIndicator {
  display: none !important;
}

body.mobile-mode #tutorialBar {
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  z-index: 2000;
}

body.mobile-mode #tutorialBar {
  top: 0;
}

body.mobile-mode #tutorialBar button {
  min-height: 44px;
}

/* Mobile fixed header (hamburger + progress bar). */
#mobile-header {
  display: none;
}

body.mobile-mode #mobile-header {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) 10px 6px;
  background: var(--page-bg, #faf8ef);
  z-index: 1000;
}

body.mobile-mode #mobile-header-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  margin: 0;
}

body.mobile-mode #mobile-header-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: var(--mobile-header-item);
}

body.mobile-mode #mobile-header-left-slot,
body.mobile-mode #mobile-header-spacer {
  min-height: var(--mobile-header-item);
  display: flex;
  align-items: center;
}

body.mobile-mode #mobile-header-left-slot {
  grid-column: 1;
  justify-self: start;
  justify-content: flex-start;
  gap: 4px;
}

body.mobile-mode #mobile-header-title {
  grid-column: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  height: var(--mobile-header-item);
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

body.mobile-mode #mobile-header-top.mobile-header-centered #mobile-header-title {
  justify-content: center;
}

body.mobile-mode #mobile-header-inline-actions-left,
body.mobile-mode #mobile-header-inline-actions-right {
  display: none;
  align-items: center;
  gap: 4px;
}

body.mobile-mode #mobile-header-money-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Header brand (logo + mode label). */
.header-brand {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--desktop-header-item);
  user-select: none;
  max-width: 100%;
  min-width: 0;
}

.header-logo {
  height: 90%;
  width: auto;
  display: block;
  flex: 0 0 auto;
}

.header-brand-text {
  font-size: 28px;
  font-weight: 800;
  /* Prevent descenders (e.g. "y" in "Daily") from being clipped in desktop Chrome. */
  line-height: 1.12;
  color: currentColor;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-daily-index {
  font-size: 0.68em;
  font-weight: 800;
  opacity: 0.85;
  display: inline-flex;
  align-items: center;
  line-height: 1.12;
  vertical-align: middle;
}

body:not(.mobile-mode) .header-daily-index {
  font-size: 0.78em;
}

body.mobile-mode .header-brand {
  height: var(--mobile-header-item);
  gap: 6px;
}

body.mobile-mode .header-brand-text {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.12;
  overflow: visible;
  text-overflow: clip;
}

body.mobile-mode #historyModal th {
  white-space: normal;
  line-height: 1.05;
}

body.mobile-mode #historyModal th .history-table-header-label {
  display: inline-block;
  white-space: normal;
  line-height: 1.05;
}

body.mobile-mode.desktop-mobile-layout .header-brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Daily/practice complete overlay */
#daily-complete-overlay,
#practice-complete-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  z-index: 1040;
  /* Do not block clicks (e.g., hamburger/menu/logo). We dismiss via a document listener instead. */
  pointer-events: none;
}

#daily-complete-overlay.visible,
#practice-complete-overlay.visible {
  display: flex;
}

#daily-complete-overlay .daily-complete-card,
#practice-complete-overlay .daily-complete-card {
  background: #fff;
  color: #000;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 28px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  max-width: min(600px, 94vw);
  min-height: 190px;
  pointer-events: auto;
}

#daily-complete-overlay .daily-complete-title,
#practice-complete-overlay .daily-complete-title {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 0;
  color: #000;
}

/* Daily-complete overlay: keyboard hint (desktop only). */
#daily-complete-overlay .daily-complete-hint,
#practice-complete-overlay .daily-complete-hint {
  font-size: 17px;
  font-weight: 900;
  color: #333;
  line-height: 1.1;
}
body.mobile-mode #daily-complete-overlay .daily-complete-hint,
body.mobile-mode #practice-complete-overlay .daily-complete-hint {
  display: none;
}

body.mobile-mode #daily-complete-overlay .daily-complete-title,
body.mobile-mode #practice-complete-overlay .daily-complete-title {
  font-size: 18px;
}

body.mobile-mode #mobile-header-spacer {
  grid-column: 3;
  justify-self: end;
  justify-content: flex-end;
  gap: 4px;
}

body.mobile-mode #mobile-header-bar {
  width: 100%;
}

body.mobile-mode .mobile-header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--mobile-header-item);
  height: var(--mobile-header-item);
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  background: #fff;
  color: #000;
  cursor: pointer;
  flex: 0 0 auto;
}

body.mobile-mode .mobile-header-action.is-on {
  background: #6aaa64;
  color: #fff;
  border-color: #538d4e;
}

body.mobile-mode .mobile-header-action .zoable-menu-icon {
  width: 22px;
  height: 22px;
}

body.mobile-mode #mobile-menu-button {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--mobile-header-item);
  height: var(--mobile-header-item);
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  background: #fff;
  color: #000;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

body.mobile-mode #mobile-menu-button svg {
  width: 22px;
  height: 22px;
  display: block;
}

body.mobile-mode #mobile-menu-dropdown {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 6px + var(--mobile-header-item) + 6px);
  left: 10px;
  min-width: 190px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  padding: 6px;
  z-index: 1050;
}

body.mobile-mode .mobile-menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 10px 10px;
  font-size: 16px;
  cursor: pointer;
}

body.mobile-mode .mobile-menu-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body.mobile-mode .mobile-menu-item:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

/* Menu rows: keep the left miniatures close to cap-height size. */
.zoable-menu-left {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.zoable-menu-icon {
  width: 1.43em;
  height: 1.43em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.zoable-menu-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Shared: small on/off switch used in menus + tutorial. */
.zoable-switch-row {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.zoable-switch {
  width: 46px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  transition: background 160ms ease;
}

.zoable-switch-knob {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  transform: translateX(0);
  transition: transform 160ms ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.zoable-switch-row.is-on .zoable-switch {
  background: #6aaa64;
}

.zoable-switch-row.is-on .zoable-switch-knob {
  transform: translateX(22px);
}

/* Tutorial: intro bullets + centered 2048 toggle. */
.tutorial-bullets {
  margin: 0 0 10px 18px;
  padding: 0;
}

.tutorial-break {
  height: 12px;
}

.tutorial-toggle-center {
  text-align: center;
  margin: 8px 0 18px;
}

.tutorial-2048-toggle {
  min-width: 180px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  color: #111;
}

.walkthrough-2048-toggle {
  font-size: 21px;
}

.tutorial-2048-toggle:active {
  transform: translateY(1px);
}

/* Menu: make the "2048" row align label + switch. */
body.mobile-mode .mobile-menu-item.zoable-switch-row,
.desktop-menu-item.zoable-switch-row {
  width: 100%;
}

body.mobile-mode #progress-bar-container {
  width: 100%;
  height: 20px;
  margin: 0;
  border-radius: 8px;
  position: relative;
  left: auto;
  top: auto;
  transform: none;
}

body.mobile-mode #progress-bar-container.progress-bar-compare-mode {
  height: 40px;
}

body.mobile-mode #progress-bar-fill {
  left: 0;
  top: 0;
  bottom: auto;
  width: 0;
  height: 100%;
  border-radius: 8px;
}

body.mobile-mode #progress-bar-fill.progress-bar-fill-compare-primary {
  height: 50%;
  border-radius: 0 !important;
}

body.mobile-mode #progress-bar-segments {
  flex-direction: row;
}

body.mobile-mode .progress-segment {
  border-top: none;
  border-left: none;
  border-right: 1px solid rgba(0, 0, 0, 0.22);
}
body.mobile-mode .progress-segment:last-child {
  border-right: none;
}

body.mobile-mode #progress-bar-markers {
  display: none;
}

body.mobile-mode #game2048,
body.mobile-mode #gameWordle {
  width: 100%;
  min-height: auto;
}

body.mobile-mode #game2048 {
  flex: 0 0 auto;
  padding: 6px;
  overflow-x: hidden;
  max-width: 94vw;
  width: auto;
  margin: 0 auto;
  min-height: 0 !important;
  align-items: center;
  gap: 4px;
  height: auto;
  box-sizing: border-box;
}

/* Make the 2048 grid itself tight (no extra blank column) on mobile. */
body.mobile-mode #game2048 .board-container {
  width: 445px !important;
  height: 445px !important;
  margin: 0 auto;
}
body.mobile-mode #game2048 .grid-cells,
body.mobile-mode #game2048 .grid-container {
  width: 445px !important;
  height: 445px !important;
}

body.mobile-mode .board-scale-wrap {
  display: block;
  overflow: visible;
}

body.mobile-mode #gameWordle {
  flex: 0 0 auto;
  padding: 8px;
  max-width: 100vw;
  width: 100vw;
  margin: 0;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
  min-height: 0 !important;
  height: auto !important;
  max-height: 999px;
  transition: max-height 260ms ease, padding-top 260ms ease, padding-bottom 260ms ease;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.mobile-mode .wordle-grid {
  margin-bottom: 10px;
}

/* The old search bar is no longer shown; the active Wordle row acts as input. */
.word-checker-container {
  display: none !important;
}

body.mobile-mode .search-key {
  height: 48px;
  margin: 0;
  border-radius: 6px;
  width: var(--mobile-key-w) !important;
  min-width: var(--mobile-key-w);
  flex: 0 0 auto;
}

/* Special keys should be a solid white pill (no "two-band" background bleed). */
.search-key-enter,
.search-key-backspace {
  /* Must override the later `.search-key { background: transparent; }`. */
  background: #fff !important;
}
body.mobile-mode .search-key-enter .key-content,
body.mobile-mode .search-key-backspace .key-content,
body.mobile-mode .search-key-enter .key-letter-container,
body.mobile-mode .search-key-backspace .key-letter-container {
  background: #fff !important;
  /* Only the outer button should have rounding; avoids "cut-out" corners showing through. */
  border-radius: 0 !important;
}

body.mobile-mode.dark-theme .search-key-enter .key-content,
body.mobile-mode.dark-theme .search-key-backspace .key-content,
body.mobile-mode.dark-theme .search-key-enter .key-letter-container,
body.mobile-mode.dark-theme .search-key-backspace .key-letter-container {
  background: var(--wordle-neutral-bg) !important;
}

body.mobile-mode .search-keyboard {
  --mobile-key-gap: 2px;
  --mobile-key-w: 36px;
  --mobile-key-wide-w: 72px;
  width: 100%;
  max-width: 560px;
  max-height: 260px;
  overflow: hidden;
  opacity: 1;
  transition: opacity 260ms ease, max-height 260ms ease;
  margin: 0 auto;
  position: relative;
}

body.mobile-mode .search-keyboard-row {
  display: flex;
  justify-content: center;
  gap: var(--mobile-key-gap);
  width: 100%;
}

body.mobile-mode .search-keyboard-row .search-key { max-width: none; }

body.mobile-mode .search-key-enter,
body.mobile-mode .search-key-backspace {
  width: var(--mobile-key-wide-w) !important;
  min-width: var(--mobile-key-wide-w);
}

/* Enter/Backspace keys: center the glyph within the whole key (no blank top number band). */
.search-key-enter .key-number-container,
.search-key-backspace .key-number-container {
  display: none;
}
.search-key-enter .key-letter-container,
.search-key-backspace .key-letter-container {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}
.search-key-enter .key-letter,
.search-key-backspace .key-letter {
  font-size: 39px;
  line-height: 1;
}

/* Desktop: make the Enter/Backspace glyphs a bit smaller and vertically centered. */
body:not(.mobile-mode) .search-key-enter .key-letter,
body:not(.mobile-mode) .search-key-backspace .key-letter {
  font-size: 35px;
  line-height: 1;
}

body.mobile-mode .search-key-enter .key-letter-container,
body.mobile-mode .search-key-backspace .key-letter-container {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}
body.mobile-mode .search-key-enter .key-letter,
body.mobile-mode .search-key-backspace .key-letter {
  font-size: 35px;
}

/* Hide "Guesses / Cost" header row on mobile (keeps indices intact). */
body.mobile-mode #gameWordle .wordle-row.header-row {
  display: none !important;
}

body.mobile-mode .search-key .key-number-container {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.mobile-mode .search-key .key-letter-container {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.mobile-mode .search-key .key-number {
  font-size: calc(13px * 0.90);
}

body.mobile-mode .search-key .key-letter {
  font-size: var(--mobile-legend-letter-font-size, 16px);
}

/* Desktop: make Enter/Backspace keys wider (Wordle-style). */
body:not(.mobile-mode) .search-key-enter,
body:not(.mobile-mode) .search-key-backspace {
  width: 68px;
}

body.mobile-mode .legend-container {
  display: block;
  font-size: 13px;
  line-height: 1.15;
  /* Mobile: dynamically size legend keys so each bucket stays on one line across devices. */
  --mobile-legend-col-gap: 6px;
  --mobile-legend-tile-w: 48px;
  --mobile-legend-key-h: 24px;
  --mobile-legend-tile-font-size: 15px;
  --mobile-legend-tile-mr: 4px;
  --mobile-legend-letter-mr: 2px;
  /* Fit 2 columns (left row: tile + 4 letters, right row: tile + 2 letters). */
  --mobile-legend-letter-w: clamp(
    12px,
    calc((min(520px, 94vw) - 122px - 2px) / 6),
    40px
  );
}
body.mobile-mode .legend-container > div {
  gap: var(--mobile-legend-col-gap) !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  max-width: 100% !important;
}
body.mobile-mode .legend-tile {
  width: var(--mobile-legend-tile-w) !important;
  height: var(--mobile-legend-key-h) !important;
  line-height: var(--mobile-legend-key-h) !important;
  font-size: var(--mobile-legend-tile-font-size) !important;
  margin-right: var(--mobile-legend-tile-mr) !important;
}
body.mobile-mode .legend-letter {
  width: var(--mobile-legend-letter-w) !important;
  height: var(--mobile-legend-key-h) !important;
  line-height: var(--mobile-legend-key-h) !important;
  font-size: var(--mobile-legend-letter-font-size, 16px) !important;
  margin-right: var(--mobile-legend-letter-mr) !important;
  box-sizing: border-box;
  overflow: hidden;
}
body.mobile-mode .legend-letter.legend-letter-split-host {
  display: inline-flex !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  padding: 0 !important;
}
body.mobile-mode .legend-container span {
  font-size: 13px !important;
  margin-right: 4px !important;
}
body.mobile-mode .legend-letter-content-with-alt,
body.mobile-mode .legend-letter-half,
body.mobile-mode .legend-letter-content-with-alt > span,
body.mobile-mode .legend-letter-half > span,
body.mobile-mode .legend-letter-content-with-alt * {
  margin-right: 0 !important;
}
body.mobile-mode .legend-letter-content-with-alt {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  line-height: 1 !important;
  overflow: hidden !important;
  align-items: stretch !important;
  justify-items: stretch !important;
}
body.mobile-mode .legend-letter-half {
  display: flex !important;
  flex: 1 1 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
body.mobile-mode .legend-letter-half > span {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  line-height: 1 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
body.mobile-mode .legend-letter-content-with-alt .legend-letter-main {
  font-size: inherit !important;
}
body.mobile-mode .legend-letter-content-with-alt .key-letter-alt {
  font-size: calc(1em - 2px) !important;
}
body.mobile-mode .legend-container > div > div {
  margin-bottom: 0 !important;
}

/* Mobile: hide the 2048 legend by default (it is shown temporarily via an overlay while pressing the progress bar). */
body.mobile-mode #game2048 .legend-container {
  display: none !important;
}

/* Mobile: legend is used in a keyboard/legend swipe panel (see `#mobile-kb-legend-panel`). */
body.mobile-mode #mobile-legend-overlay {
  position: static;
  width: min(520px, 94vw);
  margin: 2px auto 0 auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: block;
}

/* Mobile: keyboard/legend horizontal swipe panel (fixed height matching the keyboard). */
body.mobile-mode #mobile-kb-legend-panel {
  width: 100%;
  max-width: 560px;
  height: var(--mobile-kb-legend-h, 150px);
  /* Allow swipe-hint glyphs to sit outside the clipped content without affecting layout. */
  overflow: visible;
  margin: 0 auto;
  position: relative;
  touch-action: pan-y;
}

/* Hint that the keyboard/legend area is swipeable (no extra "key"). */
body.mobile-mode #mobile-kb-legend-panel .mobile-kb-legend-hint {
  position: absolute;
  top: 0;
  transform: translateY(-100%);
  font-size: 18px;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.35);
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.9);
  pointer-events: auto;
  z-index: 10;
  user-select: none;
  touch-action: manipulation;
}
body.mobile-mode #mobile-kb-legend-panel .mobile-kb-legend-hint-left { left: 8px; }
body.mobile-mode #mobile-kb-legend-panel .mobile-kb-legend-hint-right { right: 8px; }

body.mobile-mode #mobile-kb-legend-clip {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body.mobile-mode #mobile-kb-legend-track {
  height: var(--mobile-kb-legend-h, 150px);
  display: flex;
  flex-direction: row;
  width: 200%;
  transform: translateX(var(--mobile-kb-legend-x, 0px));
  transition: transform 220ms ease;
  will-change: transform;
}

body.mobile-mode .mobile-kb-legend-page {
  flex: 0 0 50%;
  height: var(--mobile-kb-legend-h, 150px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

body.mobile-mode.second-keyboard-disabled #mobile-kb-legend-panel .mobile-kb-legend-hint,
body.mobile-mode.second-keyboard-disabled #mobile-legend-overlay {
  display: none !important;
}

body.mobile-mode.second-keyboard-disabled #mobile-kb-legend-track {
  width: 100% !important;
  transform: translateX(0px) !important;
}

body.mobile-mode.second-keyboard-disabled .mobile-kb-legend-page[data-page="keyboard"] {
  flex: 0 0 100% !important;
}

body.mobile-mode.second-keyboard-disabled .mobile-kb-legend-page[data-page="legend"] {
  display: none !important;
}

/* In the swipe panel, the keyboard should fill the panel height without adding extra margins. */
body.mobile-mode #mobile-kb-legend-panel .search-keyboard {
  max-height: none;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Chrome/mobile can clip 1px of the top/bottom key borders if the keyboard is taller than the panel. */
  gap: var(--mobile-key-gap);
  margin: 0;
}

/* In the swipe panel, the legend should also fill the same height as the keyboard. */
body.mobile-mode #mobile-kb-legend-panel #mobile-legend-overlay {
  width: 100%;
  margin: 0;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

/* Mobile: legend enter/backspace buttons (bottom-right, aligned with the 256/512/1024 rows). */
body.mobile-mode #mobile-legend-overlay .legend-right-col {
  position: relative;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .legend-right-col {
  position: relative;
}

/* Mobile: in the swipe panel, make the legend fill the panel height (match keyboard). */
body.mobile-mode #mobile-kb-legend-panel #mobile-legend-overlay .legend-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
body.mobile-mode #mobile-kb-legend-panel #mobile-legend-overlay .legend-container > div {
  height: 100% !important;
  align-items: stretch !important;
}
body.mobile-mode #mobile-kb-legend-panel #mobile-legend-overlay .legend-container > div > div {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 0;
  box-sizing: border-box;
}
body.mobile-mode #mobile-kb-legend-panel #mobile-legend-overlay .legend-container > div > div > div {
  margin-bottom: 0 !important;
}

/* Desktop (2048 disabled): keyboard/legend horizontal swipe panel in the Wordle pane. */
#desktop-kb-legend-panel {
  display: none;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel {
  display: block;
  width: 100%;
  max-width: var(--desktop-kb-legend-w, 560px);
  height: var(--desktop-kb-legend-h, 170px);
  overflow: visible;
  margin: 0 auto;
  position: relative;
  touch-action: pan-y;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-clip {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-track {
  height: var(--desktop-kb-legend-h, 170px);
  display: flex;
  flex-direction: row;
  width: 200%;
  transform: translateX(0px);
  transition: transform 220ms ease;
  will-change: transform;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) .desktop-kb-legend-page {
  flex: 0 0 50%;
  height: var(--desktop-kb-legend-h, 170px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) .desktop-kb-legend-page[data-page="keyboard"] {
  align-items: flex-start;
  justify-content: flex-start;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) .desktop-kb-legend-page[data-page="legend"] {
  /* Match keyboard vertical placement (avoid legend being closer to the grid). */
  align-items: flex-start;
  justify-content: flex-start;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .search-keyboard {
  max-height: none;
  height: auto;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .legend-container {
  width: 100%;
  margin: 8px auto 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .desktop-kb-legend-hint {
  position: absolute;
  top: 0;
  transform: translateY(-100%);
  font-size: 18px;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.35);
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.9);
  pointer-events: auto;
  z-index: 10;
  user-select: none;
  cursor: pointer;
  touch-action: manipulation;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .desktop-kb-legend-hint-left { left: 8px; }
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .desktop-kb-legend-hint-right { right: 8px; }

/* Desktop: position hint arrows over the Q and P keys when available. */
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .desktop-kb-legend-hint-left {
  left: var(--desktop-kb-legend-hint-left, 8px);
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .desktop-kb-legend-hint-right {
  right: var(--desktop-kb-legend-hint-right, 8px);
}

body.mobile-mode #mobile-legend-overlay .legend-actions {
  position: absolute;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: auto;
  z-index: 20;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .legend-actions {
  position: absolute;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: auto;
  z-index: 20;
}
body.mobile-mode #mobile-legend-overlay .legend-action-btn {
  flex: 1 1 0;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 1px solid #000;
  border-radius: 3px;
  background: #fff;
  color: #111;
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .legend-action-btn {
  flex: 1 1 0;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 1px solid #000;
  border-radius: 3px;
  background: #fff;
  color: #111;
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* Shared inline SVG icons (e.g., Enter). Scale with font-size via `em`. */
.zoable-icon {
  width: 1em;
  height: 1em;
  display: block;
  fill: currentColor;
}

/* Keyboard Enter icon sizing tweaks. */
.search-key-enter .key-letter {
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-key-enter .zoable-icon {
  width: 1.05em;
  height: 1.05em;
}

/* Backspace icon alignment/sizing (keyboard). */
.search-key-backspace .key-letter {
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-key-backspace .zoable-icon {
  width: 1.05em;
  height: 1.05em;
}

/* Special keys (Enter/Backspace): single-area layout (no top number band). */
.search-key-enter .key-content,
.search-key-backspace .key-content {
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-key-enter .key-content.key-content-single,
.search-key-backspace .key-content.key-content-single {
  width: 100%;
  height: 100%;
}
.search-key-enter .key-letter,
.search-key-backspace .key-letter {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Desktop: reduce icon size ~20% and keep it centered within the key. */
body:not(.mobile-mode) .search-key-enter .zoable-icon,
body:not(.mobile-mode) .search-key-backspace .zoable-icon {
  width: 0.84em;
  height: 0.84em;
  transform: none;
}

/* Mobile keyboard: make the Enter icon larger and vertically centered. */
body.mobile-mode .search-key-enter .zoable-icon {
  width: 1.56em;
  height: 1.56em;
  transform: none;
}

body.mobile-mode .search-key-backspace .zoable-icon {
  width: 1.48em;
  height: 1.48em;
  transform: none;
}

body.mobile-mode #mobile-legend-overlay .legend-action-enter .zoable-icon {
  width: 1.2em;
  height: 1.2em;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .legend-action-enter .zoable-icon {
  width: 1em;
  height: 1em;
}

body.mobile-mode #mobile-legend-overlay .legend-action-backspace .zoable-icon {
  width: 1.08em;
  height: 1.08em;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .legend-action-backspace .zoable-icon {
  width: 0.95em;
  height: 0.95em;
}
body.mobile-mode #mobile-legend-overlay .legend-action-enter {
  flex: 2 1 0;
}
body.mobile-mode #mobile-legend-overlay .legend-action-backspace {
  flex: 1 1 0;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .legend-action-enter {
  flex: 2 1 0;
}
body.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .legend-action-backspace {
  flex: 1 1 0;
}

#mobile-legend-overlay {
  display: none;
}

body.mobile-mode #mobile-legend-overlay.legend-visible {
  display: block;
}

body.mobile-mode #game2048 .grid-container,
body.mobile-mode #game2048 .grid-cells,
body.mobile-mode #game2048 .board-container {
  touch-action: none;
}

body.mobile-mode .modal {
  padding: 10px;
}

body.mobile-mode .modal-content {
  margin: 10px auto;
  width: 94%;
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
}

body.mobile-mode .modal-scroll {
  padding: 12px;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

body.mobile-mode.desktop-mobile-layout #gameWordle .search-keyboard,
body.mobile-mode.desktop-mobile-layout #mobile-kb-legend-panel,
body.mobile-mode.desktop-mobile-layout #mobile-kb-legend-panel .mobile-kb-legend-hint {
  pointer-events: auto;
}

body.mobile-mode.desktop-mobile-layout .modal {
  padding: 0;
}

body.mobile-mode.desktop-mobile-layout .modal-content {
  margin: 5vh auto;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  max-height: 90dvh;
}

body.mobile-mode.desktop-mobile-layout .modal-scroll {
  padding: 20px;
  touch-action: auto;
  overscroll-behavior: auto;
}

/* FAQ: make the awesome-score table fit on mobile */
.faq-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body:not(.mobile-mode) .faq-awesome-cost-table {
  font-size: 17px !important;
}

body:not(.mobile-mode) .faq-awesome-cost-table th,
body:not(.mobile-mode) .faq-awesome-cost-table td {
  padding: 8px 14px !important;
}

body.mobile-mode .faq-awesome-cost-table {
  font-size: 13px !important;
}

body.mobile-mode .faq-awesome-cost-table th,
body.mobile-mode .faq-awesome-cost-table td {
  padding: 4px 7px !important;
}

/* Mobile two-position view: collapse Wordle rows when focusing on 2048. */
body.mobile-mode #gameWordle .wordle-row {
  max-height: 70px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 260ms ease, opacity 260ms ease, margin 260ms ease;
}

/* Narrow desktop (desktop-mobile-layout): allow row overflow so immediate hover
   tooltips for side swipe buttons are not clipped. */
body.mobile-mode.desktop-mobile-layout #gameWordle .wordle-row {
  overflow: visible;
}

body.mobile-mode.mobile-focus-2048 #gameWordle .wordle-row.header-row {
  max-height: 0;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}

body.mobile-mode.mobile-focus-2048 #gameWordle .wordle-row:not(.mobile-focus-row):not(.header-row) {
  max-height: 0;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}

body.mobile-mode.mobile-focus-2048 #gameWordle .wordle-grid {
  margin-bottom: 6px;
}

/* Mobile: keep per-guess cost column visible on narrow screens. */
body.mobile-mode #gameWordle .guess-wrapper {
  width: calc(var(--wordle-cell-size) * 5 + var(--wordle-cell-gap) * 4) !important;
  max-width: calc(var(--wordle-cell-size) * 5 + var(--wordle-cell-gap) * 4) !important;
  padding-right: 0;
  padding-left: 0;
  box-sizing: border-box;
}

body.mobile-mode #gameWordle .guess-cost {
  left: auto !important;
  right: calc(100% + 12px) !important;
  text-align: right;
  font-size: clamp(12px, 3.6vw, 18px);
}

/* Mobile: make "played" Wordle tiles as tall as the plan-input ("search") tiles. */
body.mobile-mode .wordle-cell {
  height: 51px;
}

body.mobile-mode .wordle-cell.plan-input-cell {
  padding: 0;
  width: 49px;
  height: 51px;
  border-width: 1px;
  border-color: #000;
  display: block;
}

body.mobile-mode #gameWordle {
  overflow: hidden;
}

body.mobile-mode.mobile-focus-2048 #gameWordle {
  padding-top: 4px;
  padding-bottom: 0;
}

body.mobile-mode.mobile-focus-2048 #game2048 {
  align-self: center;
}

/* Mobile: interactive swipe between expanded Wordle and focus-2048. */
body.mobile-mode.mobile-swipe-dragging #gameWordle,
body.mobile-mode.mobile-swipe-dragging #gameWordle .wordle-row {
  transition: none !important;
}

body.mobile-mode.mobile-swipe-dragging #gameWordle {
  padding-top: calc(4px + 4px * (1 - var(--mobile-wordle-collapse, 0)));
  padding-bottom: calc(8px * (1 - var(--mobile-wordle-collapse, 0)));
}

body.mobile-mode.mobile-swipe-dragging #gameWordle .search-keyboard {
  transition: none !important;
  pointer-events: none;
}

/* Mobile: second compression (hide keyboard/legend panel for extra 2048 space). */
body.mobile-mode #mobile-kb-legend-panel {
  transition: height 220ms ease, opacity 220ms ease, margin 220ms ease;
}
body.mobile-mode.mobile-kb-dragging #mobile-kb-legend-panel {
  transition: none !important;
}
/* While dragging the keyboard/legend reveal, disable Wordle's max-height transition so the pane
   tracks the finger immediately (avoids "late start" and clipped/stuck intermediate states). */
body.mobile-mode.mobile-kb-dragging #gameWordle {
  transition: none !important;
}
body.mobile-mode.mobile-focus-2048-2 #mobile-kb-legend-panel {
  height: 0px !important;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  pointer-events: none;
}
body.mobile-mode.mobile-focus-2048-2 #mobile-kb-legend-panel .mobile-kb-legend-hint {
  display: none;
}

/* Safety: if the mobile keyboard/legend panel exists while not in mobile-mode, hide it. */
body:not(.mobile-mode) #mobile-kb-legend-panel,
body:not(.mobile-mode) #mobile-kb-legend-panel .mobile-kb-legend-hint {
  display: none !important;
}

/* Prevent a one-frame "jump" of the 2048 pane when starting a drag from the 2nd-compressed state:
   keep the Wordle grid bottom margin tied to the same collapse variable during dragging. */
body.mobile-mode.mobile-swipe-dragging #gameWordle .wordle-grid {
  margin-bottom: calc(10px * (1 - var(--mobile-wordle-collapse, 0)));
}

body.mobile-mode.mobile-swipe-dragging #gameWordle .wordle-row:not(.mobile-focus-row):not(.header-row) {
  max-height: calc(70px * (1 - var(--mobile-wordle-collapse, 0)));
  opacity: calc(1 - var(--mobile-wordle-collapse, 0));
  margin: 0 0 calc(5px * (1 - var(--mobile-wordle-collapse, 0))) 0;
  pointer-events: none;
}

/* Mobile tall screens: if everything fits, disable the compression system entirely. */
body.mobile-mode.mobile-no-compression #gameWordle .wordle-row {
  max-height: none;
  opacity: 1;
  margin: 0 0 5px 0;
  pointer-events: auto;
}
body.mobile-mode.mobile-no-compression #gameWordle .search-keyboard {
  max-height: none;
  opacity: 1;
  pointer-events: auto;
}

body.mobile-mode.desktop-mobile-layout.mobile-no-compression .game-container {
  gap: 0;
}

body.mobile-mode.desktop-mobile-layout.mobile-no-compression #gameWordle {
  padding-top: 6px;
  padding-bottom: 0;
}

body.mobile-mode.desktop-mobile-layout.mobile-no-compression .wordle-grid {
  margin-bottom: 4px;
}

body.mobile-mode.desktop-mobile-layout.mobile-no-compression #mobile-kb-legend-panel {
  margin-top: -4px;
}

body.mobile-mode.desktop-mobile-layout.mobile-no-compression #game2048 {
  padding-top: 0;
  margin-top: -10px;
}

/* Global toast message (Wordle-style). */
#global-message {
  position: fixed;
  top: calc(var(--desktop-header-h, 0px) - 20px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: max-content;
  max-width: min(560px, 92vw);
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: var(--ui-message-font-size, 16px);
  line-height: 1.2;
  text-align: center;
  margin: 0 !important;
  opacity: 0;
  pointer-events: none;
  z-index: 3000;
  transition: opacity 160ms ease, transform 160ms ease;
}

body.mobile-mode #global-message {
  top: calc(var(--mobile-header-h, 0px) + 10px);
}

#global-message.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* First-visit interactive walkthrough (blocks input until completed). */
#walkthroughModal {
  z-index: 3200;
  padding: 0;
  background-color: rgba(0, 0, 0, 0);
}

#walkthroughModal .walkthrough-toast {
  position: fixed;
  top: calc(50% - clamp(36px, 7vh, 72px));
  left: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: min(640px, 92vw);
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: var(--ui-message-font-size, 16px);
  line-height: 1.25;
  text-align: center;
  box-sizing: border-box;
  pointer-events: auto;
}

body.mobile-mode #walkthroughModal .walkthrough-toast {
  top: calc(50% - clamp(36px, 7vh, 72px));
}

#walkthroughModal .walkthrough-skip-button {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  border: 0;
  border-radius: 999px;
  background: #2e7d32;
  color: #fff;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
  cursor: pointer;
}

body.mobile-mode #walkthroughModal .walkthrough-skip-button {
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  font-size: 14px;
  padding: 10px 16px;
}

#walkthroughModal .walkthrough-toast .walkthrough-toggle-row {
  display: block;
  width: 100%;
  margin-top: 10px;
}

#walkthroughModal .walkthrough-toast .walkthrough-2048-toggle {
  width: 100%;
  box-sizing: border-box;
  display: flex;
}

@keyframes walkthrough-highlight-blink {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.0), 0 0 0 0 rgba(106,170,100,0.0); }
  45% { box-shadow: 0 0 0 3px rgba(255,255,255,0.85), 0 0 0 10px rgba(106,170,100,0.22); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.0), 0 0 0 0 rgba(106,170,100,0.0); }
}

.walkthrough-highlight-blink {
  animation: walkthrough-highlight-blink 0.55s ease-in-out 0s 2;
  border-radius: 10px;
}

/* Make daily mode more visually distinct on mobile. */
body.mobile-mode.mode-daily #mobile-header {
  background: var(--page-bg, #d6f1ff);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.mobile-mode.mode-practice #mobile-header {
  background: var(--page-bg, #faf8ef);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.mobile-mode.mode-daily #mobile-header-title {
  color: #0a3d66;
}

body.mobile-mode.mode-daily #progress-bar-container {
  border-color: rgba(10, 61, 102, 0.35);
}

body.mobile-mode.mode-daily #gameWordle {
  background: var(--page-bg, #d6f1ff);
}

body.dark-theme.mode-daily #mobile-header,
body.dark-theme.mode-daily #gameWordle,
body.dark-theme.mode-daily #dailyResultsContainer,
body.dark-theme.mode-daily #mobileBetweenPanesResultsContainer {
  background: var(--page-bg) !important;
}

body.dark-theme.mode-practice #mobile-header,
body.dark-theme.mode-practice #gameWordle,
body.dark-theme.mode-practice #dailyResultsContainer,
body.dark-theme.mode-practice #mobileBetweenPanesResultsContainer {
  background: var(--page-bg) !important;
}

body.dark-theme.mode-daily #mobile-header-title {
  color: #dcefff !important;
}

body.dark-theme.mode-daily #progress-bar-container {
  border-color: rgba(176, 215, 235, 0.35) !important;
}

/* Mobile: under-pane action buttons belong under the 2048 pane. */
body.mobile-mode #dailyResultsContainer {
  margin-top: 2px !important;
  margin-bottom: 2px !important;
}

/* The "↑" Wordle-expand shortcut is mobile-only. */
body:not(.mobile-mode) #mobileExpandWordleButton {
  display: none !important;
}

body.mobile-mode #mobileExpandWordleButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding-left: 14px;
  padding-right: 14px;
  line-height: 1;
  font-size: 16px;
  letter-spacing: 0.6px;
}

body.mobile-mode #practiceShareUnderButton {
  order: 0;
}

body.mobile-mode #practiceNewGameButton {
  order: 1;
}

body.mobile-mode #mobileExpandWordleButton {
  order: 2;
}

/* Wordle-only mode: no need for the ↑ button. */
body.mobile-mode.disable-2048 #mobileExpandWordleButton {
  display: none !important;
}

body.mobile-mode #dailyResultsContainer {
  position: relative;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  background: var(--page-bg, #faf8ef);
  padding-left: 8px;
  padding-right: 8px;
  box-sizing: border-box;
  min-height: 44px; /* ensures the row has height even if ↑ is the only visible button */
  justify-content: center !important;
  text-align: center;
  gap: 6px !important;
}

body.mobile-mode #mobileBetweenPanesResultsContainer {
  width: 100%;
  margin: 2px 0;
  background: var(--page-bg, #faf8ef);
  padding: 4px 8px 2px;
  box-sizing: border-box;
  justify-content: center;
  text-align: center;
  gap: 6px !important;
  flex-wrap: wrap;
}

#dailyResultsContainer {
  background: var(--page-bg, #faf8ef);
}

/* Mobile: slightly narrower green action buttons so more fit on one row. */
body.mobile-mode .see-results-button {
  padding-left: 18px;
  padding-right: 18px;
  white-space: nowrap;
}

/* Optionally, reduce the gap between game panes */
.game-container {
  display: flex;
  flex-direction: row;
  gap: 2px;  /* minimal gap */
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

/* Prevent accidental text selection in the main game UI (costs, emojis, labels, etc.). */
.game-container,
.game-container *,
#mobile-header,
#mobile-header *,
#progress-bar-container,
#progress-bar-container *,
#dailyResultsContainer,
#dailyResultsContainer *,
#global-message,
#mobile-legend-overlay,
#mobile-legend-overlay * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Desktop: progress bar on top spanning both panes; panes side-by-side below */
body:not(.mobile-mode) .game-container {
  display: grid;
  grid-template-columns: var(--desktop-2048-pane-w) var(--desktop-wordle-pane-w);
  grid-template-rows: auto auto;
  grid-template-areas:
    "bar bar"
    "g2048 gwordle";
  column-gap: var(--desktop-pane-gap);
  row-gap: 6px;
  justify-content: center;
  align-items: start;
}

body:not(.mobile-mode) #progress-bar-container { grid-area: bar; }
body:not(.mobile-mode) #game2048 { grid-area: g2048; }
body:not(.mobile-mode) #gameWordle { grid-area: gwordle; }

/* Ensure the desktop fixed header doesn't overlap the progress bar / panes. */
body:not(.mobile-mode) .game-container {
  padding-top: max(0px, calc(var(--desktop-header-h, 0px) - 6px));
}

body:not(.mobile-mode) #progress-bar-container {
  margin-top: -6px !important;
  align-self: start;
}

/* --- Wordle-only mode (Disable 2048) --- */
body.disable-2048 #game2048 {
  display: none !important;
}

body.disable-2048:not(.mobile-mode) .game-container {
  grid-template-areas:
    "bar bar"
    "gwordle gwordle";
}

body.disable-2048:not(.mobile-mode) #gameWordle {
  grid-column: 1 / -1;
  justify-self: stretch;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

@media (max-width: 800px) {
  .game-container {
    flex-direction: column;
    align-items: center;
  }
}

/* ---------------- 2048 Pane ---------------- */
#game2048 {
  position:relative;
  width: 500px;
  min-height: 612px;  
  background: #bbada0;
  padding: 15px;
  padding-bottom: 20px;
  border-radius: 6px;
  --tile-radius: 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Practice mode: circular 2048 tiles + circular grid cells. */
body.mode-practice #game2048 {
  --tile-radius: 50%;
}

/* Initial-load skeletons: show something immediately before JS builds the game DOM. */
#game2048:empty::before {
  content: "";
  display: block;
  height: 520px;
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.10), rgba(255,255,255,0.18), rgba(255,255,255,0.10));
  background-size: 240px 100%;
  animation: boot-skeleton 1.1s ease-in-out infinite;
}

#gameWordle:empty::before {
  content: "";
  display: block;
  height: 520px;
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.04), rgba(0,0,0,0.08), rgba(0,0,0,0.04));
  background-size: 240px 100%;
  animation: boot-skeleton 1.1s ease-in-out infinite;
}

@keyframes boot-skeleton {
  0% { background-position: -240px 0; }
  100% { background-position: calc(100% + 240px) 0; }
}

#game2048::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.game2048-center-notice {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  max-width: min(420px, 92%);
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
  border-radius: 12px;
  text-align: center;
  font-size: var(--ui-message-font-size, 15px);
  line-height: 1.25;
  pointer-events: none;
}

body.mobile-mode #game2048 .game2048-center-notice {
  font-size: 17px !important;
}

@keyframes pane-blink {
  0% { opacity: 0; box-shadow: none; }
  45% { opacity: 1; box-shadow: 0 0 0 3px rgba(255,255,255,0.22) inset, 0 0 18px rgba(255,255,255,0.18); }
  100% { opacity: 0; box-shadow: none; }
}

#game2048.pane-blink::after {
  animation: pane-blink 0.45s ease-in-out 0s 2;
}


@media (max-width: 800px) {
  #game2048 {
    width: 90%;
  }
}

.grid-container {
  position: relative;
  height: 445px;  /* fixed board height (4*100 + 3*15) */
}

/* Static grid cells background (empty cells) */
.grid-cells {
  position: absolute;
  top: 0;
  left: 0;
  width: 445px;
  height: 445px;
  z-index: 1;
}

.grid-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}
.grid-row:last-child {
  margin-bottom: 0;
}
.grid-cell {
  width: 100px;
  height: 100px;
  background: #cdc1b4;
  border-radius: var(--tile-radius);
  margin: 0;
}

/* 2048 Tile Styles – 100×100px tiles with 30px font */
.tile {
  position: absolute;
  width: 100px;
  height: 100px;
  margin: 0;
  border-radius: var(--tile-radius);
  transition: transform var(--tile-slide-ms, 120ms) ease-in-out;
  z-index: 2;
  user-select: none;
  will-change: transform;
}

.tile-ghost {
  pointer-events: none;
}

.tile-inner {
  width: 100%;
  height: 100%;
  border-radius: var(--tile-radius);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 30px;
  font-weight: bold;
  text-align: center;
  box-sizing: border-box;
  background: #eee4da;
  color: #776e65;
}

.tile-remove {
  opacity: 0;
}
.tile-remove .tile-inner {
  transform: scale(0.5);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

@keyframes tile-appear {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

@keyframes tile-pop {
  0% { transform: scale(0.92); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.tile.tile-vanish .tile-inner {
  animation: tile-vanish var(--tile-vanish-ms, 120ms) ease-in forwards;
}

@keyframes tile-vanish {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0); opacity: 0; }
}

.tile.tile-new .tile-inner {
  animation: tile-appear var(--tile-appear-ms, 200ms) ease-in-out;
}

.tile.tile-merged .tile-inner {
  animation: tile-pop var(--tile-pop-ms, 200ms) ease-in-out;
}

/* Specific tile colors */
.tile-2 .tile-inner    { background: #eee4da; color: #776e65; }
.tile-4 .tile-inner    { background: #ede0c8; color: #776e65; }
.tile-8 .tile-inner    { background: #f2b179; color: #f9f6f2; }
.tile-16 .tile-inner   { background: #f59563; color: #f9f6f2; }
.tile-32 .tile-inner   { background: #f67c5f; color: #f9f6f2; }
.tile-64 .tile-inner   { background: #f65e3b; color: #f9f6f2; }
.tile-128 .tile-inner  { background: #edcf72; color: #f9f6f2; }
.tile-256 .tile-inner  { background: #edcc61; color: #f9f6f2; }
.tile-512 .tile-inner  { background: #edc850; color: #f9f6f2; }
.tile-1024 .tile-inner { background: #edc53f; color: #f9f6f2; }
.tile-2048 .tile-inner { background: #edc22e; color: #f9f6f2; }

body.dark-theme .tile-2 .tile-inner    { background: #d7cfc4; color: #5f564d; }
body.dark-theme .tile-4 .tile-inner    { background: #d7c8af; color: #5f564d; }
body.dark-theme .tile-8 .tile-inner    { background: #d19a67; color: #f9f6f2; }
body.dark-theme .tile-16 .tile-inner   { background: #cf8456; color: #f9f6f2; }
body.dark-theme .tile-32 .tile-inner   { background: #cf6e54; color: #f9f6f2; }
body.dark-theme .tile-64 .tile-inner   { background: #cf5536; color: #f9f6f2; }
body.dark-theme .tile-128 .tile-inner  { background: #c7ad60; color: #f9f6f2; }
body.dark-theme .tile-256 .tile-inner  { background: #c5a954; color: #f9f6f2; }
body.dark-theme .tile-512 .tile-inner  { background: #c2a543; color: #f9f6f2; }
body.dark-theme .tile-1024 .tile-inner { background: #be9f34; color: #f9f6f2; }
body.dark-theme .tile-2048 .tile-inner { background: #bb9926; color: #f9f6f2; }

/* Legend removed */

/* ---------------- Wordle Pane ---------------- */
#gameWordle {
  width: 520px;
  /* Set height if defined; for example: */
  min-height: 612px; 
  background-color: var(--wordle-surface-bg, #f3f3f3);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

body:not(.mobile-mode) #gameWordle {
  padding-top: 15px;
  padding-bottom: 20px;
  box-sizing: border-box;
}


@media (max-width: 800px) {
  #gameWordle {
    width: 90%;
  }
}

/* Global message is now an overlay toast (see earlier `#global-message` rule). */

/* Search (Word Checker) Bar */
.word-checker-container {
  display: flex;
  margin-top: 20px;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}
.checker-message {
  height: 20px;
  background-color: black;
  color: white;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 5px;
  text-align: center;
}
.word-checker-bar {
  display: flex;
  gap: 5px;
  align-items: center;
}

.word-checker-bar.dict-clickable,
.word-checker-bar.dict-clickable .checker-cell {
  cursor: pointer;
}

.word-checker-bar.dict-clickable:hover .checker-cell {
  border-color: #888;
}

.word-checker-bar.dict-clickable .checker-cell.dict-link-disabled {
  cursor: default;
}

.checker-cell {
  width: 40px;
  height: 40px;
  border: 1px solid #000;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  background-color: #fff;
  box-sizing: border-box;
  outline: none;
}

@keyframes reserve1024Pulse {
  0% {
    outline-color: rgba(255, 191, 0, 0);
    box-shadow: 0 0 0 rgba(237, 197, 63, 0);
  }
  50% {
    outline-color: #ffbf00;
    box-shadow: 0 0 0 3px rgba(255, 191, 0, 0.35), 0 0 14px rgba(237, 197, 63, 0.95);
  }
  100% {
    outline-color: rgba(255, 191, 0, 0);
    box-shadow: 0 0 0 rgba(237, 197, 63, 0);
  }
}

.checker-cell.reserve-1024-target .key-letter-container,
.guess-cells-container .wordle-cell.reserve-1024-target {
  animation: reserve1024Pulse 1.7s ease-in-out infinite;
  animation-delay: var(--reserve-1024-pulse-delay, 0s);
}

.search-key.reserve-1024-target-key,
.legend-letter.reserve-1024-target-legend {
  outline: 3px solid transparent;
  outline-offset: -3px;
  animation: reserve1024Pulse 1.7s ease-in-out infinite;
  animation-delay: var(--reserve-1024-pulse-delay, 0s);
}

.search-key.reserve-1024-target-key .key-number-container,
.search-key.reserve-1024-target-key .key-letter-container {
  border-color: #ffbf00 !important;
}

body.search-bar-knowledge-outlines .checker-cell .key-content {
  width: 100%;
  height: 100%;
  position: relative;
  box-sizing: border-box;
}

body.search-bar-knowledge-outlines .checker-cell.knowledge-gray .key-content::after,
body.search-bar-knowledge-outlines .checker-cell.knowledge-yellow .key-content::after,
body.search-bar-knowledge-outlines .checker-cell.knowledge-green .key-content::after {
  content: "";
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 3;
}

body.search-bar-knowledge-outlines .checker-cell.knowledge-gray .key-content::after {
  border: 2px dotted #000;
}

body.search-bar-knowledge-outlines .checker-cell.knowledge-yellow .key-content::after {
  border: 2px dotted #c9b458;
}

body.search-bar-knowledge-outlines .checker-cell.knowledge-green .key-content::after {
  border: 2px solid #6aaa64;
}

body.search-bar-knowledge-outlines .checker-cell.knowledge-gray,
body.search-bar-knowledge-outlines .checker-cell.knowledge-yellow,
body.search-bar-knowledge-outlines .checker-cell.knowledge-green {
  outline: none;
}

/* Desktop: nudge the checker letters slightly lower inside their square. */
body:not(.mobile-mode) .word-checker-bar .checker-cell .key-letter {
  display: inline-block;
  transform: translateY(9px);
  font-size: calc(18px - 2pt);
}

/* Desktop: the "Q" glyph sits a bit low; nudge it slightly higher. */
body:not(.mobile-mode) .word-checker-bar .checker-cell .key-letter.checker-letter-q {
  transform: translateY(0px);
}
.checker-back-button {
  width: 40px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;
}

/* Search Keyboard */
.search-keyboard {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  margin-bottom: 10px;
}

/* Desktop: nudge the keyboard down so key tops align with the legend squares. */
body:not(.mobile-mode) .search-keyboard {
  padding-top: 0;
  margin-top: 8px;
  /* Keep the overall keyboard height stable while making keys larger. */
  gap: 9px;
}
.search-keyboard-row {
  display: flex;
  gap: 5px;
}

/* Desktop: compensate for wider keys by slightly reducing horizontal spacing. */
body:not(.mobile-mode) .search-keyboard-row {
  gap: 4px;
}
.search-key {
  display: inline-block;
  width: 42px;         /* adjust width as needed */
  height: 54px;        /* adjust height as needed */
  padding: 0;
  margin: 2px;         /* or 0 if you prefer */
  border: 1px solid #000;
  box-sizing: border-box;
  border-radius: 8px; /* Adjust the radius as desired */
  user-select: none;
  background: transparent;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
}

/* Desktop: make keys larger but keep the keyboard's top/bottom alignment stable. */
body:not(.mobile-mode) .search-key {
  width: 44px;
  height: 67px;
  margin: 0;
  cursor: pointer;
}

body:not(.mobile-mode) .search-key:disabled {
  cursor: pointer;
}

/* Desktop: Enter/Backspace keys are double-width. */
body:not(.mobile-mode) .search-key-enter,
body:not(.mobile-mode) .search-key-backspace {
  width: 70px;
}

/* Desktop: scale key fonts up now that keys are larger (letter + cost). */
body:not(.mobile-mode) .search-key:not(.search-key-enter):not(.search-key-backspace) .key-letter {
  font-size: calc(18px * 1.265);
}
body:not(.mobile-mode) .search-key:not(.search-key-enter):not(.search-key-backspace) .key-number {
  font-size: calc(12px * 1.265);
}
.key-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}
.key-number {
  font-size: 12px;
 /* color: #555;*/
  line-height: 1;
  font-weight: 700;
}
.key-letter {
  font-size: 18px;
  font-weight: bold;
}
.key-letter-container-with-alt {
  gap: 0;
  overflow: hidden;
  font-size: 18px;
  padding: 0;
}
.key-letter-split,
.legend-letter-content-with-alt {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  flex: 1 1 auto;
  width: 100%;
  min-width: 100%;
  height: 100%;
  line-height: 1;
  overflow: hidden;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.key-letter-half,
.legend-letter-half {
  flex: 1 1 0;
  width: 50%;
  max-width: 50%;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: inherit;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.key-letter-split .key-letter-half:first-child,
.legend-letter-content-with-alt .legend-letter-half:first-child {
  border-top-left-radius: inherit;
  border-bottom-left-radius: inherit;
}
.key-letter-split .key-letter-half:last-child,
.legend-letter-content-with-alt .legend-letter-half:last-child {
  border-top-right-radius: inherit;
  border-bottom-right-radius: inherit;
}
.key-letter-container-with-alt .key-letter {
  font-size: inherit !important;
}
.legend-letter-main {
  font-size: inherit;
}
.key-letter-alt {
  font-size: calc(1em - 2px);
  font-weight: 600;
  color: #9a9a9a;
  line-height: 1;
  align-self: center;
  transform: none;
}
body.dark-theme .key-letter-alt {
  color: #b8b8b8;
}
.key-letter-alt-half[data-status] .key-letter-alt,
.legend-letter-alt-half[data-status] .key-letter-alt {
  color: #ececec;
}
body.dark-theme .key-letter-alt-half[data-status] .key-letter-alt,
body.dark-theme .legend-letter-alt-half[data-status] .key-letter-alt {
  color: #f2f2f2;
}
body:not(.mobile-mode) .search-key:not(.search-key-enter):not(.search-key-backspace) .key-letter-container-with-alt {
  font-size: calc(18px * 1.265);
}
.search-key-alt-preview {
  position: fixed;
  z-index: 100000;
  transform: translate(-50%, -100%);
  min-width: 42px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid #000;
  border-radius: 10px;
  background: #f9f6f2;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}
body.dark-theme .search-key-alt-preview {
  background: #2f2f2f;
  color: #fff;
  border-color: #9a9a9a;
}

/* Plan Button */
.plan-button {
  margin-left: 10px;
  padding: 5px 10px;
  font-size: 16px;
  cursor: pointer;
  background-color: #d3d3d3;
}



/* Wordle Guess Keyboard – using same markup as search keyboard */
.wordle-keyboard {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  margin-top: 10px;
}
.wordle-keyboard-row {
  display: flex;
  gap: 5px;
}
.wordle-key {
  width: 45px;
  height: 45px;
  background-color: #fff;
  border: 1px solid #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

/* Planned Guess Letters */
.planned-key {
  display: inline-block;
  text-align: center;
}
.planned-key .key-number {
  font-size: 12px;
  color: #000;
  display: block;
  line-height: 1;
}
.planned-key .key-letter {
  font-size: 18px;
  font-weight: bold;
  display: block;
}

/* Desktop: scale planned-cell number/letter with the larger Wordle cells. */
body:not(.mobile-mode) .planned-key .key-number {
  font-size: calc(var(--wordle-cell-size) * 0.26);
}
body:not(.mobile-mode) .planned-key .key-letter {
  font-size: calc(var(--wordle-cell-size) * 0.34);
}
.planned-letter {
  background-color: var(--wordle-pending-plan-bg, #e0e0e0) !important;
}
.legend-container {
  position: relative;
  margin-top: 0px;
  z-index: 10;
  text-align: left;
  color: #000;
  font-size: 23px;
  line-height: 1.4;
}

/* Desktop: keep the 2048 legend aligned with the 2048 board (both are 445px wide). */
body:not(.mobile-mode) #game2048 .legend-container {
  width: 445px;
  margin-left: auto;
  margin-right: auto;
}

.key-number-container {
  flex: 0 0 45%;    /* occupies 30% of the button’s height */
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  border-top-left-radius: 8px;   
  border-top-right-radius: 8px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  transition: background-color 140ms ease, transform 140ms ease;

}
.key-letter-container {
  flex: 1;          /* occupies the remaining height */
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.key-number {
  transition: color 140ms ease, transform 140ms ease;
}


@media (min-width: 801px) {
  #game2048,
  #gameWordle {
    height: 700px;
  }
}

/* New: Ensure the plan row elements are in one horizontal row */
.plan-row {
  display: flex;
  align-items: center;
}


/* (Optional) You can also tweak the legend tiles if needed */
.legend-tile,
.legend-letter {
  vertical-align: middle;
  user-select: none;
  box-sizing: border-box;
}

.legend-letter.legend-letter-revealed {
  border-width: 1px !important;
}

.search-key.vowel-outline {
  border-width: var(--zoable-vowel-outline-w);
}

.search-key.vowel-outline .key-content {
  width: calc(100% + (var(--zoable-vowel-fill-overlap) * 2));
  height: calc(100% + (var(--zoable-vowel-fill-overlap) * 2));
  margin: calc(-1 * var(--zoable-vowel-fill-overlap));
}

.legend-letter.legend-vowel-outline {
  border-width: var(--zoable-vowel-outline-w) !important;
}

/* Create Puzzle editor: highlight the currently selected letter (for swapping costs). */
.search-key.create-puzzle-selected,
.legend-letter.create-puzzle-selected,
.tile.create-puzzle-selected {
  outline: 3px solid #ffbf00;
  outline-offset: -3px;
  box-shadow: 0 0 0 3px rgba(255, 191, 0, 0.35);
}
.search-key.create-puzzle-selected .key-number-container,
.search-key.create-puzzle-selected .key-letter-container {
  border-color: #ffbf00 !important;
}

/* Legend number tile: thin black outline around the blue wrapper (not the text). */
.legend-tile {
  border: 1px solid #000;
  box-sizing: border-box;
}

/* Practice mode: make the legend's number pills horizontal ellipses. */
body.mode-practice .legend-tile {
  border-radius: 999px !important;
}

body.mode-practice .legend-letter {
  border-radius: 999px !important;
  overflow: hidden;
}

body.mode-practice .legend-letter .legend-letter-content-with-alt {
  border-radius: inherit;
}

body.mode-practice .legend-letter .legend-letter-half:first-child {
  border-top-left-radius: inherit;
  border-bottom-left-radius: inherit;
}

body.mode-practice .legend-letter .legend-letter-half:last-child {
  border-top-right-radius: inherit;
  border-bottom-right-radius: inherit;
}

/* Practice mode: make the keyboard keys more rounded (desktop + mobile). */
body.mode-practice .search-key {
  border-radius: 999px;
}

body.mode-practice .search-key .key-number-container {
  border-top-left-radius: 999px;
  border-top-right-radius: 999px;
}

body.mode-practice .search-key .key-letter-container {
  border-bottom-left-radius: 999px;
  border-bottom-right-radius: 999px;
}
body.mode-practice .search-key .key-number-container {
  border-top-left-radius: 999px;
  border-top-right-radius: 999px;
}
body.mode-practice .search-key .key-letter-container {
  border-bottom-left-radius: 999px;
  border-bottom-right-radius: 999px;
}

/* Practice mode: round the mobile legend Enter/Backspace buttons too. */
body.mode-practice #mobile-legend-overlay .legend-action-btn {
  border-radius: 999px;
}
body.mode-practice.desktop-kb-legend-enabled:not(.mobile-mode) #desktop-kb-legend-panel .legend-action-btn {
  border-radius: 999px;
}

/* Practice mode: make keyboard Enter/Backspace match the pill style (their CSS overrides top radii). */
body.mode-practice .search-key-enter .key-letter-container,
body.mode-practice .search-key-backspace .key-letter-container {
  border-radius: 999px;
}

/* Ensure the Wordle grid spans full width */
.wordle-grid {
  width: 100%;
  margin-bottom: 20px;
}

/* Desktop: keep the keyboard flush with the grid so it aligns with the 2048 legend. */
body:not(.mobile-mode) .wordle-grid {
  margin-bottom: 0;
}

/* Header row styling */
.wordle-row.header-row {
  display: none !important;
}

.wordle-row {
  position: relative;
  width: 100%;
  margin-bottom: var(--wordle-cell-gap);
}

/* Keep exactly 5 vertical gaps so the grid height is deterministic. */
.wordle-row:last-child {
  margin-bottom: 0;
}

.guess-cells-container {
  display: flex;
  gap: var(--wordle-cell-gap);
  justify-content: center;
}

/* Wordle cells styling */
.wordle-cell {
  width: var(--wordle-cell-size);
  height: var(--wordle-cell-size);
  border: 2px solid #d3d6da;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  background-color: #fff;
  transition: background-color 0.3s ease;
  user-select: none;
}

/* Desktop: scale the "search bar" (plan-input) tiles so the cost numbers use the available space. */
body:not(.mobile-mode) .wordle-cell.plan-input-cell {
  padding: 0;
  border-width: 1px;
  border-color: #000;
  display: block;
}
body:not(.mobile-mode) .wordle-cell.plan-input-cell .key-content {
  height: 100%;
}
body:not(.mobile-mode) .wordle-cell.plan-input-cell .key-number-container {
  height: calc(var(--wordle-cell-size) * 0.34) !important;
  line-height: calc(var(--wordle-cell-size) * 0.34) !important;
  font-size: calc(var(--wordle-cell-size) * 0.24) !important;
}
body:not(.mobile-mode) .wordle-cell.plan-input-cell .key-number {
  font-size: inherit !important;
}
body:not(.mobile-mode) .wordle-cell.plan-input-cell .key-letter-container {
  height: calc(var(--wordle-cell-size) * 0.66) !important;
  font-size: calc(var(--wordle-cell-size) * 0.44) !important;
}
body:not(.mobile-mode) .wordle-cell.plan-input-cell .key-letter {
  font-size: inherit !important;
  display: inline-block;
  transform: translateY(3px);
}

/* Desktop: "Q" in the search bar / plan-input tiles should sit slightly higher. */
body:not(.mobile-mode) .wordle-cell.plan-input-cell .key-letter.checker-letter-q {
  transform: translateY(0px);
}

/* Desktop: scale the letter font with the larger grid cells. */
body:not(.mobile-mode) .wordle-cell {
  font-size: calc(var(--wordle-cell-size) * 0.46);
}

@keyframes subtle-complete-blink {
  0% { filter: brightness(1); box-shadow: none; }
  40% { filter: brightness(1.12); box-shadow: 0 0 0 2px rgba(255,255,255,0.35) inset; }
  100% { filter: brightness(1); box-shadow: none; }
}

.wordle-row.guess-completed-blink .wordle-cell {
  animation: subtle-complete-blink 0.55s ease-in-out 0s 2;
}

@keyframes wordle-win-blink {
  0% { filter: brightness(1); box-shadow: none; }
  40% { filter: brightness(1.18); box-shadow: 0 0 0 3px rgba(255,255,255,0.45) inset; }
  100% { filter: brightness(1); box-shadow: none; }
}

.wordle-row.wordle-win-blink .wordle-cell {
  animation: wordle-win-blink 0.55s ease-in-out 0s 2;
}

@keyframes wordle-win-wave {
  0% { transform: translateY(0); }
  35% { transform: translateY(-12px); }
  60% { transform: translateY(0); }
  78% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

.wordle-row.wordle-win-wave .wordle-cell {
  animation: wordle-win-wave 0.55s ease-in-out 0s 1 both;
  will-change: transform;
}

/* Ensure the win celebration tiles render above other UI layers (especially on mobile with a fixed header). */
.wordle-row.wordle-win-wave,
.wordle-row.wordle-win-blink {
  z-index: 2005;
}
.wordle-row.wordle-win-wave .wordle-cell,
.wordle-row.wordle-win-blink .wordle-cell {
  position: relative;
  z-index: 2006;
}

body.mobile-mode #gameWordle.wordle-win-animating {
  position: relative;
  z-index: 2004;
  overflow: visible;
}
body.mobile-mode #gameWordle.wordle-win-animating .wordle-row.wordle-win-wave,
body.mobile-mode #gameWordle.wordle-win-animating .wordle-row.wordle-win-blink {
  overflow: visible !important;
}

.wordle-cell2 {
  display: inline-block;
  width: 45px;
  height: 45px;
  line-height: 45px;
  text-align: center;
  border: 2px solid #d3d6da;
  font-size: 24px;
  font-weight: bold;
  margin-right: 5px;
  vertical-align: middle;
  box-sizing: border-box;
}

/* The cost cell is absolutely positioned */
.guess-cost {
  width: auto;
  max-width: none;
  text-align: right;
  white-space: nowrap;
  line-height: 1.1;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Desktop: scale the per-row cost number with the larger grid cells. */
body:not(.mobile-mode) .guess-cost {
  font-size: clamp(11px, calc(var(--wordle-cell-size) * 0.29), 18px);
  min-width: 0;
  width: max-content;
  left: auto !important;
  right: calc(100% + 16px) !important;
  text-align: right;
}

body.costs-right-emojis-left .guess-cost {
  left: calc(100% + 16px) !important;
  right: auto !important;
  text-align: left;
}

body:not(.mobile-mode) .guess-cost.guess-cost-tight {
  right: calc(100% + 12px) !important;
}

body:not(.mobile-mode).costs-right-emojis-left .guess-cost.guess-cost-tight {
  left: calc(100% + 12px) !important;
  right: auto !important;
}

body.mobile-mode.costs-right-emojis-left #gameWordle .guess-cost {
  left: calc(100% + 12px) !important;
  right: auto !important;
  text-align: left;
}

.guess-wrapper {
  width: 245px;
  margin: 0 auto;
  position: relative;
}

a.dict-link {
  color: #0645ad;
  text-decoration: underline;
  cursor: pointer;
}
a.dict-link:hover {
  color: #0b0080;
}

/* History: answer cell should be clickable without link styling on the word itself. */
td.history-answer-dict {
  cursor: pointer;
}

/* Desktop: put the per-guess share emoji slightly farther from the guess row. */
body:not(.mobile-mode) .guess-share-btn {
  left: auto !important;
  right: -34px !important;
  width: 11px !important;
  height: 11px !important;
}

body.costs-right-emojis-left:not(.mobile-mode) .guess-share-btn {
  left: -34px !important;
  right: auto !important;
}

/* Mobile: keep the per-guess share emoji closer to the guess row (avoid clipping on narrow screens). */
body.mobile-mode .guess-share-btn {
  left: auto !important;
  right: -28px !important;
  width: 23px !important;
  height: 23px !important;
  font-size: 20px;
}

.guess-share-btn svg {
  width: 100%;
  height: 100%;
  display: block;
}

body.mobile-mode.costs-right-emojis-left .guess-share-btn {
  left: -28px !important;
  right: auto !important;
}

/* Desktop: match share emoji spacing for the active-row clear emoji. */
body:not(.mobile-mode) .guess-clear-btn {
  left: auto !important;
  right: -42px !important;
}

body.costs-right-emojis-left:not(.mobile-mode) .guess-clear-btn {
  left: -42px !important;
  right: auto !important;
}

/* Mobile: keep the active-row clear emoji closer to the guess row (match share emoji). */
body.mobile-mode .guess-clear-btn {
  left: auto !important;
  right: -40px !important;
  font-size: 24px;
  width: 28px !important;
  height: 28px !important;
  transition: opacity 180ms ease, transform 220ms ease;
}

body.mobile-mode.costs-right-emojis-left .guess-clear-btn {
  left: -40px !important;
  right: auto !important;
  transition: opacity 180ms ease, transform 220ms ease;
}

body.mobile-mode .mobile-floating-clear-btn {
  position: fixed !important;
  left: 0;
  top: 0;
  right: auto !important;
  transform: none !important;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 1;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: none;
  will-change: left, top;
}

body:not(.mobile-mode) .mobile-floating-clear-btn {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.mobile-mode.mobile-clear-hidden .mobile-floating-clear-btn {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Desktop: make the left-side emoji buttons easier to see/click. */
body:not(.mobile-mode) .guess-share-btn,
body:not(.mobile-mode) .guess-clear-btn {
  width: 30px !important;
  height: 30px !important;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

body:not(.mobile-mode) .guess-share-btn svg {
  width: 17px;
  height: 17px;
}

.guess-swipe-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: var(--wordle-cell-size);
  min-height: 24px;
  border: 1px solid rgba(125, 94, 0, 0.55);
  border-radius: 4px;
  background: #e2bf2f;
  padding: 0;
  margin: 0;
  color: #5a4100;
  cursor: pointer;
  display: none;
  z-index: 4;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 232, 128, 0.55) inset;
  overflow: visible;
}

.guess-swipe-btn svg {
  width: 100%;
  height: 100%;
  display: block;
}

.guess-swipe-left-btn {
  left: -11px;
}

.guess-swipe-right-btn {
  right: -11px;
}

.guess-swipe-btn:hover {
  filter: brightness(1.05);
}

body.mobile-mode .guess-swipe-btn {
  width: 10px;
  opacity: 0.92;
}

/* Narrow desktop: keep side-button hover tooltips above the fixed mobile-like header/progress bar. */
body.mobile-mode.desktop-mobile-layout .guess-swipe-btn {
  z-index: 1300;
}

body.mobile-mode.desktop-mobile-layout .guess-swipe-tooltip {
  z-index: 1301;
}

/* Real mobile only: make side swipe buttons subtle/background-like. */
body.mobile-mode:not(.desktop-mobile-layout) .guess-swipe-btn {
  border: none;
  background: rgba(226, 191, 47, 0.18);
  color: rgba(90, 65, 0, 0.45);
  box-shadow: none;
  opacity: 0.62;
  cursor: default;
}

body.dark-theme.mobile-mode:not(.desktop-mobile-layout) .guess-swipe-btn {
  border: none;
  background: rgba(226, 191, 47, 0.2);
  color: rgba(90, 65, 0, 0.52);
  box-shadow: none;
}

body.dark-theme .guess-swipe-btn {
  background: #e2bf2f;
  color: #5a4100;
  border-color: rgba(125, 94, 0, 0.55);
}

body.dark-theme .guess-swipe-btn:hover {
  filter: brightness(1.05);
}

.guess-swipe-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translate(-50%, 2px);
  background: rgba(18, 18, 19, 0.96);
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 16;
}

.guess-swipe-btn:hover .guess-swipe-tooltip,
.guess-swipe-btn:focus-visible .guess-swipe-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.mobile-mode:not(.desktop-mobile-layout) .guess-swipe-tooltip {
  display: none;
}

.history-tooltip {
  position: relative;
}

.history-tooltip-trigger {
  cursor: default;
}

.magic-score-block {
  text-align: center;
  margin-top: 10px;
}

.magic-score-award-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.magic-score-main-award {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.magic-score-emoji {
  font-size: 3em;
  line-height: 1;
  display: block;
  margin: 0 auto 4px;
}

.magic-score-award-row .magic-score-emoji {
  margin: 0;
}

.magic-score-main-award .history-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.magic-score-main-award .magic-score-label {
  font-size: 1.2em;
  text-align: center;
}

.magic-score-label {
  text-decoration: underline;
}

/* Win/loss pane: make the "X lower cost was needed for 💫" line more prominent. */
.magic-score-label-no {
  font-size: 1.2em;
}

.magic-score-reward-inline,
.magic-score-reward-below,
.magic-score-block-reward-only {
  display: flex;
  justify-content: center;
}

.magic-score-reward-inline {
  align-items: center;
}

.magic-score-reward-below {
  margin-top: 8px;
}

.win-coin-reward-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2em;
  color: #111;
  white-space: nowrap;
}

.win-coin-reward-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.win-coin-reward-count {
  font-weight: 800;
  font-size: 1.2em;
  line-height: 1;
}

.win-coin-reward-icon {
  width: 3em;
  height: 3em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #000;
  flex: 0 0 auto;
}

.win-coin-reward-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.win-coin-reward-label {
  font-size: 1.2em;
  text-decoration: underline;
  text-align: center;
}

body.mobile-mode .magic-score-award-row {
  gap: 12px;
  align-items: start;
}

body.mobile-mode .magic-score-main-award,
body.mobile-mode .win-coin-reward-stack {
  display: grid;
  grid-template-rows: minmax(3em, auto) auto;
  align-items: start;
}

body.mobile-mode .magic-score-main-award .magic-score-emoji,
body.mobile-mode .win-coin-reward-stack .win-coin-reward-inner {
  align-self: center;
}

body.mobile-mode .win-coin-reward-count {
  font-size: 1.05em;
}

body.mobile-mode .win-coin-reward-icon {
  width: 2.55em;
  height: 2.55em;
}

body.mobile-mode .history-tooltip-trigger {
  cursor: pointer;
}

.history-row-share-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}

.history-row-share-btn svg {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: middle;
}

.history-row-share-btn:active {
  transform: translateY(1px);
}

.history-hist-axis {
  position: relative;
  margin: 10px 0 6px;
  padding-bottom: 18px;
}

body:not(.mobile-mode) .history-hist-axis {
  padding-bottom: 30px;
}

.history-hist-axis-segments {
  display: flex;
  height: 26px;
  background-color: #bbada0; /* match the progress bar container */
  border: 1px solid #aaa;    /* match the progress bar border */
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
}

.history-hist-axis-seg {
  flex: 1 1 0%;
}

.history-hist-axis-seg:not(:last-child) {
  border-right: 1px solid rgba(0, 0, 0, 0.22);
}

.history-hist-axis-ticks {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  pointer-events: none;
}

.history-hist-axis-tick {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  font-size: 18px;
  color: rgba(0, 0, 0, 0.75);
  white-space: nowrap;
}

body.mobile-mode .history-hist-axis-tick {
  font-size: 13px;
}

.history-hist-axis-tick.start {
  transform: translateX(0%);
}

.history-hist-axis-tick.end {
  transform: translateX(-100%);
}

.history-histogram {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.history-hist-yaxis {
  width: 34px;
  flex: 0 0 34px;
  border-right: 1px solid rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.history-hist-yaxis-scale {
  position: relative;
  height: 200px;
}

.history-hist-yaxis-tick {
  position: absolute;
  right: 6px;
  transform: translateY(50%);
  font-size: 12px;
  color: rgba(0, 0, 0, 0.72);
  line-height: 1;
  user-select: none;
}

.history-hist-yaxis-tick[style*="bottom:0%"] {
  transform: translateY(0%);
}

.history-hist-yaxis-unit {
  position: absolute;
  right: 6px;
  bottom: -22px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.72);
  user-select: none;
}

.history-hist-yaxis-spacer {
  flex: 1 1 auto;
  min-height: 0;
}

body.mobile-mode .history-hist-yaxis {
  width: 28px;
  flex: 0 0 28px;
}

body.mobile-mode .history-hist-yaxis-tick,
body.mobile-mode .history-hist-yaxis-unit {
  font-size: 10px;
}

.history-hist-bars {
  display: flex;
  gap: 5px;
  flex: 1 1 auto;
}

.history-hist-plot {
  flex: 1 1 auto;
  min-width: 0;
}

.history-hist-bucket {
  flex: 1 1 0%;
  text-align: center;
}

.history-hist-bar-wrap {
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.history-hist-bar {
  width: 50%;
  margin: 0 auto;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.history-hist-bar-seg {
  width: 100%;
}

.history-hist-bar-awesome {
  background: #6aaa64;
}

.history-hist-bar-not {
  background: #f59563;
}

.history-hist-bar:hover {
  filter: brightness(0.95);
}

.history-hist-frac {
  font-size: 18px;
  color: #666;
  line-height: 1.1;
  background: transparent;
}

body.mobile-mode .history-hist-frac {
  font-size: 13px;
}

#history-tooltip-float {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-9999px, -9999px);
  max-width: min(760px, 92vw);
  min-width: 320px;
  white-space: pre-wrap;
  background: rgba(20, 20, 20, 0.95);
  color: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.25;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 5000;
}

#history-tooltip-float.visible {
  opacity: 1;
}

/* Daily cost hover text should be larger. */
#history-tooltip-float.daily-cost {
  font-size: 16px;
}

.history-stats {
  padding: 10px 0 6px;
}

.history-stats-title {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  margin: 6px 0 12px;
}

.history-stats-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 18px;
  align-items: stretch;
  text-align: center;
  padding-bottom: 6px;
}

.history-stat {
  width: 160px;
  max-width: 45vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.history-stat-clickable {
  cursor: pointer;
  user-select: none;
}

.history-stat-clickable:hover .history-stat-label {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.history-stat-clickable.active .history-stat-label {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.history-stat-label {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  color: rgba(0, 0, 0, 0.72);
}

.history-stat-label-underlined {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.history-intuition-underlined {
  text-decoration: none;
}

.history-stat-value {
  font-size: 36px;
  font-weight: 900;
  line-height: 1.05;
  white-space: nowrap;
}

body.mobile-mode .history-stats-title {
  font-size: 22px;
}

body.mobile-mode .history-stats-grid {
  gap: 12px 12px;
}

/* Mobile: prefer 2 stats per row (centered), with sensible min/max sizes. */
body.mobile-mode .history-stat {
  width: auto;
  max-width: 200px;
  flex: 0 1 calc(50% - 12px);
  min-width: 128px;
}

body.mobile-mode .history-stat-value {
  font-size: 30px;
}

.history-previous-daily-picker {
  margin: 14px 0 12px;
}

.history-previous-daily-toggle,
.history-previous-daily-month-toggle,
.history-previous-daily-year-toggle,
.history-previous-daily-entry {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  color: inherit;
  font: inherit;
}

.history-previous-daily-toggle,
.history-previous-daily-month-toggle,
.history-previous-daily-year-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.history-previous-daily-toggle.is-open,
.history-previous-daily-month-toggle.is-open,
.history-previous-daily-year-toggle.is-open {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.history-previous-daily-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-previous-daily-body[hidden] {
  display: none !important;
}

.history-previous-daily-month {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-previous-daily-year {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-previous-daily-month-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-previous-daily-month-body[hidden] {
  display: none !important;
}

.history-previous-daily-year-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-previous-daily-year-body[hidden] {
  display: none !important;
}

.history-previous-daily-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  text-align: left;
}

.history-previous-daily-entry-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
}

.history-previous-daily-entry-status {
  flex: 0 0 auto;
  min-width: 1.5em;
  text-align: right;
  font-size: 18px;
}

.history-previous-daily-entry.is-finished,
.history-previous-daily-entry.is-unfinished {
  background: rgba(255, 255, 255, 0.82);
}

.history-previous-daily-empty {
  padding: 14px 16px;
  border: 1px dashed rgba(0, 0, 0, 0.18);
  border-radius: 12px;
  text-align: center;
  color: rgba(0, 0, 0, 0.65);
  font-size: 15px;
  font-weight: 600;
}

.history-previous-daily-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.history-previous-daily-toggle.is-open .history-previous-daily-chevron,
.history-previous-daily-month-toggle.is-open .history-previous-daily-chevron,
.history-previous-daily-year-toggle.is-open .history-previous-daily-chevron {
  transform: rotate(225deg);
}

body.mobile-mode .history-previous-daily-toggle,
body.mobile-mode .history-previous-daily-month-toggle,
body.mobile-mode .history-previous-daily-year-toggle {
  font-size: 17px;
  padding: 12px 14px;
}

body.mobile-mode .history-previous-daily-entry {
  padding: 10px 12px;
}

body.mobile-mode .history-previous-daily-entry-label {
  font-size: 15px;
}

body.dark-theme .history-previous-daily-toggle,
body.dark-theme .history-previous-daily-month-toggle,
body.dark-theme .history-previous-daily-year-toggle,
body.dark-theme .history-previous-daily-entry {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

body.dark-theme .history-previous-daily-empty {
  color: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.16);
}

.guess-cells-container.dict-clickable,
.guess-cells-container.dict-clickable .wordle-cell,
.guess-cells-container.dict-clickable .planned-key {
  cursor: pointer;
}

.guess-cells-container.dict-clickable .wordle-cell.dict-link-disabled,
.guess-cells-container.dict-clickable .wordle-cell.dict-link-disabled .planned-key {
  cursor: default;
}

.guess-cells-container.dict-clickable:hover .wordle-cell {
  border-color: #888;
}

/* When a special 2048 tile is active, disable any inline dictionary anchors (e.g. in messages). */
body.special-tile-waiting .dict-link {
  pointer-events: none;
}


.header-cell {
  font-size: 18px;
}

/*
.guess-message {
  min-height: 30px; 
}
*/
/* Tutorial Bar at the top */
#tutorialBar {
  width: 100%;
  background: var(--page-bg, #faf8ef);
  color: var(--page-fg, #111);
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

/* Desktop: full-width top header row (hamburger + centered brand). */
body:not(.mobile-mode) #tutorialBar {
  width: var(--desktop-game-total-w) !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  background: var(--page-bg, #faf8ef) !important;
  padding: 4px 0 !important;
  color: #111 !important;
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 0 !important;
}

body:not(.mobile-mode) #tutorialBar > button:not(.desktop-header-action) {
  display: none !important;
}

body:not(.mobile-mode) #header-brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: var(--desktop-header-item);
  justify-self: center;
  z-index: 0;
}

body:not(.mobile-mode) #tutorialBar::after {
  content: none;
}

body:not(.mobile-mode) #desktop-header-actions {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  z-index: 1;
}

body:not(.mobile-mode) #desktop-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--desktop-header-item);
}

body:not(.mobile-mode) #desktop-header-right-cluster {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--desktop-header-item);
}

body:not(.mobile-mode) #desktop-header-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--desktop-header-item);
}

body:not(.mobile-mode) #desktop-header-money {
  display: inline-flex;
  align-items: center;
}

.desktop-header-action {
  position: relative;
  background: #fff !important;
  background-color: #fff !important;
  border: 1px solid rgba(0, 0, 0, 0.35) !important;
  color: #000 !important;
  width: var(--desktop-header-item);
  min-width: var(--desktop-header-item);
  max-width: var(--desktop-header-item);
  height: var(--desktop-header-item);
  min-height: var(--desktop-header-item);
  max-height: var(--desktop-header-item);
  padding: 0;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 var(--desktop-header-item);
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  box-sizing: border-box;
  overflow: visible;
}

.desktop-header-action:hover,
.desktop-header-action:focus-visible {
  background: #fff !important;
  background-color: #fff !important;
  outline: none;
}

.desktop-header-action.is-on {
  background: #6aaa64 !important;
  background-color: #6aaa64 !important;
  color: #fff !important;
  border-color: #538d4e !important;
}

.desktop-header-action .zoable-menu-icon {
  width: 1.72em;
  height: 1.72em;
  color: inherit !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex: 0 0 auto;
}

.desktop-header-action .zoable-menu-icon svg {
  color: inherit !important;
  fill: currentColor;
}

.desktop-header-action::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translate(-50%, -2px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  background: rgba(20, 20, 20, 0.96);
  color: #fff;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 1200;
}

.desktop-header-action:hover::after,
.desktop-header-action:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Narrow desktop only: desktop-like immediate hover tooltips for inline header buttons. */
body.mobile-mode.desktop-mobile-layout .mobile-header-action[data-tooltip] {
  position: relative;
  overflow: visible;
}

body.mobile-mode.desktop-mobile-layout .mobile-header-action[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translate(-50%, -2px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  background: rgba(20, 20, 20, 0.96);
  color: #fff;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 1200;
}

body.mobile-mode.desktop-mobile-layout .mobile-header-action[data-tooltip]:hover::after,
body.mobile-mode.desktop-mobile-layout .mobile-header-action[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

#desktop-menu-dropdown {
  position: fixed;
  min-width: 0;
  width: fit-content;
  max-width: calc(100vw - 16px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  padding: 6px 10px;
  z-index: 1050;
}

#desktop-menu-dropdown[hidden] {
  display: none;
}

.desktop-menu-item {
  width: 100%;
  display: block;
  text-align: left;
  background: transparent;
  border: none;
  padding: 8px 6px;
  font-size: 16px;
  cursor: pointer;
  white-space: nowrap;
}

body:not(.mobile-mode) .desktop-menu-item .zoable-menu-left {
  gap: 0.32em;
}

body:not(.mobile-mode) .desktop-menu-item .zoable-menu-icon {
  width: 1.72em;
  height: 1.72em;
}

body:not(.mobile-mode) .desktop-menu-item.zoable-switch-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

body:not(.mobile-mode) .desktop-menu-item.zoable-switch-row .zoable-switch {
  margin-left: auto;
}

.desktop-menu-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.desktop-menu-item:not(:last-child) {
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

/* Style for tutorial bar buttons */
#tutorialBar button {
  background: #555;
  border: none;
  color: #fff;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  white-space: normal;
  line-height: 1.1;
}

.modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 20px;
  box-sizing: border-box;
  background-color: rgba(0,0,0,0.6);
}

/* Ensure the generic confirmation prompt stacks above other open modals (e.g. History). */
#confirmModal {
  z-index: 6000;
}

.modal-content {
  background-color: #fefefe;
  margin: 5vh auto;
  padding: 0;
  border: 1px solid #888;
  width: 90%;
  max-width: 600px;
  position: relative;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.special-pattern-pane {
  display: none;
  position: fixed;
  z-index: 5600;
  width: min(calc(100vw - 16px), 420px);
  padding: 12px 12px 14px;
  box-sizing: border-box;
  background: #fefefe;
  border: 1px solid #888;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.special-pattern-pane.is-visible {
  display: block;
}

.special-pattern-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.special-pattern-pane-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.special-pattern-pane-close,
.special-pattern-question-btn {
  border: 1px solid #d3d6da;
  background: #f3f4f6;
  color: #111;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.special-pattern-pane-close {
  width: 34px;
  height: 34px;
  font-size: 24px;
  line-height: 1;
}

.special-pattern-pane-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.special-pattern-help {
  text-align: center;
  font-size: 15px;
  line-height: 1.35;
}

.special-pattern-submit-btn {
  display: none;
  min-width: 96px;
  min-height: 42px;
  margin-left: 16px;
  padding: 8px 20px;
  font-size: 17px;
}

.special-pattern-submit-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

body.mobile-mode .special-pattern-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.special-pattern-row {
  display: flex;
  justify-content: center;
  gap: var(--wordle-cell-gap);
}

.special-pattern-cell {
  font-size: calc(var(--wordle-cell-size) * 0.46);
  font-weight: 700;
  border-width: 2px;
}

.special-pattern-cell.filled {
  border-color: #878a8c;
}

.special-pattern-actions {
  display: flex;
  justify-content: center;
  align-items: center;
}

.special-pattern-question-btn {
  min-width: 56px;
  height: 42px;
  padding: 0 14px;
  font-size: 24px;
}

body.mobile-mode .special-pattern-pane {
  width: min(calc(100vw - 16px), 360px);
  padding: 10px 10px 12px;
}

body.mobile-mode .special-pattern-pane-title {
  font-size: 16px;
}

body.mobile-mode .special-pattern-help {
  font-size: 14px;
}

.modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-bottom: 1px solid #ddd;
  position: relative;
}

#languageModalTitle {
  margin: 0;
  width: 1.43em;
  height: 1.43em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

#languageModalTitle svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* History: make the entire top bar clickable to switch modes (except the close button). */
#historyModal .modal-header {
  padding: 0;
  min-height: 44px;
}

#historyModal #historyToggleButton.history-toggle-bar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 60px 10px 12px;
  box-sizing: border-box;
  font-weight: 700;
}

#historyModal .close-button-history {
  z-index: 2;
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.14);
  border-left: 1px solid rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.95);
  box-sizing: border-box;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  border-radius: 0;
  transform: none;
}

body.mobile-mode #historyModal .modal-header {
  min-height: 54px;
}

body.mobile-mode #historyModal .modal-content {
  max-height: calc(100vh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}

body.mobile-mode #historyModal #historyToggleButton.history-toggle-bar {
  padding-right: 66px;
}

body.mobile-mode #historyModal .close-button-history {
  width: 60px;
  height: 100%;
  right: 0;
}

body.mobile-mode #historyModal .modal-scroll {
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

body.mobile-mode.desktop-mobile-layout #historyModal .modal-header {
  min-height: 44px;
}

body.mobile-mode.desktop-mobile-layout #historyModal #historyToggleButton.history-toggle-bar {
  padding-right: 60px;
}

body.mobile-mode.desktop-mobile-layout #historyModal .close-button-history {
  width: 56px;
}

.close-button-history:hover,
.close-button-history:focus {
  background: rgba(0, 0, 0, 0.22);
}

.modal-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
}

.settings-modal-content {
  max-width: 520px;
}

.upgrades-modal-content {
  max-width: 640px;
}

.upgrades-modal-content.upgrades-modal-content-compact {
  max-width: 520px;
}

.upgrades-modal-header-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: calc(100% - 48px);
  flex-wrap: wrap;
}

.upgrades-modal-title {
  font-size: 22px;
  font-weight: 700;
}

.settings-modal-title {
  font-size: 22px;
  font-weight: 700;
}

.settings-modal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-modal-divider {
  height: 1px;
  border: none;
  background: rgba(0, 0, 0, 0.14);
  margin: 4px 2px;
}

.settings-modal-row {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.settings-modal-label {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
}

body.dark-theme .settings-modal-row {
  background: #232527;
  border-color: rgba(255, 255, 255, 0.12);
}

body.dark-theme .settings-modal-divider {
  background: rgba(255, 255, 255, 0.14);
}

.settings-modal-row.settings-modal-row-secondary {
  background: #f3eadc;
  border-color: rgba(123, 97, 63, 0.24);
  color: #20170d;
}

.upgrades-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.upgrades-modal-subtitle {
  color: #5d5244;
  font-size: 14px;
}

.upgrades-modal-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  font-weight: 700;
}

.upgrades-modal-summary-header {
  align-self: center;
  padding: 6px 10px;
}

.upgrades-modal-summary-icon,
.upgrades-modal-price-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
}

.upgrades-modal-summary-icon svg,
.upgrades-modal-price-icon svg {
  width: 100%;
  height: 100%;
}

.upgrades-modal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upgrades-modal-previous-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.upgrades-modal-previous-section.is-collapsed {
  padding-bottom: 72px;
}

.upgrades-modal-previous-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: #f3eadb;
  color: #2b241a;
  font: inherit;
  font-weight: 700;
  padding: 12px 14px;
  cursor: pointer;
}

.upgrades-modal-previous-title {
  min-width: 0;
}

.upgrades-modal-previous-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  height: 12px;
  flex: 0 0 18px;
  transform-origin: center center;
  transition: transform 140ms ease;
}

.upgrades-modal-previous-chevron::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transform-origin: center center;
}

.upgrades-modal-previous-toggle.is-open .upgrades-modal-previous-chevron {
  transform: rotate(180deg);
}

.upgrades-modal-previous-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upgrades-modal-previous-list[hidden] {
  display: none !important;
}

.upgrades-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: #fffaf1;
}

.upgrades-modal-row.is-clickable {
  cursor: pointer;
}

.upgrades-modal-row.is-owned {
  background: #edf8ed;
  border-color: rgba(46, 125, 50, 0.28);
}

.upgrades-modal-row.is-locked-sequence {
  background: #f0f0f0;
  border-color: rgba(0, 0, 0, 0.1);
}

.upgrades-modal-row.is-unavailable {
  background: #f0f0f0;
  border-color: rgba(0, 0, 0, 0.1);
}

.upgrades-modal-row.is-locked-sequence .upgrades-modal-row-title,
.upgrades-modal-row.is-locked-sequence .upgrades-modal-row-subtitle,
.upgrades-modal-row.is-locked-sequence .upgrades-modal-buy-btn,
.upgrades-modal-row.is-unavailable .upgrades-modal-row-title,
.upgrades-modal-row.is-unavailable .upgrades-modal-row-subtitle,
.upgrades-modal-row.is-unavailable .upgrades-modal-buy-btn {
  color: #7a7a7a;
}

.upgrades-modal-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.upgrades-modal-row-title {
  font-weight: 700;
}

.upgrades-modal-row-subtitle,
.upgrades-modal-row-prereq {
  margin-top: 4px;
  font-size: 13px;
  color: #5d5244;
  white-space: pre-line;
}

.upgrades-modal-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upgrades-modal-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #000;
  font: inherit;
  font-weight: 700;
  text-align: center;
}

.upgrades-modal-buy-btn.is-muted {
  color: #7a7a7a;
}

.upgrades-modal-buy-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
}

.upgrades-modal-buy-btn-icon svg {
  width: 100%;
  height: 100%;
}

.upgrades-modal-buy-btn-icon svg [stroke] {
  stroke: #000 !important;
  stroke-width: 0.85 !important;
}

body.mobile-mode .upgrades-modal-buy-btn-icon {
  width: 1.43em;
  height: 1.43em;
}

body.mobile-mode.desktop-mobile-layout .upgrades-modal-buy-btn-icon {
  width: 1.55em;
  height: 1.55em;
}

body.mobile-mode .upgrades-modal-buy-btn {
  font-size: 1.3em;
}

body.mobile-mode.desktop-mobile-layout .upgrades-modal-buy-btn {
  font-size: 1em;
  min-height: 42px;
}

body:not(.mobile-mode) .upgrades-modal-buy-btn {
  min-height: 42px;
}

body:not(.mobile-mode) .upgrades-modal-buy-btn-icon {
  width: 1.55em;
  height: 1.55em;
}

body.mobile-mode .upgrades-modal-row {
  flex-direction: column;
  align-items: stretch;
}

body.mobile-mode.desktop-mobile-layout .upgrades-modal-row {
  flex-direction: row;
  align-items: center;
}

body.mobile-mode .upgrades-modal-actions {
  width: 100%;
}

body.mobile-mode.desktop-mobile-layout .upgrades-modal-actions {
  width: auto;
  align-items: center;
}

body.dark-theme .upgrades-modal-subtitle,
body.dark-theme .upgrades-modal-row-subtitle,
body.dark-theme .upgrades-modal-row-prereq {
  color: #d0d4d7;
}

body.dark-theme .upgrades-modal-row.is-locked-sequence {
  background: #4a4a4a;
  border-color: rgba(255, 255, 255, 0.12);
}

body.dark-theme .upgrades-modal-row.is-locked-sequence .upgrades-modal-row-title,
body.dark-theme .upgrades-modal-row.is-locked-sequence .upgrades-modal-row-subtitle,
body.dark-theme .upgrades-modal-row.is-locked-sequence .upgrades-modal-price {
  color: #b7bcc0;
}

body.dark-theme .upgrades-modal-summary {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-theme .upgrades-modal-row {
  background: #2b261f;
  border-color: rgba(255, 255, 255, 0.12);
}

body.dark-theme .upgrades-modal-previous-toggle {
  background: #342d24;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f1f1f1;
}

body.mobile-mode .upgrades-modal-previous-chevron {
  width: 20px;
  min-width: 20px;
  height: 10px;
  flex-basis: 20px;
}

body.mobile-mode.desktop-mobile-layout .upgrades-modal-previous-chevron {
  width: 18px;
  min-width: 18px;
  height: 12px;
  flex-basis: 18px;
}

body.mobile-mode .upgrades-modal-previous-chevron::before {
  width: 14px;
  height: 14px;
  transform: rotate(45deg) translateY(-3px);
}

body.dark-theme .upgrades-modal-row.is-owned {
  background: #223025;
  border-color: rgba(98, 196, 109, 0.32);
}

body.mobile-mode .upgrades-modal-row {
  flex-direction: column;
  align-items: stretch;
}

body.mobile-mode .upgrades-modal-actions {
  align-items: stretch;
}

.faq-tutorial-entry {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 16px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
}

.faq-tutorial-entry .zoable-menu-left {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  justify-content: center;
  width: 100%;
}

.faq-tutorial-entry .zoable-menu-icon {
  color: #000;
}

.faq-tutorial-entry .zoable-menu-label {
  color: #fff;
  font-size: 1.08em;
}

.faq-tutorial-entry:hover,
.faq-tutorial-entry:focus {
  background: #256a2a;
}

.header-money {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: var(--desktop-header-item);
  color: #111;
  user-select: none;
  white-space: nowrap;
}

.header-money-count {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.header-money-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #000;
  flex: 0 0 auto;
}

.header-money-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

body.mobile-mode .header-money {
  min-height: var(--mobile-header-item);
  gap: 6px;
}

body.mobile-mode .header-money-count {
  font-size: 13px;
}

body.mobile-mode .header-money-icon {
  width: 24.5px;
  height: 24.5px;
}

.close-button {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}
.close-button:hover,
.close-button:focus {
  color: black;
}

.close-button-history,
.close-button-share,
.close-button-faq,
.close-button-language {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}
.close-button-win {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}
.close-button-history:hover,
.close-button-history:focus,
.close-button-share:hover,
.close-button-share:focus,
.close-button-faq:hover,
.close-button-faq:focus,
.close-button-language:hover,
.close-button-language:focus {
  color: black;
}
.close-button-win:hover,
.close-button-win:focus {
  color: black;
}

.win-share-button {
  background: #2e7d32;
  border: none;
  color: #fff;
  padding: 8px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  min-height: 36px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.win-share-button:hover {
  filter: brightness(1.05);
}

.win-share-button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.daily-friend-solutions {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.daily-friend-score-link {
  background: none;
  border: none;
  padding: 2px 6px;
  font: inherit;
  color: #0b57d0;
  text-decoration: underline;
  cursor: pointer;
}

.daily-friend-score-link:hover {
  filter: brightness(0.92);
}

.streak-protector-yes,
.streak-protector-no {
  min-height: 36px;
  padding: 8px 18px;
  font-size: 16px;
  border-radius: 12px;
  cursor: pointer;
}

.streak-protector-yes {
  background: #2e7d32;
  color: #fff;
  border: none;
}

.streak-protector-no {
  background: #f3f3f3;
  color: #222;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.see-results-button {
  background: #2e7d32;
  border: none;
  color: #fff;
  padding: 10px 22px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  min-height: 40px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}

#dailyCopyResultsButton {
  background: #e2bf2f;
  color: #5a4100;
  border: 2px solid rgba(125, 94, 0, 0.55);
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.18),
    0 0 0 2px rgba(255, 232, 128, 0.55) inset;
}

#dailyCopyResultsButton svg {
  width: 1.05em;
  height: 1.05em;
  display: block;
}

#practiceShareUnderButton {
  background: #e2bf2f;
  color: #5a4100;
  border: 2px solid rgba(125, 94, 0, 0.55);
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.18),
    0 0 0 2px rgba(255, 232, 128, 0.55) inset;
}

#practiceShareUnderButton svg {
  width: 1.05em;
  height: 1.05em;
  display: block;
}

#historyDailyShareButton,
#historyPracticeShareButton {
  background: #e2bf2f;
  color: #5a4100;
  border: 2px solid rgba(125, 94, 0, 0.55);
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.18),
    0 0 0 2px rgba(255, 232, 128, 0.55) inset;
}

.see-results-button:hover {
  filter: brightness(1.05);
}

.see-results-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

body:not(.mobile-mode) #dailyResultsContainer .see-results-button {
  padding: 13px 29px;
  border-radius: 18px;
  font-size: 23px;
  min-height: 52px;
}

body:not(.mobile-mode) #dailyResultsContainer #dailyCopyResultsButton svg,
body:not(.mobile-mode) #dailyResultsContainer #practiceShareUnderButton svg {
  width: 1.365em;
  height: 1.365em;
}

body.modal-open {
  overflow: hidden;
}

#zoable-footer {
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.45);
  padding: 8px 0 10px;
  user-select: none;
}

body.mobile-mode #zoable-footer {
  font-size: 10px;
  padding: 6px 0 8px;
  margin-top: auto;
}

/* Collapsible sections */
.collapsible {
  border-top: 1px solid #ccc;
  margin-top: 15px;
}
.collapsible-header {
  cursor: pointer;
  padding: 10px 0;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.collapsible-content {
  display: none;
  padding: 5px 0 10px 10px;
}
.collapsible.active .collapsible-content {
  display: block;
}
.arrow {
  font-size: 14px;
  transition: transform 0.2s;
}
.collapsible.active .arrow {
  transform: rotate(180deg);
}

/* Wordle example guess row styling */
.guess-row {
  margin: 10px 0;
}
