:root {
  --sky: #b8e0ff;
  --sea: #5bb5e8;
  --sand: #ffe8b8;
  --text: #2d3436;
  --card: #ffffff;
  --btn: #42a5f5;
  --btn2: #81c784;
  --btn3: #ffb74d;
  --reward-bg: #e0f7fa;
  --reward-accent: #00838f;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--sky) 0%, var(--sea) 55%, var(--sand) 100%);
  transition: background 0.4s ease, color 0.3s ease;
}

.page {
  position: relative;
  height: 100%;
  height: 100dvh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.buddy-slot {
  flex-shrink: 0;
  width: 124px;
  padding: 0;
  overflow: visible;
}

.buddy-slot.hidden { display: none; }

.buddy-pod {
  background: var(--card);
  border-radius: 18px;
  padding: 8px 6px 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  text-align: center;
  border: none;
  cursor: pointer;
  font: inherit;
  width: 100%;
  overflow: visible;
}

.buddy-pod:active { transform: scale(0.97); }

.buddy-stage {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  line-height: 1;
}

.buddy-character {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.buddy-headwear {
  font-size: 1rem;
  margin-bottom: -0.35em;
  z-index: 3;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.buddy-headwear.hidden { display: none; }

.buddy-base {
  font-size: 2.2rem;
  z-index: 2;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.14));
}

.buddy-dress {
  font-size: 0.9rem;
  margin-top: -0.45em;
  z-index: 4;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.buddy-dress.hidden { display: none; }

.buddy-dress.dress-sun { filter: hue-rotate(35deg) saturate(1.45) brightness(1.08) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)); }
.buddy-dress.dress-sea { filter: hue-rotate(175deg) saturate(1.25) brightness(1.05) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)); }
.buddy-dress.dress-star { filter: hue-rotate(255deg) saturate(1.15) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)); }
.buddy-dress.dress-berry { filter: hue-rotate(320deg) saturate(1.35) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)); }
.buddy-dress.dress-emerald { filter: hue-rotate(95deg) saturate(1.4) brightness(1.05) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)); }
.buddy-dress.dress-gold { filter: hue-rotate(15deg) saturate(1.55) brightness(1.12) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)); }
.buddy-dress.dress-night { filter: hue-rotate(220deg) saturate(1.2) brightness(0.92) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15)); }

.shop-card-icon.dress-sun { filter: hue-rotate(35deg) saturate(1.45) brightness(1.08) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12)); }
.shop-card-icon.dress-sea { filter: hue-rotate(175deg) saturate(1.25) brightness(1.05) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12)); }
.shop-card-icon.dress-star { filter: hue-rotate(255deg) saturate(1.15) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12)); }
.shop-card-icon.dress-berry { filter: hue-rotate(320deg) saturate(1.35) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12)); }
.shop-card-icon.dress-emerald { filter: hue-rotate(95deg) saturate(1.4) brightness(1.05) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12)); }
.shop-card-icon.dress-gold { filter: hue-rotate(15deg) saturate(1.55) brightness(1.12) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12)); }
.shop-card-icon.dress-night { filter: hue-rotate(220deg) saturate(1.2) brightness(0.92) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12)); }

.buddy-pet {
  font-size: 1.35rem;
  align-self: center;
  margin-bottom: 0.15em;
  margin-left: -2px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.12));
  animation: buddyBob 2.8s ease-in-out infinite 0.45s;
}

.buddy-pet.hidden { display: none; }

.buddy-amnyam {
  width: 1.85rem;
  height: 1.85rem;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 0.25em;
  margin-left: -2px;
  z-index: 5;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.14));
  animation: buddyBob 2.6s ease-in-out infinite 0.65s;
}

.buddy-amnyam.hidden { display: none; }

.shop-card-amnyam-img {
  width: 36%;
  height: 36%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.18));
}

.buddy-stage.size-mini .buddy-amnyam { width: 2.8rem; height: 2.8rem; margin-bottom: 0.2em; }
.buddy-stage.size-full .buddy-amnyam {
  width: clamp(4.2rem, 22vw, 7.5rem);
  height: clamp(4.2rem, 22vw, 7.5rem);
  margin-bottom: 0.55em;
}
.buddy-stage.size-runner .buddy-amnyam { width: 1.35rem; height: 1.35rem; margin-bottom: 0.1em; }

.buddy-stage.has-rare-amnyam .buddy-amnyam {
  animation: buddyBob 2.2s ease-in-out infinite 0.65s, amnyamGlow 2.8s ease-in-out infinite;
}

@keyframes amnyamGlow {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.04); }
}

.buddy-rare-list li.kind-amnyam {
  border-color: #81c784;
  background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e9 100%);
}
.buddy-stage.size-mini .buddy-base { animation: buddyBob 2.8s ease-in-out infinite 0.15s; }
.buddy-stage.size-mini .buddy-headwear { animation: buddyBob 2.8s ease-in-out infinite; }
.buddy-stage.size-mini .buddy-dress { animation: buddyBob 2.8s ease-in-out infinite 0.3s; }

@keyframes buddyBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

#screenBuddy {
  overflow-y: auto;
  justify-content: center;
  padding-top: 8px;
}

.buddy-full-card {
  padding: 20px 16px 18px !important;
}

.buddy-stage.size-full {
  gap: 12px;
  padding: 12px 0 8px;
}

.buddy-stage.size-full .buddy-base {
  font-size: clamp(5rem, 28vw, 8.5rem);
}

.buddy-stage.size-full .buddy-headwear {
  font-size: clamp(2rem, 10vw, 3.2rem);
  margin-bottom: -0.4em;
}

.buddy-stage.size-full .buddy-dress {
  font-size: clamp(1.6rem, 8vw, 2.6rem);
  margin-top: -0.45em;
}

.buddy-stage.size-full .buddy-pet {
  font-size: clamp(2.8rem, 14vw, 4.5rem);
  margin-bottom: 0.5em;
}

.buddy-stage.size-full {
  position: relative;
}

.buddy-stage.size-full.has-rare-pet .buddy-pet {
  animation: rarePetWiggle 2.1s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(255, 235, 59, 0.8)) drop-shadow(0 5px 14px rgba(0, 188, 212, 0.45));
  z-index: 3;
}

