/* Minecraft Buddy: детский PWA. Шесть биом-тем, блочные углы, пиксельная полоса. */

:root {
  --bg: #eef3e6;
  --bg2: #f7f9f1;
  --card: #ffffff;
  --ink: #1b2416;
  --muted: #5f6f57;
  --line: #c9d4bd;
  --primary: #4c8c3f;
  --primary-dark: #356329;
  --accent: #2f6df6;
  --danger: #c0392b;
  --sky: #cfe6f5;
  --dirt: #8a5a3b;
  --pixel1: #4c8c3f;
  --pixel2: #8a5a3b;
  --pixel3: #cfe6f5;
  --pixel4: #6b7565;
  --radius: 4px;
  --radius-lg: 6px;
  --shadow-color: rgba(27, 36, 22, 0.22);
  --shadow: 4px 4px 0 var(--shadow-color);
  --font-pixel: "Lucida Console", "Courier New", ui-monospace, monospace;
}

html[data-theme="nether"] {
  color-scheme: dark;
  --bg: #170d0d;
  --bg2: #211111;
  --card: #2a1717;
  --ink: #f7e8dc;
  --muted: #c7a596;
  --line: #4a2a24;
  --primary: #ff6b1a;
  --primary-dark: #b23c0b;
  --accent: #ffb020;
  --danger: #ff4d3d;
  --sky: #3a1a1a;
  --dirt: #3b3b46;
  --pixel1: #ff6b1a;
  --pixel2: #ffb020;
  --pixel3: #3b3b46;
  --pixel4: #7a2e1a;
  --shadow-color: rgba(0, 0, 0, 0.55);
}

html[data-theme="end"] {
  color-scheme: dark;
  --bg: #120d1b;
  --bg2: #1a1327;
  --card: #201830;
  --ink: #eee8ff;
  --muted: #aa9dc6;
  --line: #3b2c55;
  --primary: #a855f7;
  --primary-dark: #6d28d9;
  --accent: #22d3ee;
  --danger: #ff5c8a;
  --sky: #2a1b3d;
  --dirt: #d8d2c0;
  --pixel1: #a855f7;
  --pixel2: #22d3ee;
  --pixel3: #d8d2c0;
  --pixel4: #4c1d95;
  --shadow-color: rgba(0, 0, 0, 0.6);
}

html[data-theme="ocean"] {
  --bg: #e6f4f7;
  --bg2: #f4fbfc;
  --card: #ffffff;
  --ink: #0a2a33;
  --muted: #4f7480;
  --line: #b9dbe3;
  --primary: #0e7490;
  --primary-dark: #155e75;
  --accent: #f59e0b;
  --danger: #dc2626;
  --sky: #c9ecf4;
  --dirt: #0f4c5c;
  --pixel1: #0e7490;
  --pixel2: #f59e0b;
  --pixel3: #c9ecf4;
  --pixel4: #155e75;
  --shadow-color: rgba(10, 42, 51, 0.20);
}

html[data-theme="cave-diamonds"] {
  color-scheme: dark;
  --bg: #0b1016;
  --bg2: #101821;
  --card: #141c26;
  --ink: #e8f4f8;
  --muted: #8fa6b5;
  --line: #263544;
  --primary: #22d3ee;
  --primary-dark: #0e7490;
  --accent: #67e8f9;
  --danger: #fb7185;
  --sky: #132430;
  --dirt: #2b3440;
  --pixel1: #22d3ee;
  --pixel2: #67e8f9;
  --pixel3: #2b3440;
  --pixel4: #0e7490;
  --shadow-color: rgba(0, 0, 0, 0.6);
}

