/* === Yandex Games requirements === */
html {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

:root {
  --cream: #F9F4E8;
  --cream-dark: #F0E9D6;
  --pink: #F5D0C5;
  --pink-dark: #E8B8A8;
  --mint: #B8E0D2;
  --lavender: #D4C5E2;
  --honey: #E8C07D;
  --terracotta: #E07856;
  --terracotta-dark: #C8633F;
  --plum: #4A3B52;
  --plum-light: #6B5570;
  --shadow: 0 8px 24px rgba(74, 59, 82, 0.08);
  --shadow-hover: 0 12px 32px rgba(74, 59, 82, 0.15);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-lg: 28px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow-x: hidden; }
body {
  font-family: 'Inter', 'Segoe UI', -apple-system, system-ui, sans-serif;
  color: var(--plum);
  background: var(--cream);
  height: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}
button, input { font-family: inherit; color: inherit; }

h1, h2, h3 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 700;
  color: var(--plum);
}

.screen { position: fixed; inset: 0; display: none; overflow: hidden; background: var(--cream); }
.screen.active { display: flex; flex-direction: column; }

/* ============ SPLASH ============ */
#splash {
  background: radial-gradient(ellipse at center, #FDF8ED 0%, var(--cream) 50%, #F0E2D4 100%);
  align-items: center;
  justify-content: center;
}
.splash-inner { text-align: center; animation: fadeIn 0.8s ease; padding: 20px; }
.splash-piece {
  width: 120px; height: 120px; margin-bottom: 24px;
  fill: var(--terracotta);
  filter: drop-shadow(0 8px 20px rgba(224, 120, 86, 0.3));
  animation: float 3s ease-in-out infinite;
}
.splash-title { font-size: clamp(32px, 8vw, 52px); letter-spacing: 0.5px; margin-bottom: 8px; }
.splash-tagline { font-size: clamp(14px, 3vw, 18px); color: var(--plum-light); margin-bottom: 40px; font-style: italic; }
.progress-wrap { width: min(320px, 70vw); margin: 0 auto; }
.progress-bar { height: 8px; background: rgba(74, 59, 82, 0.1); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--terracotta), var(--honey)); border-radius: 999px; transition: width 0.3s ease; }
.progress-text { font-size: 13px; color: var(--plum-light); margin-top: 10px; }

/* ============ TOP BAR ============ */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: var(--cream);
  border-bottom: 1px solid rgba(74, 59, 82, 0.06);
  flex-shrink: 0;
}
.top-bar-title { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 18px; }
.top-bar-right { display: flex; gap: 10px; align-items: center; }
.logo-small { display: flex; align-items: center; gap: 10px; font-family: 'Playfair Display', serif; font-weight: 700; font-size: 18px; }
.logo-small svg { width: 28px; height: 28px; fill: var(--terracotta); }

.stat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cream-dark);
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 600; font-size: 14px;
}
.stat-icon { font-size: 14px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--cream-dark);
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.15s, background 0.15s;
  color: var(--plum);
}
.icon-btn svg { fill: currentColor; }
.icon-btn:hover, .icon-btn:active { background: var(--pink); transform: scale(1.05); }

/* ============ BUTTONS ============ */
.btn {
  border: none; cursor: pointer;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 16px; font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--terracotta), var(--terracotta-dark));
  color: white;
  box-shadow: 0 6px 18px rgba(224, 120, 86, 0.35);
}
.btn-primary:hover, .btn-primary:active { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(224, 120, 86, 0.45); }
.btn-ghost { background: transparent; color: var(--plum); padding: 12px 24px; }
.btn-ghost:hover { background: var(--cream-dark); }

/* ============ MENU ============ */
.menu-content { flex: 1; overflow-y: auto; padding: 20px; }
.menu-content::-webkit-scrollbar { width: 8px; }
.menu-content::-webkit-scrollbar-thumb { background: var(--cream-dark); border-radius: 999px; }