.buddy-rare-panel {
  margin: 10px 0 6px;
  padding: 12px 14px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(255, 193, 7, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.buddy-rare-panel.hidden { display: none; }

.buddy-rare-panel-title {
  margin: 0;
  font-size: clamp(1rem, 4.2vw, 1.2rem);
  font-weight: 900;
  color: #6a1b9a;
  line-height: 1.2;
}

.buddy-rare-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.buddy-rare-list li {
  font-size: clamp(1.05rem, 4.5vw, 1.25rem);
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
}

.buddy-rare-list li.kind-outfit {
  color: #bf360c;
  border: 2px solid rgba(255, 112, 67, 0.35);
}

.buddy-rare-list li.kind-pet {
  color: #01579b;
  border: 2px solid rgba(3, 169, 244, 0.35);
}

.buddy-rare-list li.kind-headwear {
  color: #4a148c;
  border: 2px solid rgba(171, 71, 188, 0.35);
}

#buddyFullMount {
  width: 100%;
}

.buddy-stage.size-full {
  margin-bottom: 2px;
}

.buddy-full-card.has-rare-outfit {
  background: linear-gradient(
    165deg,
    #1a0a2e 0%,
    #2d1b4e 35%,
    #ffffff 100%
  );
}

.buddy-full-card.has-rare-headwear-view {
  box-shadow: 0 14px 40px rgba(123, 31, 162, 0.2);
}

.buddy-pet-glow {
  position: absolute;
  right: 6%;
  bottom: 16%;
  width: 42%;
  height: 42%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 235, 59, 0.5) 0%, rgba(77, 208, 225, 0.28) 42%, transparent 72%);
  animation: rarePetGlow 2.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.buddy-pet-sparkle {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  line-height: 1;
  animation: rarePetSparkle 2.3s ease-in-out infinite;
}

.buddy-pet-sparkle-1 { right: 4%; top: 26%; font-size: clamp(1rem, 5vw, 1.45rem); }
.buddy-pet-sparkle-2 { right: 20%; top: 14%; font-size: clamp(0.75rem, 4vw, 1.1rem); animation-delay: 0.55s; }
.buddy-pet-sparkle-3 { right: 0; top: 40%; font-size: clamp(0.85rem, 4.2vw, 1.2rem); animation-delay: 1.05s; }

@keyframes rarePetWiggle {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  18% { transform: translateY(-10px) scale(1.07) rotate(-6deg); }
  42% { transform: translateY(-6px) scale(1.04) rotate(5deg); }
  68% { transform: translateY(-12px) scale(1.08) rotate(-4deg); }
}

@keyframes rarePetGlow {
  0%, 100% { opacity: 0.5; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes rarePetSparkle {
  0%, 100% { opacity: 0.15; transform: scale(0.75) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(18deg); }
}

.shop-card.rare-pet .shop-card-icon {
  animation: shopRarePetBob 2.4s ease-in-out infinite;
}

@keyframes shopRarePetBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(-3deg); }
}

.buddy-stage.size-runner { transform: scaleX(-1); }
.buddy-stage.size-runner .buddy-base { font-size: 2.4rem; }
.buddy-stage.size-runner .buddy-dress { font-size: 1.05rem; margin-top: -0.42em; }
.buddy-stage.size-runner .buddy-headwear { font-size: 1.15rem; }
.buddy-stage.size-runner .buddy-pet { font-size: 1.35rem; margin-left: -0.2em; }

#screenRunner {
  justify-content: flex-start;
  padding-top: 2px;
  overflow: hidden;
}

.runner-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  flex: 1;
}

.runner-badge {
  display: inline-block;
  background: #fff3e0;
  color: #e65100;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 6px 12px;
  border-radius: 999px;
}

.runner-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 0 4px;
  gap: 8px;
  flex-wrap: wrap;
}

.runner-stars {
  display: flex;
  gap: 3px;
  justify-content: center;
  width: 100%;
  margin-bottom: 2px;
}

.runner-star {
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.25;
}

.runner-star.ok { opacity: 1; }
.runner-star.now { opacity: 1; transform: scale(1.15); }

.runner-choice-btn.ok {
  border-color: #43a047 !important;
  background: #e8f5e9 !important;
  box-shadow: 0 0 0 3px rgba(102, 187, 106, 0.35);
}

.runner-choice-btn.bad {
  border-color: #e53935 !important;
  background: #ffebee !important;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.3);
}

.runner-choice-btn:disabled { opacity: 1; }

.runner-viewport {
  position: relative;
  width: 100%;
  height: min(34vh, 220px);
  min-height: 160px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #87ceeb 0%, #b8e0ff 62%, transparent 62%);
  border: 3px solid rgba(255, 255, 255, 0.65);
  touch-action: manipulation;
  user-select: none;
  cursor: pointer;
}

.runner-clouds {
  position: absolute;
  inset: 8% 0 auto 0;
  height: 28%;
  opacity: 0.55;
  background: repeating-linear-gradient(90deg, transparent 0 80px, rgba(255,255,255,0.85) 80px 120px, transparent 120px 220px);
  animation: runnerClouds 12s linear infinite;
  pointer-events: none;
}

.runner-viewport.is-paused .runner-clouds,
.runner-viewport.is-paused .runner-ground-scroll { animation-play-state: paused; }

.runner-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  background: #8d6e4a;
  border-top: 4px solid #6d4c2e;
}