html[data-theme="tundra"] {
  --bg: #eef5fa;
  --bg2: #f8fbfd;
  --card: #ffffff;
  --ink: #14232c;
  --muted: #5a7180;
  --line: #c3d6e2;
  --primary: #3b82c4;
  --primary-dark: #1e5f8a;
  --accent: #7dd3fc;
  --danger: #dc2626;
  --sky: #dbeafe;
  --dirt: #8aa6b8;
  --pixel1: #3b82c4;
  --pixel2: #7dd3fc;
  --pixel3: #dbeafe;
  --pixel4: #8aa6b8;
  --shadow-color: rgba(20, 35, 44, 0.18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button, input, textarea, select { font-family: inherit; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 17px;
  overscroll-behavior-y: none;
}

/* Пиксельная полоса сверху: четыре цвета темы. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 6px;
  z-index: 60;
  background: repeating-linear-gradient(
    90deg,
    var(--pixel1) 0 18px,
    var(--pixel2) 18px 36px,
    var(--pixel3) 36px 54px,
    var(--pixel4) 54px 72px
  );
  border-bottom: 2px solid var(--line);
}

.app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

/* --- верхняя панель --- */
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
  position: sticky;
  top: 6px;
  z-index: 5;
  background: linear-gradient(var(--bg) 78%, transparent);
}
.brand {
  font-family: var(--font-pixel);
  font-weight: 800;
  font-size: 18px;
  flex: 1;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.icon-btn {
  border: 2px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  width: 44px; height: 44px; font-size: 20px;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.icon-btn:active, .tile:active, .primary:active, .round-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--shadow-color);
}
.timer-chip {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  background: var(--ink); color: var(--card);
  font-family: var(--font-pixel);
  font-weight: 700; font-size: 15px;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow);
}
.timer-chip.is-break { background: var(--dirt); }

/* --- экраны --- */
.screens { flex: 1; padding: 4px 16px 16px; }
.screen { display: none; }
.screen.is-active { display: block; animation: fade 0.15s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.screen-center {
  display: none;
  min-height: 60vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}
.screen-center.is-active { display: flex; }

h2 {
  font-family: var(--font-pixel);
  font-size: 23px;
  margin: 10px 0 12px;
  letter-spacing: 0.3px;
}
h3 { font-family: var(--font-pixel); font-size: 17px; margin: 0 0 8px; }
.muted, .hint { color: var(--muted); font-size: 15px; }
.hint { text-align: center; min-height: 22px; }

/* --- главная --- */
.greeting { font-size: 26px; font-weight: 800; margin: 18px 0 6px; text-align: center; }

.voice-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 210px;
  height: 210px;
  margin: 18px auto 8px;
  border: 3px solid var(--primary-dark);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 6px 6px 0 var(--shadow-color);
  transition: transform 0.08s ease;
}
.voice-big.is-on { animation: pulse 1.4s infinite; }
.stop-big {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px auto 0;
  padding: 12px 28px;
  border: 3px solid #7a1610;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #d84a35, #a8231a);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 4px 4px 0 var(--shadow-color);
}
.stop-big[hidden] { display: none; }
.stop-big svg { width: 18px; height: 18px; }
.round-btn.stop { background: #c0392b; color: #fff; }
.round-btn.stop[hidden] { display: none; }
.round-btn.stop svg { width: 16px; height: 16px; vertical-align: middle; }
@keyframes pulse {
  0%, 100% { box-shadow: 6px 6px 0 var(--shadow-color), 0 0 0 0 rgba(255,255,255,0.35); }
  50% { box-shadow: 6px 6px 0 var(--shadow-color), 0 0 0 16px rgba(255,255,255,0); }
}
.voice-big-icon { font-size: 68px; line-height: 1; }
.voice-big-label { font-weight: 800; font-size: 17px; padding: 0 12px; text-align: center; }

.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  min-height: 72px;
}
.tile-icon { font-size: 28px; }

