/* ======================================================
   WordRam - Stylesheet (v18)
   Теплая палитра Cocoa-Mauve, Колесо фортуны, Блиц-карточки,
   Квесты дня, Еженедельные лиги, Карта глав и SVG эффекты.
   ====================================================== */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  --bg-color: #07080d;
  --bg-gradient: radial-gradient(ellipse at 50% -10%, #2a3358 0%, #12141c 42%, #07080d 100%);
  --surface-color: rgba(255, 255, 255, 0.08);
  --surface-border: rgba(255, 255, 255, 0.16);
  --text-main: #f5f5f7;
  --text-muted: rgba(235, 235, 245, 0.62);
  
  --primary: #7aa2ff;
  --primary-hover: #9bb8ff;
  --primary-light: rgba(122, 162, 255, 0.22);
  --accent: #7aa2ff;
  
  --cell-bg: rgba(255, 255, 255, 0.72);
  --cell-border: rgba(255, 255, 255, 0.55);
  --cell-text: #1c1c1e;
  --cell-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 8px 20px rgba(0, 0, 0, 0.22);
  
  --cell-selected-bg: rgba(122, 162, 255, 0.92);
  --cell-selected-text: #ffffff;
  --cell-head-bg: #5b82f0;
  
  --cell-hint-bg: rgba(255, 214, 10, 0.88);
  --cell-hint-border: rgba(255, 214, 10, 0.95);
  --cell-hint-text: #3f2e00;

  --nav-bg: rgba(22, 24, 32, 0.55);
  --nav-border: rgba(255, 255, 255, 0.14);
  --glass: rgba(255, 255, 255, 0.09);
  --glass-strong: rgba(255, 255, 255, 0.16);
  --radius-lg: 22px;
  --blur: 28px;
}

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

.hidden { display: none !important; }
.full-width { width: 100%; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background: var(--bg-color);
  color: var(--text-main);
  touch-action: manipulation;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 500px;
  margin: 0 auto;
  background: var(--bg-gradient);
  position: relative;
  overflow: hidden;
}

/* ======================================================
   Header
   ====================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--surface-color);
  border-bottom: 1px solid var(--surface-border);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #c084fc;
  letter-spacing: -0.5px;
}

.level-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(168, 85, 247, 0.25);
  color: #e9d5ff;
}

.cefr-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 10px;
  background: #3b2838;
  color: #fbbf24;
  border: 1px solid #785272;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coins-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(251, 191, 36, 0.2);
  padding: 4px 10px;
  border-radius: 16px;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fde047;
  border: 1px solid rgba(251, 191, 36, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* ======================================================
   Main Content & Screens
   ====================================================== */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(70px + env(safe-area-inset-bottom));
  position: relative;
}

.screen-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  min-height: 100%;
}

.screen-header {
  width: 100%;
  margin-bottom: 12px;
  text-align: center;
}

.screen-header h2 {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
}

.screen-header .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ======================================================
   Screen: Game
   ====================================================== */
.game-top-bar {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.progress-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2d9e0;
}

.word-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 440px;
}

