/* English Quest — пиксельный блочный мир (pixel + glossy) */
:root {
  --bg: #cfe9f6;
  --bg-2: #a4d5ee;
  --surface: #fffdf6;
  --ink: #1c2b1a;
  --ink-2: #3a4a38;
  --muted: #6a7a68;
  --line: #1c2b1a;

  --grass: #3fb650;
  --grass-2: #2e8a3d;
  --grass-3: #61d074;
  --diamond: #3a9fe0;
  --diamond-2: #2a7cb4;
  --diamond-3: #5cbaee;
  --gold: #f5c02b;
  --gold-2: #d69f0a;
  --rose: #ff7bb0;
  --rose-2: #d64f8a;
  --violet: #a870ff;
  --violet-2: #7c4bd6;
  --lava: #ff6b3a;
  --lava-2: #d64a1c;

  --on-color: #1c2b1a; /* text on bright block colors (AA on all of them) */

  /* v2 (docs/design-v2/STYLE.md): тень кнопки и редкость — заливка метки и фон таблички; текст на них тёмный */
  --shadow-press: 0 4px 0 var(--ink);
  --rarity-common: #c9d3d8;   --rarity-common-bg: #c9d3d8;
  --rarity-revenge: #ff7bb0;  --rarity-revenge-bg: #ffb3d1;
  --rarity-rare: #3a9fe0;     --rarity-rare-bg: #8cc8f0;
  --rarity-epic: #a870ff;     --rarity-epic-bg: #c9b3ff;
  --rarity-legend: #f5c02b;   --rarity-legend-bg: #f5c02b;
  --rarity-special: #ff6b3a;  --rarity-special-bg: #ff9a7a;
  --locked: #cfd6d2;
  --nav-active: #d6ecfb;

  --grid: rgba(0,0,0,0.06);
  --stud: rgba(255,255,255,0.35);
  --shadow-hard: 4px 4px 0 #1c2b1a;
  --shadow-soft: 0 6px 0 rgba(0,0,0,0.18), 0 12px 24px rgba(0,0,0,0.15);

  --radius-brick: 4px;
  --radius-stud: 14px;
  --radius-pill: 999px;

  --font-pixel: 'Press Start 2P', system-ui, sans-serif;
  --font-body: 'Baloo 2', 'Nunito', system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg: #0f1721;
  --bg-2: #1a2635;
  --surface: #1c2b3a;
  --ink: #f2f8ff;
  --ink-2: #cfe0f2;
  --muted: #8ea3b8;
  --line: #05080d;
  --shadow-hard: 4px 4px 0 #05080d;
  --grid: rgba(255,255,255,0.05);
  --stud: rgba(255,255,255,0.18);
  --shadow-press: 0 4px 0 #05080d;
  --locked: #3a4652;
  --nav-active: #24425e;
}

/* base */
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 20% 15%, #ffffff90 0 40px, transparent 42px),
    radial-gradient(circle at 80% 60%, #ffffff70 0 30px, transparent 32px),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
}

/* ground grid (pixel blocks) */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.app { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 20px 24px 80px; }

/* Pixel-friendly heading */
h1, h2, h3, .pixel {
  font-family: var(--font-pixel);
  letter-spacing: 0.5px;
  line-height: 1.25;
}

h1 { font-size: 26px; }
h2 { font-size: 20px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }

img, svg { shape-rendering: crispEdges; image-rendering: pixelated; }

/* ==== HUD ==== */
.hud {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius-stud);
  padding: 10px 14px;
  box-shadow: var(--shadow-hard);
  position: sticky; top: 12px; z-index: 5;
}
.hud .spacer { flex: 1; }
/* игрок в шапке: герой в рамке цвета героя, имя, звание (эскиз 31) */
.player { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; min-height: 48px; }
.player-av { width: 46px; height: 46px; flex-shrink: 0; overflow: hidden; border: 3px solid var(--hero-color, var(--diamond)); border-radius: 6px;
  background: color-mix(in srgb, var(--hero-color, var(--diamond)) 22%, var(--surface)); display: flex; align-items: flex-start; justify-content: center; font-size: 26px; }