.hero-daily {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #FFF4EA 0%, var(--pink) 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-daily-text { z-index: 1; max-width: 70%; }
.daily-badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--terracotta);
  background: rgba(255,255,255,0.7); padding: 4px 12px; border-radius: 999px;
  margin-bottom: 10px;
}
.hero-daily-title { font-size: clamp(20px, 4vw, 28px); margin-bottom: 6px; }
.hero-daily-sub { color: var(--plum-light); font-size: 14px; margin-bottom: 16px; }
.hero-daily-art { position: absolute; right: -20px; top: 10px; bottom: 10px; width: 160px; pointer-events: none; }
.daily-piece { position: absolute; width: 60px; height: 60px; background: rgba(255,255,255,0.5); border-radius: 14px; backdrop-filter: blur(4px); animation: float 4s ease-in-out infinite; }
.daily-piece-1 { top: 10px; right: 40px; }
.daily-piece-2 { top: 60px; right: 0; animation-delay: 0.6s; background: rgba(184, 224, 210, 0.7); }
.daily-piece-3 { top: 110px; right: 60px; animation-delay: 1.2s; background: rgba(212, 197, 226, 0.7); }

.section-title { font-size: 22px; margin: 14px 6px 14px; }
.section-title.center { text-align: center; }

.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; padding-bottom: 80px; }
.category-card {
  background: white;
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer; border: none; text-align: left;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex; flex-direction: column; gap: 10px;
}
.category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.category-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--cream-dark) center/cover;
  position: relative; overflow: hidden;
}
.category-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.25));
}
.category-name { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 16px; }
.category-count { font-size: 12px; color: var(--plum-light); }