.word-slot {
  background: var(--surface-color);
  border: 1px dashed var(--surface-border);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.word-slot.found {
  transform: scale(1.04);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.preview-wrapper {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.word-preview-box {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  padding: 3px 16px;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #c084fc;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.15s ease-out;
}

.word-preview-box.active {
  opacity: 1;
  transform: translateY(0);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

/* Grid */
.grid-container {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  touch-action: none;
  background: transparent;
  border: none;
  box-shadow: none;
}

.drag-svg-overlay {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  pointer-events: none;
  z-index: 5;
}

.drag-svg-glow {
  fill: none;
  stroke: rgba(192, 132, 252, 0.45);
  stroke-width: 18px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drag-svg-core {
  fill: none;
  stroke: #c084fc;
  stroke-width: 7px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.letter-grid {
  display: grid;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.grid-cell {
  background: var(--cell-bg);
  border: 2px solid var(--cell-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--cell-text);
  box-shadow: var(--cell-shadow);
  cursor: pointer;
  position: relative;
  transition: transform 0.1s, background-color 0.15s;
}

.grid-cell .hint-badge {
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 0.6rem;
  font-weight: 900;
  color: var(--cell-hint-text);
}

.letter-grid[data-size="4"] { gap: 10px; }
.letter-grid[data-size="4"] .grid-cell { font-size: 1.65rem; border-radius: 16px; }

.letter-grid[data-size="5"] { gap: 8px; }
.letter-grid[data-size="5"] .grid-cell { font-size: 1.45rem; border-radius: 14px; }

.letter-grid[data-size="6"] { gap: 6px; }
.letter-grid[data-size="6"] .grid-cell { font-size: 1.2rem; border-radius: 10px; }

.letter-grid[data-size="7"] { gap: 4px; }
.letter-grid[data-size="7"] .grid-cell { font-size: 0.98rem; border-radius: 8px; }

.letter-grid[data-size="8"] { gap: 3px; }
.letter-grid[data-size="8"] .grid-cell { font-size: 0.85rem; border-radius: 6px; }

.letter-grid[data-size="9"] { gap: 2px; }
.letter-grid[data-size="9"] .grid-cell { font-size: 0.74rem; border-radius: 5px; }

.grid-cell.selected {
  background: #a855f7 !important;
  border-color: #a855f7 !important;
  color: #ffffff !important;
  transform: scale(1.06);
  box-shadow: 0 4px 0 #7e22ce, 0 8px 16px rgba(168, 85, 247, 0.4) !important;
  z-index: 2;
}

.grid-cell.path-head {
  background: #9333ea !important;
  border-color: #9333ea !important;
  box-shadow: 0 0 14px rgba(192, 132, 252, 0.9) !important;
}

.grid-cell.hinted {
  background: #fde047 !important;
  border-color: #eab308 !important;
  color: #713f12 !important;
  box-shadow: 0 4px 0 #ca8a04 !important;
}

.grid-cell.found-cell {
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15) !important;
}

.cell-hint-pulse {
  animation: pulseHint 1.2s infinite ease-in-out;
}

@keyframes pulseHint {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); box-shadow: 0 0 16px rgba(253, 224, 71, 0.9); }
}

.cell-found-pop {
  animation: popSuccess 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.cell-shake {
  animation: shakeError 0.35s ease-in-out;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.game-controls {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  padding: 9px 22px;
  border-radius: 24px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: transform 0.15s, background-color 0.15s;
}

.action-btn:active {
  transform: scale(0.95);
  background-color: rgba(168, 85, 247, 0.3);
}

.small-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 14px;
}

.hint-btn {
  background: #fde047;
  border-color: #eab308;
  color: #713f12;
  box-shadow: 0 4px 0 #ca8a04, 0 6px 14px rgba(234, 179, 8, 0.35);
}

/* ======================================================
   Screen: My Vocabulary & Blitz Flashcards
   ====================================================== */
.vocab-toolbar {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

#screen-vocab .vocab-stars-hint {
  width: 100%;
  max-width: 440px;
  margin: 0 0 10px;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(235, 235, 245, 0.5);
  text-align: center;
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  background: var(--surface-color);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
}

.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip {
  padding: 5px 12px;
  border-radius: 14px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

.vocab-grid {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vocab-card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: transform 0.15s, box-shadow 0.15s;
}

.vocab-card:active { transform: scale(0.98); }

.vocab-card-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.vocab-word-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #34d399;
}

.mastery-stars {
  font-size: 0.8rem;
  margin-left: 4px;
}

.vocab-word-tr {
  font-size: 0.85rem;
  color: #f8fafc;
}

.vocab-word-ph {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.vocab-tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.empty-vocab-msg {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ======================================================
   Screen: Chapters Map
   ====================================================== */
.chapters-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  width: 100%;
  max-width: 440px;
  padding-bottom: 6px;
}

.chapter-chip {
  padding: 6px 14px;
  border-radius: 16px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.chapter-chip.active {
  background: #a855f7;
  color: #ffffff;
  border-color: #a855f7;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.levels-scroll-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 420px;
}

.level-card {
  aspect-ratio: 1 / 1;
  background: var(--surface-color);
  border: 2px solid var(--surface-border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.level-card.unlocked:active { transform: scale(0.92); }
.level-card.current {
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.level-card.locked {
  opacity: 0.35;
  cursor: not-allowed;
  background: rgba(255,255,255,0.02);
}

.level-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.level-stars {
  font-size: 0.75rem;
  color: #fde047;
  margin-top: 2px;
}

/* ======================================================
   Screen: Events & Quests
   ====================================================== */
.event-banner-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  border-radius: 20px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35);
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-icon { font-size: 1.8rem; }
.banner-sub { font-size: 0.75rem; opacity: 0.85; }

.daily-quests-card, .daily-streak-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.quests-badge {
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(168, 85, 247, 0.25);
  color: #c084fc;
  padding: 3px 8px;
  border-radius: 10px;
}

.quests-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quest-item-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quest-item-card.completed {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

.quest-item-info {
  text-align: left;
  flex: 1;
}

.quest-item-info strong { font-size: 0.9rem; }
.quest-sub { font-size: 0.75rem; color: var(--text-muted); }
.quest-reward { font-size: 0.75rem; font-weight: 800; color: #fde047; margin-top: 2px; }

.claim-ready-btn {
  background: #10b981 !important;
  color: #ffffff !important;
  font-weight: 800;
  cursor: pointer;
}

.claimed-btn {
  background: rgba(255,255,255,0.1) !important;
  color: var(--text-muted) !important;
}

.locked-btn {
  background: rgba(255,255,255,0.05) !important;
  color: var(--text-muted) !important;
}

.super-chest-box {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chest-icon { font-size: 1.6rem; }
.chest-info { text-align: left; flex: 1; }
.chest-info strong { font-size: 0.85rem; color: #fde047; }
.chest-sub { font-size: 0.7rem; color: var(--text-muted); }

.streak-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.freeze-pill {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
}

.rewards-calendar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.reward-day-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.reward-day-item.claimed {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
}

.reward-day-item.current {
  border-color: #f43f5e;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.5);
}

.reward-day-title { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); }
.reward-day-prize { font-size: 0.8rem; font-weight: 900; color: #fde047; }
.reward-day-item:last-child { grid-column: span 2; }

/* ======================================================
   Screen: Leagues & Leaderboards
   ====================================================== */
.league-card {
  width: 100%;
  max-width: 400px;
}

.league-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.league-title-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.league-big-icon { font-size: 2rem; }
.league-name-text { font-size: 1.1rem; font-weight: 900; color: #fde047; }
.league-sub { font-size: 0.75rem; color: var(--text-muted); }
.league-badge-pill {
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(251, 191, 36, 0.2);
  color: #fde047;
  padding: 4px 10px;
  border-radius: 12px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.leaderboard-row {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.leaderboard-row.user-row {
  background: rgba(168, 85, 247, 0.25);
  border-color: #a855f7;
}

.row-rank { font-size: 0.9rem; font-weight: 900; width: 24px; color: var(--text-muted); }
.row-avatar { font-size: 1.2rem; }
.row-name { font-size: 0.85rem; font-weight: 700; flex: 1; text-align: left; }
.row-xp { font-size: 0.85rem; font-weight: 900; color: #fde047; }

/* Profile XP */
.xp-profile-card { width: 100%; max-width: 400px; }
.xp-rank-header { display: flex; justify-content: space-between; align-items: center; }
.xp-progress-bar-wrap { width: 100%; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.xp-bar-fill { height: 100%; background: linear-gradient(90deg, #a855f7 0%, #ec4899 100%); border-radius: 4px; transition: width 0.4s ease; }
.xp-sub-info { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* Achievements */
.achievements-container { display: flex; flex-direction: column; gap: 8px; }
.achievement-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.achievement-card.unlocked {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.5);
}

.ach-icon { font-size: 1.6rem; }
.ach-info { flex: 1; text-align: left; }
.ach-title { font-size: 0.9rem; font-weight: 800; color: var(--text-main); }
.ach-desc { font-size: 0.75rem; color: var(--text-muted); }
.ach-reward { font-size: 0.8rem; font-weight: 800; color: #fde047; }

.settings-group {
  width: 100%;
  max-width: 400px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 16px;
}

.settings-group h3 { font-size: 1rem; font-weight: 800; color: #c084fc; margin-bottom: 10px; }
.setting-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--surface-border); }
.setting-item:last-child { border-bottom: none; }
.setting-item label { font-size: 0.95rem; font-weight: 600; }
.toggle-switch { width: 44px; height: 24px; accent-color: #a855f7; cursor: pointer; }

.settings-danger { width: 100%; max-width: 400px; margin-top: 10px; }
.danger-btn { width: 100%; background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); padding: 10px; border-radius: 12px; font-size: 0.9rem; font-weight: 700; cursor: pointer; }

/* Buttons */
.primary-btn {
  background: #a855f7;
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
  transition: transform 0.15s, background-color 0.15s;
}

.primary-btn:active { transform: scale(0.96); background: #9333ea; }
.secondary-btn { background: var(--surface-color); border: 1px solid var(--surface-border); color: var(--text-main); padding: 10px 16px; border-radius: 20px; font-size: 0.9rem; font-weight: 700; cursor: pointer; }

.pulse-glow { animation: pulseButton 2s infinite ease-in-out; }
@keyframes pulseButton {
  0%, 100% { box-shadow: 0 4px 10px rgba(168, 85, 247, 0.35); }
  50% { box-shadow: 0 6px 20px rgba(168, 85, 247, 0.75); }
}

/* ======================================================
   Modals: Lucky Wheel & Blitz Quiz
   ====================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.modal-overlay.open { display: flex !important; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 24px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: modalEnter 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-close-icon {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: #64748b;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* Lucky Wheel */
.wheel-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 14px auto;
}

.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  color: #fde047;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.lucky-wheel-disc {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 8px auto 12px;
  border-radius: 50%;
  background: conic-gradient(
    #7c3aed 0deg 60deg,
    #a855f7 60deg 120deg,
    #c084fc 120deg 180deg,
    #7c3aed 180deg 240deg,
    #a855f7 240deg 300deg,
    #c084fc 300deg 360deg
  );
  border: 4px solid rgba(253, 224, 71, 0.55);
}

.wheel-sector-label {
  position: absolute;
  left: 50%;
  top: 12px;
  width: 70px;
  margin-left: -35px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  transform-origin: 50% 108px;
}

.wheel-result-badge {
  background: rgba(251, 191, 36, 0.2);
  color: #fde047;
  font-weight: 900;
  padding: 8px 16px;
  border-radius: 16px;
  margin-top: 10px;
  font-size: 0.95rem;
}

/* Blitz Quiz */
.blitz-header { display: flex; justify-content: space-between; align-items: center; }
.blitz-title { font-size: 1rem; font-weight: 800; color: #a855f7; }
.blitz-badge { font-size: 0.8rem; font-weight: 800; background: rgba(168,85,247,0.25); color: #c084fc; padding: 3px 8px; border-radius: 10px; }
.blitz-progress-wrap { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.blitz-progress-bar-fill { height: 100%; background: #a855f7; border-radius: 3px; transition: width 0.3s; }

.blitz-card-box {
  background: rgba(255,255,255,0.05);
  border: 2px solid #a855f7;
  border-radius: 18px;
  padding: 16px;
  text-align: center;
}

.blitz-target-word { font-size: 1.8rem; font-weight: 900; color: #c084fc; letter-spacing: 1.5px; }
.blitz-target-ph { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }
.blitz-prompt { font-size: 0.85rem; color: var(--text-muted); margin: 12px 0 8px 0; }

.blitz-options-grid { display: flex; flex-direction: column; gap: 8px; }
.blitz-opt-btn {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-main);
  padding: 12px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.15s;
}

.blitz-opt-btn:active { transform: scale(0.97); }
.blitz-opt-btn.correct { background: #10b981 !important; border-color: #10b981 !important; color: #ffffff !important; }
.blitz-opt-btn.wrong { background: #ef4444 !important; border-color: #ef4444 !important; color: #ffffff !important; }

/* Word Definition Modal */
.word-definition-card { max-width: 360px; padding-top: 28px; background: #ffffff !important; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important; }
.word-ribbon-badge { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%); color: #ffffff; padding: 8px 24px; border-radius: 20px; font-size: 1.3rem; font-weight: 900; letter-spacing: 1.5px; box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4); }
.def-content-box { background: #f8f5f8 !important; border: 1px solid #e7dfe6 !important; border-radius: 18px; padding: 16px; text-align: left; margin-top: 8px; }
.def-phonetic-text { font-size: 0.85rem; color: #64748b !important; font-style: italic; margin-bottom: 4px; }
.def-translation-title { font-size: 1.2rem; font-weight: 900; color: #7c3aed !important; margin-bottom: 8px; }
.def-meaning-text { font-size: 0.95rem; line-height: 1.45; color: #2b2029 !important; margin-bottom: 10px; }
.def-example-box { background: rgba(124, 58, 237, 0.08) !important; border-left: 3px solid #7c3aed !important; padding: 6px 10px; border-radius: 6px; font-size: 0.85rem; }
.example-label { font-weight: 700; color: #7c3aed !important; margin-right: 4px; }
.example-text { color: #475569 !important; font-style: italic; }

/* Placement Quiz */
.placement-card { max-width: 400px; background: #ffffff !important; color: #2b2029 !important; }
.quiz-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding-right: 46px; }
.quiz-step-title { font-size: 0.95rem; font-weight: 800; color: #7c3aed !important; }
.quiz-counter { font-size: 0.85rem; font-weight: 700; color: #64748b !important; }
.quiz-progress-bar-wrap { width: 100%; height: 6px; background: #e2e8f0 !important; border-radius: 3px; overflow: hidden; margin-bottom: 16px; }
.quiz-progress-bar-fill { height: 100%; background: #7c3aed !important; border-radius: 3px; transition: width 0.3s ease; }
.quiz-word-card { background: #f5f3ff !important; border: 2px solid #7c3aed !important; border-radius: 20px; padding: 24px 16px; margin-bottom: 14px; }
.quiz-target-word { font-size: 2.1rem; font-weight: 900; letter-spacing: 2px; color: #7c3aed !important; text-align: center; }
.quiz-prompt { font-size: 0.9rem; color: #475569 !important; margin-bottom: 14px; }
.quiz-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.quiz-btn { padding: 12px; border-radius: 16px; font-size: 1rem; font-weight: 700; cursor: pointer; border: 2px solid transparent; }
.btn-know { background: #dcfce7 !important; color: #15803d !important; border-color: #86efac !important; }
.btn-unsure { background: #fef3c7 !important; color: #92400e !important; border-color: #fde68a !important; }
.btn-dontknow { background: #fee2e2 !important; color: #b91c1c !important; border-color: #fca5a5 !important; }

.result-cefr-badge { font-size: 1.5rem; font-weight: 900; color: #ffffff; background: #7c3aed; padding: 8px 20px; border-radius: 24px; display: inline-block; margin: 12px 0; }
.result-cefr-title { font-size: 1.2rem; font-weight: 800; color: #2b2029 !important; margin-bottom: 6px; }
.result-cefr-desc { font-size: 0.9rem; color: #475569 !important; line-height: 1.4; }

/* Victory Modal */
.modal-title { font-size: 1.5rem; font-weight: 900; color: #c084fc; }
.modal-subtitle { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 10px; }
.modal-action-btn { width: 100%; }

.victory-card {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100dvh - 32px);
  padding: 28px 20px 22px;
  background:
    radial-gradient(ellipse 120% 70% at 50% -10%, rgba(168, 85, 247, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(251, 191, 36, 0.12) 0%, transparent 50%),
    var(--surface-color);
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 48px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(168, 85, 247, 0.18);
  animation: victoryCardEnter 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes victoryCardEnter {
  from { opacity: 0; transform: scale(0.82) translateY(18px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.victory-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 88px;
  margin-bottom: 6px;
}

.victory-trophy-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.25), rgba(168, 85, 247, 0.3));
  border: 2px solid rgba(253, 224, 71, 0.45);
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.25), 0 0 28px rgba(168, 85, 247, 0.3);
  animation: trophyPulse 2.2s ease-in-out infinite;
}

.victory-trophy {
  font-size: 2.4rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
  animation: trophyPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes trophyPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(251, 191, 36, 0.25), 0 0 28px rgba(168, 85, 247, 0.3); transform: scale(1); }
  50% { box-shadow: 0 10px 32px rgba(251, 191, 36, 0.4), 0 0 40px rgba(168, 85, 247, 0.45); transform: scale(1.04); }
}

@keyframes trophyPop {
  from { transform: scale(0.4) rotate(-12deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.victory-spark {
  position: absolute;
  color: #fde047;
  font-size: 0.85rem;
  pointer-events: none;
  animation: sparkFloat 2s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(253, 224, 71, 0.8);
}

.victory-spark-1 { top: 8px; left: 22%; animation-delay: 0s; }
.victory-spark-2 { top: 18px; right: 18%; font-size: 1.1rem; animation-delay: 0.4s; }
.victory-spark-3 { bottom: 6px; left: 30%; animation-delay: 0.8s; color: #e9d5ff; }

@keyframes sparkFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.7; }
  50% { transform: translateY(-8px) scale(1.2); opacity: 1; }
}

.victory-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fde047 0%, #e9d5ff 45%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
}

.victory-level-label {
  margin: 4px 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.victory-stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 16px;
}

.victory-stars .star {
  font-size: 1.85rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.18);
  text-shadow: none;
  transform: scale(0.85);
  transition: color 0.25s, transform 0.25s, filter 0.25s;
}

.victory-stars .star.filled {
  color: #fde047;
  filter: drop-shadow(0 0 8px rgba(253, 224, 71, 0.65));
  transform: scale(1);
  animation: starReveal 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.victory-stars .star.filled:nth-child(1) { animation-delay: 0.15s; }
.victory-stars .star.filled:nth-child(2) { animation-delay: 0.28s; }
.victory-stars .star.filled:nth-child(3) { animation-delay: 0.41s; }

@keyframes starReveal {
  from { transform: scale(0.3) rotate(-20deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.victory-rewards {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.victory-reward-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px 10px;
  border-radius: 16px;
  border: 1px solid transparent;
}

.victory-reward-chip.coins {
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.22), rgba(251, 191, 36, 0.08));
  border-color: rgba(251, 191, 36, 0.35);
}

.victory-reward-chip.xp {
  background: linear-gradient(160deg, rgba(168, 85, 247, 0.28), rgba(168, 85, 247, 0.1));
  border-color: rgba(192, 132, 252, 0.4);
}

.reward-chip-icon { font-size: 1.15rem; line-height: 1; }
.reward-chip-value {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.victory-reward-chip.coins .reward-chip-value { color: #fde047; }
.victory-reward-chip.xp .reward-chip-value { color: #e9d5ff; }
.reward-chip-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.victory-words-block {
  text-align: left;
  margin-bottom: 18px;
}

.victory-words-caption {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.win-words-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.4) transparent;
}

.win-word-item {
  display: inline-flex;
  align-items: flex-start;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #f3e8ff;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.win-word-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.win-word-tr {
  display: none;
  max-width: 200px;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0;
  color: #ffe08a;
  white-space: normal;
}

.win-word-item.is-open {
  border-radius: 14px;
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(192, 132, 252, 0.7);
}

.win-word-item.is-open .win-word-tr {
  display: block;
}

.win-word-item:active {
  transform: scale(0.96);
  background: rgba(168, 85, 247, 0.35);
  border-color: rgba(192, 132, 252, 0.7);
}

.win-word-check {
  color: #4ade80;
  font-size: 0.75rem;
}

.victory-next-btn {
  margin-top: 0;
  padding: 14px 24px;
  font-size: 1.05rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.45);
  animation: nextBtnGlow 2s ease-in-out infinite;
}

@keyframes nextBtnGlow {
  0%, 100% { box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4); }
  50% { box-shadow: 0 8px 28px rgba(168, 85, 247, 0.7); }
}

.victory-share-btn {
  margin-top: 10px;
  border-radius: 16px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.victory-report-link {
  display: flex;
  align-items: center;
  justify-content: center;
  position: static;
  width: 100%;
  box-sizing: border-box;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(245, 245, 247, 0.92);
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}

.victory-report-link:active {
  background: rgba(255, 255, 255, 0.16);
}

/* ======================================================
   Bottom Navigation
   ====================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  height: calc(60px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--nav-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.1s;
}

.nav-item:active { transform: scale(0.9); }
.nav-icon { font-size: 1.15rem; transition: transform 0.2s; }
.nav-label { font-size: 0.7rem; font-weight: 700; }

#nav-btn-game.active { color: #c084fc; }
#nav-btn-game.active .nav-icon { transform: scale(1.15); }

#nav-btn-vocab.active { color: #34d399; }
#nav-btn-vocab.active .nav-icon { transform: scale(1.15); }

#nav-btn-levels.active { color: #fbbf24; }
#nav-btn-levels.active .nav-icon { transform: scale(1.15); }

#nav-btn-daily.active { color: #fb7185; }
#nav-btn-daily.active .nav-icon { transform: scale(1.15); }

#nav-btn-settings.active { color: #e879f9; }
#nav-btn-settings.active .nav-icon { transform: scale(1.15); }

/* Toasts */
.game-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(31, 23, 29, 0.96);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10000;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  border: 1px solid #5c4756;
}

.game-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.game-toast.toast-warning { background: #dc2626; border-color: #ef4444; }
.game-toast.toast-success { background: #15803d; border-color: #22c55e; }
.game-toast.toast-bonus { background: #b45309; border-color: #f59e0b; }

/* ======================================================
   Magnifier Bubble & Speech Buttons (v19)
   ====================================================== */
.magnifier-bubble {
  position: fixed;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #a855f7;
  color: #ffffff;
  border: 3px solid #fde047;
  font-size: 1.5rem;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  animation: popMagnifier 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.magnifier-bubble.show {
  display: flex !important;
}

@keyframes popMagnifier {
  from { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.ribbon-wrap {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.ribbon-wrap .word-ribbon-badge {
  position: static;
  transform: none;
}

.speak-btn {
  background: #ffffff;
  border: 2px solid #a855f7;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.12s;
}

.speak-btn:active {
  transform: scale(0.9);
  background: #f3e8ff;
}

.small-speak {
  width: 32px;
  height: 32px;
  font-size: 1rem;
}

.def-collocations-box {
  background: rgba(168, 85, 247, 0.08);
  border: 1px dashed rgba(168, 85, 247, 0.4);
  border-radius: 12px;
  padding: 8px 10px;
}

.collocations-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #7c3aed;
  display: block;
  margin-bottom: 4px;
}

.collocations-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.collocation-tag {
  background: #ffffff;
  border: 1px solid #e9d5ff;
  color: #6b21a8;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
}

.blitz-word-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ======================================================
   Theme Badge & Monster Stage Levels Screen (v20)
   ====================================================== */
.theme-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #f3e8ff;
  padding: 3px 12px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.stage-screen-view {
  padding-top: 16px;
  justify-content: flex-start;
}

.stage-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}

.stage-app-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.bonus-piggy-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.5);
  padding: 4px 12px;
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.piggy-icon { font-size: 1.3rem; }
.piggy-count { font-size: 0.9rem; font-weight: 900; color: #fde047; }

/* Flask & Monster in circle */
.stage-monster-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0 16px 0;
}

.monster-flask-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, #3d2c39 0%, #20171e 100%);
  border: 6px solid #5c4756;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(168, 85, 247, 0.25);
  position: relative;
}

.monster-avatar {
  font-size: 4.5rem;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
  animation: floatMonster 3s infinite ease-in-out;
}

@keyframes floatMonster {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.stage-monster-name {
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffffff;
  margin-top: 10px;
}

.stage-percent-text {
  font-size: 1.6rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Milestone Track Line */
.stage-milestone-track-wrap {
  position: relative;
  margin: 16px 0 12px 0;
  padding: 0 10px;
}

.milestone-track-bg {
  width: 100%;
  height: 10px;
  background: #382c35;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.milestone-track-fill {
  height: 100%;
  background: linear-gradient(90deg, #eab308 0%, #fde047 100%);
  border-radius: 5px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(253, 224, 71, 0.7);
}

.stage-milestones-points-row {
  display: flex;
  justify-content: space-between;
  margin-top: -18px;
  position: relative;
  z-index: 2;
}

.milestone-point-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.milestone-icon-bubble {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2b2029;
  border: 2px solid #5c4756;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.milestone-point-item.reached .milestone-icon-bubble {
  border-color: #fde047;
  background: #43333f;
  box-shadow: 0 0 10px rgba(253, 224, 71, 0.6);
}

.milestone-lbl {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* Big Green 3D Play Button (в точности как на референсе) */
.stage-green-play-btn {
  background: #22c55e;
  border: none;
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 16px 20px;
  border-radius: 20px;
  box-shadow: 0 6px 0 #15803d, 0 12px 24px rgba(34, 197, 94, 0.45);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.stage-green-play-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #15803d, 0 6px 12px rgba(34, 197, 94, 0.45);
}

.stage-toggle-grid-row {
  display: flex;
  justify-content: center;
}

.levels-grid-collapsible {
  width: 100%;
}

/* ======================================================
   Interactive Badges, CEFR Breakdown & Custom Alerts (v22)
   ====================================================== */
.clickable-badge {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.clickable-badge:active {
  transform: scale(0.92);
}

/* Fix Blitz Header Overlapping */
.blitz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 46px !important; /* Безопасная зона для крестика ✕ */
  margin-bottom: 8px;
}

.blitz-title {
  font-size: 1rem;
  font-weight: 800;
  color: #c084fc;
}

.blitz-badge {
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(168, 85, 247, 0.25);
  color: #f3e8ff;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

/* CEFR Progress Breakdown Card */
.cefr-breakdown-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cefr-breakdown-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fde047;
  margin-bottom: 10px;
  text-align: left;
}

.cefr-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cefr-breakdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cefr-lvl-tag {
  font-size: 0.75rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 8px;
  min-width: 38px;
  text-align: center;
}

.cefr-lvl-tag.A1 { background: #166534; color: #86efac; }
.cefr-lvl-tag.A2 { background: #1e40af; color: #93c5fd; }
.cefr-lvl-tag.B1 { background: #854d0e; color: #fde047; }
.cefr-lvl-tag.B2 { background: #701a75; color: #f0abfc; }
.cefr-lvl-tag.C1 { background: #991b1b; color: #fca5a5; }

.cefr-bar-bg {
  flex: 1;
  height: 7px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.cefr-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.cefr-bar-fill.A1 { background: #22c55e; }
.cefr-bar-fill.A2 { background: #3b82f6; }
.cefr-bar-fill.B1 { background: #eab308; }
.cefr-bar-fill.B2 { background: #d946ef; }
.cefr-bar-fill.C1 { background: #ef4444; }

.cefr-count-txt {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  min-width: 75px;
  text-align: right;
}

.cefr-lock-badge {
  font-size: 0.75rem;
  margin-left: 2px;
}

/* Custom In-Game Info Dialog */
.info-dialog-card {
  max-width: 350px;
  padding: 24px 20px;
  background: var(--surface-color);
  border: 1px solid #5c4756;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.info-dialog-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.info-dialog-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: #fde047;
  margin-bottom: 8px;
}

.info-dialog-message-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #f8fafc;
  text-align: left;
}

/* ======================================================
   Word of the Day Card (v25)
   ====================================================== */
.word-of-day-card {
  background: linear-gradient(135deg, #3d2b3c 0%, #261924 100%);
  border: 1.5px solid #a855f7;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.25);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.wod-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wod-badge {
  font-size: 0.8rem;
  font-weight: 900;
  color: #fde047;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  padding: 3px 10px;
  border-radius: 12px;
}

.wod-reward-tag {
  font-size: 0.8rem;
  font-weight: 800;
  color: #86efac;
}

.wod-word-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wod-word {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.wod-phonetic {
  font-size: 0.85rem;
  color: #c084fc;
}

.wod-translation {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
  margin-top: 4px;
}

.wod-example {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}

/* ======================================================
   Community Highlight Card (v30)
   ====================================================== */
.community-highlight-card {
  background: linear-gradient(135deg, #3d2b3c 0%, #291a27 100%);
  border: 1.5px solid #a855f7;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.25);
  margin-bottom: 12px;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

/* ======================================================
   Finishing Touches: Sleek Dots, Large Theme, Quests & Share (v33)
   ====================================================== */
.slot-dots {
  font-size: 0.48rem !important;
  letter-spacing: 2.2px !important;
  vertical-align: middle !important;
  opacity: 0.65 !important;
}

.slot-length {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  opacity: 0.75 !important;
}

.progress-label {
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  color: #f8fafc !important;
  letter-spacing: 0.3px !important;
}

.theme-pill-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: rgba(168, 85, 247, 0.32) !important;
  border: 1.5px solid rgba(192, 132, 252, 0.65) !important;
  color: #ffffff !important;
  padding: 6px 18px !important;
  border-radius: 20px !important;
  font-size: 0.98rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.4px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

.community-highlight-card {
  background: linear-gradient(135deg, #3d2b3c 0%, #291a27 100%) !important;
  border: 1.5px solid #a855f7 !important;
  border-radius: 16px !important;
  padding: 16px !important;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.25) !important;
  margin-bottom: 12px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 400px !important;
  box-sizing: border-box !important;
}

.share-highlight-btn {
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
  border: 2px solid #c084fc;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.share-highlight-btn:active {
  transform: scale(0.98);
}

.btn-main-label {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.btn-bonus-chip {
  background: #fde047;
  color: #713f12;
  font-size: 0.8rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.tg-feedback-link-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(168, 85, 247, 0.5);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 16px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s ease, transform 0.15s ease;
}

.tg-feedback-link-btn:active {
  background: rgba(168, 85, 247, 0.2);
  transform: scale(0.98);
}

.tg-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tg-btn-icon {
  font-size: 1.3rem;
}

.tg-btn-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.tg-btn-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
}

.tg-btn-sub {
  font-size: 0.76rem;
  font-weight: 600;
  color: #c084fc;
  letter-spacing: 0.2px;
  margin-top: 1px;
}

.tg-btn-arrow {
  font-size: 1rem;
  color: #c084fc;
  font-weight: 800;
}

/* Quest Done Badge */
.quest-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quest-check-pill {
  background: #22c55e;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 900;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quest-done-badge {
  background: rgba(34, 197, 94, 0.2);
  border: 1.5px solid #22c55e;
  color: #86efac;
  font-size: 0.8rem;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.claim-ready-btn {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border: 1.5px solid #86efac;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 900;
  padding: 8px 16px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(34, 197, 94, 0.4);
}

.quest-progress-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 12px;
}


/* ======================================================
   Main Game Screen & Board Layout (v36)
   ====================================================== */
#screen-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 4px 12px 10px 12px;
  box-sizing: border-box;
}

.game-top-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin-bottom: 4px;
}

.progress-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f1e6ef;
  letter-spacing: 0.2px;
}

.theme-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.28);
  border: 1.5px solid rgba(192, 132, 252, 0.55);
  color: #ffffff;
  padding: 4px 14px;
  border-radius: 18px;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  margin-bottom: 2px;
}

.word-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 380px;
}

.word-slot {
  background: var(--surface-color);
  border: 1px dashed var(--surface-border);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--text-color);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.word-slot.found {
  transform: scale(1.04);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.slot-dots {
  font-size: 0.52rem;
  letter-spacing: 2px;
  vertical-align: middle;
  opacity: 0.7;
}

.slot-length {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.75;
  margin-left: 2px;
}

.preview-wrapper {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px 0;
}

/* Clean Seamless Game Board (Без фона и рамок - фишки прямо на фоне игры) */
.grid-container {
  width: 100% !important;
  max-width: min(88vw, 360px) !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  position: relative !important;
  touch-action: none !important;
  margin: 6px auto 12px auto !important;
  box-sizing: border-box !important;
}

.drag-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.drag-svg-glow {
  fill: none;
  stroke: rgba(192, 132, 252, 0.45);
  stroke-width: 18px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drag-svg-core {
  fill: none;
  stroke: #c084fc;
  stroke-width: 7px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.letter-grid {
  display: grid;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.grid-cell {
  background: var(--cell-bg);
  border: 2px solid var(--cell-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: var(--cell-text);
  box-shadow: var(--cell-shadow);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.grid-cell .hint-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #7c2d12;
}

.letter-grid[data-size="4"] { gap: 10px; }
.letter-grid[data-size="4"] .grid-cell { font-size: 1.75rem; border-radius: 16px; }

.letter-grid[data-size="5"] { gap: 8px; }
.letter-grid[data-size="5"] .grid-cell { font-size: 1.5rem; border-radius: 14px; }

.letter-grid[data-size="6"] { gap: 6px; }
.letter-grid[data-size="6"] .grid-cell { font-size: 1.25rem; border-radius: 11px; }

.letter-grid[data-size="7"] { gap: 5px; }
.letter-grid[data-size="7"] .grid-cell { font-size: 1.05rem; border-radius: 9px; }

.letter-grid[data-size="8"] { gap: 4px; }
.letter-grid[data-size="8"] .grid-cell { font-size: 0.9rem; border-radius: 7px; }

.letter-grid[data-size="9"] { gap: 3px; }
.letter-grid[data-size="9"] .grid-cell { font-size: 0.78rem; border-radius: 6px; }

.game-controls {
  width: 100%;
  max-width: min(88vw, 360px);
  margin-top: 2px;
}


/* Mid-Screen Toast (Между слотами и полем - не перекрывает тему и шапку v38) */
.preview-wrapper {
  min-height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  width: 100% !important;
  max-width: 360px !important;
  margin: 2px 0 4px 0 !important;
}

.game-mid-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(31, 21, 30, 0.96);
  color: #ffffff;
  padding: 5px 16px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  border: 1.5px solid #a855f7;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 20;
}

.game-mid-toast.show {
  opacity: 1 !important;
  transform: translate(-50%, -50%) scale(1) !important;
}

.game-mid-toast.toast-success {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  border-color: #4ade80;
  color: #ffffff;
}

.game-mid-toast.toast-bonus {
  background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
  border-color: #fde047;
  color: #ffffff;
}

.game-mid-toast.toast-warning {
  background: #dc2626;
  border-color: #f87171;
  color: #ffffff;
}

.game-mid-toast.toast-info {
  background: #3b0764;
  border-color: #c084fc;
  color: #f3e8ff;
}


/* ==================================================== */
/* MULTILINGUAL LANGUAGE SELECTOR & CHECHEN GRAPHIC TILES */
/* ==================================================== */
.lang-selector-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid var(--border-color, #4a384b);
  background: var(--bg-card, #2b1f2d);
  color: var(--text-color, #f3f4f6);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.12);
}

.lang-btn.active {
  background: rgba(122, 162, 255, 0.32);
  border-color: rgba(201, 214, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.lang-current-label {
  margin: 10px 0 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffe08a;
}

.welcome-lang-overlay {
  z-index: 10050;
}

.welcome-lang-card {
  max-width: 400px;
  padding: 28px 22px 22px;
  text-align: center;
}

.welcome-lang-logo {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #e9d5ff;
  margin-bottom: 8px;
}

.welcome-lang-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffffff;
}

.welcome-lang-lead {
  margin: 10px 0 4px;
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.welcome-lang-note {
  margin: 0 0 18px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.welcome-lang-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.welcome-lang-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 10px 14px;
  border-radius: 18px;
  border: 2px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.welcome-lang-choice:active {
  transform: scale(0.97);
}

.welcome-lang-choice:hover,
.welcome-lang-choice:focus-visible {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.18);
  outline: none;
}

.welcome-lang-flag {
  font-size: 1.8rem;
  line-height: 1;
}

.welcome-lang-name {
  font-size: 1rem;
  font-weight: 800;
}

.welcome-lang-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.howto-list {
  margin: 8px 0 18px;
  padding: 0 0 0 1.15rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 650;
}

.welcome-lang-hint {
  margin: 16px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: left;
}

.lang-flag {
  font-size: 18px;
  display: inline-flex;
  align-items: center;
}

/* Флаг Чеченской Республики (не Ичкерия): зелёное поле, белая и красная полосы, жёлтая кайма с орнаментом */
.flag-ce {
  display: inline-block;
  width: 1.4em;
  height: 0.93em;
  vertical-align: -0.12em;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.22);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 24'%3E%3Crect width='36' height='24' fill='%232d8a4e'/%3E%3Crect y='16.8' width='36' height='7.2' fill='%23c41e3a'/%3E%3Crect y='15.2' width='36' height='1.7' fill='%23ffffff'/%3E%3Crect width='7.4' height='24' fill='%23e6c34a'/%3E%3Cpath fill='%23ffffff' d='M1.4 3.4 L3.7 1.6 L6 3.4 L3.7 5.2Z M1.4 8.2 L3.7 6.4 L6 8.2 L3.7 10Z M1.4 13 L3.7 11.2 L6 13 L3.7 14.8Z M1.4 17.8 L3.7 16 L6 17.8 L3.7 19.6Z'/%3E%3C/svg%3E");
  background-size: cover;
  background-repeat: no-repeat;
}
.info-dialog-icon .flag-ce {
  width: 2.4em;
  height: 1.6em;
}
.cefr-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.setting-hint-text {
  font-size: 12px;
  color: var(--text-muted, #9ca3af);
  margin-top: 8px;
  line-height: 1.4;
}

.grid-cell.cell-multichar {
  font-size: clamp(14px, 4.2vw, 22px) !important;
  letter-spacing: -0.5px;
}


/* SVG Drag Line Connector Fix - strictly stroke without fill */
#drag-connector-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

#drag-connector-svg path.drag-line {
  fill: none !important;
  stroke: #a855f7 !important;
  stroke-width: 8px !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.7));
}


/* ==================================================== */
/* CELL SELECTION & HINT HIGHLIGHT FIXES */
/* ==================================================== */

/* Highlight when letter is swiped / selected */
.grid-cell.cell-selected,
.grid-cell.selected {
  background: #a855f7 !important;
  border-color: #c084fc !important;
  color: #ffffff !important;
  transform: scale(1.08) !important;
  box-shadow: 0 4px 0 #7e22ce, 0 0 16px rgba(168, 85, 247, 0.75) !important;
  z-index: 5 !important;
}

.grid-cell.cell-selected-first {
  border-color: #e9d5ff !important;
}

.grid-cell.cell-selected-head {
  border-color: #ffffff !important;
  box-shadow: 0 4px 0 #7e22ce, 0 0 20px rgba(192, 132, 252, 0.9) !important;
}

/* Highlight when letter is revealed by hint */
.grid-cell.cell-hint-revealed,
.grid-cell.hinted {
  background: #fef08a !important;
  border: 2px solid #eab308 !important;
  color: #713f12 !important;
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.65) !important;
  animation: hint-glow 1.5s infinite alternate !important;
}

.grid-cell .hint-badge {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 0.65rem;
  font-weight: 900;
  color: #854d0e;
  background: rgba(254, 240, 138, 0.9);
  padding: 1px 4px;
  border-radius: 6px;
  border: 1px solid #eab308;
  display: none;
}

@keyframes hint-glow {
  0% { box-shadow: 0 0 6px rgba(234, 179, 8, 0.4); }
  100% { box-shadow: 0 0 18px rgba(234, 179, 8, 0.85); transform: scale(1.03); }
}

/* Chechen 2-character tiles: bold, uppercase, balanced font sizing */
.grid-cell.cell-multichar {
  font-weight: 900 !important;
  letter-spacing: -1px !important;
  text-transform: uppercase !important;
}

.letter-grid[data-size="4"] .grid-cell.cell-multichar {
  font-size: 1.45rem !important;
}

.letter-grid[data-size="5"] .grid-cell.cell-multichar {
  font-size: 1.25rem !important;
}

.letter-grid[data-size="6"] .grid-cell.cell-multichar {
  font-size: 1.05rem !important;
}

.letter-grid[data-size="7"] .grid-cell.cell-multichar {
  font-size: 0.88rem !important;
}

.letter-grid[data-size="8"] .grid-cell.cell-multichar {
  font-size: 0.76rem !important;
}

.letter-grid[data-size="9"] .grid-cell.cell-multichar {
  font-size: 0.66rem !important;
}

/* CEFR Explanation card */
.cefr-info-banner {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-color, #f3f4f6);
  line-height: 1.45;
}

.cefr-info-banner-title {
  font-weight: 700;
  color: #c084fc;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}


/* Coin pop animation when reward is claimed */
.coins-badge.coin-pop-anim {
  animation: coin-pop 0.35s ease-out;
}

@keyframes coin-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.22); background: rgba(234, 179, 8, 0.45); }
  100% { transform: scale(1); }
}

/* Quest checkmark badge */
.quest-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quest-check-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #22c55e;
  color: #ffffff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
}

.claimed-btn {
  background: rgba(34, 197, 94, 0.18) !important;
  color: #86efac !important;
  border: 1px solid #22c55e !important;
  cursor: default;
}

.claim-ready-btn.pulse-ready {
  animation: pulse-glow-btn 1.2s infinite alternate;
}

@keyframes pulse-glow-btn {
  0% { box-shadow: 0 0 4px rgba(168, 85, 247, 0.3); }
  100% { box-shadow: 0 0 16px rgba(168, 85, 247, 0.85); transform: scale(1.02); }
}

/* CEFR Info list */
.cefr-info-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
}

.cefr-info-list li {
  margin-bottom: 6px;
  font-size: 0.82rem;
  line-height: 1.35;
}

/* ==================================================== */
/* SHARE PROGRESS MODAL & WORD MASTERY STYLES (v44) */
/* ==================================================== */

.share-preview-card {
  background: linear-gradient(135deg, #2d1838, #1c1024);
  border: 2px solid #a855f7;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.share-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.share-card-logo {
  font-weight: 900;
  font-size: 1.1rem;
  color: #c084fc;
}

.share-card-badge {
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid #a855f7;
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #e9d5ff;
}

.share-mastery-title {
  font-size: 1.85rem;
  font-weight: 900;
  color: #fef08a;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
  margin-bottom: 4px;
}

.share-mastery-desc {
  font-size: 0.9rem;
  color: #d8b4fe;
  margin-bottom: 14px;
}

.share-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.share-stat-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.share-stat-box .stat-num {
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
}

.share-stat-box .stat-lbl {
  font-size: 0.68rem;
  color: #9ca3af;
  margin-top: 2px;
}

.share-actions-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.social-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: none;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s;
}

.social-share-btn:hover {
  transform: translateY(-2px);
}

.social-share-btn.tg-btn {
  background: #229ED9;
  color: #ffffff;
}

.social-share-btn.wa-btn {
  background: #25D366;
  color: #ffffff;
}

.social-share-btn.copy-btn {
  background: #374151;
  color: #f3f4f6;
  border: 1px solid #4b5563;
}


/* CEFR Breakdown list in Vocab screen */
.cefr-info-banner {
  background: rgba(168, 85, 247, 0.14);
  border: 2px solid rgba(168, 85, 247, 0.4);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}

.cefr-info-banner-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fef08a;
  margin-bottom: 6px;
}

.cefr-info-intro {
  font-size: 0.82rem;
  color: #e9d5ff;
  line-height: 1.4;
  margin-bottom: 8px;
}

.cefr-level-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cefr-level-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
}

.cefr-lvl-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 24px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 0.75rem;
  color: #ffffff;
  flex-shrink: 0;
}

.cefr-lvl-pill.A1 { background: #22c55e; }
.cefr-lvl-pill.A2 { background: #3b82f6; }
.cefr-lvl-pill.B1 { background: #f59e0b; }
.cefr-lvl-pill.B2 { background: #ec4899; }
.cefr-lvl-pill.C1 { background: #ef4444; }
.cefr-lvl-pill.C2 { background: #8b5cf6; }

.cefr-level-text {
  font-size: 0.78rem;
  color: #f3f4f6;
  line-height: 1.35;
}

.cefr-level-text strong {
  color: #ffffff;
}

.secondary-share-btn {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.3)) !important;
  border: 1px solid rgba(147, 51, 234, 0.5) !important;
  margin-top: 8px;
}


/* Found word cells: cozy, vibrant pastel gradient cards */
.grid-cell.cell-found,
.grid-cell.found {
  color: #ffffff !important;
  font-weight: 900 !important;
  border-width: 2px !important;
  border-style: solid !important;
  border-radius: 13px !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
  transform: scale(0.97);
  transition: all 0.25s ease;
  z-index: 3;
}

.word-slot.found {
  border-radius: 12px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}


/* Share preview card mobile responsiveness */
.share-preview-card {
  background: linear-gradient(135deg, #2d1838, #1c1024);
  border: 2px solid #a855f7;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.share-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.share-stat-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.share-stat-box .stat-num {
  font-size: 1rem;
  font-weight: 900;
  color: #ffffff;
  white-space: nowrap;
}

.share-stat-box .stat-lbl {
  font-size: 0.65rem;
  color: #9ca3af;
  margin-top: 2px;
  white-space: nowrap;
}


/* ==================================================== */
/* EXACT VISUAL RESTORATION (Screenshots 42, 44, 45) */
/* ==================================================== */

/* 1. Screenshot 44: Word Definition Modal (Clean white card with floating purple pill) */
.definition-card {
  max-width: 360px !important;
  padding-top: 32px !important;
  background: #ffffff !important;
  border: none !important;
  border-radius: 24px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
  position: relative !important;
  color: #2b2029 !important;
}

.def-header {
  position: absolute !important;
  top: -18px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  z-index: 10 !important;
}

.def-word-badge {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%) !important;
  color: #ffffff !important;
  padding: 8px 24px !important;
  border-radius: 20px !important;
  font-size: 1.3rem !important;
  font-weight: 900 !important;
  letter-spacing: 1.5px !important;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4) !important;
  text-shadow: none !important;
}

.def-phonetic-text {
  font-size: 0.85rem !important;
  color: #64748b !important;
  font-style: italic !important;
  margin-bottom: 6px !important;
}

.def-translation-title {
  font-size: 1.3rem !important;
  font-weight: 900 !important;
  color: #7c3aed !important;
  margin-bottom: 8px !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.def-meaning-text {
  font-size: 0.95rem !important;
  line-height: 1.45 !important;
  color: #475569 !important;
  margin-bottom: 12px !important;
}

.definition-card .modal-action-btn {
  background: #a855f7 !important;
  color: #ffffff !important;
  border-radius: 16px !important;
  font-weight: 800 !important;
  padding: 12px !important;
  border: none !important;
}

/* 2. Screenshot 42: Placement Modal (Clean white card & responsive words) */
.placement-modal-card {
  max-width: 360px !important;
  background: #ffffff !important;
  border: none !important;
  border-radius: 24px !important;
  padding: 24px 20px !important;
  color: #2b2029 !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
}

.placement-modal-card h2 {
  color: #7c3aed !important;
  font-size: 1.25rem !important;
  font-weight: 900 !important;
}

.quiz-word-card {
  background: #f8f5f8 !important;
  border: 2px solid #e9d5ff !important;
  border-radius: 18px !important;
  min-height: 80px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px 14px !important;
  overflow: hidden !important;
}

.quiz-target-word {
  font-size: clamp(1.15rem, 5.5vw, 1.85rem) !important;
  font-weight: 900 !important;
  color: #7c3aed !important;
  text-align: center !important;
  word-break: break-word !important;
  line-height: 1.2 !important;
}

.quiz-prompt {
  color: #64748b !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  text-align: center !important;
  margin: 12px 0 16px 0 !important;
}

/* 3. Screenshot 45: Vocab cards */
.vocab-card {
  background: var(--surface-color) !important;
  border: 1px solid var(--surface-border) !important;
  border-radius: 16px !important;
  padding: 12px 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  cursor: pointer !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
  transition: transform 0.15s, box-shadow 0.15s !important;
  margin-bottom: 8px !important;
}

.vocab-card-left {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  text-align: left !important;
}

.vocab-word-title {
  font-size: 1.05rem !important;
  font-weight: 900 !important;
  color: #34d399 !important;
}

.mastery-stars {
  font-size: 0.8rem !important;
  margin-left: 4px !important;
  color: #fde047 !important;
}

.vocab-word-tr {
  font-size: 0.85rem !important;
  color: #f8fafc !important;
}

.vocab-word-ph {
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
  font-style: italic !important;
}

.vocab-tag {
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  padding: 3px 8px !important;
  border-radius: 8px !important;
  background: rgba(16, 185, 129, 0.25) !important;
  color: #6ee7b7 !important;
}

/* Modal Close Icon: Bright, prominent, high z-index in top-right */
.modal-close-icon {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  width: 32px !important;
  height: 32px !important;
  background: rgba(0, 0, 0, 0.08) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 50% !important;
  color: #475569 !important;
  font-size: 16px !important;
  font-weight: bold !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 25 !important;
}

.modal-content.modal-card .modal-close-icon,
.share-preview-card ~ .modal-close-icon {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}


/* ==================================================== */
/* v54 CLEAN WHITE SHARE MODALS & REFINED LAYOUT */
/* ==================================================== */

/* 1. White card for Share Game and Share Progress modals */
#modal-share-game .modal-card,
#modal-share-progress .modal-card,
.share-modal-card {
  background: #ffffff !important;
  color: #1e293b !important;
  border: none !important;
  border-radius: 24px !important;
  padding: 24px 18px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
  max-width: 360px !important;
  width: 90% !important;
  box-sizing: border-box !important;
  text-align: center !important;
  position: relative !important;
}

#modal-share-game h2,
#modal-share-progress h2 {
  color: #7c3aed !important;
  font-size: 1.25rem !important;
  font-weight: 900 !important;
  margin-bottom: 4px !important;
}

/* 2. Three share buttons: neat grid without text overflow */
.share-actions-container {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-top: 12px !important;
}

.social-share-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 10px 4px !important;
  border-radius: 12px !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  border: none !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-sizing: border-box !important;
}

.social-share-btn.tg-btn {
  background: #229ED9 !important;
  color: #ffffff !important;
}

.social-share-btn.wa-btn {
  background: #25D366 !important;
  color: #ffffff !important;
}

.social-share-btn.copy-btn {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

.share-native-btn,
#btn-game-share-native,
#btn-share-native {
  background: #7c3aed !important;
  color: #ffffff !important;
  border-radius: 16px !important;
  font-weight: 800 !important;
  padding: 12px 14px !important;
  font-size: 0.88rem !important;
  border: none !important;
  cursor: pointer !important;
  width: 100% !important;
  margin-top: 10px !important;
  white-space: nowrap !important;
}

/* 3. Clean light preview card for progress share */
.share-preview-card {
  background: #f8f5f8 !important;
  border: 2px solid #e9d5ff !important;
  border-radius: 18px !important;
  padding: 14px 12px !important;
  text-align: center !important;
  margin-bottom: 12px !important;
  box-sizing: border-box !important;
}

.share-card-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px !important;
}

.share-card-logo {
  font-weight: 900 !important;
  font-size: 1rem !important;
  color: #7c3aed !important;
}

.share-card-badge {
  background: #e9d5ff !important;
  border-radius: 10px !important;
  padding: 2px 8px !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  color: #6b21a8 !important;
}

.share-mastery-title {
  font-size: 1.5rem !important;
  font-weight: 900 !important;
  color: #7c3aed !important;
  margin-bottom: 2px !important;
}

.share-mastery-desc {
  font-size: 0.82rem !important;
  color: #64748b !important;
  margin-bottom: 10px !important;
}

.share-stats-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr !important;
  gap: 6px !important;
}

.share-stat-box {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 6px 2px !important;
}

.share-stat-box .stat-num {
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  color: #1e293b !important;
}

.share-stat-box .stat-lbl {
  font-size: 0.65rem !important;
  color: #64748b !important;
}

/* 4. Level Map: 4-column level cards grid & horizontal milestones */
#levels-grid,
.levels-grid,
.levels-scroll-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: 420px !important;
  margin: 0 auto !important;
  padding: 10px 0 20px 0 !important;
}

.level-card {
  aspect-ratio: 1 / 1 !important;
  background: var(--surface-color) !important;
  border: 2px solid var(--surface-border) !important;
  border-radius: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: transform 0.15s, border-color 0.15s !important;
}

.level-card.unlocked {
  border-color: #a855f7 !important;
  color: #ffffff !important;
}

.level-card.current {
  border-color: #fbbf24 !important;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.6) !important;
  background: rgba(168, 85, 247, 0.3) !important;
}

.level-card.locked {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.level-num {
  font-size: 1.15rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
}

.level-stars {
  font-size: 0.72rem !important;
  color: #fde047 !important;
  margin-top: 2px !important;
}

#stage-milestones-points,
.stage-milestones-points,
.stage-milestones-points-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  margin-top: -18px !important;
  position: relative !important;
  z-index: 2 !important;
  width: 100% !important;
}

.milestone-point-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 3px !important;
}

.milestone-icon-bubble {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: #2b2029 !important;
  border: 2px solid #5c4756 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1rem !important;
}

.milestone-point-item.reached .milestone-icon-bubble {
  border-color: #fde047 !important;
  background: #43333f !important;
  box-shadow: 0 0 10px rgba(253, 224, 71, 0.6) !important;
}

.milestone-lbl {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  color: var(--text-muted) !important;
}

/* 5. Daily Streak Calendar: clean 7-column row */
.daily-calendar-grid {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 4px !important;
  width: 100% !important;
  margin-top: 10px !important;
}

.reward-day-item {
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  padding: 8px 2px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  min-height: 64px !important;
  gap: 2px !important;
}


/* ==================================================== */
/* v54 SHARE MODALS WHITE CARD DESIGN & MAP FIXES */
/* ==================================================== */

/* Share Modals (Invite Friends & Share Progress): Clean White Card Design */
#modal-share-game .modal-card,
#modal-share-progress .modal-card {
  background: #ffffff !important;
  border-radius: 24px !important;
  padding: 24px 18px 20px 18px !important;
  color: #1e293b !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
  max-width: 380px !important;
  width: 92% !important;
  position: relative !important;
}

#modal-share-game .modal-header h2,
#modal-share-progress .modal-header h2 {
  color: #7c3aed !important;
  font-size: 1.3rem !important;
  font-weight: 900 !important;
  text-align: center !important;
  margin-bottom: 8px !important;
}

#modal-share-game p,
#modal-share-progress p {
  color: #475569 !important;
  font-size: 0.9rem !important;
}

/* 3 Social Buttons Grid: Compact, perfectly fitted, zero overflowing */
.share-actions-container {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 14px 0 10px 0 !important;
}

.social-share-btn {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 10px 4px !important;
  border-radius: 12px !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
}

.social-share-btn.tg-btn {
  background: #229ED9 !important;
  color: #ffffff !important;
}

.social-share-btn.wa-btn {
  background: #25D366 !important;
  color: #ffffff !important;
}

.social-share-btn.copy-btn {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

/* Main Share Button */
#modal-share-game .primary-btn,
#modal-share-progress .primary-btn {
  background: #a855f7 !important;
  color: #ffffff !important;
  border-radius: 16px !important;
  font-weight: 800 !important;
  padding: 12px !important;
  font-size: 0.9rem !important;
}

/* Close button on white card */
#modal-share-game .modal-close-icon,
#modal-share-progress .modal-close-icon {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  width: 32px !important;
  height: 32px !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 50% !important;
  color: #475569 !important;
  font-size: 16px !important;
  font-weight: bold !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 20 !important;
}

/* Levels map milestones: strictly horizontal layout */
.stage-milestones-track {
  position: relative !important;
  width: 100% !important;
  margin: 16px 0 10px 0 !important;
}

.stage-milestones-points {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  position: relative !important;
  width: 100% !important;
  z-index: 2 !important;
}

.milestone-point-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
}

.milestone-icon-bubble {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: var(--surface-color) !important;
  border: 2px solid var(--surface-border) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.4rem !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
}

.milestone-lbl {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  color: #c9b9c6 !important;
  white-space: nowrap !important;
}

.levels-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 10px !important;
  width: 100% !important;
  padding: 10px 0 20px 0 !important;
  box-sizing: border-box !important;
}


/* ==================================================== */
/* v54 CLEAN WHITE SHARE MODALS & REFINED MAP LAYOUTS */
/* ==================================================== */

/* Clean White Share Modal Card */
.share-modal-card {
  max-width: 360px !important;
  background: #ffffff !important;
  border: none !important;
  border-radius: 24px !important;
  padding: 24px 18px !important;
  color: #2b2029 !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
  text-align: center !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.share-modal-card h2 {
  color: #7c3aed !important;
  font-size: 1.3rem !important;
  font-weight: 900 !important;
  margin-bottom: 6px !important;
}

.share-modal-card p {
  color: #64748b !important;
  font-size: 0.88rem !important;
  line-height: 1.4 !important;
}

.share-preview-card {
  background: #f8f5f8 !important;
  border: 2px solid #e9d5ff !important;
  border-radius: 18px !important;
  padding: 14px !important;
  text-align: center !important;
  color: #2b2029 !important;
  box-shadow: none !important;
}

.share-card-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px !important;
}

.share-card-logo {
  font-weight: 900 !important;
  font-size: 1rem !important;
  color: #7c3aed !important;
}

.share-card-badge {
  background: #ede9fe !important;
  border: 1px solid #c4b5fd !important;
  border-radius: 10px !important;
  padding: 2px 8px !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  color: #6d28d9 !important;
}

.share-mastery-title {
  font-size: 1.6rem !important;
  font-weight: 900 !important;
  color: #7c3aed !important;
  text-shadow: none !important;
  margin-bottom: 2px !important;
}

.share-mastery-desc {
  font-size: 0.85rem !important;
  color: #64748b !important;
  margin-bottom: 10px !important;
}

.share-stats-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 6px !important;
}

.share-stat-box {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 6px 2px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
}

.share-stat-box .stat-num {
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  color: #1e293b !important;
}

.share-stat-box .stat-lbl {
  font-size: 0.65rem !important;
  color: #64748b !important;
  margin-top: 2px !important;
}

.share-actions-container {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 6px !important;
  width: 100% !important;
  margin-top: 12px !important;
  box-sizing: border-box !important;
}

.social-share-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 10px 2px !important;
  border-radius: 12px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  border: none !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

.social-share-btn.tg-btn {
  background: #229ED9 !important;
  color: #ffffff !important;
}

.social-share-btn.wa-btn {
  background: #25D366 !important;
  color: #ffffff !important;
}

.social-share-btn.copy-btn {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

.share-native-btn {
  background: #a855f7 !important;
  color: #ffffff !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  border-radius: 14px !important;
  padding: 12px !important;
  width: 100% !important;
  margin-top: 10px !important;
  border: none !important;
  cursor: pointer !important;
}

/* Modal Close Icon for White Modals */
.modal-overlay .modal-close-icon {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  width: 32px !important;
  height: 32px !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 50% !important;
  color: #64748b !important;
  font-size: 16px !important;
  font-weight: 900 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 30 !important;
}


/* ==================================================== */
/* v54 CLEAN WHITE SHARE MODAL & MAP LAYOUT REFINEMENTS */
/* ==================================================== */

/* Clean white background for share modals */
#modal-share-game .modal-card,
#modal-share-progress .modal-card {
  background: #ffffff !important;
  color: #1e293b !important;
  border-radius: 24px !important;
  padding: 24px 20px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
  max-width: 360px !important;
  width: 92% !important;
  position: relative !important;
}

#modal-share-game .modal-header h2,
#modal-share-progress .modal-header h2 {
  color: #7c3aed !important;
  font-size: 1.25rem !important;
  font-weight: 900 !important;
  text-align: center !important;
}

/* Share action buttons: 3 clean columns that never overflow */
.share-actions-container {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.social-share-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 10px 4px !important;
  border-radius: 12px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  border: none !important;
}

.social-share-btn.tg-btn {
  background: #229ED9 !important;
  color: #ffffff !important;
}

.social-share-btn.wa-btn {
  background: #25D366 !important;
  color: #ffffff !important;
}

.social-share-btn.copy-btn {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

#modal-share-game .modal-close-icon,
#modal-share-progress .modal-close-icon {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  width: 32px !important;
  height: 32px !important;
  background: rgba(0, 0, 0, 0.07) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 50% !important;
  color: #475569 !important;
  font-size: 16px !important;
  font-weight: bold !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 30 !important;
}


/* ==================================================== */
/* v54 UI REFINEMENTS: WHITE SHARE MODALS & CLASSIC MAP */
/* ==================================================== */

/* 1. White Share Modal Cards */
.share-white-modal-card {
  max-width: 360px !important;
  width: 90% !important;
  background: #ffffff !important;
  border: none !important;
  border-radius: 24px !important;
  padding: 22px 18px 20px 18px !important;
  color: #1e293b !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.modal-header-safe {
  padding-right: 36px !important;
  margin-bottom: 8px !important;
  text-align: left !important;
}

.modal-header-safe h2 {
  font-size: 1.18rem !important;
  font-weight: 900 !important;
  color: #7c3aed !important;
  margin: 0 !important;
  line-height: 1.25 !important;
}

.modal-close-icon-fixed {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
  font-size: 16px !important;
  font-weight: 900 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 50 !important;
  transition: transform 0.15s, background 0.15s !important;
}

.modal-close-icon-fixed:active {
  transform: scale(0.92) !important;
  background: #e2e8f0 !important;
}

.share-sub-text {
  font-size: 0.88rem !important;
  color: #64748b !important;
  margin-bottom: 12px !important;
  line-height: 1.35 !important;
}

.share-actions-grid-3 {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.social-share-pill {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 10px 2px !important;
  border-radius: 12px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  border: none !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.social-share-pill.tg-btn {
  background: #229ED9 !important;
  color: #ffffff !important;
}

.social-share-pill.wa-btn {
  background: #25D366 !important;
  color: #ffffff !important;
}

.social-share-pill.copy-btn {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

/* Inner preview card inside Share Progress */
.share-preview-card-inner {
  background: linear-gradient(135deg, #2d1838, #1c1024) !important;
  border: 2px solid #a855f7 !important;
  border-radius: 16px !important;
  padding: 14px 12px !important;
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.25) !important;
  text-align: center !important;
  margin-bottom: 12px !important;
}

.share-card-header-inner {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px !important;
}

.share-card-logo-inner {
  font-weight: 900 !important;
  font-size: 0.95rem !important;
  color: #c084fc !important;
}

.share-card-badge-inner {
  background: rgba(168, 85, 247, 0.25) !important;
  border: 1px solid #a855f7 !important;
  border-radius: 10px !important;
  padding: 2px 6px !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  color: #e9d5ff !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.share-mastery-title-inner {
  font-size: 1.45rem !important;
  font-weight: 900 !important;
  color: #fef08a !important;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.5) !important;
}

.share-mastery-desc-inner {
  font-size: 0.8rem !important;
  color: #d8b4fe !important;
  margin-bottom: 8px !important;
}

.share-stats-grid-inner {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 4px !important;
}

.share-stat-box-inner {
  background: rgba(0, 0, 0, 0.35) !important;
  border-radius: 8px !important;
  padding: 6px 2px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.stat-num-inner {
  font-size: 0.92rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  white-space: nowrap !important;
}

.stat-lbl-inner {
  font-size: 0.62rem !important;
  color: #9ca3af !important;
  margin-top: 1px !important;
}

/* 2. Classic Map (Screen: Levels) Styles from v39 */
.stage-screen-view {
  padding-top: 12px !important;
  width: 100% !important;
  max-width: 440px !important;
  margin: 0 auto !important;
}

.stage-top-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 12px !important;
  width: 100% !important;
}

.stage-app-title {
  font-size: 1.5rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
}

.bonus-piggy-badge {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgba(245, 158, 11, 0.25) !important;
  border: 1px solid rgba(245, 158, 11, 0.5) !important;
  padding: 4px 12px !important;
  border-radius: 18px !important;
  cursor: pointer !important;
}

.stage-monster-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  margin: 8px 0 14px 0 !important;
}

.monster-flask-ring {
  width: 130px !important;
  height: 130px !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, #3d2c39 0%, #20171e 100%) !important;
  border: 6px solid #5c4756 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(168, 85, 247, 0.25) !important;
}

.monster-avatar {
  font-size: 4.2rem !important;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4)) !important;
  animation: floatMonster 3s infinite ease-in-out !important;
}

.stage-monster-name {
  font-size: 1.35rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  margin-top: 8px !important;
}

.stage-percent-text {
  font-size: 1.45rem !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  margin-top: 2px !important;
}

.stage-milestone-track-wrap {
  position: relative !important;
  margin: 14px 0 10px 0 !important;
  width: 100% !important;
}

.milestone-track-bg {
  width: 100% !important;
  height: 10px !important;
  background: #382c35 !important;
  border-radius: 5px !important;
  overflow: hidden !important;
}

.milestone-track-fill {
  height: 100% !important;
  background: linear-gradient(90deg, #eab308 0%, #fde047 100%) !important;
  border-radius: 5px !important;
  transition: width 0.5s ease !important;
  box-shadow: 0 0 10px rgba(253, 224, 71, 0.7) !important;
}

.stage-milestones-points-row {
  display: flex !important;
  justify-content: space-between !important;
  margin-top: -18px !important;
  position: relative !important;
  z-index: 2 !important;
  width: 100% !important;
}

.milestone-point-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 3px !important;
}

.milestone-icon-bubble {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: #2b2029 !important;
  border: 2px solid #5c4756 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1rem !important;
}

.milestone-point-item.reached .milestone-icon-bubble {
  border-color: #fde047 !important;
  background: #43333f !important;
  box-shadow: 0 0 10px rgba(253, 224, 71, 0.6) !important;
}

.milestone-lbl {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  color: var(--text-muted) !important;
}

.stage-green-play-btn {
  background: #22c55e !important;
  border: none !important;
  color: #ffffff !important;
  font-size: 1.4rem !important;
  font-weight: 900 !important;
  letter-spacing: 1px !important;
  padding: 16px 20px !important;
  border-radius: 20px !important;
  box-shadow: 0 6px 0 #15803d, 0 12px 24px rgba(34, 197, 94, 0.45) !important;
  cursor: pointer !important;
  width: 100% !important;
}

.stage-green-play-btn:active {
  transform: translateY(4px) !important;
  box-shadow: 0 2px 0 #15803d, 0 6px 12px rgba(34, 197, 94, 0.45) !important;
}

.levels-scroll-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 8px !important;
  width: 100% !important;
  padding: 10px 0 !important;
}


/* ==================================================== */
/* v54 UI POLISH: White Share Modals & Classic 4-Col Calendar */
/* ==================================================== */

/* 1. White Share Modals */
#modal-share-game .modal-card,
#modal-share-progress .modal-card {
  background: #ffffff !important;
  color: #2b2029 !important;
  border-radius: 24px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
  max-width: 360px !important;
  padding: 24px 18px !important;
  position: relative !important;
  border: none !important;
}

#modal-share-game .modal-header h2,
#modal-share-progress .modal-header h2 {
  color: #7c3aed !important;
  font-size: 1.25rem !important;
  font-weight: 900 !important;
  text-align: center !important;
}

.share-preview-card {
  background: linear-gradient(135deg, #2d1838, #1c1024) !important;
  border: 2px solid #a855f7 !important;
  border-radius: 18px !important;
  padding: 16px 12px !important;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35) !important;
  text-align: center !important;
  position: relative !important;
  overflow: hidden !important;
  margin-top: 8px !important;
}

.share-actions-container {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.social-share-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 10px 4px !important;
  border-radius: 12px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  border: none !important;
}

.social-share-btn.tg-btn {
  background: #229ED9 !important;
  color: #ffffff !important;
}

.social-share-btn.wa-btn {
  background: #25D366 !important;
  color: #ffffff !important;
}

.social-share-btn.copy-btn {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

/* 2. Classic 4-Column Daily Streak Calendar (like v39) */
.daily-calendar-grid,
.rewards-calendar-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 6px !important;
  width: 100% !important;
  margin-top: 10px !important;
}

.reward-day-item {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--surface-border) !important;
  border-radius: 12px !important;
  padding: 8px 4px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  min-height: 60px !important;
  gap: 2px !important;
}

.reward-day-item:last-child {
  grid-column: span 2 !important;
}

.reward-day-item.current {
  border-color: #f43f5e !important;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.5) !important;
}

.reward-day-item.claimed {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
}

/* 3. Coin Vault Badge in Levels Screen */
.bonus-vault-badge {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid #eab308;
  border-radius: 14px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.vault-icon {
  font-size: 1.2rem;
}

.vault-count {
  font-size: 0.95rem;
  font-weight: 900;
  color: #fde047;
}


/* ==================================================== */
/* v54 WHITE SHARE MODALS & REFINED GRID LAYOUTS */
/* ==================================================== */

/* White background for Share Modals */
.share-white-modal {
  background: #ffffff !important;
  color: #2b2029 !important;
  border: none !important;
  border-radius: 24px !important;
  padding: 24px 18px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6) !important;
  max-width: 360px !important;
  box-sizing: border-box !important;
}

.share-white-modal .modal-close-icon {
  background: rgba(0, 0, 0, 0.08) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #475569 !important;
}

/* 3-column share actions: perfectly fitted without overflow */
.share-actions-container {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.social-share-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 10px 4px !important;
  border-radius: 12px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  border: none !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}

.social-share-btn.tg-btn {
  background: #229ED9 !important;
  color: #ffffff !important;
}

.social-share-btn.wa-btn {
  background: #25D366 !important;
  color: #ffffff !important;
}

.social-share-btn.copy-btn {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

/* Full-width native share button */
.primary-btn.full-width {
  width: 100% !important;
  font-size: 0.88rem !important;
  padding: 12px 14px !important;
  white-space: nowrap !important;
  border-radius: 16px !important;
  box-sizing: border-box !important;
}

/* Stage Milestones & Level Grid (Map Screen) */
.stage-milestones-track {
  position: relative !important;
  width: 100% !important;
  margin: 16px 0 10px 0 !important;
}

.stage-milestones-points {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  position: relative !important;
  width: 100% !important;
  z-index: 2 !important;
}

.milestone-point-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 4px !important;
}

.levels-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 10px !important;
  width: 100% !important;
  padding: 10px 0 20px 0 !important;
  box-sizing: border-box !important;
}

.level-card {
  aspect-ratio: 1 / 1 !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  border: 2px solid !important;
  position: relative !important;
}

/* 7-column horizontal streak calendar */
.daily-calendar-grid {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 4px !important;
  width: 100% !important;
  margin-top: 10px !important;
  box-sizing: border-box !important;
}

.reward-day-item {
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  padding: 8px 2px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  min-height: 64px !important;
  gap: 2px !important;
  box-sizing: border-box !important;
}

/* ======================================================
   Liquid Glass — единый слой поверх всех экранов
   Сетка букв та же, визуал плиток — матовое стекло.
   ====================================================== */
#app.liquid-app::before,
#app.liquid-app::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}
#app.liquid-app::before {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -60px;
  background: #4c6fff;
}
#app.liquid-app::after {
  width: 320px;
  height: 320px;
  bottom: 80px;
  left: -120px;
  background: #7a5cff;
}
#app.liquid-app > * {
  position: relative;
  z-index: 1;
}

.app-header {
  background: rgba(18, 20, 28, 0.42) !important;
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  border-bottom: 1px solid var(--surface-border) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 24px rgba(0, 0, 0, 0.18) !important;
}
.app-title {
  color: #f5f5f7 !important;
  font-weight: 700 !important;
  letter-spacing: -0.6px;
}
.level-badge,
.cefr-badge,
.coins-badge,
.theme-pill-badge,
.bonus-vault-badge {
  background: var(--glass) !important;
  border: 1px solid var(--surface-border) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
  color: var(--text-main) !important;
}
.cefr-badge { color: var(--primary) !important; }
.coins-badge { color: #ffe08a !important; }

.word-slot,
.word-preview-box,
.search-input,
.chip,
.cefr-breakdown-card,
.event-banner-card,
.vocab-card,
.settings-card,
.quest-card,
.info-dialog-card,
.modal-card {
  background: var(--glass) !important;
  border: 1px solid var(--surface-border) !important;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 32px rgba(0, 0, 0, 0.22) !important;
  color: var(--text-main);
}
.word-preview-box.active {
  color: #fff !important;
  background: rgba(122, 162, 255, 0.28) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 8px 28px rgba(122, 162, 255, 0.28) !important;
}
.word-slot.found {
  background: rgba(90, 200, 120, 0.22) !important;
  border-color: rgba(90, 200, 120, 0.45) !important;
  color: #dff8e6 !important;
}

.grid-cell {
  background: var(--cell-bg) !important;
  border: 1px solid var(--cell-border) !important;
  color: var(--cell-text) !important;
  font-weight: 700 !important;
  box-shadow: var(--cell-shadow) !important;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.grid-cell.cell-selected,
.grid-cell.selected,
.grid-cell.path-head,
.grid-cell.cell-selected-head,
.grid-cell.cell-selected-first {
  background: var(--cell-selected-bg) !important;
  border-color: rgba(255, 255, 255, 0.55) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 10px 24px rgba(90, 130, 255, 0.45) !important;
  transform: scale(1.05) !important;
}
.grid-cell.cell-hint-revealed,
.grid-cell.hinted {
  background: var(--cell-hint-bg) !important;
  border-color: var(--cell-hint-border) !important;
  color: var(--cell-hint-text) !important;
  box-shadow: 0 0 0 1px rgba(255, 214, 10, 0.35), 0 8px 20px rgba(255, 214, 10, 0.28) !important;
  animation: none !important;
}
.drag-svg-core { stroke: #9bb8ff !important; }
.drag-svg-glow { stroke: rgba(122, 162, 255, 0.35) !important; }

.primary-btn,
.action-btn,
.stage-green-play-btn,
.welcome-lang-choice {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 10px 28px rgba(0, 0, 0, 0.25) !important;
  font-weight: 600 !important;
  letter-spacing: 0.2px;
}
.primary-btn,
.stage-green-play-btn {
  background: linear-gradient(180deg, rgba(150, 180, 255, 0.55), rgba(90, 120, 240, 0.42)) !important;
}
.stage-green-play-btn:active,
.primary-btn:active,
.action-btn:active {
  transform: scale(0.98) translateY(0) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}
.pulse-glow { animation: none !important; }
.secondary-btn,
.small-btn {
  background: var(--glass) !important;
  border: 1px solid var(--surface-border) !important;
  color: var(--text-main) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.bottom-nav {
  left: 50% !important;
  width: calc(100% - 20px) !important;
  max-width: 480px !important;
  bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  height: 64px !important;
  padding: 6px 8px !important;
  border-radius: 22px !important;
  background: rgba(18, 20, 28, 0.5) !important;
  border: 1px solid var(--surface-border) !important;
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 12px 40px rgba(0, 0, 0, 0.35) !important;
}
.app-content {
  padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
}
.nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0 !important;
}
.nav-icon svg { width: 22px; height: 22px; display: block; }
.nav-item { color: rgba(235, 235, 245, 0.5) !important; }
.nav-item.active { color: #fff !important; }
#nav-btn-game.active,
#nav-btn-vocab.active,
#nav-btn-levels.active,
#nav-btn-daily.active,
#nav-btn-settings.active {
  color: #ffffff !important;
}
.nav-item.active .nav-icon {
  transform: none;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 4px;
}

.monster-flask-ring,
.monster-avatar {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 16px 40px rgba(0, 0, 0, 0.25) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.stage-monster-name,
.stage-percent-text,
.screen-header h2,
.modal-title {
  color: #f5f5f7 !important;
  font-weight: 700 !important;
}

.modal-overlay {
  background: rgba(8, 10, 16, 0.45) !important;
  backdrop-filter: blur(18px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(140%) !important;
}
.game-toast {
  background: rgba(22, 24, 32, 0.62) !important;
  border: 1px solid var(--surface-border) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.filter-chips .chip.active {
  background: rgba(122, 162, 255, 0.28) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: #fff !important;
}

#modal-share-game .modal-card,
#modal-share-progress .modal-card {
  max-width: 360px !important;
  width: min(92vw, 360px) !important;
  box-sizing: border-box !important;
}

#screen-settings .community-highlight-card {
  max-width: 400px !important;
  width: 100% !important;
}

/* Блиц-повторение: колонка, без наезда заголовка на крестик и таймер */
#modal-blitz-quiz .blitz-modal-card {
  width: min(92vw, 360px) !important;
  max-width: 360px !important;
  max-height: min(88dvh, 640px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 44px 16px 18px !important;
  text-align: center !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}
#modal-blitz-quiz .blitz-heading {
  margin: 0 !important;
  padding: 0 8px !important;
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: #f5f5f7 !important;
  line-height: 1.25 !important;
}
#modal-blitz-quiz .blitz-meta {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px 12px !important;
  font-size: 0.8rem !important;
  color: rgba(235, 235, 245, 0.7) !important;
}
#modal-blitz-quiz .blitz-step-pill,
#modal-blitz-quiz .blitz-xp {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 999px !important;
  padding: 3px 10px !important;
  font-weight: 600 !important;
  color: #fff !important;
}
#modal-blitz-quiz #blitz-correct-counter {
  color: #7ee0a3 !important;
}
#modal-blitz-quiz .blitz-progress-wrap {
  width: 100% !important;
  height: 5px !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border-radius: 99px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
}
#modal-blitz-quiz .blitz-progress-bar-fill {
  height: 100% !important;
  width: 0;
  background: linear-gradient(90deg, #7aa2ff, #9bb8ff) !important;
  border-radius: 99px !important;
}
#modal-blitz-quiz .blitz-card {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 18px !important;
  padding: 14px 12px 10px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
}
#modal-blitz-quiz .blitz-word {
  margin: 0 !important;
  font-size: clamp(1.15rem, 5.5vw, 1.55rem) !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  color: #fff !important;
  word-break: break-word !important;
  line-height: 1.2 !important;
}
#modal-blitz-quiz .blitz-ph {
  display: block !important;
  margin-top: 4px !important;
  font-size: 0.8rem !important;
  color: rgba(235, 235, 245, 0.55) !important;
  font-style: italic !important;
}
#modal-blitz-quiz .blitz-prompt {
  margin: 8px 0 0 !important;
  font-size: 0.78rem !important;
  color: rgba(235, 235, 245, 0.6) !important;
}
#modal-blitz-quiz .blitz-options-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
}
#modal-blitz-quiz .blitz-opt-btn {
  width: 100% !important;
  box-sizing: border-box !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #f5f5f7 !important;
  padding: 11px 12px !important;
  border-radius: 14px !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  white-space: normal !important;
  word-break: break-word !important;
  hyphens: auto;
  min-height: 44px !important;
}
#modal-blitz-quiz .blitz-opt-btn.correct {
  background: rgba(46, 180, 110, 0.45) !important;
  border-color: rgba(126, 224, 163, 0.7) !important;
  color: #fff !important;
}
#modal-blitz-quiz .blitz-opt-btn.wrong {
  background: rgba(220, 70, 70, 0.42) !important;
  border-color: rgba(255, 140, 140, 0.55) !important;
  color: #fff !important;
}

/* Отгаданные слова: пастельное стекло, каждое слово — свой цвет */
.grid-cell.cell-found,
.grid-cell.found {
  font-weight: 700 !important;
  transform: none !important;
  border-width: 1px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 16px rgba(0, 0, 0, 0.16) !important;
}
.grid-cell.found-tone-0, .word-slot.found.found-tone-0 { background: #b8e0d2 !important; border-color: #8fcbb6 !important; color: #14352c !important; }
.grid-cell.found-tone-1, .word-slot.found.found-tone-1 { background: #d4c8f5 !important; border-color: #b5a4e8 !important; color: #2a1f4a !important; }
.grid-cell.found-tone-2, .word-slot.found.found-tone-2 { background: #f5d7b8 !important; border-color: #e8bc8d !important; color: #4a2e12 !important; }
.grid-cell.found-tone-3, .word-slot.found.found-tone-3 { background: #b9d7f2 !important; border-color: #8bbbe6 !important; color: #16324a !important; }
.grid-cell.found-tone-4, .word-slot.found.found-tone-4 { background: #f3c5d4 !important; border-color: #e4a0b5 !important; color: #4a1c2c !important; }
.grid-cell.found-tone-5, .word-slot.found.found-tone-5 { background: #bfe8e2 !important; border-color: #8fd4ca !important; color: #13403b !important; }
.grid-cell.found-tone-6, .word-slot.found.found-tone-6 { background: #c9d0f7 !important; border-color: #a8b2ee !important; color: #1c2250 !important; }
.grid-cell.found-tone-7, .word-slot.found.found-tone-7 { background: #f6cfc0 !important; border-color: #ebb39c !important; color: #4a2416 !important; }
.grid-cell.found-tone-8, .word-slot.found.found-tone-8 { background: #ead4f2 !important; border-color: #d3b3e0 !important; color: #3a1f46 !important; }
.grid-cell.found-tone-9, .word-slot.found.found-tone-9 { background: #d3e8b8 !important; border-color: #b5d48c !important; color: #24380f !important; }

.word-slot.found {
  background: unset;
}

#modal-word-definition .definition-card {
  width: min(92vw, 380px) !important;
  max-width: 380px !important;
  max-height: min(78vh, 640px);
  overflow-y: auto;
  padding: 26px 20px 18px !important;
  color: #f5f5f7 !important;
  background: rgba(18, 20, 28, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 26px !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45) !important;
  text-align: center;
}
#modal-word-definition .def-hero {
  margin: 2px 0 4px;
}
#modal-word-definition .def-word-row,
#modal-word-definition .def-header {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
}
#modal-word-definition .def-word-badge {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0 36px !important;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: #ffffff !important;
  font-size: clamp(1.45rem, 6vw, 1.95rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  line-height: 1.15 !important;
  overflow-wrap: anywhere;
  text-align: center;
}
#modal-word-definition .def-speak-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #fff !important;
  box-shadow: none !important;
}
#modal-word-definition .def-phonetic-text {
  margin: 2px 0 12px;
  font-size: 0.78rem !important;
  font-style: italic !important;
  letter-spacing: 0.04em;
  color: rgba(201, 214, 255, 0.55) !important;
}
#modal-word-definition .def-primary {
  margin: 0 0 8px;
  font-size: clamp(1.15rem, 4.6vw, 1.42rem);
  font-weight: 750;
  line-height: 1.3;
  color: #ffe08a;
  text-wrap: balance;
}
#modal-word-definition .def-senses {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 10px;
}
#modal-word-definition .def-sense {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  color: rgba(235, 235, 245, 0.62);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
#modal-word-definition .def-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin: 2px 0 14px;
  font-size: 0.66rem;
  font-weight: 550;
  letter-spacing: 0.04em;
  color: rgba(235, 235, 245, 0.38);
}
#modal-word-definition .def-meta-dot {
  opacity: 0.5;
}
#modal-word-definition .def-translation-title {
  color: #ffe08a !important;
  font-size: 1.2rem !important;
  font-weight: 750 !important;
  line-height: 1.35 !important;
  margin: 0 0 10px !important;
}
#modal-word-definition .def-meaning-text {
  margin: 0 0 12px;
  font-size: 0.86rem !important;
  line-height: 1.45 !important;
  color: rgba(236, 236, 241, 0.62) !important;
}
#modal-word-definition .def-example-box {
  margin-top: 2px;
  padding: 11px 12px 10px;
  border-radius: 16px;
  text-align: left;
  background: rgba(255, 255, 255, 0.045) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-left: 3px solid rgba(255, 224, 138, 0.45) !important;
}
#modal-word-definition .def-section-label,
#modal-word-definition .collocations-label {
  margin: 0 0 6px;
  font-size: 0.62rem !important;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(201, 214, 255, 0.42) !important;
}
#modal-word-definition .def-example-content {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.88rem !important;
  line-height: 1.45 !important;
  color: rgba(243, 243, 247, 0.82) !important;
}
#modal-word-definition .def-ex-src {
  font-weight: 650;
  color: #ffffff;
}
#modal-word-definition .def-ex-tr {
  font-size: 0.8rem;
  color: rgba(235, 235, 245, 0.72);
}
#modal-word-definition .def-hit {
  background: rgba(255, 214, 10, 0.28);
  color: inherit;
  padding: 0 3px;
  border-radius: 5px;
  font-weight: 800;
}
#modal-word-definition .def-collocations-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
#modal-word-definition .collocations-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#modal-word-definition .collocation-tag {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}
#modal-word-definition .modal-close-icon {
  background: #1c1c1e !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45) !important;
  font-weight: 600 !important;
  z-index: 40 !important;
}
#modal-word-definition .modal-action-btn {
  margin-top: 14px !important;
}

/* Placement + welcome: light text on liquid glass (old dark-on-white leftovers) */
#modal-placement .placement-modal-card,
#modal-welcome-lang .welcome-lang-card,
#modal-howto .welcome-lang-card,
#modal-info-dialog .info-dialog-card {
  color: #f5f5f7 !important;
  background: rgba(22, 24, 32, 0.78) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

#modal-placement .placement-modal-card h2,
#modal-placement .quiz-step-title,
#modal-placement .result-title,
#modal-placement .result-rank-name,
#modal-welcome-lang .welcome-lang-title,
#modal-welcome-lang .welcome-lang-logo,
#modal-welcome-lang .welcome-lang-name,
#modal-howto .welcome-lang-title,
#modal-howto .welcome-lang-logo,
#modal-info-dialog .info-dialog-title {
  color: #f5f5f7 !important;
}

#modal-placement .quiz-counter,
#modal-placement .quiz-prompt,
#modal-placement .result-description,
#modal-placement .result-description p,
#modal-welcome-lang .welcome-lang-lead,
#modal-welcome-lang .welcome-lang-note,
#modal-welcome-lang .welcome-lang-hint,
#modal-welcome-lang .welcome-lang-sub,
#modal-howto .howto-list {
  color: rgba(235, 235, 245, 0.86) !important;
}

#modal-info-dialog .info-dialog-message-box {
  color: #ececf1 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}
#modal-info-dialog .info-dialog-message-box strong {
  color: #ffffff !important;
}

#modal-placement .quiz-word-card {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(201, 214, 255, 0.35) !important;
}
#modal-placement .quiz-target-word {
  color: #eef2ff !important;
}

#modal-placement .quiz-progress-bar-wrap {
  background: rgba(255, 255, 255, 0.14) !important;
}
#modal-placement .quiz-progress-bar-fill {
  background: #9bb8ff !important;
}

#modal-placement .result-badge-pill,
#modal-placement .result-cefr-badge {
  color: #ffffff !important;
  background: rgba(122, 162, 255, 0.42) !important;
  border: 1px solid rgba(201, 214, 255, 0.4);
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 800;
  margin: 10px 0;
}

#modal-placement .modal-close-icon,
#modal-welcome-lang .modal-close-icon,
#modal-info-dialog .modal-close-icon {
  background: #1c1c1e !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45) !important;
  font-weight: 600 !important;
  z-index: 40 !important;
}

.app-content {
  display: flex;
  flex-direction: column;
}
#screen-game.game-focus,
#screen-game {
  flex: 1;
  width: 100% !important;
  max-width: none !important;
  min-height: 0;
  justify-content: flex-start !important;
  align-items: center;
  padding: 8px 12px 14px !important;
  overflow: hidden;
}
#screen-game .game-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: min(100%, 440px);
  flex: 1;
  min-height: 0;
  justify-content: flex-start;
  padding-top: 0;
  margin-top: 0;
}
#screen-game .game-top-bar {
  flex-shrink: 0;
  gap: 6px;
  margin-top: 0;
  margin-bottom: 4px;
  padding-top: 0;
}
#screen-game .progress-label {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  opacity: 0.92;
}
#screen-game .theme-pill-badge {
  padding: 8px 14px !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  box-shadow: none !important;
}
#screen-game .word-slots {
  display: flex !important;
  gap: 4px;
  max-width: 100%;
}
#screen-game .word-slot {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 8px;
  letter-spacing: 0.02em;
}
#screen-game .slot-dots { font-size: 0.42rem !important; letter-spacing: 1px !important; }
#screen-game .slot-length { font-size: 0.6rem !important; }
#screen-game .preview-wrapper {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  flex-shrink: 0;
  min-height: 22px !important;
  height: 22px !important;
  margin: 0 !important;
  z-index: 8 !important;
  pointer-events: none;
}
#screen-game .word-preview-box {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 3px 12px;
}
#screen-game .grid-container {
  flex: 1 1 auto;
  min-height: 0 !important;
  width: min(100%, 420px, calc(100dvh - 340px)) !important;
  max-width: min(100%, 420px) !important;
  max-height: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 auto 8px !important;
}
#screen-game .letter-grid[data-size="4"] .grid-cell { font-size: 1.9rem; }
#screen-game .letter-grid[data-size="5"] .grid-cell { font-size: 1.65rem; }
#screen-game .letter-grid[data-size="6"] .grid-cell { font-size: 1.38rem; }
#screen-game .letter-grid[data-size="7"] .grid-cell { font-size: 1.15rem; }
#screen-game .letter-grid[data-size="8"] .grid-cell { font-size: 0.98rem; }
#screen-game .letter-grid[data-size="9"] .grid-cell { font-size: 0.86rem; }
#screen-game .game-controls {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 6px;
  margin-bottom: 4px;
  padding-bottom: 4px;
  flex-shrink: 0 !important;
  max-width: none;
}
#screen-game .hud-hint {
  min-width: 148px;
  height: 42px;
  border-radius: 21px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
#screen-game .hud-hint .btn-icon { font-size: 0.95rem; line-height: 1; }
#screen-game .hud-hint .btn-hint-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
#screen-game .hud-hint .btn-text {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.9;
}

.coin-icon {
  display: inline-block;
  width: 1.12em;
  height: 1.12em;
  vertical-align: -0.2em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='cg' x1='8' y1='4' x2='24' y2='28' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23fff4b8'/%3E%3Cstop offset='0.45' stop-color='%23f0c43a'/%3E%3Cstop offset='1' stop-color='%23b5790c'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='16' cy='16' r='14.2' fill='url(%23cg)' stroke='%238a5608' stroke-width='1.5'/%3E%3Ccircle cx='16' cy='16' r='10.4' fill='none' stroke='%23fff6d0' stroke-width='1.6'/%3E%3Cellipse cx='12.5' cy='11' rx='6' ry='3.2' fill='%23fff8e0' opacity='0.45'/%3E%3Cpath fill='%23724708' d='M17.55 9.1h-2.7c-2.35 0-3.9 1.35-3.9 3.35 0 1.65 1.05 2.7 2.95 3.2l1.55.42c1.15.3 1.55.62 1.55 1.25 0 .75-.75 1.25-1.9 1.25-1.25 0-2.1-.52-2.4-1.45l-2.2.42c.45 1.9 2.15 3.15 4.5 3.35V22.2h2.2v-1.45c2.5-.28 4.15-1.7 4.15-3.65 0-1.85-1.15-2.9-3.25-3.42l-1.55-.4c-1.05-.28-1.45-.62-1.45-1.15 0-.62.62-1.12 1.68-1.12 1.05 0 1.75.5 2 1.32l2.1-.4c-.42-1.75-2-2.9-4.08-3.08z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}
.coin-icon-lg {
  width: 2.7rem;
  height: 2.7rem;
  vertical-align: middle;
}
.info-dialog-icon .coin-icon-lg {
  display: block;
  margin: 0 auto;
}

.map-info-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
  font-size: 1.05rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.map-help-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #c9d6ff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.map-help[hidden] {
  display: none !important;
}
.map-help {
  width: 100%;
  max-width: 360px;
  margin: 0 auto 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
}
.map-help p {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  color: rgba(235, 235, 245, 0.86);
}
.league-card[hidden] {
  display: none !important;
}

.streak-calendar-caption {
  width: 100%;
  margin: 14px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(235, 235, 245, 0.72);
  text-align: center;
}

#daily-rewards-calendar.daily-calendar-grid {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 5px !important;
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box !important;
}
#daily-rewards-calendar .reward-day-item {
  min-width: 0 !important;
  width: 100% !important;
  padding: 8px 2px 6px !important;
  min-height: 78px !important;
  gap: 3px !important;
  overflow: hidden;
  grid-column: auto !important;
}
#daily-rewards-calendar .reward-day-num {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(235, 235, 245, 0.78);
}
#daily-rewards-calendar .reward-day-prize {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.68rem !important;
  font-weight: 800 !important;
  color: #ffe08a !important;
  white-space: nowrap;
}
#daily-rewards-calendar .reward-day-prize .coin-icon {
  width: 0.95em;
  height: 0.95em;
}
#daily-rewards-calendar .reward-day-extra {
  font-size: 0.58rem;
  color: #c9d6ff;
  min-height: 0.7rem;
  line-height: 1;
}
#daily-rewards-calendar .reward-day-status {
  font-size: 0.7rem;
  line-height: 1;
  color: #86efac;
}
#daily-rewards-calendar .reward-day-item.current {
  border-color: rgba(255, 214, 10, 0.7) !important;
  box-shadow: 0 0 10px rgba(255, 214, 10, 0.25) !important;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