.player-av .hero-pic { width: 52px; height: 62px; margin-top: 2px; }
.player-text { display: flex; flex-direction: column; min-width: 0; }
.player-name { font-size: 20px; font-weight: 800; line-height: 1; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-rank { font-size: 13px; font-weight: 700; color: var(--diamond-2); white-space: nowrap; }
[data-theme="dark"] .player-rank { color: var(--diamond-3); }
.player:focus-visible { outline: 3px solid var(--diamond); outline-offset: 3px; border-radius: 8px; }
/* уровень «L14» — пиксельный бейдж (эскиз) */
.lvl-badge { font-family: var(--font-pixel); font-size: 11px; line-height: 1; padding: 7px 6px; background: var(--gold); color: var(--on-color); border: 3px solid var(--line); border-radius: 4px; flex-shrink: 0; }
.coin-pill { background: #fff4cc; border-width: 3px; font-weight: 800; font-size: 16px; padding: 4px 10px; box-shadow: none; }
.stat {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff3c2;
  border: 2px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-weight: 700;
  font-family: var(--font-body);
  font-size: 15px;
  box-shadow: 0 3px 0 var(--line);
}
.stat.xp { background: #ffe388; }
.stat.gold { background: #ffe388; }
.stat.freeze { background: #d5eefa; cursor: pointer; color: var(--on-color); }
.stat.freeze.empty > span:first-child { filter: grayscale(1); opacity: 0.6; }
.stat.streak { background: #ffd6b3; }
[data-theme="dark"] .stat { background: #263849; color: var(--ink); }
[data-theme="dark"] .stat.xp { background: #3a3320; color: #ffe388; }
[data-theme="dark"] .stat.gold { background: #3a3320; color: #ffe388; }
[data-theme="dark"] .stat.freeze { background: #1f3346; color: #cfe8ff; }
[data-theme="dark"] .stat.streak { background: #3a2a20; color: #ffcda4; }

.icon-btn {
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  min-width: 44px; min-height: 44px;
  cursor: pointer;
  font: inherit;
  box-shadow: 0 3px 0 var(--line);
  transition: transform 0.06s ease;
}
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--line); }

/* ==== LEVEL BAR ==== */
.level-bar {
  margin-top: 14px;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius-stud);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow-hard);
}
/* кольцо цели дня: одна величина — доля выполненных минут */
.goal { display: flex; align-items: center; gap: 10px; --p: 0; }
.goal-ring {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--grass) calc(var(--p) * 1%), #d9e6ec 0);
  border: 3px solid var(--line);
  position: relative;
}
[data-theme="dark"] .goal-ring { background: conic-gradient(var(--grass) calc(var(--p) * 1%), #22303f 0); }
.goal-ring span {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line);
  font-weight: 800; font-size: 16px;
}
.goal.met .goal-ring span { background: var(--grass); color: var(--on-color); }
.goal-txt { display: flex; flex-direction: column; line-height: 1.2; }
.goal-txt b { font-family: var(--font-pixel); font-size: 10px; }
.goal-txt span { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.stat.streak.pending > span:first-child { filter: grayscale(1); opacity: 0.6; }
.level-info { display: flex; flex-direction: column; gap: 6px; }
.level-info .rank {
  font-family: var(--font-pixel); font-size: 12px; line-height: 1.4;
  align-self: flex-start;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--line);
  border-left: 8px solid var(--rank-color, var(--grass-3));
  border-radius: var(--radius-pill);
  padding: 6px 12px 6px 10px; min-height: 32px;
  cursor: pointer;
}
.level-info .rank:hover { box-shadow: 0 3px 0 var(--line); }
/* «Мои звания» */
.rank-region { margin: 14px 0 0; padding: 12px; border: 3px solid var(--line); border-radius: 14px; border-top: 8px solid var(--rank-color); }
.rank-region h3 { margin: 0 0 8px; }
.rank-region h3 small { font-weight: 600; color: var(--muted); }
.rank-region > p { margin: 8px 0 0; }
.rank-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.rank-steps li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 2px dashed var(--muted); border-radius: 12px; opacity: .8; }
.rank-steps li.got { border: 2px solid var(--line); border-left: 8px solid var(--rank-color); opacity: 1; background: var(--surface); }
.rank-steps .rank-em { font-size: 24px; }
.rank-steps small { color: var(--muted); }
.level-info .xp-text { font-size: 13px; color: var(--muted); }
.progress {
  height: 18px;
  background: #d9e6ec;
  border: 2px solid var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}
[data-theme="dark"] .progress { background: #22303f; }
.progress > span {
  display: block; height: 100%;
  background: linear-gradient(180deg, var(--grass-3) 0%, var(--grass) 55%, var(--grass-2) 100%);
  transition: width 0.4s ease;
  position: relative;
}
.progress > span::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 8px, rgba(255,255,255,0.25) 8px 10px);
}

/* ==== HERO ==== */
.hero {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: center;
  background: linear-gradient(180deg, #e2f6ff, #fff3d0);
  border: 3px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow-hard);
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .hero { background: linear-gradient(180deg, #142235, #24333a); }
.hero h1 { color: var(--ink); font-family: var(--font-body); font-weight: 800; font-size: 38px; line-height: 1.1; letter-spacing: 0; }
.hero p { max-width: 46ch; font-size: 16px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.btn {
  font-family: var(--font-pixel);
  font-size: 13px;
  line-height: 1.3;
  min-height: 48px;
  padding: 12px 18px;
  border: 3px solid var(--line);
  border-radius: 12px;
  background: var(--grass);
  color: var(--on-color);
  cursor: pointer;
  box-shadow: 0 6px 0 var(--grass-2);
  transition: transform 0.07s ease, box-shadow 0.07s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--grass-2); }
.btn.secondary { background: var(--diamond); box-shadow: 0 6px 0 var(--diamond-2); }
.btn.secondary:active { box-shadow: 0 2px 0 var(--diamond-2); }
.btn.gold { background: var(--gold); box-shadow: 0 6px 0 var(--gold-2); }
.btn.gold:active { box-shadow: 0 2px 0 var(--gold-2); }
.btn.rose { background: var(--rose); box-shadow: 0 6px 0 var(--rose-2); }
.btn.violet { background: var(--violet); box-shadow: 0 6px 0 var(--violet-2); }

.hero-art {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 18px;
  background: linear-gradient(180deg, #c7e8f8 0%, #a4d5ee 55%, #7bbd7b 55%, #61a555 100%);
  border: 3px solid var(--line);
  overflow: hidden;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,0.15);
}
[data-theme="dark"] .hero-art { background: linear-gradient(180deg, #1b3852 0%, #274866 55%, #325c39 55%, #234023 100%); }

/* stud pattern for the toy stage floor */
.stud-floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 50%;
  background:
    radial-gradient(circle at 12% 30%, var(--stud) 0 5px, transparent 6px),
    radial-gradient(circle at 32% 30%, var(--stud) 0 5px, transparent 6px),
    radial-gradient(circle at 52% 30%, var(--stud) 0 5px, transparent 6px),
    radial-gradient(circle at 72% 30%, var(--stud) 0 5px, transparent 6px),
    radial-gradient(circle at 92% 30%, var(--stud) 0 5px, transparent 6px),
    radial-gradient(circle at 12% 60%, var(--stud) 0 5px, transparent 6px),
    radial-gradient(circle at 32% 60%, var(--stud) 0 5px, transparent 6px),
    radial-gradient(circle at 52% 60%, var(--stud) 0 5px, transparent 6px),
    radial-gradient(circle at 72% 60%, var(--stud) 0 5px, transparent 6px),
    radial-gradient(circle at 92% 60%, var(--stud) 0 5px, transparent 6px),
    linear-gradient(180deg, #7bbd7b, #4e9c50);
}
[data-theme="dark"] .stud-floor {
  background:
    radial-gradient(circle at 12% 30%, rgba(255,255,255,0.14) 0 5px, transparent 6px),
    radial-gradient(circle at 32% 30%, rgba(255,255,255,0.14) 0 5px, transparent 6px),
    radial-gradient(circle at 52% 30%, rgba(255,255,255,0.14) 0 5px, transparent 6px),
    radial-gradient(circle at 72% 30%, rgba(255,255,255,0.14) 0 5px, transparent 6px),
    radial-gradient(circle at 92% 30%, rgba(255,255,255,0.14) 0 5px, transparent 6px),
    radial-gradient(circle at 12% 60%, rgba(255,255,255,0.14) 0 5px, transparent 6px),
    radial-gradient(circle at 32% 60%, rgba(255,255,255,0.14) 0 5px, transparent 6px),
    radial-gradient(circle at 52% 60%, rgba(255,255,255,0.14) 0 5px, transparent 6px),
    radial-gradient(circle at 72% 60%, rgba(255,255,255,0.14) 0 5px, transparent 6px),
    radial-gradient(circle at 92% 60%, rgba(255,255,255,0.14) 0 5px, transparent 6px),
    linear-gradient(180deg, #325c39, #204020);
}

/* animated cloud */
.cloud {
  position: absolute; top: 8%; width: 46px; height: 26px; background: #fff;
  border-radius: 20px;
  box-shadow: 12px 4px 0 #fff, -12px 4px 0 #fff;
  animation: drift 40s linear infinite;
  opacity: 0.9;
}
.cloud.c2 { top: 22%; left: 60%; animation-duration: 55s; }
/* freeze the scenery while a lesson is open */
body:has(.modal-back.open) .cloud { animation-play-state: paused; }
@keyframes drift { from { transform: translateX(-60px); } to { transform: translateX(600px); } }

/* sun */
.sun {
  position: absolute; top: 8%; right: 10%; width: 42px; height: 42px;
  background: var(--gold);
  border: 3px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 0 0 6px rgba(245,192,43,0.35);
}

/* ==== SECTIONS ==== */
section { margin-top: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }

/* Character team */
.team {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.char-card {
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-hard);
  transition: transform 0.15s ease;
  position: relative;
  overflow: hidden;
}
.char-card:hover { transform: translateY(-4px) rotate(-1deg); }
.char-card::before {
  content: '';
  position: absolute; inset: 6px 6px 55% 6px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.1));
  border-radius: 12px;
  pointer-events: none;
}
[data-theme="dark"] .char-card::before { background: linear-gradient(180deg, rgba(255,255,255,0.15), rgba(255,255,255,0.02)); }
.char-avatar {
  width: 96px; height: 112px;
  background: var(--hero-tint);
  padding: 4px;
  margin: 4px auto 8px;
  border: 3px solid var(--line);
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 44px;
  position: relative;
}
.char-card .avatar-plate {
  position: absolute; left: 0; right: 0; bottom: -6px; height: 8px;
  border-radius: 50%; background: rgba(0,0,0,0.18); filter: blur(2px);
}
/* avatars bob only in response to the pointer */
.char-card:hover .char-avatar { animation: bob 0.8s ease-in-out 1; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.char-name { font-family: var(--font-pixel); font-size: 12px; margin-bottom: 2px; }
.char-sub { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.char-role { font-size: 13px; }
.char-card.mine { outline: 4px solid var(--gold); outline-offset: 2px; }
.char-mine { margin-top: 8px; font-weight: 800; }
.char-pick { margin-top: 8px; font-size: 13px; padding: 6px 10px; min-height: 40px; white-space: normal; }

/* Grade tabs */
.grade-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.grade-tabs .tab {
  padding: 8px 14px;
  border: 3px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  font-family: var(--font-pixel);
  font-size: 12px;
  min-height: 44px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--line);
}
.grade-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 640px; }
.grade-tabs .tab { font-family: var(--font-body); font-size: 16px; font-weight: 800; color: var(--ink); line-height: 1.2; padding: 8px 6px; }
@media (max-width: 480px){ .grade-tabs .tab { font-size: 14px; } .grade-tabs .tab small { font-size: 12px; } }
.grade-tabs .tab small { display: block; font-size: 13px; font-weight: 700; color: var(--muted); }
.grade-tabs .tab.active { background: var(--gold); color: var(--line); }
.grade-tabs .tab.active small { color: var(--ink-2); }
[data-theme="dark"] .grade-tabs .tab.active small { color: var(--line); }
.region-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 12px; padding: 10px 14px; background: var(--surface); border: 3px solid var(--line); border-left: 10px solid var(--region-color); border-radius: 14px; }
.region-head b { font-size: 18px; }
.region-head .region-rank { flex-basis: 100%; font-weight: 700; font-size: 15px; }
.grade-tabs .tab:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }

/* ==== КАРТА-ПУТЬ (docs/design-v2 STYLE.md §7, эскиз 34) ==== */
.path { position: relative; box-sizing: content-box; width: calc(100% - 6px); max-width: 554px; margin: 0 auto; border: 3px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-hard); }
.path-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
[data-theme="dark"] .path-art { filter: brightness(.82) saturate(.95); }
.path-mark { position: absolute; z-index: 2; transform: translate(-50%, -50%); padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.path-mark .mn-block { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  border: 4px solid var(--line); border-radius: 26px; background: #fffdf6; color: #1c2b1a; font-size: 20px; font-weight: 800; box-shadow: 3px 3px 0 var(--line); }
.path-mark.done .mn-block { background: var(--grass); }
.path-mark.current .mn-block { background: #fffdf6; box-shadow: 0 0 0 4px #fffdf6, 0 0 0 8px var(--gold); }
.path-mark.locked .mn-block { background: #dfe6e2; border-color: #9fb0b8; }
.path-mark.checkpoint .mn-block { width: 54px; height: 54px; border-radius: 8px 8px 27px 27px; border-color: var(--gold-2); }
.path-mark.checkpoint.locked .mn-block { background: #efe3c2; border-color: var(--gold-2); }
.path-mark:active .mn-block { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.path-mark:focus-visible { outline: none; }
.path-mark:focus-visible .mn-block { outline: 3px solid var(--diamond); outline-offset: 4px; }
.path-label { position: absolute; z-index: 1; transform: translateX(-50%); padding: 1px 10px; background: #fffdf6; color: #1c2b1a; border: 2px solid var(--line);
  border-radius: var(--radius-pill); font-size: 14px; font-weight: 800; white-space: nowrap; }
.path-label.locked { color: #4a5a48; border-color: #9fb0b8; }
.path-label .mn-new { position: static; display: inline-block; margin-left: 4px; transform: none; font-size: 10px; padding: 0 5px; }
.path-here-tag { position: absolute; z-index: 2; padding: 1px 8px; background: var(--gold); color: #1c2b1a; border: 2px solid var(--line); border-radius: var(--radius-pill); font-size: 13px; font-weight: 800; white-space: nowrap; }
.path-hero { position: absolute; z-index: 1; width: 15%; max-width: 70px; aspect-ratio: 58 / 70; }
.path-card { position: absolute; z-index: 4; width: 236px; box-sizing: border-box; padding: 10px 12px; background: #fffdf6; color: #1c2b1a; border: 3px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow-hard); display: flex; flex-direction: column; gap: 4px; }
.path-card-kicker { font-size: 12px; font-weight: 800; color: #3a4a38; letter-spacing: .04em; }
.path-card-name { font-size: 20px; font-weight: 800; line-height: 1.05; }
.path-card-en { font-size: 17px; font-weight: 700; color: #2a7cb4; }
.path-card-prog { font-size: 14px; font-weight: 700; color: #3a4a38; }
.path-card .btn { margin-top: 4px; min-height: 46px; width: 100%; justify-content: center; font-family: var(--font-body); font-size: 19px; font-weight: 800; }
.path-card-lock { margin-top: 4px; padding: 6px 8px; background: #eef1ef; border-radius: 6px; font-size: 14px; font-weight: 700; color: #3a4a38; }
.path-tail { position: absolute; z-index: 1; left: 16px; right: 16px; }
.path-next { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; text-align: left; font: inherit; color: #fffdf6; cursor: pointer;
  background: rgba(28, 43, 26, .55); border: 3px solid #9ff2f5; border-radius: 6px; min-height: 64px; }
.path-next > span:first-child { font-size: 26px; }
.path-next b { display: block; font-size: 18px; }
.path-next small { font-size: 14px; font-weight: 600; color: #dfe6e2; }
.path-passed { display: flex; align-items: center; gap: 8px; margin: 0 auto 10px; max-width: 560px; padding: 6px 10px; background: #e4f7e7; color: #2e5e35;
  border: 3px solid var(--line); border-radius: 6px; font-size: 14px; font-weight: 800; }
.path-passed > span:nth-child(2) { flex: 1; }
.path-passed-go { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; min-height: 32px; }
.path-plate { max-width: 560px; margin: 0 auto 12px; flex-direction: column; align-items: stretch; gap: 2px; }
.path-kicker { font-size: 12px; font-weight: 800; color: var(--diamond-2); letter-spacing: .06em; }
[data-theme="dark"] .path-kicker { color: var(--diamond-3); }
.path-plate-row { display: flex; align-items: baseline; gap: 8px; }
.path-plate-row b { flex: 1; font-size: 22px; line-height: 1.1; }
.path-count { font-size: 14px; font-weight: 800; }

/* ==== ЭКРАН ТЕМЫ ==== */
/* доска квестов: рамка цвета редкости, приз виден заранее */
.quest-legend { margin-top: 10px; font-size: 13px; }
/* «Новое» — тема или квест из пакета локации (14 дней) */
.new-badge { position: absolute; top: -10px; right: -6px; padding: 2px 8px; border: 2px solid var(--line); border-radius: var(--radius-pill); background: var(--lava); color: #1c2b1a; font-size: 12px; font-weight: 800; transform: rotate(4deg); }
.quest-result { margin: 6px 0 0; padding: 8px 12px; border: 3px solid var(--rarity, var(--line)); border-radius: 12px; background: var(--surface); }
/* боссы на месте проверок — легендарная рамка */
/* сундук достижений */
.ach-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ach { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 3px dashed var(--muted); border-radius: 14px; background: var(--surface); color: var(--ink); opacity: .85; }
.ach.got { border: 4px solid var(--rarity); opacity: 1; box-shadow: 0 4px 0 var(--line); }
.ach-em { font-size: 30px; line-height: 1.1; }
.ach small { color: var(--muted); font-size: 12px; }
#ach-count { font-family: var(--font-body); font-size: 15px; }
/* вступительное испытание — страж ворот (js/placement.js) */
.placement-card { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; padding: 12px 14px; border: 3px solid var(--line); border-left: 10px solid var(--rarity-epic); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-press); }
.placement-hero .hero-pic { width: 64px; height: 64px; flex: none; }
.placement-text { flex: 1; min-width: 0; }
.placement-text b { font-size: 18px; }
.placement-text p { margin: 4px 0 8px; font-size: 16px; }
.placement-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.placement-actions .btn, .placement-grade { font-family: var(--font-body); font-size: 17px; font-weight: 800; min-height: 48px; }
.placement-again { display: block; margin: 0 0 10px auto; padding: 8px 12px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); background: var(--surface); border: 2.5px solid var(--line); border-radius: var(--radius-pill); cursor: pointer; }
.placement-again:focus-visible, .placement-grade:focus-visible { outline: 3px solid var(--diamond); outline-offset: 3px; }
.placement-letter { display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin: 0 0 12px; border: 3px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); }
.placement-letter p { margin: 0; font-size: 17px; line-height: 1.4; }
.placement-grades { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.placement-grade { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px; background: var(--region-color); box-shadow: 0 6px 0 var(--line); color: #1c2b1a; }
.placement-grade small { font-size: 14px; font-weight: 700; }
.placement-parts { list-style: none; margin: 8px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.placement-parts li { padding: 8px 10px; border: 2.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.placement-parts li.ok { border-color: var(--grass); }
.placement-parts small { color: var(--muted); margin-left: 6px; }
.opt.opt-skip { display: block; width: 100%; margin-top: 10px; font-size: 16px; background: var(--surface); border-style: dashed; color: var(--ink-2); }
.placement-reward { font-size: 17px; }
@media (max-width: 420px){ .placement-card { flex-direction: column; } .placement-actions .btn { width: 100%; } }
/* посылка от Dr. Harlow (итерация 5, js/parcels.js) */
.parcel-banner { display: block; width: 100%; margin: 0 0 12px; padding: 12px 14px; min-height: 48px; text-align: left; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 3px solid var(--line); border-left: 10px solid var(--rarity-special); border-radius: 14px; box-shadow: var(--shadow-press); cursor: pointer; }
.parcel-banner:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.parcel-banner:focus-visible { outline: 3px solid var(--diamond); outline-offset: 3px; }
.parcel-letter { display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin: 0 0 12px; border: 3px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); }
.parcel-letter p { margin: 0; font-size: 17px; line-height: 1.4; }
.parcel-hero .hero-pic { width: 64px; height: 64px; flex: none; }
.parcel-prize { display: flex; gap: 10px; align-items: center; padding: 10px 12px; margin: 0 0 12px; border: 3px solid var(--rarity); border-radius: 14px; background: var(--surface); color: var(--ink); }
.parcel-prize-em { font-size: 34px; }
.parcel-prize small { display: block; color: var(--muted); font-size: 13px; }
.parcel-prize b { font-size: 17px; }
.parcel-quests { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.parcel-quest { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 3px solid var(--line); border-left: 8px solid var(--rarity); border-radius: 12px; background: var(--surface); color: var(--ink); }
.parcel-quest.done { opacity: .85; }
.parcel-q-em { font-size: 30px; }
.parcel-q-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.parcel-q-text small { color: var(--muted); font-size: 13px; }
.parcel-quest .quest-pill { align-self: flex-start; font-size: 10px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--rarity-pill); color: #1c2b1a; font-weight: 800; }
.parcel-quest .btn { flex: none; min-height: 44px; font-family: var(--font-body); font-size: 16px; font-weight: 800; padding: 8px 14px; }
.parcel-won { font-size: 17px; }
.specials { margin-top: 14px; }
.specials h3 { margin: 0 0 8px; }
@media (max-width: 420px){
  .parcel-quest { flex-wrap: wrap; }
  .parcel-quest .btn { width: 100%; }
}
.t-label { display: block; margin: 10px 0 4px; font-weight: 700; }
.t-err { color: #b3261e; font-weight: 700; margin: 6px 0 2px; }
[data-theme="dark"] .t-err { color: #ff9a8a; }
.t-parcel-off { font-size: 12px; padding: 8px 12px; min-height: 40px; }
/* карта пробелов для родителя (панель репетитора и админ-панель) */
.gap-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.gap-group { padding: 10px 12px; border: 2.5px solid var(--line); border-left-width: 8px; border-radius: 12px; background: var(--surface); color: var(--ink); }
.gap-group.gap-gap { border-left-color: #d64a1c; }
.gap-group.gap-watch { border-left-color: #d69f0a; }
.gap-group.gap-fixed { border-left-color: var(--grass); }
.gap-group h4 { margin: 0 0 6px; font-size: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gap-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gap-code { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.gap-code-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 700; }
.gap-code-id { font-family: var(--font-pixel); font-size: 10px; padding: 2px 5px; border: 2px solid var(--line); border-radius: 6px; }
.gap-badge { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--bg); color: var(--ink); white-space: nowrap; }
.gap-tip { font-size: 13px; color: var(--ink-2); }
/* своя клиника (эскиз 33-screen-clinic) */
.clinic-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.clinic-head h2 { margin-right: auto; }
.clinic-head p { flex-basis: 100%; }
.clinic-head h2:focus-visible { outline: 3px solid var(--diamond); outline-offset: 4px; border-radius: 6px; }
.clinic-mats { display: flex; flex-wrap: wrap; gap: 6px; }
.clinic-mat { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 2.5px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); font-weight: 800; font-size: 15px; }
.clinic-house { max-width: 560px; margin: 0 auto 14px; }
.clinic-roof { display: block; width: 100%; height: auto; }
.clinic-rooms { list-style: none; margin: 0; padding: 8px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; background: #f3dcb5; border: 3px solid var(--line); border-top: 0; border-bottom: 0; }
.clinic-base { height: 10px; background: var(--grass); border: 3px solid var(--line); border-radius: 0 0 6px 6px; }
.clinic-room { position: relative; min-height: 120px; padding: 6px; border: 2.5px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; text-align: center; color: #1c2b1a; font-size: 13px; line-height: 1.2; }
.clinic-room b { font-size: 14px; }
.clinic-room small { font-size: 12px; color: #3a4a38; }
.clinic-room.built { background: var(--room); }
.clinic-room-art { flex: 1; display: flex; align-items: flex-end; justify-content: center; width: 100%; }
.clinic-room-art .hero-pic { width: 64px; height: 64px; }
.clinic-room-em { font-size: 40px; }
.clinic-furn { position: absolute; top: 4px; left: 4px; right: 4px; display: flex; flex-wrap: wrap; gap: 2px; font-size: 16px; }
.clinic-room.secret { background: #1f2b3a; justify-content: center; }
.clinic-room.secret b { color: #e8f6ff; }
.clinic-room.secret small { color: #9ff2f5; }
.clinic-q { font-family: var(--font-pixel); font-size: 26px; color: #9ff2f5; margin-bottom: 4px; }
.clinic-room.locked { background: #e9ecea; border: 3px dashed #7c4bd6; justify-content: center; }
.clinic-lock { color: #4a5a48; }
.clinic-room.building { background: #e4f7e7; justify-content: space-between; }
.clinic-bar { display: block; width: 100%; height: 10px; border: 2px solid var(--line); border-radius: 6px; background: #fffdf6; overflow: hidden; }
.clinic-bar i { display: block; height: 100%; background: #c58a4a; transform-origin: left; }
.clinic-bar.wide { height: 14px; margin: 6px 0; }
.clinic-need { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 4px; font-size: 12px; font-weight: 700; }
.clinic-need svg { width: 14px; height: 14px; }
.btn.clinic-build { width: 100%; min-height: 44px; padding: 6px 4px; font-family: var(--font-body); font-size: 16px; font-weight: 800; }
.btn.clinic-build[aria-disabled="true"] { background: var(--locked); box-shadow: 0 6px 0 var(--muted); }
.clinic-card { padding: 12px 14px; margin: 0 0 12px; border: 3px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-press); }
.clinic-card h3 { margin: 0 0 8px; font-family: var(--font-body); font-size: 20px; font-weight: 800; }
.clinic-card h3 small { font-weight: 600; font-size: 15px; color: var(--muted); }
.clinic-card p { margin: 4px 0 0; }
.clinic-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.clinic-patients { display: flex; flex-wrap: wrap; gap: 8px; }
.clinic-patient { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--pt); border: 2.5px solid var(--line); }
.clinic-patient.sick { background: transparent; border-style: dashed; border-color: var(--muted); }
.clinic-patient.sick svg { display: none; }
.clinic-patient b { color: var(--muted); font-size: 18px; }
.clinic-helpers { display: flex; gap: 6px; }
.clinic-helper .hero-pic { width: 52px; height: 52px; }
.clinic-helper.off .hero-pic { filter: brightness(0) opacity(.35); }
[data-theme="dark"] .clinic-helper.off .hero-pic { filter: brightness(0) invert(1) opacity(.3); }
[data-theme="dark"] .btn.clinic-build[aria-disabled="true"] { background: #c9d3d8; box-shadow: 0 6px 0 #6a7a68; color: #1c2b1a; }
@media (max-width: 420px){
  .clinic-row { grid-template-columns: 1fr; }
  .clinic-room { min-height: 112px; padding: 4px; }
  .clinic-room-art .hero-pic { width: 52px; height: 52px; }
}
/* квест-реванш */
.revenge-banner { display: block; width: 100%; margin: 0 0 12px; padding: 12px 14px; text-align: left; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 3px solid var(--line); border-left: 10px solid var(--rarity-revenge); border-radius: 14px; box-shadow: var(--shadow-press); cursor: pointer; min-height: 44px; }
.revenge-banner:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.revenge-soon { font-size: 13px; align-self: center; }
.options.options-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* секретный регион: туман и счётчик, потом локации */
.grade-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 820px; }
@media (max-width: 480px){ .grade-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grade-tabs .tab-secret { background: #d7dde2; border-style: dashed; }
.grade-tabs .tab-secret.active { background: #4a5a68; color: #fff; border-style: solid; }
.grade-tabs .tab-secret.active small { color: #e6ecf0; }
[data-theme="dark"] .grade-tabs .tab-secret { background: #2b3a48; }
.secret-fog { position: relative; overflow: hidden; text-align: center; padding: 28px 18px; border: 3px dashed var(--line); border-radius: 18px; color: var(--ink);
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.75), transparent 45%), radial-gradient(circle at 70% 60%, rgba(255,255,255,.6), transparent 40%), #c9d3d9; }
[data-theme="dark"] .secret-fog { background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.12), transparent 45%), #22303d; }
.fog-scene { position: relative; height: 170px; margin: -6px auto 6px; max-width: 520px; overflow: hidden; border: 3px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, #3a4150 0%, #2a2433 100%); }
.fog-isl { position: absolute; bottom: -6px; width: 46%; max-width: 220px;
  filter: blur(calc(4px - 3px * var(--reveal))) grayscale(calc(0.65 - 0.5 * var(--reveal))) brightness(calc(0.85 + 0.15 * var(--reveal)));
  opacity: calc(0.75 + 0.25 * var(--reveal)); }
.fog-isl-0 { left: -4%; transform: scale(.82); transform-origin: bottom left; }
.fog-isl-1 { left: 27%; z-index: 1; }
.fog-isl-2 { right: -4%; transform: scale(.82); transform-origin: bottom right; }
.fog-cloud { position: absolute; z-index: 2; width: 70%; height: 90px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(236,242,246,.85), rgba(236,242,246,.45) 60%, rgba(236,242,246,0));
  opacity: calc(0.8 - 0.45 * var(--reveal)); animation: fog-drift 14s ease-in-out infinite alternate; }
.fc1 { left: -20%; top: 10px; }
.fc2 { left: 40%; top: 50px; animation-duration: 18s; animation-delay: -6s; }
.fc3 { left: 10%; top: 105px; width: 80%; height: 70px; animation-duration: 22s; animation-delay: -11s; }
@keyframes fog-drift { from { transform: translateX(-8%); } to { transform: translateX(10%); } }
.fog-paused .fog-cloud { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce){ .fog-cloud { animation: none; } }
.fog-q { position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%); display: block; font-size: 64px; line-height: 1; filter: drop-shadow(0 2px 0 var(--line)); }
.secret-fog h3 { margin: 8px 0 4px; }
.fog-bar { height: 16px; max-width: 320px; margin: 10px auto 4px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-pill); overflow: hidden; }
.fog-bar span { display: block; height: 100%; background: var(--diamond); }
.fog-count { font-size: 17px; }
.secret-head { align-items: center; flex-wrap: nowrap; gap: 12px; }
.secret-text { display: flex; flex-direction: column; gap: 4px; }
.secret-guide { flex-shrink: 0; width: 72px; height: 72px; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--hero-color) 22%, var(--surface)); }
@media (max-width: 480px){ .secret-locs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .secret-guide { width: 56px; height: 56px; } }

/* ==== КАРТОЧКИ ==== */
.flash {
  margin-top: 14px; padding: 20px 16px;
  text-align: center;
  background: #fff; border: 3px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-hard);
}
[data-theme="dark"] .flash { background: #263849; }
.flash-count { font-size: 14px; color: var(--muted); font-weight: 700; }
.flash-em { display: block; font-size: 88px; line-height: 1.1; margin: 6px 0; }
.flash-en { font-size: 40px; font-weight: 800; line-height: 1.1; }
.flash-ru { font-size: 20px; color: var(--ink-2); margin-top: 4px; }
.flash-controls { justify-content: center; }
.word-tile { color: var(--ink); min-height: 44px; }
.word-tile .en, .word-tile .ru { display: block; }

/* ==== НАПИШИ ==== */
.spell-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0 14px; min-height: 56px; }
.slot-l {
  width: 44px; height: 54px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 28px;
  border-bottom: 4px solid var(--line);
  background: rgba(0,0,0,0.04); border-radius: 8px 8px 0 0;
}
.slot-l.filled { background: #fff3c2; }
.slot-l.ok { background: #b8f0c1; }
.slot-l.bad { background: #f7b8b8; }
[data-theme="dark"] .slot-l { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .slot-l.filled { background: #3a3320; }
[data-theme="dark"] .slot-l.ok { background: #2f6c3c; }
[data-theme="dark"] .slot-l.bad { background: #6c2f34; }
.slot-gap { width: 18px; }
.slot-fixed { font-weight: 800; font-size: 28px; align-self: end; }
.spell-answer { text-align: center; font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.spell-answer::before { content: '✗ '; }
.spell-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.spell-tile {
  width: 52px; height: 56px;
  font-weight: 800; font-size: 26px;
  background: var(--gold); color: var(--on-color);
  border: 3px solid var(--line); border-radius: 10px;
  box-shadow: inset 0 -5px 0 var(--gold-2), 0 3px 0 var(--line);
}
.spell-tile:active { transform: translateY(2px); }
.spell-tile:disabled { opacity: 0.25; cursor: default; }
.spell-kbd { text-align: center; margin-top: 10px; }

/* ==== ПРОВЕРКА ==== */
.checkpoint-result { text-align: center; }
.checkpoint-result .cp-big { font-size: 72px; display: block; }
.checkpoint-result h3 { font-size: 18px; margin: 6px 0; }
.checkpoint-result p { font-size: 17px; }
.slot.trophy { background: linear-gradient(180deg, #ffe388, #f5c02b); box-shadow: inset 0 -6px 0 var(--gold-2); }
[data-theme="dark"] .slot.trophy { background: linear-gradient(180deg, #6b5a1c, #4a3d10); }
.t-cps { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.t-unlock { margin-top: 12px; display: inline-flex !important; }
.t-offline { border: 2px dashed var(--line); border-radius: 12px; padding: 12px; margin-top: 8px; }
.t-h4 { font-size: 15px; margin: 16px 0 6px; }
.t-file-btn { display: inline-flex; align-items: center; cursor: pointer; }
.t-bk-card { margin-top: 10px; padding: 12px; border: 3px solid var(--line); border-radius: 12px; background: var(--bg); }
[data-theme="dark"] .t-bk-card { background: #1a2635; }
.t-bk-card p { font-size: 15px; }
.t-view-banner {
  margin-top: 10px; padding: 12px;
  background: #fff3c2; color: var(--on-color);
  border: 3px solid var(--line); border-radius: 12px;
  font-size: 15px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
[data-theme="dark"] .t-view-banner { background: #3a3320; color: var(--ink); }
.t-audio-stat { font-size: 15px; }
.t-offline .t-muted { margin-top: 8px; }

/* ==== INVENTORY ==== */
.inv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 10px;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow-hard);
}
.slot {
  aspect-ratio: 1/1;
  border: 3px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #e6c58c, #b98c48);
  display: grid; place-items: center;
  font-size: 26px;
  position: relative;
  box-shadow: inset 0 -6px 0 #8f6b34;
}
[data-theme="dark"] .slot { background: linear-gradient(180deg, #4a3a24, #2c2416); box-shadow: inset 0 -6px 0 #1a1409; }
.slot.empty { background: repeating-linear-gradient(45deg, #efe0c8 0 6px, #d9c69f 6px 12px); box-shadow: none; opacity: 0.6; }
[data-theme="dark"] .slot.empty { background: repeating-linear-gradient(45deg, #22303f 0 6px, #1a2532 6px 12px); }
.slot .count { position: absolute; right: 4px; bottom: 2px; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 1px 1px 0 var(--line); }

/* ==== МОИ ОШИБКИ ==== */
.review-panel, .review-empty {
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-hard);
}
.review-empty { display: flex; gap: 14px; align-items: center; }
.review-empty-icon { font-size: 40px; }
.review-empty strong { font-size: 18px; }
.review-empty p { color: var(--ink-2); font-size: 15px; }

.review-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 2px dashed var(--grid);
}
.review-count { display: flex; align-items: baseline; gap: 10px; font-weight: 700; font-size: 17px; }
.review-count .big {
  font-family: var(--font-pixel); font-size: 28px; line-height: 1;
  color: var(--on-color);
  background: var(--gold); border: 3px solid var(--line); border-radius: 12px;
  padding: 8px 12px; box-shadow: inset 0 -5px 0 var(--gold-2);
}
.review-stats { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--ink-2); flex: 1; min-width: 180px; }
.review-summary .btn { margin-left: auto; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }

.mistake-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  max-height: 340px; overflow-y: auto;
  padding: 2px 4px 6px 2px;
}
.mistake-item {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 3px 0 var(--line);
}
[data-theme="dark"] .mistake-item { background: #263849; }
.mi-em { font-size: 30px; flex-shrink: 0; }
.mi-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mi-en { font-weight: 800; font-size: 19px; line-height: 1.2; }
.mi-en.mi-sentence { font-size: 16px; }
.mi-ru { font-size: 13px; color: var(--muted); }
.mi-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.pips { display: flex; gap: 3px; }
.pip { width: 12px; height: 12px; border: 2px solid var(--line); border-radius: 3px; background: transparent; }
.pip.on { background: var(--grass); }
.when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.when.now { color: var(--on-color); background: var(--rose); border: 2px solid var(--line); border-radius: var(--radius-pill); padding: 0 8px; font-weight: 700; }

/* сессия повторения */
.review-progress {
  height: 12px; margin-top: 12px;
  background: #d9e6ec; border: 2px solid var(--line); border-radius: var(--radius-pill); overflow: hidden;
}
[data-theme="dark"] .review-progress { background: #22303f; }
.review-progress > span { display: block; width: 0; height: 100%; background: var(--grass); transition: width 0.3s ease; }
.review-hint { text-align: center; color: var(--muted); font-size: 15px; margin: -4px 0 12px; }
/* вопросы в упражнениях (раньше — встроенные стили в коде) */
.q-text.q-sentence { font-size: 24px; font-weight: 800; text-align: center; margin: 10px 0; }
.q-text.q-question { font-size: 22px; font-weight: 800; }
.q-hint { color: var(--muted); font-size: 13px; text-align: center; }
/* разбор неверного ответа (js/why.js) */
.why { margin: 12px auto 0; max-width: 520px; padding: 10px 14px; border: 3px solid var(--line); border-radius: 12px; background: #fff3c2; color: var(--on-color); font-size: 17px; line-height: 1.4; text-align: left; animation: why-in .25s ease-out; }
[data-theme="dark"] .why { background: #3a3320; color: var(--ink); }
@keyframes why-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce){ .why { animation: none; } }
/* тип ошибки в «Моих ошибках» */
.mi-err { align-self: flex-start; display: inline-block; margin-top: 2px; padding: 1px 8px; border: 2px solid var(--line); border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; background: var(--surface); color: var(--ink); }
.q-text.q-lead { margin-top: 12px; }
.q-options-gap { margin-top: 10px; }
.q-listen-icon { text-align: center; font-size: 56px; }
.opt.opt-emoji { font-size: 36px; }
.match-item.match-emoji { font-size: 24px; }
.reading-text { font-size: 20px; line-height: 1.6; }
.rec-result { text-align: center; min-height: 22px; font-weight: 700; }
.review-passage {
  font-size: 17px; line-height: 1.55; color: var(--ink-2);
  background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}
[data-theme="dark"] .review-passage { background: #1a2635; }

/* ==== ДОМАШНЕЕ ЗАДАНИЕ ==== */
.hw-card {
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-hard);
  border-left: 10px solid var(--violet);
}
.hw-card.done { border-left-color: var(--grass); }
.hw-head { display: flex; gap: 12px; align-items: center; }
.hw-icon { font-size: 40px; }
.hw-title { font-family: var(--font-pixel); font-size: 15px; }
.hw-sub { font-size: 14px; color: var(--muted); }
.hw-note {
  margin-top: 12px; padding: 10px 12px;
  background: var(--bg); border-radius: 12px;
  font-size: 16px;
}
[data-theme="dark"] .hw-note { background: #1a2635; }
.hw-tasks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hw-task {
  min-height: 48px; padding: 8px 14px;
  border: 3px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink);
  font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 0 var(--line);
}
[data-theme="dark"] .hw-task { background: #263849; }
.hw-task.done { background: #b8f0c1; color: var(--on-color); }
[data-theme="dark"] .hw-task.done { background: #2f6c3c; color: var(--ink); }
.hw-task:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.hw-finish { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 17px; }

/* ==== РЕЖИМ РЕПЕТИТОРА ==== */
.tutor-btn { margin-top: 12px; font-size: 14px; }
.modal.wide { max-width: 900px; }

.gate { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.gate-q { font-family: var(--font-pixel); font-size: 18px; }
.gate input, .t-hw-form input, .t-hw-form select, .t-report, .t-link {
  min-height: 44px; padding: 8px 10px;
  border: 2px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink);
  font-size: 16px;
}
[data-theme="dark"] :is(.gate input, .t-hw-form input, .t-hw-form select, .t-report, .t-link) { background: #263849; }
.gate input { width: 90px; font-size: 20px; text-align: center; }
.gate-err { color: var(--lava-2); font-weight: 700; min-height: 1.5em; margin-top: 8px; }
.gate-forgot { margin-top: 4px; min-height: 44px; color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: underline; }
.t-warn { background: #fff3c2; color: var(--on-color); border: 2px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 15px; margin-bottom: 8px; }
[data-theme="dark"] .t-warn { background: #3a3320; color: var(--ink); }
.t-pin-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 8px; }
.t-pin-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; }
.t-pin-form input { width: 110px; min-height: 44px; padding: 6px 10px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 20px; letter-spacing: 4px; text-align: center; }
[data-theme="dark"] .t-pin-form input { background: #263849; }
[data-theme="dark"] .gate-err { color: #ffb39a; }

.t-h { margin: 22px 0 10px; font-size: 14px; }
.t-muted { color: var(--muted); font-size: 14px; }
.t-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.t-tile {
  display: flex; flex-direction: column; gap: 2px;
  border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px;
  background: var(--bg);
}
[data-theme="dark"] .t-tile { background: #1a2635; }
.t-num { font-weight: 800; font-size: 28px; line-height: 1.1; }
.t-num small { font-size: 16px; color: var(--muted); }
.t-lbl { font-size: 13px; color: var(--ink-2); }

/* столбики: одна серия, один цвет, скруглённый верх, зазор 2px */
.t-chart { margin-top: 14px; position: relative; }
.bars-empty { position: absolute; left: 0; right: 0; top: 60px; text-align: center; }
.t-chart figcaption { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.bars {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  height: 120px; align-items: end;
  border-bottom: 2px solid var(--muted);
}
.bar-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: default; }
.bar-col:hover .bar { filter: brightness(1.1); }
.bar { display: block; width: 70%; max-width: 44px; background: var(--diamond); border-radius: 4px 4px 0 0; }
.bar-val { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.bar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.bars { position: relative; }
.goal-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--grass-2); pointer-events: none; }
.goal-line i { position: absolute; right: 0; top: -18px; font-style: normal; font-size: 11px; font-weight: 700; color: var(--ink-2); background: var(--surface); padding: 0 4px; }
[data-theme="dark"] .goal-line { border-color: var(--grass-3); }
.bar-days span { display: flex; flex-direction: column; align-items: center; }
.day-met { color: var(--grass-2); font-size: 13px; }
[data-theme="dark"] .day-met { color: var(--grass-3); }
.t-goal { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 700; font-size: 15px; }
.t-goal select { min-height: 44px; padding: 6px 10px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 15px; }
[data-theme="dark"] .t-goal select { background: #263849; }

.t-hw-current {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 2px dashed var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
}
.t-hw-form { display: flex; flex-direction: column; gap: 10px; }
.t-hw-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; }
.t-hw-form fieldset { border: none; }
.t-hw-form legend { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.t-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.t-check {
  flex-direction: row !important; align-items: center;
  min-height: 44px; padding: 6px 12px;
  border: 2px solid var(--line); border-radius: var(--radius-pill);
  font-weight: 700; cursor: pointer;
}
.t-check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--grass-2); }
.t-row { display: flex; flex-wrap: wrap; gap: 10px; }
.t-grow { flex: 1; min-width: 220px; }
.t-link, .t-report { width: 100%; font-size: 14px; }
.t-report { font-family: var(--font-body); line-height: 1.5; margin-top: 10px; resize: vertical; }
.t-hint { min-height: 1em; }

.t-table-wrap { overflow-x: auto; }
.t-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.t-table th { text-align: left; font-size: 13px; color: var(--muted); padding: 6px 8px; border-bottom: 2px solid var(--line); }
.t-table td { padding: 6px 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.t-table td:first-child { white-space: normal; }
.t-table tr.idle td { color: var(--muted); }
.t-table tr.hot td { background: rgba(255,107,58,0.12); }
.t-table .pips { display: inline-flex; vertical-align: middle; margin-right: 4px; }
.t-table .pip { width: 10px; height: 10px; }

.t-hard { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.t-hard li { display: flex; justify-content: space-between; gap: 10px; align-items: center; border: 2px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 15px; }

/* ==== ЗАМОРОЗКИ ==== */
.freeze-box { margin-top: 12px; }
.freeze-count { font-size: 44px; letter-spacing: 6px; text-align: center; }
.freeze-slot { filter: grayscale(1); opacity: 0.3; }
.freeze-box p { font-size: 16px; margin: 8px 0; }
.freeze-rules { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }

/* ==== УЧЕНИКИ ==== */
.profile-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 4px 12px;
  border: 2px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink);
  font-weight: 800; font-size: 15px;
  box-shadow: 0 3px 0 var(--line);
}
.profile-chip #pf-avatar { font-size: 22px; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: var(--hero-tint); border: 2px solid var(--line); --hero-tint: color-mix(in srgb, var(--hero-color, var(--grass)) 22%, var(--surface)); }
.profile-chip #pf-name { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-note { background: #fff3c2; color: var(--on-color); border: 2px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-top: 10px; font-weight: 700; }
[data-theme="dark"] .pf-note { background: #3a3320; color: var(--ink); }
/* «Кто играет?» (эскиз 30) */
.who-title { font-family: var(--font-pixel); font-size: 18px; text-align: center; text-transform: uppercase; margin: 4px 0 14px; }
.who-hello { display: flex; align-items: flex-end; gap: 8px; }
.who-guide { width: 76px; height: 80px; flex-shrink: 0; }
.who-bubble { flex: 1; margin: 0; padding: 10px 14px; background: var(--surface); border: 3px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-hard); font-size: 18px; font-weight: 700; line-height: 1.25; }
.pf-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.pf-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 14px 10px 10px; font: inherit;
  background: var(--surface); color: var(--ink);
  border: 3px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-hard); cursor: pointer;
}
.pf-card.current { outline: 4px solid var(--diamond); outline-offset: 2px; }
.pf-card:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--line); }
.pf-hero { width: 76px; height: 84px; flex-shrink: 0; font-size: 44px; border: 3px solid var(--hero-color, var(--line)); border-radius: 6px; overflow: hidden;
  background: color-mix(in srgb, var(--hero-color, var(--grass)) 22%, var(--surface)); display: flex; align-items: center; justify-content: center; }
.pf-hero .hero-pic { width: 66px; height: 78px; }
.pf-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-name { font-weight: 800; font-size: 26px; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-sub { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.pf-rank { align-self: flex-start; margin-top: 4px; padding: 2px 10px; background: var(--region-color); color: var(--on-color); border: 2px solid var(--line); border-radius: var(--radius-pill); font-size: 13px; font-weight: 800; }
.pf-card .lvl-badge { font-size: 13px; padding: 8px 6px; }
.pf-new { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 64px; margin-top: 14px; padding: 10px 14px;
  background: transparent; color: var(--ink); border: 3px dashed var(--line); border-radius: 6px; font: inherit; font-size: 18px; font-weight: 800; cursor: pointer; }
.pf-adults { display: flex; align-items: center; gap: 8px; margin: 18px auto 0; min-height: 44px; padding: 6px 16px; background: var(--surface); color: var(--ink-2);
  border: 3px solid var(--line); border-radius: var(--radius-pill); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.pf-new:focus-visible, .pf-adults:focus-visible, .pf-card:focus-visible { outline: 3px solid var(--diamond); outline-offset: 3px; }
.pf-hint { margin-top: 12px; }
.pf-list { display: flex; flex-direction: column; gap: 6px; }
.pf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; }
.pf-row.current { background: var(--bg); }
[data-theme="dark"] .pf-row.current { background: #1a2635; }
.pf-av-btn { font-size: 28px; min-width: 44px; min-height: 44px; border-radius: 10px; }
.pf-row-name { font-weight: 800; font-size: 16px; flex: 1; min-width: 120px; }
.pf-row-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-add { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pf-add label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; }
.pf-add input[type=text], .pf-add #pf-add-name { min-height: 44px; padding: 6px 10px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 16px; max-width: 320px; }
[data-theme="dark"] .pf-add #pf-add-name { background: #263849; }
.pf-avatars { border: none; display: flex; flex-wrap: wrap; gap: 4px; }
.pf-avatars legend { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.pf-av-pick { cursor: pointer; }
.pf-av-pick input { position: absolute; opacity: 0; pointer-events: none; }
.pf-av-pick span { display: grid; place-items: center; width: 44px; height: 44px; font-size: 26px; border: 2px solid transparent; border-radius: 10px; }
.pf-av-pick input:checked + span { border-color: var(--line); background: var(--gold); }
.pf-av-pick input:focus-visible + span { outline: 3px solid var(--diamond); outline-offset: 2px; }
.ws-name { font-size: 16px; }

/* ==== HOW TO (гайд) ==== */
.howto-btn { position: relative; display: inline-grid; place-items: center; text-decoration: none; }
.howto-new {
  position: absolute; top: -8px; right: -10px;
  font-family: var(--font-body); font-size: 10px; font-weight: 800;
  background: var(--rose); color: var(--on-color);
  border: 2px solid var(--line); border-radius: var(--radius-pill); padding: 0 5px; line-height: 1.5;
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.footer-links .tutor-btn { margin-top: 0; text-decoration: none; display: inline-flex; align-items: center; }
.t-guide-link { display: inline-block; margin-top: 6px; font-weight: 700; font-size: 14px; color: var(--diamond-2); }
[data-theme="dark"] .t-guide-link { color: var(--diamond-3); }

.ht-page a { color: inherit; }
.ht-logo { text-decoration: none; }
.ht-hud .btn { text-decoration: none; display: inline-flex; align-items: center; }
.ht-hero { grid-template-columns: 1fr auto; }
.ht-hero h1 { font-family: var(--font-body); font-weight: 800; font-size: 36px; line-height: 1.1; letter-spacing: 0; color: var(--ink); }
.ht-hero p { font-size: 17px; margin-top: 8px; }
.ht-hero-art { font-size: 96px; line-height: 1; text-align: center; }
.ht-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ht-nav .tab {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px;
  border: 3px solid var(--line); border-radius: 12px; background: var(--surface);
  font-weight: 800; font-size: 15px; text-decoration: none; box-shadow: 0 4px 0 var(--line);
}
.ht-nav .tab:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.ht-part { margin-top: 36px; scroll-margin-top: 90px; }
.ht-part .section-head { margin-bottom: 12px; }
.ht-card {
  background: var(--surface); border: 3px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-hard); padding: 18px 20px; margin-top: 16px; scroll-margin-top: 90px;
}
.ht-card h3 { font-size: 15px; margin-bottom: 10px; }
.ht-h4 { font-family: var(--font-body); font-size: 17px; font-weight: 800; margin: 14px 0 8px; letter-spacing: 0; }
.ht-card p, .ht-card li { font-size: 16px; line-height: 1.55; }
.ht-card p + p { margin-top: 8px; }
.ht-steps, .ht-list { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.ht-list { list-style: disc; }
.ht-chip { display: inline-block; padding: 0 8px; border: 2px solid var(--line); border-radius: 8px; background: var(--bg); white-space: nowrap; }
[data-theme="dark"] .ht-chip { background: #1a2635; }
.ht-tip { margin-top: 12px; padding: 10px 14px; background: #fff3c2; color: var(--on-color); border: 2px solid var(--line); border-radius: 12px; }
.ht-warn { margin-bottom: 10px; padding: 10px 14px; background: #ffd9cc; color: var(--on-color); border: 2px solid var(--line); border-radius: 12px; }
[data-theme="dark"] .ht-tip { background: #3a3320; color: var(--ink); }
[data-theme="dark"] .ht-warn { background: #4a2a22; color: var(--ink); }
.ht-legend { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 10px 0; }
.ht-legend li { display: flex; align-items: center; gap: 14px; }
.ht-node {
  position: relative; flex-shrink: 0; width: 56px; height: 56px; display: grid; place-items: center; font-size: 28px;
  border: 3px solid var(--line); border-radius: 12px; box-shadow: 0 4px 0 var(--line); background: var(--surface);
}
.ht-node i { position: absolute; right: -9px; top: -9px; width: 24px; height: 24px; display: grid; place-items: center; font-style: normal; font-size: 12px; border: 2px solid var(--line); border-radius: 50%; background: var(--surface); }
.ht-node.current { background: var(--diamond-3); box-shadow: 0 4px 0 var(--diamond-2), 0 0 0 5px rgba(58,159,224,0.35); }
.ht-node.done { background: var(--grass-3); }
.ht-node.done i { background: var(--grass); color: var(--on-color); font-weight: 800; }
.ht-node.locked { background: #c9d3d9; filter: grayscale(1); }
.ht-node.cp { background: var(--gold); border-radius: 50%; }
[data-theme="dark"] .ht-node.locked { background: #2b3a48; }
.ht-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ht-ex { border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--bg); }
[data-theme="dark"] .ht-ex { background: #1a2635; }
.ht-ex span { font-size: 28px; margin-right: 6px; vertical-align: middle; }
.ht-ex b { font-size: 17px; vertical-align: middle; }
.ht-ex p { font-size: 15px; margin-top: 4px; }
.ht-table { width: 100%; border-collapse: collapse; }
.ht-table td { padding: 8px 6px; border-bottom: 1px solid var(--grid); vertical-align: top; font-size: 16px; }
.ht-table td:nth-child(2) { white-space: nowrap; }
.ht-ico { width: 56px; font-size: 24px; text-align: center; }
.ht-lvl { display: inline-grid; place-items: center; width: 36px; height: 36px; font-family: var(--font-pixel); font-size: 11px; background: var(--gold); border: 2px solid var(--line); border-radius: 8px; color: var(--on-color); }
.ht-ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.ht-rank { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 12px; border-left: 8px solid var(--rank-color); }
.ht-rank-em { font-size: 22px; }
.ht-rank small { color: var(--muted); font-size: 13px; }
.ht-pips { display: inline-flex; gap: 3px; vertical-align: middle; }
.ht-pips i { width: 12px; height: 12px; border: 2px solid var(--line); border-radius: 3px; }
.ht-pips i.on { background: var(--grass); }
.ht-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 10px 0; }
.ht-hero-card { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--line); border-radius: 14px; padding: 10px; }
.ht-hero-av { flex-shrink: 0; width: 64px; height: 64px; display: grid; place-items: center; font-size: 28px; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; padding: 2px; }
.ht-hero-av img { width: 100%; height: 100%; object-fit: contain; }
.ht-hero-card p { font-size: 15px; margin-top: 4px; }
.ht-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.ht-grade ol { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.ht-cp { font-weight: 800; color: var(--ink-2); padding: 2px 0 4px 8px; border-left: 4px solid var(--gold); }
.ht-faq details { border-bottom: 2px dashed var(--grid); padding: 10px 0; }
.ht-faq details:last-child { border-bottom: none; }
.ht-faq summary { cursor: pointer; font-weight: 800; font-size: 17px; min-height: 32px; display: flex; align-items: center; }
.ht-faq summary::marker { color: var(--grass-2); }
.ht-faq details p { margin-top: 6px; }
.ht-page footer { margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ht-page footer .btn { text-decoration: none; }
@media (max-width: 720px) {
  .ht-hero { grid-template-columns: 1fr; }
  .ht-hero-art { display: none; }
  .ht-hero h1 { font-size: 28px; }
  .ht-card { padding: 14px; }
  .ht-table td:nth-child(2) { white-space: normal; }
}
@media print {
  .ht-page .ht-hud, .ht-nav, .ht-page footer { display: none; }
  .ht-card { box-shadow: none; break-inside: avoid; }
}

/* ==== ЛИСТ ДЛЯ ПЕЧАТИ ==== */
.t-ws fieldset { border: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.t-ws legend { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.t-ws select { min-height: 44px; padding: 6px 10px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 15px; }
[data-theme="dark"] .t-ws select { background: #263849; }
#print-sheet { display: none; }

@media print {
  @page { size: A4; margin: 14mm 14mm 12mm; }
  body.printing { background: #fff !important; color: #000; }
  body.printing::before, body.printing > :not(#print-sheet) { display: none !important; }
  body.printing #print-sheet { display: block; }
}
#print-sheet { font-family: var(--font-body); color: #000; font-size: 15px; line-height: 1.4; }
.ws-page { break-after: page; }
.ws-page:last-child { break-after: auto; }
.ws-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; border-bottom: 3px solid #000; padding-bottom: 6px; margin-bottom: 10px; }
.ws-brand { font-family: var(--font-pixel); font-size: 10px; letter-spacing: 0.5px; }
#print-sheet .ws-head h1 { font-family: var(--font-body); font-size: 24px; font-weight: 800; margin: 2px 0 0; letter-spacing: 0; }
.ws-meta { font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.ws-fill { display: inline-block; width: 180px; border-bottom: 1.5px solid #000; }
.ws-fill.short { width: 110px; }
#print-sheet h2 { font-family: var(--font-body); font-size: 17px; font-weight: 800; margin: 12px 0 2px; letter-spacing: 0; }
.ws-task { font-size: 13px; color: #333; margin-bottom: 6px; }
.ws-write { width: 100%; border-collapse: collapse; }
.ws-write td { padding: 3px 6px; border-bottom: 1px solid #bbb; vertical-align: bottom; }
.ws-num { width: 22px; font-weight: 800; color: #333; }
.ws-em { width: 44px; font-size: 24px; text-align: center; line-height: 1; }
.ws-ru { width: 34%; font-size: 15px; }
.ws-write .ws-line { border-bottom: 1.5px solid #000; height: 30px; }
.ws-hint { font-size: 17px; letter-spacing: 1px; color: #777; }
.ws-match { display: grid; grid-template-columns: 1fr 1fr; gap: 0 60px; }
.ws-match ol { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ws-match li { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.ws-sec { break-inside: avoid; }
.ws-match ol:first-child .ws-dot { margin-left: auto; }
.ws-match ol:last-child .ws-num { margin-left: auto; }
.ws-dot { font-size: 12px; }
.ws-word { font-size: 17px; font-weight: 700; }
.ws-gram { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.ws-blank { display: inline-block; width: 90px; border-bottom: 1.5px solid #000; margin: 0 4px; }
.ws-opts { color: #444; font-size: 14px; }
.ws-foot { margin-top: 16px; font-size: 11px; color: #666; text-align: right; }
.ws-key-list { padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.ws-key-line { font-size: 16px; }

/* ==== ГЕРОИ (assets/heroes/*.svg, запасной вариант — эмодзи) ==== */
.mini-avatar, .char-avatar, .guide-bubble .avatar, .pf-hero, .hero-pick-av { --hero-tint: color-mix(in srgb, var(--hero-color, var(--grass)) 22%, var(--surface)); }
.hero-pic { position: relative; display: grid; place-items: center; width: 100%; height: 100%; }
.hero-pic .hero-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hero-pic .hero-fallback { display: none; line-height: 1; }
.hero-pic.broken .hero-img { display: none; }
.hero-pic.broken .hero-fallback { display: block; }

/* ==== GUIDE BUBBLE ==== */
.guide-bubble {
  position: fixed; right: 16px; bottom: 16px;
  z-index: 9;
  display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 10px;
  max-width: 380px;
  pointer-events: none;
}
.guide-bubble .avatar {
  width: 76px; height: 76px;
  background: var(--hero-tint);
  overflow: hidden; padding: 2px;
  border: 3px solid var(--line);
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 36px;
  box-shadow: 0 6px 0 var(--grass-2);
  pointer-events: auto;
  cursor: pointer;
}
.guide-bubble .bubble {
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--ink);
  box-shadow: 0 4px 0 var(--line);
  pointer-events: auto;
  max-width: 300px;
  position: relative;
}
.guide-bubble .bubble::before {
  content: ''; position: absolute; right: -12px; bottom: 14px;
  width: 0; height: 0;
  border: 6px solid transparent;
  border-left-color: var(--line);
}
.guide-bubble .bubble strong { font-family: var(--font-pixel); font-size: 11px; display: block; margin-bottom: 4px; color: var(--guide-accent, var(--grass-2)); }
[data-theme="dark"] .guide-bubble .bubble strong { color: var(--ink); }
.guide-bubble .bubble button {
  border: none; background: none; color: var(--muted);
  font-family: var(--font-body); font-size: 14px; font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  min-height: 44px; padding: 0 12px 0 0; margin-bottom: -10px;
}
.guide-actions { display: flex; gap: 8px; margin-bottom: -10px; }
.guide-bubble .guide-actions button { margin-bottom: 0; }

/* ==== MODAL ==== */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(15, 25, 40, 0.55);
  display: none;
  align-items: center; justify-content: center;
  z-index: 20;
  padding: 20px;
}
.modal-back.open { display: flex; }
.modal {
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-hard);
  max-width: 640px; width: 100%;
  max-height: 90vh; overflow: auto;
  padding: 22px;
  position: relative;
}
.modal .close {
  position: absolute; top: 10px; right: 10px;
  background: var(--rose); color: var(--on-color);
  border: 3px solid var(--line);
  width: 44px; height: 44px;
  border-radius: 12px;
  font-family: var(--font-pixel);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--rose-2);
}
.modal .close:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--rose-2); }
.modal h2 { padding-right: 56px; }
.modal .lead { margin-top: 6px; color: var(--muted); font-size: 14px; }
.modal .lead-guide {
  margin-top: 12px;
  display: flex; gap: 10px; align-items: flex-start;
  background: #f6f5ea;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
[data-theme="dark"] .modal .lead-guide { background: #223140; }
.modal .lead-guide .mini-avatar { width: 56px; height: 56px; border-radius: 12px; border: 2px solid var(--line); display:grid;place-items:center; font-size: 26px; flex-shrink: 0; overflow: hidden; background: var(--hero-tint); }
.modal .lead-guide .txt { font-size: 14px; }
/* Реплика героя: нажатие — озвучка его голосом (sayRow в js/heroes.js). Внутри урока выглядит как .lead-guide,
   на карте и в клинике — облачко по STYLE.md v2 */
.hero-say {
  display: flex; gap: 10px; align-items: center; width: 100%;
  margin-top: 12px; padding: 10px;
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  background: var(--surface); border: 3px solid var(--line); border-radius: 12px; box-shadow: 3px 3px 0 var(--line);
}
.hero-say .mini-avatar { width: 56px; height: 56px; border-radius: 12px; border: 2px solid var(--line); display:grid; place-items:center; font-size: 26px; flex-shrink: 0; overflow: hidden; background: var(--hero-tint); }
.hero-say .txt { flex: 1; font-size: 15px; font-weight: 700; }
.hero-say .txt strong { color: var(--ink); }
.hero-say-ico { flex-shrink: 0; font-size: 18px; }
.modal .hero-say { box-shadow: none; border-width: 2px; }
.modal .hero-say .txt { font-size: 14px; font-weight: 400; }
.hero-say:active { transform: translateY(2px); }
.hero-say:focus-visible { outline: 3px solid var(--diamond); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce){ .hero-say:active { transform: none; } }

/* Word card grid */
.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.word-tile {
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 12px;
  padding: 10px 4px 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--line);
  transition: transform 0.08s ease;
}
[data-theme="dark"] .word-tile { background: #263849; color: var(--ink); }
.word-tile:hover { transform: translateY(-2px); }
.word-tile .em { font-size: 28px; display:block; }
.word-tile .en { font-family: var(--font-body); font-weight: 800; font-size: 20px; line-height: 1.2; margin-top: 4px; }
.word-tile .ru { font-size: 14px; color: var(--muted); }

/* Question */
.question {
  margin-top: 14px;
  border: 3px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}
[data-theme="dark"] .question { background: #263849; }
.q-emoji { font-size: 56px; text-align: center; display:block; margin-bottom: 6px; filter: drop-shadow(3px 3px 0 rgba(0,0,0,0.2)); animation: pop 0.4s ease-out; }
@keyframes pop { from { transform: scale(0.6); } to { transform: scale(1); } }
.q-text { font-size: 20px; line-height: 1.35; margin-bottom: 12px; }
.q-text.pixel { font-family: var(--font-pixel); font-size: 13px; }
.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.opt {
  padding: 12px;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.25;
  min-height: 56px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--line);
  transition: transform 0.06s ease;
  text-align: center;
}
[data-theme="dark"] .opt { background: #263849; color: var(--ink); }
.opt:hover { transform: translateY(-1px); }
.opt.correct { background: #b8f0c1; }
.opt.wrong { background: #f7b8b8; }
/* never color alone: mark right/wrong with a symbol too */
.opt.correct::before, .match-item.done::before { content: '✓ '; }
.opt.wrong::before, .match-item.wrong::before { content: '✗ '; }
[data-theme="dark"] .opt.correct { background: #2f6c3c; }
[data-theme="dark"] .opt.wrong { background: #6c2f34; }

.controls { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.controls .btn { font-size: 12px; padding: 10px 14px; }

/* Match */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 14px;
}
.match-col { display: flex; flex-direction: column; gap: 8px; }
.match-item {
  padding: 10px;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.2;
  min-height: 52px;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--line);
  text-align: center;
}
[data-theme="dark"] .match-item { background: #263849; color: var(--ink); }
.match-item.sel { background: var(--gold); }
.match-item.done { background: #b8f0c1; opacity: 0.6; cursor: default; }
.match-item { width: 100%; color: var(--ink); }
.match-item.sel { color: var(--on-color); }
.modal:focus { outline: none; }
[data-theme="dark"] .match-item.done { background: #2f6c3c; }
.match-item.wrong { background: #f7b8b8; }
[data-theme="dark"] .match-item.wrong { background: #6c2f34; }

/* Speak */
.speak-phrase {
  font-size: 26px; font-weight: 800; text-align: center;
  margin: 12px 0 6px; padding: 12px;
  background: #fffbe6; border: 2px dashed var(--line); border-radius: 12px;
}
.speak-translation {
  text-align: center; margin: 0 0 10px; padding: 8px 12px;
  background: #eef7ff; border: 2px dashed #7bb7e0; border-radius: 10px;
  color: #244; font-size: 16px;
}
[data-theme="dark"] .speak-phrase { background: #2e3a2a; color: var(--ink); border-color: var(--muted); }
[data-theme="dark"] .speak-translation { background: #1f3346; color: var(--ink-2); border-color: #3f6f96; }
.speak-phrase .sw { display: inline-block; padding: 0 3px; border-radius: 6px; }
.speak-phrase .sw.ok { background: #b8f0c1; color: var(--on-color); }
.speak-phrase .sw.miss { background: #f7b8b8; color: var(--on-color); text-decoration: underline dotted; cursor: pointer; }
.speak-phrase .sw.miss::after { content: ' 🔊'; font-size: 0.6em; vertical-align: super; }
[data-theme="dark"] .speak-phrase .sw.ok { background: #2f6c3c; color: var(--ink); }
[data-theme="dark"] .speak-phrase .sw.miss { background: #6c2f34; color: var(--ink); }
.rec-live { text-align: center; min-height: 22px; color: var(--muted); font-size: 15px; font-style: italic; }
.mic-btn {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--lava);
  color: var(--on-color);
  border: 3px solid var(--line);
  font-size: 40px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--lava-2);
  display: grid; place-items: center;
  margin: 12px auto;
}
.mic-btn.rec { animation: pulseRec 1s infinite; }
@keyframes pulseRec {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Toast + confetti */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: var(--shadow-hard);
  font-weight: 700;
  z-index: 100;
  animation: toastIn 0.3s ease-out;
}
@keyframes toastIn { from { transform: translate(-50%, -30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.confetti-wrap { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti-piece { position: absolute; width: 12px; height: 12px; top: -20px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* footer */
footer { text-align: center; color: var(--muted); margin-top: 40px; font-size: 12px; }

/* mobile */
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { max-height: 260px; }
  .app { padding: 12px 16px 80px; }
  /* compact HUD: logo + buttons on row 1, stats on row 2; not sticky so it doesn't eat the screen */
  .hud { position: static; gap: 8px; padding: 8px 10px; }
  /* телефон: строка 1 — игрок, уровень, монеты (как в эскизе); строка 2 — серия, заморозки, кнопки */
  .hud .player { flex: 1; order: 0; }
  .hud .lvl-badge, .hud .coin-pill { order: 0; }
  .hud > .icon-btn, .hud > .account-btn, .hud .stat:not(.coin-pill) { order: 2; }
  .hud { row-gap: 8px; column-gap: 6px; }
  .hud > .icon-btn { min-width: 40px; padding: 4px 6px; }
  .hud .spacer { order: 1; flex: 0 0 100%; height: 0; }
  .hud .stat:not(.coin-pill) { padding: 4px 8px; font-size: 13px; gap: 4px; box-shadow: 0 2px 0 var(--line); }
  h1 { font-size: 20px; }
  .hero h1 { font-size: 30px; }
  .options { grid-template-columns: 1fr; }
  .review-summary .btn { margin-left: 0; width: 100%; }
  .t-tiles { grid-template-columns: repeat(2, 1fr); }
  .level-bar { grid-template-columns: 1fr auto; }
  .level-bar .goal { grid-column: 1 / 2; grid-row: 2; }
  .flash-en { font-size: 32px; }
  .slot-l { width: 36px; height: 48px; font-size: 24px; }
  .spell-tile { width: 46px; height: 52px; }
  .t-hw-current { flex-direction: column; align-items: flex-start; }
  .mistake-list { grid-template-columns: 1fr; max-height: 300px; }
  .guide-bubble { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .guide-bubble .bubble { flex: 1; }
}

/* accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Сервер учителя: раздел в панели и кабинет учителя ---------- */
.cl-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 10px; }
.cl-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 14px; }
.cl-form input { font: inherit; font-size: 18px; letter-spacing: 1px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); min-width: 12ch; }
.cl-form .btn { font-size: 12px; padding: 10px 14px; }
.cl-choice { flex-direction: column; align-items: stretch; }
.cl-more { margin-top: 12px; }
.cl-more summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
.cl-more p { margin-top: 6px; }

/* ---------- Ключ семьи (js/family.js) ---------- */
.fam-note { padding: 8px 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--bg); font-weight: 700; }
.fam-what { margin: 6px 0 0 1.2em; display: grid; gap: 4px; }
.fam-check, .cl-form label.fam-check { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; margin-top: 10px; font-weight: 600; font-size: 15px; cursor: pointer; }
.fam-check input { width: 24px; height: 24px; min-width: 24px; margin-top: 1px; accent-color: var(--grass-2); }
.fam-h { font-weight: 800; font-size: 16px; margin: 14px 0 6px; }
.fam-list { list-style: none; display: grid; gap: 6px; }
.fam-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); }
.fam-main { flex: 1 1 200px; }
.fam-acts { display: flex; gap: 6px; }
.fam-acts .btn { font-size: 12px; padding: 10px 14px; }
.fam-danger { color: var(--lava-2); }
[data-theme="dark"] .fam-danger { color: var(--lava); }
.fam-kids { flex-direction: column; align-items: stretch; }
.fam-kids small { font-weight: 600; opacity: .8; }
/* карточка ключа: крупные слова, QR всегда чёрный на белом (иначе камера не прочтёт) */
.fam-card { margin: 8px auto 12px; max-width: 380px; padding: 14px; border: 3px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-hard); text-align: center; }
.fam-card-title { font-weight: 800; font-size: 15px; }
.fam-key { margin: 10px 0; font-weight: 800; font-size: 24px; line-height: 1.3; letter-spacing: 1px; overflow-wrap: anywhere; }
.fam-card .qr { display: block; width: 200px; max-width: 70%; height: auto; margin: 0 auto; border: 2px solid var(--line); border-radius: 6px; }
.fam-card-note { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.fam-warn { padding: 10px 12px; border: 2px solid var(--line); border-left: 8px solid var(--lava); border-radius: 10px; background: var(--surface); }
.tc-page main { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.tc-h { font-family: var(--font-body); font-weight: 800; font-size: 22px; letter-spacing: 0; margin-bottom: 10px; }
.tc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tc-login { max-width: 520px; }
.tc-av { font-size: 22px; vertical-align: middle; }
.tc-table td { vertical-align: middle; }
.tc-acts { display: flex; flex-wrap: wrap; gap: 6px; white-space: normal !important; min-width: 260px; }
.tc-acts a.icon-btn { text-decoration: none; }
.tc-detail td { background: var(--bg); white-space: normal !important; }
[data-theme="dark"] .tc-detail td { background: #1a2635; }
.tc-code-box { padding: 6px 0; }
.tc-code { font-family: var(--font-pixel); font-size: 20px; letter-spacing: 3px; margin: 8px 0; }
.tc-devices, .tc-users { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.tc-devices li, .tc-users li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tc-add { margin-top: 18px; }
@media (max-width: 560px){
  .tc-code { font-size: 16px; }
  .cl-form { align-items: stretch; flex-direction: column; }
}

/* ---------- Админ-панель (admin/): та же палитра и кнопки, но спокойнее — без неба, сетки и картинок ---------- */
body.adm-body { background: var(--bg); background-image: none; font-size: 15px; }
body.adm-body::before { display: none; }
[data-theme="dark"] body.adm-body { background: var(--bg); }
.adm { max-width: 1180px; margin: 0 auto; padding: 0 20px 60px; }
.adm-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 10px 0; background: var(--bg); border-bottom: 2px solid var(--line); }
.adm-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.adm-brand span { display: flex; flex-direction: column; line-height: 1.1; }
.adm-brand b { font-size: 16px; font-weight: 800; }
.adm-brand small { font-size: 12px; color: var(--muted); }
.adm-nav { display: flex; gap: 4px; }
.adm-nav a { padding: 6px 12px; border: 2px solid transparent; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.adm-nav a:hover { border-color: var(--line); }
.adm-nav a.active { background: var(--surface); border-color: var(--line); box-shadow: 0 3px 0 var(--line); }
.adm-me { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.adm-main { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; outline: none; }
.adm-card { background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: 3px 3px 0 var(--line); }
.adm-login { max-width: 480px; }
.adm-recover { margin-top: 18px; }
.adm-ok { margin: 8px 0; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; background: #dff5e1; color: var(--on-color); }
[data-theme="dark"] .adm-ok { background: #1f3a26; color: var(--ink); }
#adm-me-pass-form { margin-top: 14px; }
.adm-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border: 2px solid var(--line); border-radius: 8px; background: var(--grass-3); color: var(--on-color); font-size: 12px; font-weight: 800; }
.adm-recover summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
.adm-recover p { margin-top: 6px; font-size: 14px; }
.adm-h1 { font-family: var(--font-body); font-weight: 800; font-size: 22px; letter-spacing: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adm-h2 { font-family: var(--font-body); font-weight: 800; font-size: 17px; letter-spacing: 0; margin-bottom: 8px; }
.adm-h1 .t-muted, .adm-h2 .t-muted { font-weight: 700; font-size: 0.8em; }
.adm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.adm-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.adm-tools .btn, .adm-card .controls .btn { font-size: 11px; padding: 9px 12px; }
/* у кнопок жёсткая тень 6px вниз — без отступа следующая строка ложится на неё */
.adm-card .controls { margin-bottom: 12px; }
.adm-tools input, .adm-tools select, .adm-form input, .adm-form select, .adm-card select[data-role] {
  font: inherit; font-size: 14px; padding: 7px 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); min-height: 40px;
}
.adm-tools input[type=search] { min-width: 200px; }
.adm-av { font-size: 20px; vertical-align: middle; }
.adm-table tbody tr.adm-row { cursor: pointer; }
.adm-table tbody tr.adm-row:hover td, .adm-table tbody tr.adm-row:focus-visible td { background: rgba(58,159,224,0.10); }
.adm-table a { color: inherit; text-decoration: none; }
.adm-table a:hover { text-decoration: underline; }
.adm-back { color: var(--ink-2); font-weight: 700; text-decoration: none; }
.adm-back:hover { text-decoration: underline; }
.adm-period { display: flex; gap: 6px; margin: 4px 0 2px; }
.adm-period .tab { padding: 5px 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; min-height: 36px; }
.adm-period .tab.active { background: var(--gold); color: var(--on-color); }
.adm-card .t-tiles { grid-template-columns: repeat(4, 1fr); }
.adm-alltime { margin-top: 8px; }
.adm-chart.dense .bar-days span { font-size: 10px; }
.adm-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.adm-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 14px; }
.adm-form .pf-avatars { flex-basis: 100%; }
.adm-wide { flex-basis: 100%; }
.adm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.adm-cols .t-hard, .adm-cols .t-cps { max-height: 360px; overflow: auto; }
@media (max-width: 760px){
  .adm-cols { grid-template-columns: 1fr; }
  .adm-card .t-tiles { grid-template-columns: repeat(2, 1fr); }
  .adm-me { margin-left: 0; width: 100%; justify-content: space-between; }
  .adm-tools input[type=search] { min-width: 0; flex: 1; }
}

/* ==== ВХОД: кнопка в шапке и выезжающая панель ==== */
.account-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 4px 14px;
  border: 2px solid var(--line); border-radius: var(--radius-pill);
  background: #ffe388; color: var(--on-color);
  font: inherit; font-weight: 800; font-size: 15px; cursor: pointer;
  box-shadow: 0 3px 0 var(--line);
  transition: transform 0.06s ease;
}
.account-btn:hover { transform: translateY(-1px); }
.account-btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--line); }
.account-btn.on { background: #d5eefa; }
.account-btn #acc-name { max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-theme="dark"] .account-btn { background: #3a3320; color: #ffe388; }
[data-theme="dark"] .account-btn.on { background: #1f3346; color: #cfe8ff; }

.drawer-back {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(15, 25, 40, 0);
  transition: background 0.25s ease;
}
.drawer-back.open { background: rgba(15, 25, 40, 0.55); }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(400px, 100%);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); color: var(--ink);
  border-left: 3px solid var(--line);
  box-shadow: -6px 0 0 rgba(0, 0, 0, 0.15);
  padding: 16px 18px 28px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.drawer-back.open .drawer { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.drawer-head h2 { margin: 0; font-size: 20px; }
.drawer .cl-form { flex-direction: column; align-items: stretch; }
.drawer .cl-form input { width: 100%; box-sizing: border-box; }
.drawer .cl-form .btn { align-self: flex-start; }
.drawer .t-h4 { margin: 14px 0 0; }
.drawer .controls { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-who { display: flex; align-items: center; gap: 12px; padding: 12px; margin: 4px 0 12px; border: 2px solid var(--line); border-radius: 12px; background: #d5eefa; color: var(--on-color); }
[data-theme="dark"] .acc-who { background: #1f3346; color: #cfe8ff; }
.acc-av { font-size: 34px; }
.acc-label { font-size: 13px; opacity: 0.8; }
.acc-name { font-size: 18px; }
body.drawer-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-back { transition: none; } }
@media (max-width: 720px) {
  .account-btn { padding: 4px 10px; font-size: 14px; }
  .account-btn #acc-name { max-width: 6em; }
}

/* ==== СЛОВАРЬ ==== */
.lesson-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 52px; }   /* справа — крестик окна */
.lesson-title-row h2 { margin: 0; }
.lesson-dict { min-width: 40px; min-height: 40px; padding: 4px 8px; font-size: 18px; }
.dict-form input { width: 100%; box-sizing: border-box; font: inherit; font-size: 18px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
#dict-out { margin-top: 12px; }
.dict-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dict-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); }
.dict-em { font-size: 26px; width: 34px; text-align: center; flex: none; }
.dict-main { flex: 1; min-width: 0; line-height: 1.35; }
.dict-en { font-size: 17px; }
.dict-where { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dict-say { flex: none; min-width: 40px; min-height: 40px; padding: 4px 8px; }
.dict-gloss { padding: 10px 12px; margin-bottom: 12px; border: 2px dashed var(--line); border-radius: 12px; }
.dict-gloss-title { font-weight: 800; margin-bottom: 6px; }
.dict-gloss-list { margin: 0 0 8px; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.dict-gloss-src { font-weight: 700; }
.dict-note { font-size: 12px; margin: 8px 0 0; }
@media (max-width: 720px) {
  .hud > .icon-btn { min-width: 40px; min-height: 40px; padding: 4px 7px; }
  .hud .howto-new { display: none; }
}
@media (max-width: 420px) {
  /* на телефоне шапка — значки; надпись «Войти» остаётся, имя ученика короче */
  .player-name { font-size: 18px; max-width: 6.5em; }
  .hud #btn-howto { display: none; }   /* ссылка «How to» есть внизу страницы — шапка помещается в две строки */
  .hud { gap: 6px; }
  .account-btn { padding: 4px 8px; gap: 4px; }
  .account-btn #acc-name { max-width: 4.5em; }
}

/* ==== ЧТО НА КАРТИНКЕ? (2-E) ==== */
.pic-emoji { font-size: 84px; line-height: 1.1; text-align: center; margin: 10px 0 6px; }
.pic-options { grid-template-columns: 1fr; }
.pic-options .opt { font-size: 20px; }

/* ==== СОБЕРИ ПРЕДЛОЖЕНИЕ (4-C) ==== */
.build-answer, .build-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0; min-height: 52px; }
.build-answer { padding: 10px; border: 2px dashed var(--line); border-radius: 12px; align-items: center; }
.build-tile { font: inherit; font-size: 18px; font-weight: 700; padding: 8px 14px; min-height: 44px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--line); }
.build-tile.on { background: #d5eefa; color: var(--on-color); }
[data-theme="dark"] .build-tile.on { background: #1f3346; color: #cfe8ff; }
.build-result.ok { color: #2f8f3f; }
.build-result.bad { color: #c0392b; }
@media (max-width: 720px) {
  /* на телефоне крестик окна стоит над заголовком — кнопка словаря слева от названия темы */
  .lesson-title-row { flex-direction: row-reverse; justify-content: flex-end; padding-right: 48px; }
}

/* ==== НИЖНЕЕ МЕНЮ (эскиз 31/34): Карта · Клиника · Сундук · Ошибки ==== */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; display: flex; justify-content: center;
  background: var(--surface); border-top: 3px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0); }
.bottom-nav > a, .bottom-nav > button { position: relative; flex: 1; max-width: 180px; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-2); text-decoration: none; background: none; border: 0; cursor: pointer; }
.bottom-nav [aria-current="true"] { background: var(--nav-active); color: var(--ink); font-weight: 800; }
.bottom-nav small { position: absolute; top: 4px; right: calc(50% - 34px); font-size: 10px; font-weight: 800; padding: 0 5px; border: 2px solid var(--line); border-radius: var(--radius-pill); background: var(--locked); color: var(--ink); }
.bottom-nav [aria-disabled="true"] > svg, .bottom-nav [aria-disabled="true"] > span { opacity: .6; }
.bottom-nav a:focus-visible, .bottom-nav button:focus-visible { outline: 3px solid var(--diamond); outline-offset: -4px; }
.nav-badge { position: absolute; top: 4px; right: calc(50% - 26px); min-width: 22px; padding: 0 5px; font-size: 12px; font-weight: 800; line-height: 18px; text-align: center;
  background: var(--rarity-revenge); color: var(--on-color); border: 2px solid var(--line); border-radius: var(--radius-pill); }
.app { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
section[id$="-sec"] { scroll-margin-top: 96px; }
@media (max-width: 720px){ section[id$="-sec"] { scroll-margin-top: 12px; } }
.guide-bubble { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

/* ==== СЦЕНА ЛОКАЦИИ (STYLE.md §6, эскизы 32 и 40) ==== */
.scene-progress { display: flex; align-items: center; gap: 10px; margin: 12px 0 8px; font-weight: 800; }
.scene-bar { flex: 1; height: 14px; background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius-pill); overflow: hidden; }
.scene-bar i { display: block; height: 100%; background: var(--grass); }
.scene { position: relative; max-width: 560px; margin: 0 auto; aspect-ratio: 360 / 320; border: 3px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-hard); overflow: hidden; background: #cfe9f6; }
.scene-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
[data-theme="dark"] .scene-art { filter: brightness(.88); }
.scene-plate { position: absolute; left: 8px; top: 8px; z-index: 2; display: flex; flex-direction: column; padding: 4px 10px; background: #fffdf6; color: #1c2b1a;
  border: 3px solid var(--line); border-radius: 4px; box-shadow: 3px 3px 0 var(--line); max-width: 60%; }
.scene-plate span { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--diamond-2); }
.scene-plate b { font-size: 16px; font-weight: 800; line-height: 1.1; }
/* метка квеста: круг 50 px цвета редкости; закрыта — серая с рамкой цвета редкости; выбрана — двойное кольцо */
.hub-ex.scene-mark { position: absolute; z-index: 3; transform: translate(-50%, -50%); width: clamp(44px, 13.9%, 50px); height: auto; aspect-ratio: 1; min-height: 0; padding: 0;
  display: flex; align-items: center; justify-content: center; gap: 0; border: 4px solid var(--line); border-radius: 50%;
  background: var(--rarity); color: #1c2b1a; font: 800 clamp(15px, 4.5vw, 20px) var(--font-body); box-shadow: 3px 3px 0 var(--line); cursor: pointer; }
@media (max-width: 480px){ .hub-ex.scene-mark { border-width: 3px; } .hub-ex.scene-mark svg { width: 16px; height: 16px; } .modal .scene { margin-left: -14px; margin-right: -14px; } }
.hub-ex.scene-mark.locked { background: var(--locked); border-color: var(--rarity); }
.hub-ex.scene-mark.sel { box-shadow: 0 0 0 4px #fffdf6, 0 0 0 7px var(--line); }
.hub-ex.scene-mark:focus-visible { outline: 3px solid var(--diamond); outline-offset: 6px; }
.hub-ex.scene-mark:active { transform: translate(-50%, -50%) scale(.94); }
.scene-mark .new-badge { top: -14px; right: -18px; }
.scene-card { max-width: 560px; margin: 12px auto 0; box-sizing: border-box; padding: 12px 14px; background: var(--surface); border: 3px solid var(--line); border-radius: 6px; box-shadow: var(--shadow-hard); display: flex; flex-direction: column; gap: 4px; }
.scene-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quest-pill { padding: 2px 10px; background: var(--rarity-pill); color: #1c2b1a; border: 2px solid var(--line); border-radius: var(--radius-pill); font-size: 12px; font-weight: 800; }
.scene-card-place { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.scene-card-title { font-size: 22px; font-weight: 800; line-height: 1.1; }
.scene-card-what { font-size: 16px; font-weight: 600; color: var(--ink-2); }
.scene-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.scene-card-prize { font-size: 15px; font-weight: 800; }
.scene-card .btn { font-family: var(--font-body); font-size: 19px; font-weight: 800; min-height: 48px; }
.scene-lock { padding: 6px 10px; background: #eef1ef; color: #3a4a38; border-radius: 6px; font-size: 14px; font-weight: 700; flex: 1 1 100%; }
.scene-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; padding: 0; font-size: 13px; font-weight: 700; }
.scene-legend li { display: flex; align-items: center; gap: 6px; }
.scene-legend li::before { content: ''; width: 12px; height: 12px; border: 2px solid var(--line); border-radius: 3px; background: var(--rarity); }

/* ---------- Командный квест (js/team.js) ---------- */
.team-btn { display: flex; align-items: center; gap: 8px; margin: 0 0 10px auto; padding: 8px 14px; min-height: 44px; font: inherit; font-size: 15px; font-weight: 800; color: var(--ink); background: var(--surface); border: 2.5px solid var(--line); border-left: 8px solid var(--diamond); border-radius: var(--radius-pill); box-shadow: var(--shadow-press); cursor: pointer; }
.team-btn:active { transform: translateY(3px); box-shadow: none; }
.team-btn:focus-visible, .team-mode:focus-visible, .team-hero-pick:focus-visible { outline: 3px solid var(--diamond); outline-offset: 3px; }
.team-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0; }
.team-mode { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; min-height: 120px; font: inherit; color: var(--ink); background: var(--surface); border: 3px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-press); cursor: pointer; text-align: center; }
.team-mode > span { font-size: 40px; line-height: 1; }
.team-mode b { font-size: 18px; }
.team-mode small { color: var(--ink-2); font-weight: 600; }
.team-mode:active { transform: translateY(3px); box-shadow: none; }
.team-goal { font-size: 17px; font-weight: 700; }
.team-goal span { font-size: 26px; vertical-align: middle; }
.team-code-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; margin: 10px 0; border: 3px solid var(--line); border-radius: 14px; background: var(--surface); }
.team-code-box > div { display: flex; flex-direction: column; gap: 4px; flex: 1 1 180px; }
.team-code { font-family: var(--font-pixel); font-size: 34px; letter-spacing: 4px; color: var(--ink); }
.team-code-box .qr { width: 132px; height: auto; border: 2px solid var(--line); border-radius: 6px; }
.team-h { font-weight: 800; font-size: 16px; margin: 12px 0 6px; }
.team-players { list-style: none; display: grid; gap: 6px; }
.team-players li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); }
.team-players li.off { opacity: .6; }
.team-players li.me { border-width: 3px; border-color: var(--diamond-2); }
.team-av { font-size: 24px; }
.team-hero { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-weight: 700; }
.team-players .hero-pic, .team-hero .hero-pic { width: 40px; height: 40px; flex: none; }
.team-heroes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.team-hero-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; min-height: 96px; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); background: var(--surface); border: 3px solid var(--line); border-radius: 12px; cursor: pointer; }
.team-hero-pick .hero-pic { width: 52px; height: 52px; }
.team-hero-pick.on { border-color: var(--grass-2); box-shadow: 0 0 0 3px var(--grass); }
.team-hero-pick:disabled { opacity: .5; cursor: not-allowed; }
.team-hero-pick small { font-weight: 600; color: var(--ink-2); }
.team-hud { margin: 0 0 10px; }
.team-bar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 3px solid var(--line); border-radius: 12px; background: var(--surface); }
.team-foe { font-size: 32px; line-height: 1; }
.team-meter { flex: 1; height: 18px; border: 2px solid var(--line); border-radius: var(--radius-pill); background: var(--bg); overflow: hidden; }
.team-meter span { display: block; height: 100%; transition: width .3s; }
.team-patient .team-meter span { background: var(--grass); }
.team-boss .team-meter span { background: var(--lava); }
.team-bar b { font-size: 20px; }
.team-bar b small { font-size: 14px; color: var(--ink-2); }
.team-score { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.team-score li { display: flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border: 2px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); font-size: 14px; font-weight: 700; }
.team-score li.me { border-color: var(--diamond-2); }
.team-score li.off { opacity: .6; }
.team-score .hero-pic { width: 28px; height: 28px; }
.team-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.team-feed { margin: 0; font-weight: 700; color: var(--ink-2); flex: 1 1 180px; }
.team-hint { font-size: 12px; padding: 10px 12px; }
.opt.opt-off { visibility: hidden; }
.team-final .hero-pic { width: 48px; height: 48px; }
.team-final li span { margin-left: auto; font-weight: 700; }
@media (prefers-reduced-motion: reduce){ .team-meter span { transition: none; } .team-btn:active, .team-mode:active { transform: none; } }
/* командный квест за одним устройством */
.team-who { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.team-who-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; min-height: 52px; border: 3px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 700; }
.team-who-item input { width: 24px; height: 24px; accent-color: var(--grass-2); }
.team-who-item span { font-size: 24px; }
.team-who-item small { flex-basis: 100%; font-weight: 600; color: var(--ink-2); }
.team-who-item:has(input:checked) { border-color: var(--grass-2); box-shadow: 0 0 0 3px var(--grass); }
.team-mode[aria-pressed="true"] { border-color: var(--grass-2); box-shadow: 0 0 0 3px var(--grass), var(--shadow-press); }
.team-turn { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 8px 12px; border: 3px solid var(--hero-color); border-radius: 12px; background: var(--surface); font-size: 18px; }
.team-turn .hero-pic { width: 48px; height: 48px; flex: none; }
.team-say { margin-top: 8px; }

/* ---------- «Показать пароль» (js/pwtoggle.js): кнопка-глаз внутри поля пароля ---------- */
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap > input { flex: 1 1 auto; min-width: 0; padding-right: 44px; }
.pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; }
.pw-eye:hover { color: var(--ink); }
.pw-eye:focus-visible { outline: 3px solid var(--diamond); outline-offset: -3px; }
.pw-eye:disabled { opacity: .4; cursor: not-allowed; }
/* узкие поля PIN: место для глаза */
.gate .pw-wrap > input { width: 130px; flex: none; }
.t-pin-form .pw-wrap > input { width: 150px; flex: none; }