.runner-ground-scroll {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22%;
  height: 8px;
  background: repeating-linear-gradient(90deg, #7cb342 0 18px, #689f38 18px 36px);
  animation: runnerGroundScroll 0.55s linear infinite;
}

.runner-player-wrap {
  position: absolute;
  left: 14%;
  bottom: 22%;
  z-index: 4;
  transition: transform 0.14s ease-out;
  pointer-events: none;
}

.runner-player-wrap.jumping {
  animation: runnerJumpArc 0.58s ease-out forwards;
}

@keyframes runnerJumpArc {
  0% { transform: translateY(0) scale(1); }
  32% { transform: translateY(-68px) scale(1.05); }
  58% { transform: translateY(-68px) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

.runner-player-wrap.crashed {
  transform: rotate(-28deg) translateY(10px);
  z-index: 2;
}

.runner-obstacle {
  position: absolute;
  bottom: 22%;
  left: 0;
  z-index: 3;
  width: 48px;
  text-align: center;
  will-change: transform;
}

.runner-obstacle.cleared { opacity: 1; }

.runner-obstacle-pillar {
  display: block;
  font-size: 2.15rem;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.runner-obstacle-word { display: none; }

.runner-read-word {
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  font-weight: 900;
  margin: 0;
  min-height: 1.2em;
}

.runner-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.runner-choices.hidden { display: none; }

.runner-choice-btn {
  border: 3px solid var(--btn);
  border-radius: 18px;
  background: var(--card);
  font-size: clamp(2rem, 10vw, 3rem);
  padding: 12px 8px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.runner-choice-btn:active { transform: scale(0.96); }

.runner-hint {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  min-height: 2.4em;
  line-height: 1.25;
}

.runner-intro-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.88);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
}

.runner-intro-overlay.hidden { display: none; }

@keyframes runnerGroundScroll {
  from { background-position: 0 0; }
  to { background-position: -36px 0; }
}

@keyframes runnerClouds {
  from { transform: translateX(0); }
  to { transform: translateX(-120px); }
}

.app.mode-runner .level-progress-bar { display: none !important; }
.app.mode-runner .buddy-slot { display: none !important; }

.level-runner-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff3e0;
  color: #e65100;
  font-weight: 800;
  font-size: 1.1rem;
}

.shop-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 10px 0 4px;
}

.shop-tab {
  border: none;
  border-radius: 12px;
  padding: 12px 4px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  background: var(--reward-bg);
  color: var(--text);
}

.shop-tab.active {
  background: var(--card);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.bottom-bar {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

.bottom-bar .buttons {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.bottom-bar .btn {
  padding: 16px 12px;
  font-size: 1.1rem;
}

/* Планшет и компьютер: человечек слева от игры */
@media (min-width: 768px) {
  .page {
    max-width: 760px;
    padding-left: 200px;
  }

  .buddy-slot {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    z-index: 4;
  }

  .buddy-pod { padding: 16px 12px 12px; width: 100%; border-radius: 24px; }

  .buddy-stage.size-mini .buddy-base { font-size: 5rem; }
  .buddy-stage.size-mini .buddy-dress { font-size: 2rem; margin-top: -0.45em; }
  .buddy-stage.size-mini .buddy-headwear { font-size: 2.2rem; }
  .buddy-stage.size-mini .buddy-pet { font-size: 2.8rem; }
  .buddy-stage.size-mini .buddy-amnyam { width: 3.4rem; height: 3.4rem; }

  .bottom-bar { flex-direction: column; }
  .bottom-bar .btn { padding: 20px 16px; font-size: 1.25rem; }
}

.app {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  height: 100dvh;
  width: 100%;
  padding: 10px 14px 8px;
  overflow: hidden;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  padding: 4px 0 12px;
  gap: 8px;
}

.logo {
  font-size: 1.15rem;
  font-weight: 700;
  opacity: 0.85;
  flex: 1;
  text-align: left;
}

.logo-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 4px 0;
  border-radius: 8px;
}

.logo-btn:active { opacity: 0.65; }

.header-refresh-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0.88;
}

.header-refresh-btn:active {
  transform: scale(0.94);
  opacity: 0.7;
}

html.boot-name .header-refresh-btn {
  display: none;
}

.total-gems {
  background: var(--card);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.level-badge {
  background: var(--card);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 1.1rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.level-badge.hidden { display: none; }

.daily-goal-bar {
  flex-shrink: 0;
  background: var(--card);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 6px;
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.daily-goal-bar.hidden { display: none; }
.daily-goal-bar.done { background: #fff9c4; color: #f57f17; }

.level-progress-bar {
  flex-shrink: 0;
  margin-bottom: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}

.level-progress-bar.hidden { display: none; }

.level-progress-star {
  font-size: clamp(1.05rem, 4vw, 1.25rem);
  line-height: 1;
  opacity: 0.22;
}

.level-progress-star.ok { opacity: 1; }
.level-progress-star.wrong { opacity: 0.55; filter: grayscale(0.85); }
.level-progress-star.now { opacity: 1; transform: scale(1.18); }

.island-map-full {
  width: 100%;
  margin-top: 4px;
}

.map-viewport {
  position: relative;
  width: 100%;
  height: min(68vh, 560px);
  min-height: 300px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: rgba(0, 60, 120, 0.1);
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  cursor: grab;
}

.map-viewport.is-dragging { cursor: grabbing; }

.map-viewport.map-viewport-blocks {
  --map-h: min(286px, max(200px, calc(100dvh - 360px)));
  width: min(100%, calc(var(--map-h) * 4 / 3));
  height: var(--map-h);
  max-height: var(--map-h);
  min-height: 0;
  margin: 0 auto;
  cursor: grab;
  overflow: hidden;
  touch-action: none;
  flex-shrink: 0;
}

.map-viewport.map-viewport-blocks .map-stage {
  width: 100%;
  height: 100%;
  max-width: none;
  transform-origin: 0 0;
  display: block;
}

.map-viewport.map-viewport-blocks .map-canvas-full {
  width: 100%;
  height: 100%;
  max-width: 100%;
  min-height: 160px;
  position: relative;
}

.map-viewport.map-viewport-blocks .map-canvas {
  height: 100%;
  min-height: inherit;
}

.map-viewport.map-viewport-blocks .map-image {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  display: block;
  filter: brightness(0.92) saturate(0.96) contrast(1.01);
}

.map-viewport.map-viewport-blocks .map-dim-overlay {
  background: linear-gradient(180deg, rgba(8, 20, 40, 0.02), rgba(8, 20, 40, 0.06));
}

.map-block-label {
  font-size: 0.62rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  margin-top: 2px;
  white-space: nowrap;
  max-width: 4.5em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-marker.block-marker .map-marker-bubble {
  width: 2.15em;
  height: 2.15em;
  font-size: 1.25rem;
}

.map-marker.block-marker.locked .map-marker-bubble {
  background: rgba(120, 120, 120, 0.75);
  filter: grayscale(0.9);
}

.map-marker.block-marker.unlock-pop {
  animation: blockUnlockPop 1.15s ease-out;
}

@keyframes blockUnlockPop {
  0% { transform: translate(-50%, -50%) scale(0.25); opacity: 0; }
  55% { transform: translate(-50%, -50%) scale(1.22); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.stage-progress-panel {
  margin-top: 14px;
  padding: 12px 10px 10px;
  border-radius: 18px;
  background: var(--reward-bg);
  border: 2px solid rgba(255, 255, 255, 0.65);
}

.stage-progress-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 900;
  text-align: center;
}

.stage-progress-steps {
  display: flex;
  justify-content: space-between;
  gap: 3px;
}

.stage-step {
  flex: 1;
  text-align: center;
  font-size: 1.2rem;
  line-height: 1.1;
  opacity: 0.38;
  filter: grayscale(0.85);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.stage-step.done {
  opacity: 1;
  filter: none;
}

.stage-step.current {
  opacity: 1;
  filter: none;
  transform: scale(1.18);
  animation: zonePulse 1.5s ease-in-out infinite;
}

.stage-step-growth {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  line-height: 1.1;
  flex: 1;
  min-width: 0;
  max-width: 1.35em;
  max-height: 1.25em;
  opacity: 0.38;
  filter: grayscale(0.85);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.stage-step-growth.done {
  opacity: 1;
  filter: none;
}

.stage-step-growth .stage-step-pet {
  width: 1em;
  height: 1em;
  max-width: 17px;
  max-height: 17px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}

.stage-step-growth.done:active {
  transform: scale(0.96);
}

.stage-step-growth.done:hover,
.stage-step-growth.done:focus-visible {
  transform: scale(1.05);
  outline: none;
}

.map-zoom-hint {
  margin: 4px 0 0;
  text-align: center;
  font-size: 0.72rem;
  opacity: 0.62;
  line-height: 1.2;
}

.map-pets-zone {
  margin-top: 10px;
}

.map-pets-zone.hidden { display: none; }

.map-pet-hero {
  position: relative;
  width: min(120px, 34vw);
  height: min(120px, 34vw);
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  background: #e8f4fc;
}

.map-pet-hero.hidden { display: none; }

.map-pet-hero .map-pet-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-pets-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding: 2px 4px 0;
  -webkit-overflow-scrolling: touch;
}

.map-pet-thumb {
  position: relative;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: #b3e5fc;
  opacity: 0.95;
  cursor: pointer;
  padding: 0;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.map-pet-thumb:active {
  transform: scale(0.94);
}

.map-pet-thumb.is-current {
  border-color: #ffd54f;
  box-shadow: 0 0 0 2px rgba(255, 213, 79, 0.55);
  opacity: 1;
}

.map-pet-thumb .map-pet-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.map-stage {
  transform-origin: 0 0;
  will-change: transform;
  display: inline-block;
  width: 960px;
  max-width: none;
}

.map-canvas {
  position: relative;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
}

.map-canvas-mini {
  max-height: 56px;
}

.map-canvas-full {
  width: 960px;
  max-width: none;
}

.map-image {
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(0.52) saturate(0.88) contrast(1.05);
}

.map-dim-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 20, 40, 0.18), rgba(8, 20, 40, 0.32));
  pointer-events: none;
  z-index: 1;
}

.map-path-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.map-path-future {
  fill: none;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1.25;
  stroke-dasharray: 1.4 0.65;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.45));
}

.map-path-done {
  fill: none;
  stroke: #ffeb3b;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 5px rgba(255, 235, 59, 0.75)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.map-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  gap: 2px;
}

.map-marker.locked { opacity: 0.72; filter: saturate(0.45); }

.map-marker-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  width: 1.47em;
  height: 1.47em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(255, 255, 255, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.38);
}

.map-marker.open .map-marker-bubble {
  border-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.42), 0 0 0 2px rgba(102, 187, 106, 0.55);
}

.map-marker.current .map-marker-bubble {
  border-color: #ffe082;
  box-shadow: 0 0 0 3px rgba(255, 183, 77, 0.95), 0 3px 12px rgba(0, 0, 0, 0.45);
  animation: zonePulse 1.6s ease-in-out infinite;
  transform: scale(1.08);
}

.map-marker-num {
  font-size: 0.78rem;
  font-weight: 900;
  min-width: 1.35em;
  height: 1.35em;
  padding: 0 0.25em;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(55, 55, 55, 0.88);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.map-marker.open .map-marker-num {
  background: var(--btn2);
}

.map-marker.current .map-marker-num {
  background: var(--btn3);
}

.map-marker.runner .map-marker-bubble {
  background: linear-gradient(145deg, #fff8e1, #ffe0b2);
  border-color: #ff9800;
  box-shadow: 0 0 0 4px rgba(255, 152, 0, 0.9), 0 4px 14px rgba(0, 0, 0, 0.42);
  animation: runnerMarkerPulse 2.2s ease-in-out infinite;
}

@keyframes runnerMarkerPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 152, 0, 0.9), 0 4px 14px rgba(0, 0, 0, 0.42); }
  50% { box-shadow: 0 0 0 7px rgba(255, 152, 0, 0.45), 0 4px 14px rgba(0, 0, 0, 0.42); }
}

.map-marker-runner-tag {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 7px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.38);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  z-index: 4;
  line-height: 1.25;
}

.map-marker-run {
  position: absolute;
  top: -0.55em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85em;
  line-height: 1;
  z-index: 5;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.35));
}