#screen-levels .stage-green-play-btn {
  background: linear-gradient(180deg, #4ade80, #16a34a) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 6px 0 #15803d, 0 12px 24px rgba(22, 163, 74, 0.35) !important;
}
#screen-levels .stage-green-play-btn:active {
  transform: translateY(4px) !important;
  box-shadow: 0 2px 0 #15803d, 0 6px 12px rgba(22, 163, 74, 0.3) !important;
}
#screen-levels .stage-toggle-grid-row {
  margin-top: 22px;
}

#screen-daily.events-screen {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 10px 12px 28px !important;
  box-sizing: border-box;
  overflow: visible !important;
  flex: 0 0 auto;
  height: auto;
  max-height: none;
  align-items: center;
}
#screen-daily .screen-header,
#screen-daily .events-stack {
  width: 100%;
  max-width: 400px;
}
#screen-daily .screen-header {
  margin-bottom: 10px;
}
#screen-daily .screen-header h2 {
  font-size: 1.22rem;
  font-weight: 700;
}
#screen-daily .screen-header .subtitle {
  font-size: 0.8rem;
  margin-top: 2px;
}
#screen-daily .events-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}
#screen-daily .event-card {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 10px;
  padding: 14px !important;
  border-radius: 20px !important;
  overflow: hidden;
  background: var(--glass) !important;
  border: 1px solid var(--surface-border) !important;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 32px rgba(0, 0, 0, 0.22) !important;
}
#screen-daily .wod-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
#screen-daily .wod-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #c9d6ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px 10px;
  border-radius: 999px;
}
#screen-daily .wod-reward-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffe08a;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
#screen-daily .wod-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
#screen-daily .wod-word-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
#screen-daily #btn-wod-speak {
  flex-shrink: 0;
}
#screen-daily .wod-word {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: clamp(1.05rem, 5vw, 1.35rem);
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}
#screen-daily .wod-phonetic {
  font-size: 0.78rem;
  color: rgba(201, 214, 255, 0.85);
}
#screen-daily .wod-translation,
#screen-daily .wod-example,
#screen-daily .wod-ritual-hint,
#screen-daily .weekly-review-lead,
#screen-daily .week-album-lead,
#screen-daily .chest-sub,
#screen-daily .quest-sub {
  overflow-wrap: anywhere;
  word-break: break-word;
}
#screen-daily .wod-translation {
  font-size: 0.9rem;
  font-weight: 650;
  margin-top: 0;
  color: #f5f5f7;
}
#screen-daily .wod-example {
  font-size: 0.78rem;
  line-height: 1.4;
  margin-top: 0;
  font-style: normal;
  color: rgba(235, 235, 245, 0.7);
}
#screen-daily .wod-ritual-hint,
#screen-daily .weekly-review-lead,
#screen-daily .week-album-lead {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(235, 235, 245, 0.62);
}
#screen-daily .weekly-review-list {
  margin-top: 0;
  gap: 6px;
}
#screen-daily .weekly-review-item {
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
#screen-daily .weekly-review-item strong,
#screen-daily .weekly-review-tr {
  overflow-wrap: anywhere;
  word-break: break-word;
}
#screen-daily .daily-quests-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#screen-daily .daily-quests-header h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #f5f5f7;
}
#screen-daily .quests-counter-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(235, 235, 245, 0.8);
}
#screen-daily .daily-quests-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#screen-daily .quest-item-card {
  gap: 8px;
  min-width: 0;
  align-items: flex-start;
}
#screen-daily .quest-item-info {
  min-width: 0;
}
#screen-daily .quest-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
#screen-daily .quest-item-info strong {
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}
#screen-daily .quest-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.72rem;
  color: rgba(235, 235, 245, 0.65);
}
#screen-daily .quest-reward {
  margin-top: 0;
  color: #ffe08a;
}
#screen-daily .quest-claim-btn {
  flex-shrink: 0;
  min-width: 72px;
  max-width: 96px;
  padding: 7px 8px !important;
  font-size: 0.7rem !important;
  border-radius: 12px !important;
  white-space: nowrap;
}
#screen-daily .super-chest-box {
  flex-wrap: wrap;
  min-width: 0;
}
#screen-daily .super-chest-box .small-btn,
#screen-daily .super-chest-box .primary-btn {
  flex: 0 0 auto;
}
#screen-daily .chest-info {
  min-width: 0;
  flex: 1 1 140px;
}
#screen-daily .streak-badge-big {
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  color: #f5f5f7;
}
#screen-daily .streak-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
#screen-daily .freeze-info-pill {
  font-size: 0.78rem;
  font-weight: 650;
  color: rgba(235, 235, 245, 0.8);
}
#screen-daily .streak-actions .small-btn {
  flex: 1 1 auto;
  min-width: 0;
}
#screen-daily .week-album {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: none;
}
#screen-daily .week-album-title {
  font-size: 0.82rem;
  text-align: left;
}
#screen-daily .week-album-days {
  width: 100%;
  margin-top: 6px;
}
#screen-daily .week-album-day {
  min-width: 0;
  min-height: 32px;
  padding: 0 1px;
  overflow: hidden;
  font-size: 0.62rem;
}
#screen-daily .streak-calendar-caption {
  margin: 2px 0 0;
  font-size: 0.72rem;
  text-align: left;
  color: rgba(235, 235, 245, 0.62);
}
#screen-daily .daily-calendar-grid {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 4px !important;
  width: 100% !important;
  margin-top: 0 !important;
}
#screen-daily .reward-day-item {
  min-width: 0 !important;
  min-height: 56px !important;
  padding: 5px 1px !important;
  overflow: hidden;
  grid-column: auto !important;
  gap: 1px !important;
}
#screen-daily .reward-day-num {
  font-size: 0.62rem !important;
}
#screen-daily .reward-day-prize {
  font-size: 0.62rem !important;
  white-space: nowrap;
}
#screen-daily .reward-day-extra,
#screen-daily .reward-day-status {
  font-size: 0.55rem !important;
  line-height: 1 !important;
}
#screen-daily .reward-day-item:last-child {
  grid-column: auto !important;
}
#screen-daily .primary-btn,
#screen-daily .secondary-btn {
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
  height: auto;
}