/* --- чат --- */
#screen-chat.is-active { display: flex; flex-direction: column; height: calc(100dvh - 150px); }
.chat-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 2px 12px;
}
.bubble {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.child { align-self: flex-end; background: var(--sky); }
.bubble.companion { align-self: flex-start; background: var(--card); box-shadow: var(--shadow); }
.bubble.system { align-self: center; background: transparent; color: var(--muted); font-size: 14px; text-align: center; border: 0; }

.composer {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
}
.composer input {
  flex: 1;
  min-width: 0;
  border: 2px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 17px;
  outline: none;
  color: var(--ink);
}
.composer input:focus { border-color: var(--primary); }
.round-btn {
  width: 52px; height: 52px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 22px;
  flex: none;
  color: var(--ink);
}
.round-btn.send { background: var(--accent); color: #fff; border-color: var(--accent); }
.round-btn.is-on { background: var(--danger); color: #fff; border-color: var(--danger); }

/* --- карточка аддона --- */
.addon-list { display: flex; flex-direction: column; gap: 12px; }
.addon-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.addon-shot {
  height: 120px;
  background:
    linear-gradient(45deg, var(--bg2) 25%, transparent 25%, transparent 75%, var(--bg2) 75%),
    linear-gradient(45deg, var(--bg2) 25%, var(--bg) 25%, var(--bg) 75%, var(--bg2) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  border-bottom: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--font-pixel);
  font-size: 13px;
}
.addon-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.addon-body { padding: 12px 14px; }
.addon-body h4 { font-family: var(--font-pixel); margin: 0 0 4px; font-size: 17px; }
.addon-meta { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.addon-desc { margin: 0 0 8px; line-height: 1.4; }
.addon-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag {
  font-size: 11.5px;
  background: var(--sky);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 3px 7px;
  border-radius: 2px;
}
.addon-body ol { margin: 6px 0 10px; padding-left: 20px; font-size: 14.5px; line-height: 1.45; }
.addon-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.addon-download { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.addon-source { margin: 0; color: var(--muted); font-size: 12px; }
.addon-link, .btn-block {
  display: inline-block;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 2px solid var(--primary-dark);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.addon-link:disabled, .btn-block:disabled {
  background: var(--bg2);
  color: var(--muted);
  border-color: var(--line);
  box-shadow: none;
  cursor: not-allowed;
}
.compare-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }

.search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.search-row input {
  flex: 1; min-width: 0;
  border: 2px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink);
}
.compare-bar {
  border: 2px dashed var(--primary);
  background: var(--bg2);
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  font-size: 14px;
}
.compare { overflow-x: auto; }
.compare table { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare th, .compare td { border: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
.compare th { background: var(--bg2); font-family: var(--font-pixel); font-size: 13px; }

/* --- таймер / перерыв --- */
.big-clock {
  font-family: var(--font-pixel);
  font-size: 68px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.primary {
  margin-top: 12px;
  border: 2px solid var(--primary-dark);
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  padding: 14px 24px;
  box-shadow: var(--shadow);
}
.primary:disabled { background: var(--bg2); color: var(--muted); border-color: var(--line); box-shadow: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ghost-btn {
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* --- уроки --- */
.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.card ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.5; }
.word-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.word {
  background: var(--sky);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 15px;
}
.word small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.word { cursor: pointer; }
.word.is-learned { background: var(--primary); color: #fff; border-color: var(--primary-dark); }
.word.is-learned small { color: #eafbe4; }

.speech-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.speech-item {
  display: flex; align-items: center; gap: 8px;
  border: 2px solid var(--line);
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 9px 11px;
  text-align: left;
  font-size: 15px;
  color: var(--ink);
}
.speech-item.is-active { border-color: var(--primary); background: var(--sky); }
.speech-item .num { font-family: var(--font-pixel); color: var(--muted); font-size: 12px; }
.speech-active { border-top: 2px dashed var(--line); margin-top: 10px; padding-top: 10px; }
.speech-text { font-size: 19px; font-weight: 700; line-height: 1.35; margin: 6px 0; }
.speech-cue { margin: 0 0 8px; }
.verdict { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.verdict button {
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.verdict button[data-mark="good"] { border-color: var(--primary); }
.verdict button[data-mark="fix"] { border-color: var(--accent); }
.verdict button[data-mark="repeat"] { border-color: var(--dirt); }
.rec-dot {
  display: inline-block; width: 10px; height: 10px;
  background: var(--danger); border-radius: 50%;
  margin-right: 6px;
  animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0.2; } }

/* --- шахматы --- */
.chess-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; }
.chess-status { font-weight: 700; font-size: 15px; }
.chess-level { font-size: 13px; color: var(--muted); text-align: right; }
.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border: 3px solid var(--ink);
  background: var(--ink);
  gap: 1px;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  touch-action: manipulation;
}
.sq {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  font-size: clamp(22px, 7.2vw, 38px);
  line-height: 1;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}
.sq.light { background: var(--bg2); }
.sq.dark { background: var(--dirt); }
.sq .piece { filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.25)); }
.sq.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.sq.legal::after {
  content: ""; position: absolute; width: 26%; height: 26%;
  border-radius: 50%; background: var(--accent); opacity: 0.75;
}
.sq.legal.capture::after {
  width: 86%; height: 86%; border-radius: 0;
  background: transparent; border: 4px solid var(--danger); opacity: 0.9;
}
.sq.check { background: var(--danger); }
.sq.hint-from { outline: 4px solid var(--accent); outline-offset: -4px; }
.sq.hint-to { outline: 4px dashed var(--primary); outline-offset: -4px; }
.puzzle-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.puzzle-btn {
  border: 2px solid var(--line);
  background: var(--bg2);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 13.5px;
  text-align: left;
}
.puzzle-btn.is-solved { border-color: var(--primary); background: var(--sky); }
.hint-box {
  border: 2px solid var(--accent);
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 14.5px;
  line-height: 1.4;
}
input[type="range"] { width: 100%; }

/* --- темы --- */
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme-card {
  border: 2px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  text-align: left;
  color: var(--ink);
}
.theme-card.is-active { border-color: var(--primary); outline: 2px solid var(--primary); }
.theme-swatch { display: flex; height: 54px; border: 2px solid var(--line); margin-bottom: 8px; }
.theme-swatch span { flex: 1; }
.theme-name { font-family: var(--font-pixel); font-size: 14px; font-weight: 700; }
.theme-sub { font-size: 11.5px; color: var(--muted); }

/* --- память --- */
.kv { display: grid; grid-template-columns: 42% 58%; gap: 6px 10px; font-size: 15.5px; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; word-break: break-word; }
.kv .empty { color: var(--muted); font-weight: 400; }

/* --- нижняя навигация --- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 6;
  display: flex;
  justify-content: space-around;
  background: var(--card);
  border-top: 3px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  border: 0; background: transparent;
  font-size: 22px;
  color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 8px;
  border-radius: var(--radius);
  flex: 1 1 0;
  max-width: 16.66%;
}
.tab span { font-size: 10.5px; font-weight: 700; }
.tab.is-active { color: var(--primary-dark); background: var(--sky); }

@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .tile { flex-direction: column; text-align: center; }
  .theme-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-height: 640px) {
  .voice-big { width: 170px; height: 170px; }
  .voice-big-icon { font-size: 54px; }
}

/* --- знакомство (первый запуск) --- */
.onboarding-intro {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  margin: 8px 6px 4px;
}
.onboarding-form { text-align: left; margin-top: 16px; width: 100%; max-width: 420px; }
.onboarding-label {
  display: block;
  font-weight: 700;
  font-size: 15px;
  margin: 12px 0 6px;
  color: var(--ink);
}
.onboarding-label input {
  width: 100%;
  margin-top: 6px;
  border: 2px solid var(--line);
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 9px 13px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.chip.is-active { border-color: var(--primary); background: var(--sky); }

/* --- полоса опыта, шляпа, прибавка опыта --- */
.hat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 2px auto 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.hat-chip .dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--line);
  display: inline-block;
}
.xp-wrap { position: relative; max-width: 420px; margin: 10px auto 4px; }
.xp-bar { width: 100%; }
.xp-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; font-size: 14px; font-weight: 700; margin-bottom: 5px;
}
.xp-top #xp-emeralds { font-family: var(--font-pixel); }
.xp-track {
  height: 16px;
  border: 2px solid var(--line);
  background: var(--bg2);
  border-radius: var(--radius);
  overflow: hidden;
}
.xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.4s ease;
}
.xp-gain {
  position: absolute;
  right: 4px; top: -2px;
  font-family: var(--font-pixel);
  font-weight: 800;
  font-size: 15px;
  color: var(--primary-dark);
  animation: xpfloat 1.6s ease forwards;
  pointer-events: none;
}
@keyframes xpfloat {
  0% { opacity: 0; transform: translateY(6px); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-16px); }
}
.home-context { margin-top: 6px; }

/* --- награды: задания, достижения, магазин --- */
.quest-list { display: flex; flex-direction: column; gap: 8px; }
.quest {
  display: flex; align-items: center; gap: 10px;
  border: 2px solid var(--line);
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 15px;
}
.quest .qmark { font-size: 18px; width: 22px; text-align: center; }
.quest.is-done { border-color: var(--primary); background: var(--sky); }
.quest .qbody { flex: 1; }
.quest .qtitle { font-weight: 700; }
.quest .qprog { font-size: 13px; color: var(--muted); }

.ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ach {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--bg2);
  opacity: 0.55;
}
.ach.is-unlocked { opacity: 1; border-color: var(--primary); background: var(--sky); }
.ach .ach-name { font-weight: 700; font-size: 14px; }
.ach .ach-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }

.shop-list { display: flex; flex-direction: column; gap: 8px; }
.shop-item {
  display: flex; align-items: center; gap: 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--bg2);
}
.shop-item .shop-dot {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line); flex: none;
}
.shop-item .shop-body { flex: 1; }
.shop-item .shop-name { font-weight: 700; font-size: 15px; }
.shop-item .shop-price { font-size: 13px; color: var(--muted); }
.shop-item.is-equipped { border-color: var(--primary); background: var(--sky); }
.shop-btn {
  border: 2px solid var(--primary-dark);
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 8px 12px;
  font-weight: 800;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.shop-btn:disabled { background: var(--bg2); color: var(--muted); border-color: var(--line); box-shadow: none; }

.rename-row { display: flex; gap: 8px; }
.rename-row input {
  flex: 1; min-width: 0;
  border: 2px solid var(--line);
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 11px 13px;
  font-size: 16px;
  color: var(--ink);
}

/* --- всплывающий тост --- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 70;
  background: var(--ink);
  color: var(--card);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 18px;
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 15px;
  max-width: 86%;
  text-align: center;
  animation: fade 0.15s ease;
}

/* --- заблокированные темы --- */
.theme-card.is-locked { opacity: 0.6; }
.theme-card.is-locked .theme-name::after { content: " 🔒"; }
/* --- раздел 4: живой рот, карта мира, единый дизайн --- */

@font-face {
  font-family: "Buddy Display";
  src: url("assets/fonts/buddy-display.ttf") format("truetype");
  font-display: swap;
}

h2, h3, .brand, .golem-title {
  font-family: "Buddy Display", "Montserrat", sans-serif;
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25), -1px -1px 0 rgba(255, 255, 255, 0.35);
}