/* ============ DIFFICULTY ============ */
.diff-content { flex: 1; overflow-y: auto; padding: 20px; text-align: center; }
.diff-preview {
  width: min(280px, 70vw);
  aspect-ratio: 4/3;
  margin: 0 auto 24px;
  border-radius: var(--radius);
  background: var(--cream-dark) center/cover;
  box-shadow: var(--shadow);
}
.diff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; max-width: 560px; margin: 0 auto 24px; }
.diff-card {
  background: white; border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 18px 12px; cursor: pointer; text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s;
}
.diff-card:hover { transform: translateY(-3px); border-color: var(--terracotta); }
.diff-icon { font-size: 28px; margin-bottom: 6px; }
.diff-name { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 17px; }
.diff-desc { font-size: 12px; color: var(--plum-light); margin-top: 2px; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 420px; margin: 14px auto;
  background: white; padding: 14px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow); cursor: pointer;
}
.toggle-row input[type="checkbox"] { display: none; }
.toggle-slider {
  width: 44px; height: 24px; background: var(--cream-dark); border-radius: 999px;
  position: relative; transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 20px; height: 20px; background: white; border-radius: 50%;
  transition: transform 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.toggle-row input:checked ~ .toggle-slider { background: var(--terracotta); }
.toggle-row input:checked ~ .toggle-slider::before { transform: translateX(20px); }

.lang-row { display: flex; align-items: center; justify-content: space-between; max-width: 420px; margin: 14px auto; background: white; padding: 14px 20px; border-radius: var(--radius); box-shadow: var(--shadow); }
.lang-btns { display: flex; gap: 8px; }
.lang-btn { padding: 6px 14px; border-radius: 999px; border: none; background: var(--cream-dark); cursor: pointer; font-weight: 600; }
.lang-btn.active { background: var(--terracotta); color: white; }

/* ============ GAME ============ */
.game-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(249, 244, 232, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(74, 59, 82, 0.06);
  flex-shrink: 0; z-index: 5;
}
.game-stats { display: flex; gap: 10px; }
.canvas-wrap {
  flex: 1; position: relative;
  background: var(--cream-dark);
  background-image: url('../assets/bg/board.svg');
  background-size: cover; background-position: center;
  overflow: hidden;
}
#board { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#board.dragging { cursor: grabbing; }

.game-footer { padding: 10px 16px 14px; flex-shrink: 0; background: var(--cream); }
.hint-banner {
  width: 100%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--honey), var(--terracotta));
  color: white;
  border-radius: var(--radius);
  padding: 12px 18px;
  display: flex; align-items: center; gap: 14px;
  text-align: left;
  box-shadow: 0 4px 14px rgba(224, 120, 86, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.hint-banner:hover, .hint-banner:active { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(224, 120, 86, 0.4); }
.hint-icon { font-size: 26px; flex-shrink: 0; }
.hint-text-wrap { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.hint-text { font-weight: 700; font-size: 15px; }
.hint-sub { font-size: 12px; opacity: 0.92; }
.hint-arrow { font-size: 28px; opacity: 0.8; }

/* ============ MODALS ============ */
.modal {
  position: fixed; inset: 0;
  background: rgba(74, 59, 82, 0.55);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal.active { display: flex; animation: fadeIn 0.2s ease; }
.modal-box {
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 420px; width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: scaleIn 0.25s ease;
}
.modal-box h2 { margin-bottom: 18px; font-size: 26px; }
.modal-box .btn { width: 100%; margin-bottom: 10px; }
.modal-box .btn:last-child { margin-bottom: 0; }

.preview-box { padding: 16px; }
.preview-box img { width: 100%; border-radius: var(--radius); margin-bottom: 14px; }

.win-box .win-sparkle { font-size: 60px; margin-bottom: 8px; animation: pop 0.5s ease; }
.win-stats { font-size: 15px; color: var(--plum-light); margin-bottom: 18px; }
.win-stats b { color: var(--plum); font-weight: 700; }

/* ============ TOAST ============ */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(100px);
  background: var(--plum); color: white;
  padding: 12px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  opacity: 0; transition: transform 0.3s, opacity 0.3s;
  z-index: 200; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ============ ANIMATIONS ============ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .top-bar, .game-bar { padding: 10px 14px; }
  .menu-content { padding: 14px; }
  .hero-daily { padding: 20px; }
  .hero-daily-art { width: 130px; }
  #dailyCard .hero-daily-art { width: 180px !important; right: -10px !important; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .hero-daily { padding: 18px 24px; }
  .diff-preview { width: 200px; }
}

/* ============ LEADERBOARD ============ */
.lb-body { min-height: 120px; }
.lb-loading { text-align: center; font-size: 28px; padding: 32px 0; }
.lb-my-score {
  text-align: center; background: var(--pink); border-radius: 12px;
  padding: 10px 16px; margin-bottom: 14px; font-size: 15px;
}
.lb-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.lb-entry {
  display: flex; align-items: center; gap: 10px;
  background: var(--cream-dark); border-radius: 12px; padding: 8px 14px;
}
.lb-entry.lb-me { background: var(--mint); font-weight: 600; }
.lb-rank { font-size: 13px; color: var(--plum); opacity: 0.6; width: 24px; flex-shrink: 0; }
.lb-entry:nth-child(1) .lb-rank { font-size: 18px; opacity: 1; }
.lb-entry:nth-child(2) .lb-rank { font-size: 16px; opacity: 0.9; }
.lb-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.lb-avatar-empty { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; font-size: 18px; }
.lb-name { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { font-weight: 700; color: var(--terracotta); font-size: 15px; flex-shrink: 0; }
.lb-hint { text-align: center; color: var(--plum); opacity: 0.7; margin: 16px 0; }

/* win score row */
.win-score-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 4px 0 12px; }
.win-score-earned { font-size: 24px; font-weight: 800; color: var(--terracotta); }
.win-score-total { font-size: 13px; color: var(--plum); opacity: 0.7; }

/* RATINGS */
.category-rating { font-size: 12px; color: var(--honey); letter-spacing: 1px; margin-top: 2px; }
.rating-count { font-size: 11px; color: var(--plum); opacity: 0.5; }
.win-rating { margin: 4px 0 14px; min-height: 52px; text-align: center; }
.win-rating-label { font-size: 13px; opacity: 0.7; margin: 0 0 6px; }
.win-stars { display: flex; justify-content: center; gap: 4px; }
.star-btn {
  background: none; border: none; cursor: pointer;
  font-size: 28px; color: var(--cream-dark); padding: 2px;
  transition: color 0.15s, transform 0.1s;
}
.star-btn.hover, .star-btn.active { color: var(--honey); transform: scale(1.2); }
.rating-done { font-size: 18px; color: var(--honey); letter-spacing: 2px; }

/* ============ ZOOM CONTROLS ============ */
.zoom-controls {
  position: absolute; right: 12px; bottom: 12px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 10;
}
.zoom-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(249, 244, 232, 0.88);
  backdrop-filter: blur(6px);
  color: var(--plum);
  font-size: 18px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(74, 59, 82, 0.18);
  transition: transform 0.12s, background 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.zoom-btn:hover, .zoom-btn:active { background: var(--pink); transform: scale(1.1); }

/* ============ STYLE PACKS ROW ============ */
.style-row {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 2px 6px 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.style-row:empty { display: none; }
.style-row::-webkit-scrollbar { display: none; }
.style-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 2px solid var(--cream-dark);
  background: white;
  font-weight: 600; font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--plum);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.style-pill.active {
  background: var(--terracotta);
  color: white;
  border-color: var(--terracotta);
  box-shadow: 0 4px 14px rgba(224, 120, 86, 0.35);
}
.style-pill:not(.active):hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.style-icon { font-size: 17px; }

/* Fix: scrollable modals when content is too tall */
.modal-box {
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}


/* HERO V2 PUSHOK — redesigned daily card */
#dailyCard.hero-daily {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #FFB088 0%, #FF7E65 55%, #E85A4F 100%);
  box-shadow: 0 14px 36px rgba(224, 120, 86, 0.38), inset 0 1px 0 rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
}
#dailyCard.hero-daily::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 18% 20%, rgba(255,255,255,0.32), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
#dailyCard .hero-daily-text { position: relative; z-index: 2; max-width: 58%; color: #fff; }
#dailyCard .daily-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.4);
}
#dailyCard .daily-badge::before { content: '🎲'; font-size: 13px; }
#dailyCard .hero-daily-title {
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.15;
  text-shadow: 0 2px 10px rgba(120, 40, 20, 0.22);
}
#dailyCard .hero-daily-sub {
  color: rgba(255,255,255,0.92);
  font-size: 14px;
  margin-bottom: 18px;
  font-weight: 500;
}
#dailyCard .btn {
  background: #fff !important;
  color: #C8633F !important;
  box-shadow: 0 8px 22px rgba(120, 40, 20, 0.22);
  font-weight: 800;
  animation: heroPulse 2.4s ease-in-out infinite;
  position: relative;
  z-index: 2;
}
#dailyCard .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(120, 40, 20, 0.3);
}
@keyframes heroPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
#dailyCard .hero-daily-art {
  position: absolute;
  right: -24px;
  top: 0;
  bottom: 0;
  width: 240px;
  pointer-events: none;
  z-index: 1;
  background-image: url('../assets/pushok-hero.webp');
  background-position: right center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 10px 20px rgba(74,59,82,0.25));
}
.no-webp #dailyCard .hero-daily-art {
  background-image: url('../assets/pushok-hero.webp');
}
#dailyCard .daily-piece {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  animation: float 4s ease-in-out infinite;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  z-index: 2;
}
#dailyCard .daily-piece-1 { top: 14%; right: 50%; background: rgba(255,255,255,0.9); }
#dailyCard .daily-piece-2 { top: 72%; right: 46%; background: #B8E0D2; animation-delay: 0.7s; }
#dailyCard .daily-piece-3 { top: 45%; right: 56%; background: #FFF5C8; animation-delay: 1.3s; width: 22px; height: 22px; }
@media (max-width: 520px) {
  #dailyCard.hero-daily { min-height: 180px; padding: 20px; }
  #dailyCard .hero-daily-text { max-width: 55%; }
  #dailyCard .hero-daily-art { width: 170px; right: -16px; }
  #dailyCard .daily-piece-1, #dailyCard .daily-piece-2, #dailyCard .daily-piece-3 { width: 22px; height: 22px; }
}
@media (max-width: 380px) {
  #dailyCard .daily-piece { display: none; }
  #dailyCard .hero-daily-art { width: 140px; opacity: 0.85; }
}