.map-canvas-mini .map-marker {
  font-size: 14px;
}

.map-canvas-mini .map-image {
  filter: brightness(0.68) saturate(0.92) contrast(1.02);
}

.map-canvas-mini .map-dim-overlay {
  background: rgba(8, 20, 40, 0.14);
}

.map-canvas-mini .map-marker-bubble {
  font-size: 0.67rem;
  width: 1.12em;
  height: 1.12em;
  border-width: 2px;
}

.map-canvas-mini .map-marker-num {
  display: none;
}

.map-canvas-mini .map-marker.current .map-marker-bubble {
  transform: scale(1.15);
}

.map-mini-label {
  position: absolute;
  right: 5px;
  bottom: 3px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 7px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

#screenIsland {
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 2px;
}

#screenIsland .card.map-screen-card {
  padding: 10px 12px 12px;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#screenIsland .title-big {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

#screenIsland .stage-progress-panel {
  margin-top: 10px;
  padding: 10px 8px 8px;
  flex-shrink: 0;
}

#screenIsland .stage-progress-title {
  font-size: 0.95rem;
  margin-bottom: 8px;
}

#screenIsland .stage-step {
  font-size: 1.05rem;
}

#screenIsland .stage-step-growth {
  font-size: 1.05rem;
}

.card-read-coach {
  text-align: center;
  padding: 14px 12px 16px;
}

.card-read-coach .coach-bubble {
  margin: 0 0 12px;
  text-align: left;
}

.read-coach-word-label {
  margin: 0 0 4px;
  font-size: 0.85rem;
  opacity: 0.7;
}

.read-coach-word {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 7vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
}

.read-coach-hint {
  margin: 0;
}

@keyframes zonePulse {
  0%, 100% { transform: scale(1.12); }
  50% { transform: scale(1.22); }
}

.word-progress {
  font-size: 1.2rem;
  font-weight: 800;
  opacity: 0.9;
  margin: 0 0 8px;
}