#screen-daily #card-daily-streak .streak-help-btn {
  align-self: center;
  padding: 4px 12px;
  border: 0;
  background: transparent;
  color: #c9d6ff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
#screen-daily #card-daily-streak .streak-help[hidden] {
  display: none !important;
}
#screen-daily #card-daily-streak .streak-help {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
#screen-daily #card-daily-streak .streak-help p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(235, 235, 245, 0.86);
  text-align: left;
}
#screen-daily #card-daily-streak {
  gap: 12px;
}
#screen-daily #card-daily-streak .streak-actions {
  flex-direction: column;
  align-items: stretch;
}
#screen-daily #card-daily-streak .streak-actions .small-btn {
  flex: none;
  width: 100%;
}
#screen-daily #card-daily-streak .week-album {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
#screen-daily #card-daily-streak .week-album-title,
#screen-daily #card-daily-streak .week-album-lead {
  margin: 0;
  text-align: left;
}
#screen-daily #card-daily-streak .week-album-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
}
#screen-daily #card-daily-streak .week-album-day {
  min-height: 36px;
  padding: 4px 0;
  overflow: hidden;
}
#screen-daily #card-daily-streak #btn-claim-week-stamp {
  margin: 0;
  width: 100%;
}
#screen-daily #card-daily-streak .streak-calendar-caption {
  margin: 4px 0 0;
}
#screen-daily #card-daily-streak .reward-day-item {
  min-height: 72px !important;
  overflow: hidden;
}
#screen-daily #card-daily-streak .reward-day-prize {
  white-space: normal;
  line-height: 1.15;
}