/* сцена голема */
.golem-stage {
  display: grid;
  grid-template-areas: "imgs" "line";
  background: #141a16;
  border: 3px solid #3a463c;
  border-radius: 18px;
  padding: 10px 10px 8px;
  margin: 6px 0 10px;
  overflow: hidden;
}
.golem-img {
  grid-area: imgs;
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.12s ease;
  /* Без анимации дыхания: картинка полностью неподвижна
     (распоряжение владельца 30.11.2026). */
}
.golem-img.is-visible { opacity: 1; }
.golem-line {
  grid-area: line;
  margin: 8px 0 0;
  text-align: center;
  font-family: "Buddy Display", "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: #e8f0e6;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

/* кнопки: скошенные углы, фаска, зелёное свечение */
.voice-big, .primary {
  border-radius: 14px;
  background: #58b02c;
  box-shadow:
    inset 0 -6px 0 rgba(0, 0, 0, 0.25),
    inset 0 2px 0 rgba(255, 255, 255, 0.25),
    0 0 18px rgba(88, 176, 44, 0.45);
}
.voice-big:disabled, .primary:disabled {
  background: var(--bg2);
  box-shadow: none;
}

/* сегментная полоса опыта */
.xp-track { position: relative; }
.xp-track::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    transparent 0, transparent calc(10% - 2px),
    rgba(0, 0, 0, 0.18) calc(10% - 2px), rgba(0, 0, 0, 0.18) 10%
  );
}