.word-stars {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
  max-width: 100%;
}

.word-star {
  font-size: 1rem;
  opacity: 0.22;
  line-height: 1;
}

.word-star.done { opacity: 1; }
.word-star.now { opacity: 1; transform: scale(1.2); }

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.tab {
  border: none;
  border-radius: 14px;
  padding: 12px 6px;
  font-size: clamp(0.95rem, 3.8vw, 1.15rem);
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  background: rgba(255,255,255,0.45);
  color: var(--text);
}

.tab.active {
  background: var(--card);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tab:disabled,
.tab.tab-disabled {
  opacity: 0.45;
  cursor: wait;
  pointer-events: none;
}

.egg-grow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.85rem 0 0.35rem;
}
.egg-grow-row img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  transition: transform 0.45s ease;
}
.egg-grow-row img.egg-pop {
  transform: scale(1.08);
}
.egg-grow-arrow {
  font-size: 1.6rem;
  opacity: 0.7;
}

.screen {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 0;
  overflow: hidden;
}

.screen.hidden { display: none; }

#screenRead {
  flex: 1 1 0;
  justify-content: stretch;
  overflow: hidden;
}

#screenRead .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 12px 10px;
  overflow: hidden;
}

#screenRead .word-progress {
  flex-shrink: 0;
  margin: 0 0 4px;
  font-size: 1.15rem;
}

#screenRead .word-stars {
  flex-shrink: 0;
  flex-wrap: nowrap;
  gap: 2px;
  margin-bottom: 4px;
  overflow: hidden;
}

#screenRead .word-star { font-size: 1rem; }

#screenRead .hint {
  flex-shrink: 0;
  font-size: 1.25rem;
  margin-top: 2px;
}

#screenRead .read-text.is-phrase {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  font-size: clamp(1.35rem, 6.5vw, 2.1rem);
  line-height: 1.15;
  margin: 8px 0 10px;
}

#screenRead .read-text.is-poem {
  white-space: pre-line;
  font-size: clamp(1.35rem, 5vw, 1.85rem);
  line-height: 1.45;
  text-align: center;
  padding: 0.25rem 0.5rem;
}
#screenRead .read-text.is-phrase-long {
  font-size: clamp(1.05rem, 5vw, 1.55rem);
  line-height: 1.2;
  gap: 8px;
}

#screenRead .read-word-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 16px;
  background: #fff;
  border: 3px solid var(--btn);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-weight: 900;
  min-width: 2.5em;
}

#screenRead .read-word-chip-second {
  border-color: #ff9800;
  background: #fff8e1;
  box-shadow: 0 4px 14px rgba(255, 152, 0, 0.22);
}

#screenRead .read-word-chip-key {
  border-color: #ff9800;
  background: #fff8e1;
  box-shadow: 0 4px 14px rgba(255, 152, 0, 0.22);
}

#screenRead .read-word-chip-gap {
  border-color: #42a5f5;
  background: #e3f2fd;
  color: #1565c0;
  box-shadow: 0 4px 14px rgba(66, 165, 245, 0.22);
  min-width: 1.4em;
  text-align: center;
}

#screenRead .picture-grid.picture-grid-wait {
  opacity: 0.32;
  pointer-events: none;
  filter: grayscale(0.4);
}

#screenRead .picture-grid.picture-grid-wait .pic-btn {
  cursor: default;
}

#screenRead .read-text.is-phrase-long .read-word-chip {
  padding: 8px 12px;
  border-radius: 14px;
}

#screenRead .read-text {
  flex-shrink: 0;
  font-size: clamp(2.1rem, 11vw, 2.8rem);
  margin: 6px 0;
  line-height: 1.1;
}

#screenRead .picture-grid {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 6px;
  gap: 8px;
  grid-template-rows: 1fr 1fr;
  align-content: stretch;
}

#screenRead .pic-btn {
  font-size: clamp(3.2rem, 22vmin, 5.5rem);
  line-height: 1;
  padding: 2px;
  min-height: 0;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#screenRead .pic-btn .pic-emoji {
  display: block;
  line-height: 1;
  transform: scale(1.05);
}

#screenRead .pic-btn.word-choice-btn {
  font-size: clamp(1.25rem, 5.8vw, 1.75rem);
  font-weight: 900;
  letter-spacing: 0.01em;
  padding: 8px 6px;
}

#screenRead .pic-btn.word-choice-btn .pic-emoji {
  transform: none;
  white-space: nowrap;
}

#screenRead .read-text.is-syllable {
  letter-spacing: 0.04em;
}

.app.mode-read .top { padding-bottom: 4px; }
.app.mode-read .mode-tabs { margin-bottom: 4px; }
.app.mode-read .tab { padding: 10px 8px; font-size: 1.05rem; }
.app.mode-read .daily-goal-bar { padding: 8px 12px; margin-bottom: 4px; font-size: 1.1rem; }
.app.mode-read .level-progress-bar { padding: 4px 8px; margin-bottom: 4px; }

.app.mode-name .mode-tabs,
.app.mode-name .daily-goal-bar,
.app.mode-name .level-progress-bar,
.app.mode-name .parent-link,
.app.mode-name .top,
.app.mode-name .buddy-slot { display: none !important; }

#screenShop { overflow-y: auto; justify-content: flex-start; padding-top: 4px; }

.name-input {
  width: 100%;
  font-size: 1.45rem;
  font-weight: 800;
  padding: 16px 14px;
  border: 3px solid var(--btn);
  border-radius: 18px;
  text-align: center;
  font-family: inherit;
  margin: 12px 0 4px;
  color: var(--text);
  background: var(--reward-bg);
}

.name-input:focus {
  outline: none;
  border-color: var(--btn2);
  box-shadow: 0 0 0 3px rgba(102, 187, 106, 0.25);
}

.card {
  background: var(--card);
  border-radius: 28px;
  padding: 32px 24px;
  width: 100%;
  box-shadow: 0 10px 32px rgba(0,0,0,0.1);
  transition: background 0.3s ease;
}

.emoji-big { font-size: 4rem; line-height: 1; margin-bottom: 12px; }

.read-text {
  font-size: clamp(2rem, 10vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 16px 0;
  word-break: break-word;
}

.hint { font-size: 1.35rem; font-weight: 800; opacity: 0.88; margin-top: 8px; line-height: 1.25; }

.title-big { font-size: 1.6rem; font-weight: 800; margin: 0 0 8px; }

.reward-plus {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--reward-accent);
  margin: 12px 0;
}