.stage-story {
  width: 100%;
  max-width: 340px;
  margin: 6px auto 8px;
  padding: 0 8px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
  color: rgba(235, 235, 245, 0.82);
  text-align: center;
}
.victory-new-words {
  margin: 6px 0 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e8ecff;
  line-height: 1.35;
}
.wod-ritual-hint,
.week-album-lead,
.weekly-review-lead {
  margin: 8px 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(235, 235, 245, 0.78);
}
.week-album {
  width: 100%;
  margin-top: 12px;
  padding: 12px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.week-album-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f5f5f7;
  text-align: center;
}
.week-album-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-top: 10px;
}
.week-album-day {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(235, 235, 245, 0.7);
}
.week-album-day.done {
  background: rgba(74, 222, 128, 0.28);
  border-color: rgba(74, 222, 128, 0.55);
  color: #ecfdf3;
}
.week-album-day.today {
  box-shadow: 0 0 0 1px rgba(255, 214, 10, 0.45);
}
.weekly-review-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.weekly-review-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #f5f5f7;
  text-align: left;
}
.weekly-review-item strong { font-size: 0.92rem; }
.weekly-review-tr {
  font-size: 0.75rem;
  color: rgba(235, 235, 245, 0.75);
}
.word-ease-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.word-ease-btn {
  padding: 10px 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f7;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.word-ease-btn.active {
  background: rgba(122, 162, 255, 0.32);
  border-color: rgba(201, 214, 255, 0.45);
}

/* Профиль: поделиться и поддержка — то же стекло, что у карточек событий */
#screen-settings .community-highlight-card {
  background: var(--glass) !important;
  border: 1px solid var(--surface-border) !important;
  border-radius: 20px !important;
  padding: 12px !important;
  gap: 8px !important;
  margin-bottom: 0 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 12px 32px rgba(0, 0, 0, 0.22) !important;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}