/* HERO V2 PUSHOK — redesigned daily card */
#dailyCard.hero-daily {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #FFB088 0%, #FF7E65 55%, #E85A4F 100%);
  box-shadow: 0 14px 36px rgba(224, 120, 86, 0.38), inset 0 1px 0 rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
}
#dailyCard.hero-daily::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 18% 20%, rgba(255,255,255,0.32), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
#dailyCard .hero-daily-text { position: relative; z-index: 2; max-width: 58%; color: #fff; }
#dailyCard .daily-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.4);
}
#dailyCard .daily-badge::before { content: '🎲'; font-size: 13px; }
#dailyCard .hero-daily-title {
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.15;
  text-shadow: 0 2px 10px rgba(120, 40, 20, 0.22);
}
#dailyCard .hero-daily-sub {
  color: rgba(255,255,255,0.92);
  font-size: 14px;
  margin-bottom: 18px;
  font-weight: 500;
}
#dailyCard .btn {
  background: #fff !important;
  color: #C8633F !important;
  box-shadow: 0 8px 22px rgba(120, 40, 20, 0.22);
  font-weight: 800;
  animation: heroPulse 2.4s ease-in-out infinite;
  position: relative;
  z-index: 2;
}
#dailyCard .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(120, 40, 20, 0.3);
}
@keyframes heroPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
#dailyCard .hero-daily-art {
  position: absolute;
  right: -24px;
  top: 0;
  bottom: 0;
  width: 240px;
  pointer-events: none;
  z-index: 1;
  background-image: url('../assets/pushok-hero.webp');
  background-position: right center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 10px 20px rgba(74,59,82,0.25));
}
.no-webp #dailyCard .hero-daily-art {
  background-image: url('../assets/pushok-hero.webp');
}
#dailyCard .daily-piece {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  animation: float 4s ease-in-out infinite;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  z-index: 2;
}
#dailyCard .daily-piece-1 { top: 14%; right: 50%; background: rgba(255,255,255,0.9); }
#dailyCard .daily-piece-2 { top: 72%; right: 46%; background: #B8E0D2; animation-delay: 0.7s; }
#dailyCard .daily-piece-3 { top: 45%; right: 56%; background: #FFF5C8; animation-delay: 1.3s; width: 22px; height: 22px; }
@media (max-width: 520px) {
  #dailyCard.hero-daily { min-height: 180px; padding: 20px; }
  #dailyCard .hero-daily-text { max-width: 55%; }
  #dailyCard .hero-daily-art { width: 170px; right: -16px; }
  #dailyCard .daily-piece-1, #dailyCard .daily-piece-2, #dailyCard .daily-piece-3 { width: 22px; height: 22px; }
}
@media (max-width: 380px) {
  #dailyCard .daily-piece { display: none; }
  #dailyCard .hero-daily-art { width: 140px; opacity: 0.85; }
}