.reward-total {
  font-size: 1.45rem;
  font-weight: 800;
  background: var(--reward-bg);
  border-radius: 16px;
  padding: 12px 20px;
  margin-top: 8px;
  display: inline-block;
}

.coach-bubble {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 20px;
  text-align: left;
  background: linear-gradient(135deg, rgba(255, 248, 225, 0.95), rgba(255, 236, 179, 0.88));
  border: 2px solid rgba(255, 183, 77, 0.45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.coach-bubble.coach-borya {
  background: linear-gradient(135deg, rgba(232, 245, 233, 0.96), rgba(200, 230, 201, 0.9));
  border-color: rgba(102, 187, 106, 0.45);
}

.coach-bubble.coach-vika {
  background: linear-gradient(135deg, rgba(255, 243, 224, 0.96), rgba(255, 224, 178, 0.9));
  border-color: rgba(255, 167, 38, 0.45);
}

.coach-bubble.coach-pop {
  animation: coachPop 0.45s ease;
}

@keyframes coachPop {
  0% { opacity: 0; transform: translateY(8px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.coach-avatar {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coach-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.coach-body { min-width: 0; }

.coach-name {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 800;
  opacity: 0.72;
}

.coach-text {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
}

.card-moment-done .coach-bubble {
  margin-top: 14px;
  max-width: 100%;
}

.hero-intro-card {
  text-align: center;
}

.hero-intro-duo {
  display: flex;
  gap: 10px;
  margin: 14px 0 10px;
  align-items: stretch;
}

.hero-intro-slot {
  flex: 1;
  min-width: 0;
  padding: 12px 10px;
  border-radius: 18px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.hero-intro-borya {
  background: linear-gradient(165deg, rgba(232, 245, 233, 0.96), rgba(200, 230, 201, 0.88));
  border-color: rgba(102, 187, 106, 0.35);
}

.hero-intro-vika {
  background: linear-gradient(165deg, rgba(255, 243, 224, 0.96), rgba(255, 224, 178, 0.88));
  border-color: rgba(255, 167, 38, 0.35);
}

.hero-intro-img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px;
}

.hero-intro-name {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 800;
}

.hero-intro-line {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.3;
}

.hero-intro-go {
  margin: 8px 0 0;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--reward-accent, #00838f);
}

.crown { font-size: 3rem; margin: 8px 0; }

.skin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin-top: 16px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

.shop-card {
  display: flex;
  flex-direction: column;
  border: 3px solid transparent;
  border-radius: 20px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
  text-align: center;
  transition: transform 0.1s, border-color 0.2s;
}

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

.shop-card.equipped {
  border-color: var(--btn2);
  box-shadow: 0 0 0 2px rgba(102, 187, 106, 0.25);
}

.shop-card.locked { opacity: 0.72; }

.shop-card.rare {
  position: relative;
  border: none;
  background: transparent;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  isolation: isolate;
  overflow: hidden;
}

.shop-card.rare::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  z-index: 0;
}

.shop-card.rare-outfit::before {
  background-color: #120822;
  background-image:
    radial-gradient(ellipse 90% 70% at 50% -10%, rgba(255, 152, 0, 0.55) 0%, transparent 58%),
    radial-gradient(circle at 8% 92%, rgba(233, 30, 99, 0.42) 0%, transparent 42%),
    radial-gradient(circle at 92% 78%, rgba(126, 87, 194, 0.35) 0%, transparent 38%),
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 213, 79, 0.22) 0 1px, transparent 1px 16px);
  box-shadow: inset 0 0 0 2px rgba(255, 193, 7, 0.45), inset 0 0 28px rgba(255, 111, 0, 0.18);
}

.shop-card.rare-pet::before {
  background-color: #021018;
  background-image:
    radial-gradient(ellipse 85% 65% at 50% 0%, rgba(0, 188, 212, 0.42) 0%, transparent 55%),
    radial-gradient(circle at 12% 88%, rgba(21, 101, 192, 0.45) 0%, transparent 40%),
    radial-gradient(circle at 88% 72%, rgba(0, 131, 143, 0.38) 0%, transparent 36%),
    repeating-radial-gradient(circle at 22% 28%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1px 22px),
    repeating-radial-gradient(circle at 76% 64%, rgba(179, 229, 252, 0.4) 0 1px, transparent 1px 30px);
  box-shadow: inset 0 0 0 2px rgba(77, 208, 225, 0.42), inset 0 0 28px rgba(2, 119, 189, 0.2);
}

.shop-card.rare-headwear::before {
  background-color: #1a0a28;
  background-image:
    radial-gradient(ellipse 90% 70% at 50% -10%, rgba(171, 71, 188, 0.5) 0%, transparent 58%),
    radial-gradient(circle at 10% 90%, rgba(106, 27, 154, 0.42) 0%, transparent 42%),
    radial-gradient(circle at 90% 75%, rgba(255, 193, 7, 0.32) 0%, transparent 38%),
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 213, 79, 0.18) 0 1px, transparent 1px 18px);
  box-shadow: inset 0 0 0 2px rgba(186, 104, 200, 0.48), inset 0 0 28px rgba(123, 31, 162, 0.22);
}

.shop-card.rare-amnyam::before {
  background-color: #0a1a0a;
  background-image:
    radial-gradient(ellipse 85% 65% at 50% 0%, rgba(129, 199, 132, 0.48) 0%, transparent 55%),
    radial-gradient(circle at 12% 88%, rgba(76, 175, 80, 0.4) 0%, transparent 40%),
    radial-gradient(circle at 88% 72%, rgba(255, 213, 79, 0.32) 0%, transparent 36%),
    repeating-radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.45) 0 1px, transparent 1px 20px);
  box-shadow: inset 0 0 0 2px rgba(129, 199, 132, 0.45), inset 0 0 28px rgba(46, 125, 50, 0.2);
}

.shop-card.rare::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0) 28%,
    rgba(255, 255, 255, 0) 72%,
    rgba(255, 255, 255, 0.1) 100%
  );
  animation: rareShimmer 4s ease-in-out infinite alternate;
}

.shop-card.rare > * {
  position: relative;
  z-index: 1;
}