#screen-settings .share-highlight-btn,
#screen-settings .share-highlight-btn.secondary-share-btn,
#screen-settings .tg-feedback-link-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 16px !important;
  color: #f5f5f7 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
  padding: 12px !important;
  margin-top: 0 !important;
  gap: 10px;
  align-items: center;
  text-decoration: none;
}
#screen-settings .share-highlight-btn:active,
#screen-settings .tg-feedback-link-btn:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.14) !important;
}
#screen-settings .btn-main-label {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: 0;
  color: #f5f5f7;
}
#screen-settings .btn-bonus-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 224, 138, 0.12) !important;
  color: #ffe08a !important;
  border: 1px solid rgba(255, 224, 138, 0.28);
  box-shadow: none !important;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
}
#screen-settings .tg-btn-left {
  min-width: 0;
  flex: 1;
}
#screen-settings .tg-btn-title {
  font-size: 0.92rem;
  font-weight: 650;
  color: #f5f5f7;
}
#screen-settings .tg-btn-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(201, 214, 255, 0.78);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
#screen-settings .tg-btn-arrow {
  flex-shrink: 0;
  color: rgba(201, 214, 255, 0.7);
  font-weight: 600;
}

/* Окна «Поделиться игрой» и «Поделиться прогрессом» */
#modal-share-game .modal-card,
#modal-share-progress .modal-card,
#modal-share-game .share-white-modal-card,
#modal-share-progress .share-white-modal-card {
  width: min(92vw, 360px) !important;
  max-width: 360px !important;
  background: rgba(18, 20, 28, 0.9) !important;
  color: #f5f5f7 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 26px !important;
  padding: 22px 16px 18px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 18px 48px rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}