/* HERO V3 POLISH — splash pushok + desktop width + no shadow */
.splash-pushok {
  width: 180px; height: 180px;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px;
  animation: splashBounce 1.8s ease-in-out infinite;
  filter: drop-shadow(0 8px 20px rgba(255, 126, 101, 0.25));
}
@keyframes splashBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.04); }
}

/* Убираем drop-shadow на Пушке hero + плавный fade внизу (скрывает встроенную тень PNG) */
#dailyCard .hero-daily-art {
  filter: none !important;
}

/* Desktop: ограничиваем ширину hero, Пушок крупнее */
@media (min-width: 768px) {
  #dailyCard.hero-daily {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    min-height: 240px;
  }
  #dailyCard .hero-daily-art {
    width: 300px;
    right: 20px;
  }
  #dailyCard .hero-daily-text {
    max-width: 60%;
    padding-left: 12px;
  }
  #dailyCard .daily-piece-1 { right: 38%; }
  #dailyCard .daily-piece-2 { right: 34%; }
  #dailyCard .daily-piece-3 { right: 44%; }
}
@media (min-width: 1200px) {
  #dailyCard .hero-daily-art { width: 340px; }
}


/* LAYOUT V1 CENTER — единая колонка на десктопе */
@media (min-width: 768px) {
  .menu-content > * {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }
  #dailyCard.hero-daily { max-width: 1200px; }
}