.shop-card.rare .shop-card-preview {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.shop-card-rare-ribbon {
  position: absolute;
  top: 11px;
  right: -32px;
  width: 118px;
  z-index: 6;
  transform: rotate(45deg);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  padding: 6px 0;
  line-height: 1.1;
  pointer-events: none;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.38);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.shop-card.rare-outfit .shop-card-rare-ribbon {
  top: 12px;
  right: -31px;
  background: linear-gradient(90deg, #e65100, #ff1744 45%, #ff9100);
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(120, 0, 0, 0.35);
}

.shop-card.rare-pet .shop-card-rare-ribbon {
  top: 6px;
  right: -28px;
  width: 112px;
  font-size: 0.72rem;
  padding: 5px 0;
  background: linear-gradient(90deg, #006064, #0277bd 45%, #00acc1);
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(0, 40, 80, 0.35);
}

.shop-card.rare-headwear .shop-card-rare-ribbon {
  top: 10px;
  right: -30px;
  width: 114px;
  font-size: 0.72rem;
  padding: 5px 0;
  background: linear-gradient(90deg, #6a1b9a, #ab47bc 45%, #ffd54f);
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(74, 20, 140, 0.35);
}

.shop-card.rare-amnyam .shop-card-rare-ribbon {
  top: 8px;
  right: -29px;
  width: 114px;
  font-size: 0.72rem;
  padding: 5px 0;
  background: linear-gradient(90deg, #2e7d32, #66bb6a 45%, #ffd54f);
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(27, 94, 32, 0.35);
}

.shop-card.rare .shop-card-body {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 0 0 17px 17px;
}

.shop-card.rare .shop-card-name {
  color: #fff;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
}

.shop-card.rare .shop-card-price {
  color: #ffe082;
  opacity: 1;
  font-weight: 800;
}

.shop-card.rare .shop-card-icon {
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 16px rgba(255, 255, 255, 0.5));
}

.shop-card.rare.equipped {
  box-shadow: 0 0 0 4px #ffe082, 0 14px 34px rgba(0, 0, 0, 0.32);
}

.shop-card.rare.locked {
  opacity: 0.9;
}

.shop-card.rare .shop-card-mark {
  background: #ffe082;
  color: #4a148c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 4;
}

.shop-card.rare .shop-card-lock {
  background: rgba(0, 0, 0, 0.48);
  z-index: 4;
}

@keyframes rareShimmer {
  from { opacity: 0.35; }
  to { opacity: 0.85; }
}

.shop-card-preview {
  position: relative;
  height: 84px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.shop-card-icon {
  font-size: 3.2rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

.shop-card-mark {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--btn2);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}

.shop-card-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.45);
  font-size: 2rem;
}

.shop-card-body {
  padding: 0 10px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.shop-card-name {
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.15;
}

.shop-card-price {
  font-size: 1.05rem;
  font-weight: 700;
  opacity: 0.75;
  min-height: 1.1em;
}

.shop-card-action {
  border: none;
  border-radius: 14px;
  padding: 12px 8px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  font-size: 1.05rem;
  width: 100%;
  margin-top: auto;
}

#screenShop .card {
  padding: 18px 14px 16px;
}

.skin-btn {
  border: 3px solid transparent;
  border-radius: 20px;
  padding: 16px 8px;
  background: var(--reward-bg);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s, border-color 0.2s;
}

.skin-btn:active { transform: scale(0.95); }

.skin-btn.active {
  border-color: var(--btn2);
  box-shadow: 0 0 0 2px var(--card);
}

.skin-btn .icon { font-size: 2.2rem; display: block; margin-bottom: 6px; }
.skin-btn .name { font-size: 1rem; font-weight: 700; }

.shop-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--reward-bg);
  border-radius: 16px;
  padding: 12px 14px;
  margin: 10px 0;
  text-align: left;
}

.shop-row .shop-icon { font-size: 2rem; flex-shrink: 0; }
.shop-row .shop-info { flex: 1; }
.shop-row .shop-name { font-weight: 800; font-size: 1.05rem; }
.shop-row .shop-price { font-size: 1.05rem; opacity: 0.85; }

.shop-action {
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  font-size: 1.05rem;
  white-space: nowrap;
}

.shop-buy { background: var(--btn3); color: #fff; }
.shop-equip { background: var(--btn2); color: #fff; }
.shop-on { background: var(--card); opacity: 0.7; }
.shop-lock { background: #ccc; color: #555; }

.buttons {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 16px;
}

.btn {
  border: none;
  border-radius: 20px;
  padding: 20px 16px;
  font-size: 1.25rem;
  font-weight: 800;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  transition: transform 0.1s;
}

.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--btn); color: #fff; }
.btn-success { background: var(--btn2); color: #fff; }
.btn-soft { background: var(--card); color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.btn-warm { background: var(--btn3); color: #fff; }

.level-tag { font-size: 1.1rem; font-weight: 800; opacity: 0.85; margin-bottom: 8px; }

.card-moment {
  background: linear-gradient(165deg, #fff9c4 0%, #ffe082 42%, #ffffff 100%);
  border: 5px solid #ffb300;
  border-radius: 28px;
  padding: 28px 18px 32px;
  box-shadow: 0 12px 36px rgba(255, 152, 0, 0.28);
  animation: momentPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-moment-done {
  background: linear-gradient(165deg, #e3f2fd 0%, #fff59d 38%, #f8bbd0 100%);
  border-color: #ff4081;
  box-shadow: 0 12px 36px rgba(255, 64, 129, 0.22);
}

.card-moment-skip {
  background: linear-gradient(165deg, #e8f5e9 0%, #b9f6ca 45%, #fffde7 100%);
  border-color: #66bb6a;
  box-shadow: 0 12px 36px rgba(102, 187, 106, 0.28);
}

.moment-burst {
  font-size: clamp(2.4rem, 11vw, 3.8rem);
  line-height: 1.15;
  margin-bottom: 4px;
  animation: burstWiggle 0.55s ease-in-out infinite alternate;
}

.moment-emoji {
  font-size: clamp(4.8rem, 24vw, 7.5rem);
  line-height: 1;
  margin: 4px 0 8px;
  animation: emojiBounce 0.75s ease-in-out infinite;
}

.moment-title {
  font-size: clamp(2rem, 10vw, 3.2rem);
  font-weight: 900;
  margin: 0 0 6px;
  line-height: 1.05;
  letter-spacing: 0.03em;
  color: #e65100;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.85);
}

.card-moment-done .moment-title { color: #c2185b; }
.card-moment-skip .moment-title { color: #2e7d32; }

.moment-shout {
  font-size: clamp(1.75rem, 8.5vw, 2.6rem);
  font-weight: 900;
  margin: 0;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.moment-gems {
  font-size: clamp(2.4rem, 12vw, 3.8rem);
  font-weight: 900;
  color: var(--reward-accent);
  margin: 14px 0 0;
  line-height: 1;
  animation: gemsPulse 0.9s ease-in-out infinite;
}

@keyframes momentPop {
  from { transform: scale(0.82); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes emojiBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.04); }
}

@keyframes burstWiggle {
  from { transform: rotate(-5deg) scale(1); }
  to { transform: rotate(5deg) scale(1.06); }
}

@keyframes gemsPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.parent-link {
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.45;
  margin-top: 8px;
  flex-shrink: 0;
}

.parent-link a { color: inherit; }

.picture-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
  width: 100%;
}

.pic-btn {
  font-size: clamp(2.8rem, 14vw, 4rem);
  line-height: 1;
  padding: 12px 6px;
  border: 3px solid transparent;
  border-radius: 20px;
  background: var(--reward-bg);
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s, border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pic-btn .pic-emoji { display: block; line-height: 1; }

.pic-btn:active { transform: scale(0.95); }

.card-wrong {
  background: #ffebee;
  border: 4px solid #ef5350;
  padding: 48px 24px;
}

.wrong-stack { position: relative; display: inline-block; }

.wrong-x {
  font-size: 5.5rem;
  line-height: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  animation: wshake 0.45s ease;
}

.wrong-pick {
  font-size: 5rem;
  line-height: 1;
  opacity: 0.35;
  filter: grayscale(0.4);
}

.wrong-penalty {
  font-size: clamp(2.6rem, 13vw, 4rem);
  font-weight: 900;
  color: #c62828;
  margin: 16px 0 6px;
  line-height: 1;
  animation: gemsPulse 0.9s ease-in-out infinite;
}

.wrong-penalty.hidden { display: none; }

#screenWrong .hint {
  font-size: 1.45rem;
  opacity: 0.95;
}

#screenRead .read-picture-hint {
  font-size: 1.35rem;
  font-weight: 900;
}

.screen-hint-big {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 10px;
  line-height: 1.2;
}

@keyframes wshake {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  25% { transform: translate(calc(-50% - 10px), -50%) rotate(-8deg); }
  75% { transform: translate(calc(-50% + 10px), -50%) rotate(8deg); }
}

.card-celebrate {
  background: linear-gradient(160deg, var(--reward-bg) 0%, var(--card) 100%);
  border: 4px solid var(--reward-accent);
  padding: 36px 24px;
}

.celebrate-burst { font-size: 3.5rem; line-height: 1.2; margin-bottom: 12px; }

.celebrate-title {
  font-size: clamp(1.8rem, 8vw, 2.4rem);
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.15;
}

.celebrate-sub { font-size: 1.25rem; font-weight: 800; opacity: 0.9; margin: 0; }

.profile-avatar {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 8px;
}

.setting-block {
  margin-top: 20px;
  padding: 16px 14px;
  border-radius: 20px;
  background: var(--reward-bg);
  text-align: left;
}

.setting-label {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.setting-toggle {
  border: 3px solid transparent;
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.setting-toggle.on {
  border-color: var(--btn2);
  background: #e8f5e9;
}

.setting-toggle.off {
  opacity: 0.72;
}

.setting-toggle.setting-danger {
  border-color: #ef9a9a;
  background: #ffebee;
  color: #c62828;
}

.setting-toggle + .setting-toggle {
  margin-top: 10px;
}

.share-block {
  margin-top: 18px;
  padding: 16px 14px 14px;
  border-radius: 22px;
  background: linear-gradient(160deg, #e3f2fd 0%, #fce4ec 100%);
  border: 3px solid rgba(66, 165, 245, 0.35);
  text-align: center;
}

.share-tagline {
  margin: 0 0 12px;
  font-size: clamp(1.05rem, 4.5vw, 1.25rem);
  font-weight: 900;
  line-height: 1.2;
  color: #1565c0;
}

.share-icon-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.share-icon-btn {
  width: auto;
  min-width: 68px;
  height: auto;
  padding: 10px 12px 8px;
  border: none;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  font-family: inherit;
  flex-shrink: 0;
}

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

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

.share-icon-letter {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}

.share-icon-label {
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.1;
  opacity: 0.95;
}

.share-url-preview {
  word-break: break-all;
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 0.35rem;
}

.share-icon-btn-tg {
  background: linear-gradient(160deg, #29b6f6, #0288d1);
  color: #fff;
}

.share-icon-btn-max {
  background: linear-gradient(160deg, #9c6bff, #5e35b1);
  color: #fff;
}

.share-icon-btn-sms {
  background: linear-gradient(160deg, #66bb6a, #388e3c);
  color: #fff;
}

.setting-link-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.setting-link {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid rgba(66, 165, 245, 0.25);
}

.setting-link:active { opacity: 0.85; }

.share-block.share-flash {
  animation: shareFlash 1.2s ease-in-out 2;
}

@keyframes shareFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
  50% { box-shadow: 0 0 0 6px rgba(255, 193, 7, 0.45); }
}

.reading-stats {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(227, 242, 253, 0.95), rgba(255, 249, 196, 0.85));
  text-align: left;
}
.reading-stats-title {
  font-weight: 800;
  font-size: 1.05rem;
  margin: 0 0 0.55rem;
}
.reading-stats-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.98rem;
  padding: 0.2rem 0;
}
.reading-stats-row span:last-child {
  font-weight: 700;
  text-align: right;
}

.viewer-play-lock {
  position: fixed;
  inset: 0;
  z-index: 8500;
  background: rgba(255, 255, 255, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  pointer-events: auto;
}
.viewer-play-lock.hidden { display: none !important; }
.viewer-play-lock-card {
  max-width: 360px;
  background: #fff;
  border-radius: 18px;
  padding: 1.25rem 1.1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  text-align: center;
}
.viewer-play-lock-card p { margin: 0.45rem 0; }
.viewer-play-lock-card .btn-success {
  margin-top: 0.85rem;
  width: 100%;
}
body.mode-viewer .setting-danger { display: none; }
body.mode-viewer #buddyShareBlock .share-tagline,
body.mode-viewer #buddyShareBlock .share-icon-row,
body.mode-viewer #buddyShareBlock > .hint { display: none; }

html.boot-name #screenName.hidden { display: flex !important; }
html.boot-name #screenStart { display: none !important; }
html.boot-name .top,
html.boot-name .mode-tabs,
html.boot-name .parent-link,
html.boot-name .buddy-slot,
html.boot-name .daily-goal-bar,
html.boot-name .level-progress-bar,
html.boot-name #buttons { display: none !important; }