#modal-share-game .modal-header-safe,
#modal-share-progress .modal-header-safe {
  text-align: center !important;
  padding-right: 0 !important;
  margin-bottom: 6px !important;
}
#modal-share-game .modal-header-safe h2,
#modal-share-progress .modal-header-safe h2 {
  color: #f5f5f7 !important;
  font-size: 1.12rem !important;
  font-weight: 700 !important;
  text-align: center !important;
  padding: 0 28px;
  line-height: 1.25 !important;
}
#modal-share-game .modal-close-icon-fixed,
#modal-share-progress .modal-close-icon-fixed {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f5f5f7 !important;
  font-weight: 600 !important;
}
#modal-share-game .modal-close-icon-fixed:active,
#modal-share-progress .modal-close-icon-fixed:active {
  background: rgba(255, 255, 255, 0.18) !important;
}
#modal-share-game .share-sub-text,
#modal-share-progress .share-sub-text {
  color: rgba(235, 235, 245, 0.68) !important;
  font-size: 0.86rem !important;
  font-weight: 500 !important;
}
#modal-share-game .social-share-pill,
#modal-share-progress .social-share-pill,
#modal-share-game .social-share-pill.tg-btn,
#modal-share-game .social-share-pill.wa-btn,
#modal-share-game .social-share-pill.copy-btn,
#modal-share-progress .social-share-pill.tg-btn,
#modal-share-progress .social-share-pill.wa-btn,
#modal-share-progress .social-share-pill.copy-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f5f5f7 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 14px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
  font-weight: 650 !important;
  padding: 10px 4px !important;
}
#modal-share-game .social-share-pill:active,
#modal-share-progress .social-share-pill:active {
  background: rgba(255, 255, 255, 0.16) !important;
}
#modal-share-game .primary-btn,
#modal-share-progress .primary-btn {
  background: linear-gradient(180deg, rgba(150, 180, 255, 0.55), rgba(90, 120, 240, 0.42)) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 16px !important;
  font-weight: 650 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 10px 28px rgba(0, 0, 0, 0.25) !important;
}
#modal-share-progress .share-preview-card-inner {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 18px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
  padding: 14px 12px !important;
}
#modal-share-progress .share-card-logo-inner {
  color: #c9d6ff !important;
  font-weight: 700 !important;
}
#modal-share-progress .share-card-badge-inner {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f5f5f7 !important;
  border-radius: 999px !important;
}
#modal-share-progress .share-mastery-title-inner {
  color: #ffe08a !important;
  text-shadow: none !important;
  font-weight: 800 !important;
}
#modal-share-progress .share-mastery-desc-inner {
  color: rgba(235, 235, 245, 0.68) !important;
}
#modal-share-progress .share-stat-box-inner {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
}
#modal-share-progress .stat-num-inner {
  color: #f5f5f7 !important;
  font-weight: 700 !important;
}
#modal-share-progress .stat-lbl-inner {
  color: rgba(235, 235, 245, 0.55) !important;
}