/* RECTANGULAR PROGRESS V3 + STARS BOOST */
.progress-pill {
  gap: 10px !important;
  padding: 7px 14px !important;
  min-width: 150px;
  background: linear-gradient(135deg, rgba(255,176,136,0.18), rgba(224,120,86,0.1)) !important;
  border: 1.5px solid rgba(224,120,86,0.35) !important;
  backdrop-filter: blur(6px);
  transition: all 0.35s ease;
  display: inline-flex;
  align-items: center;
}
.progress-track-mini {
  flex: 1;
  height: 7px;
  background: rgba(74, 59, 82, 0.14);
  border-radius: 999px;
  overflow: hidden;
  min-width: 60px;
  box-shadow: inset 0 1px 2px rgba(74,59,82,0.1);
}
.progress-fill-mini {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #FFB088 0%, #FF7E65 50%, #E07856 100%);
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.2, 0.8, 0.3, 1), background 0.3s;
  box-shadow: 0 0 6px rgba(224, 120, 86, 0.45);
}
.progress-percent {
  font-weight: 800 !important;
  font-size: 13px;
  color: var(--plum);
  min-width: 36px;
  text-align: right;
  letter-spacing: -0.3px;
}
.progress-pill.celebrating {
  background: linear-gradient(135deg, #FFD700, #FFA500) !important;
  border-color: #FFD700 !important;
  animation: pillCelebrate 1.2s ease-in-out infinite;
}
.progress-pill.celebrating .progress-fill-mini {
  background: linear-gradient(90deg, #FFF, #FFF5D0) !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}
.progress-pill.celebrating .progress-percent { color: #fff; text-shadow: 0 1px 3px rgba(120,60,0,0.4); }
@keyframes pillCelebrate {
  0%, 100% { box-shadow: 0 0 14px rgba(255,215,0,0.5); transform: scale(1); }
  50% { box-shadow: 0 0 26px rgba(255,215,0,0.85); transform: scale(1.04); }
}

.rating-done { font-size: 22px !important; letter-spacing: 2px; color: #FFB800 !important; font-weight: 700; }


/* STARS V2 — заметные золотые звёзды голосования (.win-stars + .star-btn + .hover) */
.win-stars {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 10px 0 18px;
}
.win-stars .star-btn {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px 6px !important;
  font-size: 38px !important;
  line-height: 1;
  cursor: pointer;
  color: #E8D5A6 !important;
  filter: drop-shadow(0 2px 4px rgba(200,150,60,0.25));
  transition: all 0.18s ease;
}
.win-stars .star-btn:hover,
.win-stars .star-btn.hover,
.win-stars .star-btn.active,
.win-stars .star-btn.selected {
  color: #FFB800 !important;
  transform: scale(1.22) translateY(-2px);
  filter: drop-shadow(0 4px 10px rgba(255,180,0,0.8));
}
.win-stars .star-btn:active { transform: scale(1.12); }
.win-rating-label {
  text-align: center;
  color: var(--plum-light, #6B5570);
  font-size: 14px;
  margin-bottom: 4px;
}
.rating-done {
  text-align: center;
  font-size: 24px !important;
  color: #FFB800 !important;
  font-weight: 700;
  letter-spacing: 3px;
  text-shadow: 0 2px 8px rgba(255,180,0,0.4);
  padding: 12px 0;
}


/* BEST TIMES — бейдж в HUD + модалка победы */
.best-time-pill {
  background: linear-gradient(135deg, rgba(255,215,0,0.18), rgba(224,120,86,0.12)) !important;
  border: 1.5px solid rgba(255,180,0,0.38) !important;
}
.best-time-pill .stat-icon { filter: drop-shadow(0 2px 4px rgba(255,180,0,0.45)); }
.win-best-time { margin: 8px 0 4px; text-align: center; }
.record-badge {
  display: inline-block;
  font-weight: 800;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  margin: 6px 0;
  letter-spacing: 0.3px;
  animation: recordPop 0.55s cubic-bezier(0.2, 1.2, 0.3, 1);
}
.record-badge.personal {
  background: linear-gradient(135deg, #B8E0D2, #8EC8B4);
  color: var(--plum);
  box-shadow: 0 4px 12px rgba(120,180,150,0.35);
}
.record-badge.world {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,180,0,0.5);
  animation: recordPop 0.55s cubic-bezier(0.2, 1.2, 0.3, 1), recordShine 1.8s infinite;
}
@keyframes recordPop {
  0% { opacity: 0; transform: scale(0.5); }
  60% { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes recordShine {
  0%, 100% { box-shadow: 0 4px 14px rgba(255,180,0,0.5); }
  50% { box-shadow: 0 4px 26px rgba(255,180,0,0.95); }
}
.best-times-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 4px;
  font-size: 13px;
  color: #6B5570;
  flex-wrap: wrap;
}
.best-times-row b { color: var(--plum); font-weight: 700; }


/* ACHIEVEMENT TOAST — уведомление при разблокировке бейджа */
.achievement-toast {
  position: fixed; top: 20px; right: 20px;
  width: 320px; max-width: calc(100vw - 32px);
  background: linear-gradient(135deg, #fff, #FDF8ED);
  border-radius: 18px; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 16px 40px rgba(74,59,82,0.25);
  z-index: 9999;
  transform: translateX(calc(100% + 40px));
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
  border: 3px solid #CD7F32;
}
.achievement-toast.show { transform: translateX(0); }
.achievement-toast img { width: 60px; height: 60px; flex-shrink: 0; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15)); }
.achievement-toast .ach-text { flex: 1; min-width: 0; }
.achievement-toast .ach-label { font-size: 11px; font-weight: 800; color: #CD7F32; letter-spacing: 1px; margin-bottom: 4px; }
.achievement-toast .ach-name { font-size: 16px; font-weight: 800; color: var(--plum, #4A3B52); line-height: 1.2; }
.achievement-toast.rarity-rare {
  border-color: #B0BEC5;
  box-shadow: 0 16px 40px rgba(160,170,200,0.4), 0 0 24px rgba(176,190,197,0.5);
}
.achievement-toast.rarity-rare .ach-label { color: #607D8B; }
.achievement-toast.rarity-legendary {
  border-color: #FFD700;
  box-shadow: 0 16px 40px rgba(255,215,0,0.5), 0 0 32px rgba(255,215,0,0.7);
  animation: legendaryPulse 1.5s ease-in-out infinite;
}
.achievement-toast.rarity-legendary .ach-label { color: #FFA500; }
@keyframes legendaryPulse {
  0%, 100% { box-shadow: 0 16px 40px rgba(255,215,0,0.5), 0 0 32px rgba(255,215,0,0.7); }
  50% { box-shadow: 0 16px 40px rgba(255,215,0,0.7), 0 0 52px rgba(255,215,0,0.95); }
}
@media (max-width: 520px) {
  .achievement-toast { width: calc(100% - 24px); right: 12px; top: 12px; }
}


/* PROFILE SCREEN */
.profile-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 24px; padding: 16px;
  background: linear-gradient(135deg, rgba(255,176,136,0.12), rgba(224,120,86,0.08));
  border-radius: 18px;
}
.stat-tile { text-align: center; padding: 8px 4px; }
.stat-num { font-size: 26px; font-weight: 800; color: var(--plum, #4A3B52); line-height: 1; }
.stat-lbl { font-size: 11px; color: var(--plum-light, #6B5570); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

.achievements-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px; padding-bottom: 80px;
}
.ach-card {
  background: #fff; border-radius: 18px; padding: 14px 10px;
  border: 2px solid #E8D5A6; box-shadow: 0 4px 12px rgba(74,59,82,0.08);
  cursor: pointer; transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: inherit; color: var(--plum, #4A3B52); text-align: center;
}
.ach-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(74,59,82,0.15); }
.ach-card.rarity-common { border-color: #CD7F32; }
.ach-card.rarity-rare { border-color: #B0BEC5; box-shadow: 0 4px 12px rgba(160,170,200,0.3); }
.ach-card.rarity-legendary {
  border-color: #FFD700;
  box-shadow: 0 6px 18px rgba(255,215,0,0.35), 0 0 12px rgba(255,215,0,0.3);
}
.ach-card.rarity-legendary.unlocked { animation: legendaryPulse 2.4s ease-in-out infinite; }
.ach-card.locked { opacity: 0.75; }
.ach-card.locked .ach-img-wrap img { filter: grayscale(1) brightness(0.85); }
.ach-img-wrap { position: relative; width: 100px; height: 100px; }
.ach-img-wrap img { width: 100%; height: 100%; object-fit: contain; }
.ach-lock {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(74,59,82,0.45); border-radius: 50%; font-size: 28px;
}
.ach-card-name { font-size: 13px; font-weight: 700; line-height: 1.2; min-height: 32px; display: flex; align-items: center; }
.ach-card-date { font-size: 11px; color: var(--plum-light, #6B5570); opacity: 0.75; }
.ach-card-progress { width: 100%; height: 5px; background: rgba(74,59,82,0.1); border-radius: 999px; overflow: hidden; }
.ach-progress-fill { height: 100%; background: linear-gradient(90deg, #FFB088, #FF7E65); border-radius: 999px; transition: width 0.4s; }
.ach-card-progress-text { font-size: 10px; color: var(--plum-light, #6B5570); font-weight: 600; }

.ach-modal-box { max-width: 380px; text-align: center; }
.ach-modal-box img { width: 140px; height: 140px; margin: 0 auto 10px; display: block; filter: drop-shadow(0 8px 18px rgba(0,0,0,0.15)); }
.ach-modal-rarity { display: inline-block; padding: 4px 14px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; margin-bottom: 10px; background: #F0E9D6; color: #8B5A2B; }
.ach-modal-rarity.rarity-rare { background: rgba(176,190,197,0.25); color: #37474F; }
.ach-modal-rarity.rarity-legendary { background: rgba(255,215,0,0.2); color: #B8860B; }
.ach-modal-box h3 { font-size: 22px; margin: 6px 0 8px; }
.ach-modal-desc { font-size: 14px; color: var(--plum-light, #6B5570); margin-bottom: 14px; line-height: 1.4; }
.ach-modal-status { font-size: 13px; margin-bottom: 18px; padding: 10px; background: #FDF8ED; border-radius: 12px; }
.ach-modal-status.got { background: rgba(255,215,0,0.15); color: #B8860B; font-weight: 700; }

@media (max-width: 520px) {
  .profile-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px; }
  .stat-num { font-size: 22px; }
  .achievements-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ach-card { padding: 10px 8px; }
  .ach-img-wrap { width: 80px; height: 80px; }
  .ach-card-name { font-size: 12px; min-height: 30px; }
  .ach-modal-box img { width: 110px; height: 110px; }
}

/* Центровка названий карточек (категории + пазлы) */
.category-name, .category-count { text-align: center; }

/* MUTE_POSITION_FIX — прижать 🎵 к кнопке 👁 справа */
#btnMute {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-left: auto !important;
}
#btnMute + #btnPreview,
.game-bar #btnPreview,
.top-bar #btnPreview {
  margin-left: 6px !important;
}
@media (max-width: 480px) {
  #btnMute { font-size: 18px !important; }
}


/* MUTE_POSITION_FIX2 — 🎵 рядом с ⏸ слева */
#btnMute {
  margin: 0 0 0 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
}




/* MUTE_FINAL_V5 — без раздавливания progress-pill */
.hud-actions {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0; margin-left: auto;
}
.game-bar .icon-btn, .hud-actions .icon-btn { flex-shrink: 0; }
.game-stats { min-width: 0; flex-shrink: 1; }
#btnMute.muted { opacity: 0.45; transition: opacity 0.25s; }
#btnMute.muted:hover { opacity: 0.7; }
@media (max-width: 520px) {
  .best-time-pill { display: none !important; }
  .game-bar { gap: 6px; padding: 8px 10px; }
}


/* NO_STICKY_HOVER — убираем залипание pink фона на touch */
@media (hover: none) {
  .icon-btn:hover, .icon-btn:active {
    background: var(--cream-dark) !important;
    transform: none !important;
  }
}
.icon-btn:focus { outline: none; }

/* Progress-pill не сжимать в хлам */
.progress-pill {
  flex-shrink: 0 !important;
  min-width: 130px;
}
.progress-pill .progress-track-mini { flex: 1 1 50px; min-width: 50px; }
.progress-pill .progress-percent { min-width: 32px; font-weight: 800; }
@media (max-width: 480px) {
  .progress-pill { min-width: 110px; }
  .progress-pill .progress-track-mini { min-width: 35px; }
}


/* HINT_BANNER_FIX — контрастный текст на баннере подсказки */
.hint-banner { background: linear-gradient(135deg, #E85A4F, #FF7E65) !important; }
.hint-text { color: #fff !important; font-weight: 800 !important; text-shadow: 0 1px 2px rgba(120,40,20,0.35); }
.hint-sub { color: #fff !important; opacity: 1 !important; font-weight: 500; text-shadow: 0 1px 2px rgba(120,40,20,0.25); }

/* STYLE_ROW_WRAP — стили-пилюли переносятся на следующую строку */
.style-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  justify-content: flex-start !important;
  padding: 0 !important;
  margin-bottom: 20px;
}
.style-row > * { flex: 0 0 auto; }
@media (max-width: 520px) {
  .style-row { gap: 8px !important; }
  .style-pill { flex: 0 0 calc(33.33% - 6px) !important; padding: 8px 6px !important; font-size: 11px !important; gap: 4px !important; justify-content: center; white-space: normal; text-align: center; }
  .style-icon { font-size: 14px !important; }
}