/* плитки и вкладки: тёмные панели, SVG-значки */
.tile, .tab {
  background: #1c241e;
  color: #e8f0e6;
  border-color: #3a463c;
}
.tile-icon, .tab .ico {
  width: 26px;
  height: 26px;
  display: block;
}
.tile-icon svg, .tab .ico svg {
  width: 26px;
  height: 26px;
  display: block;
}
.tab.is-active {
  color: #9fe08a;
  background: #232d25;
  box-shadow: inset 0 -3px 0 #58b02c;
}

/* обложки уроков */
#screen-lessons .card > h3 {
  font-family: "Buddy Display", "Montserrat", sans-serif;
  background: #1c241e;
  color: #e8f0e6;
  margin: -14px -14px 12px;
  padding: 10px 14px;
  border-radius: 4px 4px 0 0;
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

/* карта мира и путь */
.world-map {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 3px solid #3a463c;
  margin: 6px 0 10px;
}
.world-path { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.world-step {
  padding: 8px 12px;
  border-radius: 8px;
  background: #1c241e;
  color: #e8f0e6;
  font-weight: 700;
  border-left: 5px solid #3a463c;
}
.world-step.is-done { border-left-color: #58b02c; }
.world-step.is-current { border-left-color: #ffb020; background: #232d25; }
.world-step.is-locked { opacity: 0.55; }
.world-caption {
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  margin: 6px 0 10px;
}