#screen-settings .about-game-card {
  padding: 14px 16px 12px !important;
}
#screen-settings .about-game-version,
#screen-settings .about-game-line,
#screen-settings .about-game-sources {
  margin: 0;
  text-align: left;
  line-height: 1.4;
}
#screen-settings .about-game-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  color: #c9d6ff;
  text-align: left;
  cursor: pointer;
}
#screen-settings .about-version-hint {
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffe08a;
}
#screen-settings .about-changelog[hidden],
#screen-settings #params-panel[hidden],
#screen-settings #backup-panel[hidden] {
  display: none !important;
}
#screen-settings .about-changelog {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
#screen-settings .about-changelog-lead {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffe08a;
}
#screen-settings .about-changelog-release + .about-changelog-release {
  margin-top: 12px;
}
#screen-settings .about-changelog ul {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#screen-settings .about-changelog li {
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(235, 235, 245, 0.86);
}
#screen-settings .about-game-line {
  margin-top: 2px;
  font-size: 0.82rem;
  color: rgba(235, 235, 245, 0.78);
}
#screen-settings .about-game-sources {
  margin-top: 8px;
  font-size: 0.75rem;
  color: rgba(235, 235, 245, 0.62);
}
#screen-settings .about-game-sources a {
  color: #c9d6ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#screen-settings .achievements-container.is-collapsed .achievement-card:nth-child(n + 5) {
  display: none;
}
#screen-settings .achievements-more-btn {
  width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #c9d6ff;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}
#screen-settings .achievements-more-btn[hidden] {
  display: none;
}
#screen-settings .about-save-note {
  text-align: left;
  margin: 0 0 10px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(235, 235, 245, 0.68);
}
#screen-settings .backup-actions {
  display: flex;
  gap: 8px;
}
#screen-settings .backup-actions .secondary-btn {
  flex: 1;
  font-size: 0.82rem;
  padding: 10px 8px;
}
#screen-settings .settings-group h3,
#screen-settings .xp-rank-title,
#screen-settings .params-toggle {
  color: #f5f5f7;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}
#screen-settings .params-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
#screen-settings .params-toggle > span:first-child {
  min-width: 0;
}
#screen-settings .params-toggle-hint {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(235, 235, 245, 0.55);
}

/* Плавающее меню не должно закрывать низ экрана и поле */
#screen-vocab.screen-view,
#screen-levels.screen-view,
#screen-settings.screen-view,
#screen-daily.screen-view {
  min-height: 0;
  box-sizing: border-box;
  padding-bottom: calc(108px + env(safe-area-inset-bottom)) !important;
}
#screen-daily.events-screen {
  flex: 0 0 auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
#screen-game.screen-view {
  min-height: 0 !important;
  max-height: 100%;
  box-sizing: border-box;
  padding-bottom: 6px !important;
}

.account-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.account-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--surface-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-main);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}
.account-actions { display: flex; gap: 8px; }
.account-actions .primary-btn,
.account-actions .secondary-btn { flex: 1; }
#account-status:empty { display: none; }
