:root {
  --paper: #f4f1ea;
  --ink: #14120f;
  --muted: #6f675c;
  --yellow: #ffdb33;
  --green: #66e8a6;
  --pink: #f2598c;
  --white: #ffffff;
  --accent: #14120f;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

body { padding: 0; }

#app {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 16px 12px; gap: 12px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.level-screen { justify-content: flex-start; }

/* ─── типографика ─── */
h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -0.02em; text-transform: uppercase; }
h1 { font-size: clamp(30px, 9vw, 44px); line-height: 0.92; }
h2 { font-size: clamp(20px, 5.5vw, 26px); line-height: 1; }
h3 { font-size: 15px; }
.caps { text-transform: uppercase; font-weight: 900; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ─── кнопки ─── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 900; text-transform: uppercase; letter-spacing: 0.01em;
  color: var(--ink); background: var(--white);
  border: 3px solid var(--ink); border-radius: 14px;
  padding: 13px 16px; cursor: pointer;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.btn.primary { background: var(--yellow); }
.btn.green { background: var(--green); }
.btn.ghost { box-shadow: 3px 3px 0 var(--ink); padding: 9px 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.45; box-shadow: 3px 3px 0 rgba(20,18,15,0.4); }

/* ─── карточки ─── */
.card {
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 7px 7px 0 var(--ink);
  padding: 14px;
}

/* ─── титул ─── */
.title-screen { justify-content: flex-start; }
.logo-wrap { padding-top: 8px; }
.logo { font-size: clamp(38px, 13vw, 64px); line-height: 0.88; }
.logo em { font-style: normal; color: var(--pink); -webkit-text-stroke: 2px var(--ink); }
.tagline { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.badge {
  display: inline-block; margin-top: 12px; padding: 3px 9px;
  border: 2px solid var(--ink); background: var(--yellow);
  font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.09em;
}
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }

/* ─── карта ─── */
.map-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.map-stats { display: flex; gap: 8px; margin-top: 8px; }
.stat {
  flex: 1; text-align: center; background: var(--white);
  border: 2.5px solid var(--ink); border-radius: 10px; padding: 5px 4px;
}
.stat b { display: block; font-size: 16px; font-weight: 900; }
.stat span { font-size: 8px; font-weight: 800; letter-spacing: 0.06em; color: var(--muted); }

.epochs { display: flex; flex-direction: column; gap: 8px; padding-bottom: 6px; }
.epoch-row { display: flex; align-items: stretch; gap: 8px; }
.epoch-year {
  width: 52px; min-width: 52px; display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper); border: 2px solid var(--ink);
  font-weight: 900; font-size: 13px; letter-spacing: -0.02em;
}
.epoch-row.locked .epoch-year { background: #ded9cd; color: #8f887c; border-color: #b9b2a4; }
.epoch-row.current .epoch-year { background: var(--yellow); color: var(--ink); border-color: var(--ink); }
.epoch-body {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 2.5px solid var(--ink); border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink); padding: 8px 10px; cursor: pointer; position: relative;
  overflow: hidden;
}
.epoch-row.locked .epoch-body { background: #fbfaf7; border-color: #c9c3b6; box-shadow: 4px 4px 0 #ddd8cb; cursor: default; }
.epoch-body::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.epoch-row.locked .epoch-body::before { background: #d6d0c3; }
.epoch-icon { width: 34px; height: 34px; display: block; }
.epoch-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.epoch-title { font-weight: 900; font-size: 14px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epoch-sub { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.progress { width: 54px; height: 6px; background: #e6e1d5; border: 1px solid #cfc9bb; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green); }
.epoch-right { margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.epoch-count { font-weight: 900; font-size: 14px; color: #9a9285; }
.epoch-row:not(.locked) .epoch-count { color: var(--ink); }
.chip-play { background: var(--yellow); border: 1.5px solid var(--ink); font-size: 8px; font-weight: 900; padding: 1px 5px; text-transform: uppercase; }

/* ─── уровни эпохи ─── */
.levels-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.level-cell {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--white); border: 2.5px solid var(--ink); border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink); font-weight: 900; cursor: pointer;
}
.level-cell.locked { background: #fbfaf7; color: #a9a294; border-color: #cfc9bb; box-shadow: 4px 4px 0 #e2ddd1; cursor: default; }
.level-cell.done { background: #efe9db; }
.level-cell .n { font-size: 17px; }
.level-cell .stars { font-size: 9px; letter-spacing: 1px; color: var(--ink); }
.level-cell.locked .stars { color: #d6d0c3; }

/* ─── уровень ─── */
.level-top { display: flex; align-items: center; gap: 10px; }
.back-btn {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: var(--white); border: 2.5px solid var(--ink); border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink); font-size: 20px; font-weight: 900; cursor: pointer;
  color: var(--ink); padding-bottom: 3px;
}
.level-name { font-weight: 900; font-size: 15px; line-height: 1; letter-spacing: -0.01em; }
.level-meta { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.hud { display: flex; gap: 8px; }
.hud-cell {
  background: var(--white); border: 2.5px solid var(--ink); border-radius: 12px;
  padding: 6px 10px; box-shadow: 3px 3px 0 var(--ink); min-width: 66px;
}
.hud-cell b { display: block; font-size: 19px; font-weight: 900; line-height: 1; }
.hud-cell span { font-size: 8px; font-weight: 800; letter-spacing: 0.08em; color: var(--muted); }
.hud-cell.moves b.low { color: #d93b3b; }

.goals { display: flex; gap: 8px; flex-wrap: wrap; }
.goal {
  display: flex; align-items: center; gap: 7px; background: var(--white);
  border: 2.5px solid var(--ink); border-radius: 999px; padding: 4px 10px 4px 5px;
  box-shadow: 3px 3px 0 var(--ink);
}
.goal canvas { width: 22px; height: 22px; border-radius: 5px; }
.goal b { font-size: 13px; font-weight: 900; }
.goal.done { background: var(--green); }

.board-wrap {
  position: relative; aspect-ratio: 1; width: 100%; flex: none; margin: auto 0; display: flex; align-items: center; justify-content: center;
  background: var(--epoch-bg, #1b1030);
  border: 3px solid var(--ink); border-radius: 18px; box-shadow: 8px 8px 0 var(--ink);
  padding: 6px; overflow: hidden;
}
.board-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.10), transparent 60%);
}
#board { width: 100%; height: 100%; display: block; touch-action: none; }

.boosters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.booster {
  background: var(--white); border: 2.5px solid var(--ink); border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink); padding: 7px 4px; font: inherit; font-weight: 900;
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--ink);
}
.booster .ico { font-size: 17px; line-height: 1; }
.booster[disabled] { opacity: 0.4; }

.combo {
  position: absolute; top: 10px; right: 12px; z-index: 3;
  background: var(--green); border: 2.5px solid var(--ink); padding: 2px 8px;
  font-weight: 900; font-size: 13px; transform: rotate(-4deg); opacity: 0; transition: opacity 0.2s;
}
.combo.on { opacity: 1; }

/* ─── результат ─── */
.result-screen { justify-content: center; }
.result-card { padding: 0; overflow: hidden; }
.result-art { background: #d9c9af; border-bottom: 3px solid var(--ink); display: block; width: 100%; }
.demo-cap {
  background: #000; color: #fff; text-align: center; padding: 11px 14px;
  font-size: 13px; font-weight: 900; text-transform: uppercase; line-height: 1.2;
  letter-spacing: 0.01em; border-bottom: 3px solid var(--ink);
}
.result-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.result-line { font-weight: 900; font-size: 18px; line-height: 1.1; text-transform: uppercase; }
.result-sub { font-size: 12px; color: var(--muted); }
.stars-row { font-size: 26px; letter-spacing: 2px; }
.stars-row .off { color: #d8d2c4; }
.result-actions { display: flex; flex-direction: column; gap: 8px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: var(--paper); padding: 9px 14px; border-radius: 10px;
  font-weight: 800; font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity 0.18s, transform 0.18s; z-index: 50; max-width: 86vw; text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.demo-teaser { display: flex; align-items: center; gap: 10px; padding: 10px; cursor: pointer; }
.demo-teaser .art { width: 46px; height: 46px; border: 2.5px solid var(--ink); border-radius: 10px; flex: none; }
.demo-teaser .t1 { font-size: 9px; font-weight: 900; letter-spacing: 0.08em; color: var(--muted); }
.demo-teaser .t2 { font-size: 12px; font-weight: 800; line-height: 1.15; }
.demo-teaser .arrow { margin-left: auto; font-weight: 900; }

@media (min-height: 760px) {
  .screen { gap: 14px; }
}

/* ─── альбом ─── */
.album-screen { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.album-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; }
.demo-card {
  background: var(--white); border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 7px 7px 0 var(--ink); overflow: hidden;
}
.demo-art { display: block; width: 100%; height: auto; border-bottom: 3px solid var(--ink); }
.demo-card .demo-cap { border-bottom: 3px solid var(--ink); }
.demo-foot {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 12px; font-size: 11px; font-weight: 700; color: var(--muted);
}

/* ─── лента эпох ─── */
.eras { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; padding-bottom: 10px; }
.era-row {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px 7px 6px;
  background: var(--white); border: 2.5px solid var(--ink); border-radius: 12px;
  box-shadow: 4px 4px 0 var(--ink); cursor: pointer; position: relative; overflow: hidden;
}
.era-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); }
.era-row.locked { background: #fbfaf7; border-color: #cfc9bb; box-shadow: 4px 4px 0 #e2ddd1; cursor: default; }
.era-row.locked::before { background: #d6d0c3; }
.era-year {
  width: 48px; flex: none; text-align: center; font-weight: 900; font-size: 12px;
  background: var(--ink); color: var(--paper); padding: 4px 0; border-radius: 6px;
}
.era-row.locked .era-year { background: #ded9cd; color: #8f887c; }
.era-icon { width: 26px; height: 26px; flex: none; }
.era-text { flex: 1; min-width: 0; }
.era-title { font-weight: 900; font-size: 13px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.era-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }
.era-right { font-weight: 900; font-size: 13px; color: var(--muted); }

.era-bar { height: 8px; background: #e2ddd1; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
.era-bar i { display: block; height: 100%; background: var(--green); }

/* ─── карточки уровней ─── */
.lvl-list { display: flex; flex-direction: column; gap: 11px; overflow-y: auto; padding-bottom: 8px; }
.lvl-card {
  position: relative; display: flex; align-items: stretch; min-height: 96px;
  background: var(--white); border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 6px 6px 0 var(--ink); overflow: hidden; cursor: pointer;
}
.lvl-card.locked { opacity: .62; }
.lvl-art { width: 92px; height: 92px; flex: none; margin: 8px 0 8px 8px; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; }
.lvl-art canvas { width: 100%; height: 100%; display: block; }
.lvl-body { flex: 1; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.lvl-num { font-size: 8px; font-weight: 900; letter-spacing: .14em; color: #8b8171; }
.lvl-name { font-size: 15px; font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; line-height: 1.02; }
.lvl-goals { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.lvl-goals .g { display: flex; align-items: center; gap: 3px; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 6px 1px 2px; background: #fdfaf1; }
.lvl-goals .g canvas { width: 15px; height: 15px; }
.lvl-goals .g b { font-size: 10px; }
.lvl-stars { position: absolute; right: 9px; top: 8px; font-size: 12px; color: #d8cfbc; letter-spacing: 1px; }
.lvl-card:not(.locked) .lvl-stars { color: #e0a526; }
.lvl-lock {
  position: absolute; right: 8px; bottom: 8px; font-size: 8px; font-weight: 900;
  background: var(--ink); color: var(--paper); padding: 2px 6px; letter-spacing: .1em;
}

/* ─── карточка за победу ─── */
.win-burst {
  position: absolute; inset: -40px; opacity: .22; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, #ffd54a 0 10deg, #ffc400 10deg 20deg);
  filter: blur(2px); pointer-events: none;
}
.card.prize { padding: 0; overflow: hidden; transform: rotate(-1deg); position: relative; z-index: 2; }
.prize-top { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-bottom: 3px solid var(--ink); background: #fff3cf; }
.prize-top span:first-child { font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.prize-top .rare { background: var(--ink); color: #fff3cf; padding: 2px 7px; font-size: 8px; letter-spacing: .1em; }
.prize-art { display: block; width: 100%; height: auto; border-bottom: 3px solid var(--ink); }
.prize-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 5px; }
.prize-title { font-size: 19px; font-weight: 900; text-transform: uppercase; letter-spacing: -.02em; line-height: 1; }
.prize-meta { font-size: 10px; font-weight: 800; color: #6d6355; text-transform: uppercase; letter-spacing: .05em; display: flex; gap: 6px; align-items: center; }
.prize-meta .y { background: var(--ink); color: #fff3cf; padding: 1px 6px; }
.prize-fact { font-size: 12px; line-height: 1.4; }
.prize-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.prize-tags span { font-size: 9px; font-weight: 800; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 7px; background: #fdfaf1; }
.small-stars { font-size: 16px; letter-spacing: 2px; color: #e0a526; }

/* ─── альбом ─── */
.album-era { display: flex; gap: 8px; align-items: flex-start; }
.album-year { width: 46px; flex: none; font-weight: 900; font-size: 12px; background: var(--ink); color: var(--paper); text-align: center; padding: 3px 0; border-radius: 6px; margin-top: 4px; }
.album-cards { display: flex; gap: 6px; flex: 1; }
.mini { flex: 1; border: 2.5px solid var(--ink); border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.mini canvas { display: block; width: 100%; height: auto; }
.mini-name { font-size: 8px; font-weight: 800; text-transform: uppercase; padding: 3px 4px; border-top: 2px solid var(--ink); }
.mini.locked { opacity: .55; }

/* ─── титул с фотографией ─── */
.title-screen.photo { position: relative; overflow: hidden; padding: 0; gap: 0; }
.title-screen.photo .bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
}
.title-screen.photo .scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(8,6,4,.62) 0%, rgba(8,6,4,.18) 38%, rgba(8,6,4,.12) 55%, rgba(8,6,4,.82) 100%);
}
.title-inner { position: relative; z-index: 2; padding: 14px 14px 0; }
.title-screen.photo .logo { color: #fff7e8; text-shadow: 0 3px 0 rgba(0,0,0,.35), 0 10px 30px rgba(0,0,0,.45); }
.title-screen.photo .logo em { color: #ff7a9c; -webkit-text-stroke: 2px #1a1410; }
.title-screen.photo .tagline { color: rgba(255,248,235,.88); text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.title-screen.photo .badge { box-shadow: 0 3px 12px rgba(0,0,0,.35); }

.photo-stats {
  position: relative; z-index: 2; margin: 14px 18px 0;
  display: flex; gap: 8px;
}
.photo-stats .stat {
  background: rgba(20,16,12,.55); border-color: rgba(255,248,235,.4);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.photo-stats .stat b { color: #fff7e8; }
.photo-stats .stat span { color: rgba(255,248,235,.7); }

.title-screen.photo .actions {
  position: relative; z-index: 2; margin-top: auto;
  padding: 0 18px 22px; display: flex; flex-direction: column; gap: 9px;
}
.title-screen.photo .btn.ghost { background: rgba(255,248,235,.92); }

/* ─── настройки ─── */
.set-title { font-size: 10px; font-weight: 900; letter-spacing: .12em; color: var(--muted); margin: 4px 0 8px; }
.bg-grid { display: flex; gap: 9px; }
.bg-opt {
  flex: 1; padding: 0; background: #fff; border: 3px solid var(--ink); border-radius: 12px;
  overflow: hidden; box-shadow: 4px 4px 0 var(--ink); cursor: pointer;
  display: flex; flex-direction: column; gap: 0; font: inherit; color: var(--ink);
}
.bg-opt img { width: 100%; height: 120px; object-fit: cover; display: block; border-bottom: 3px solid var(--ink); }
.bg-opt span { font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 5px 4px; line-height: 1.15; }
.bg-opt.on { outline: 4px solid var(--green); outline-offset: 1px; }

/* ─── сплэш ─── */
#splash {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(circle at 50% 38%, #1a1613 0%, #0c0a08 60%, #060505 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  transition: opacity .38s ease;
}
#splash.off { opacity: 0; pointer-events: none; }
#splash img {
  width: min(84%, 380px); height: auto; display: block;
  filter: drop-shadow(0 14px 34px rgba(0,0,0,.65));
  animation: splashIn .7s cubic-bezier(.2,.9,.25,1) both;
}
@keyframes splashIn {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to { opacity: 1; transform: none; }
}
.splash-bar {
  width: min(58%, 220px); height: 6px; border-radius: 3px;
  background: rgba(255,248,235,.16); overflow: hidden;
}
.splash-bar i {
  display: block; height: 100%; width: 40%; border-radius: 3px;
  background: linear-gradient(90deg, #ffdb33, #ff7a9c);
  animation: splashLoad 1.1s ease-in-out infinite;
}
@keyframes splashLoad {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}
.splash-note {
  font-size: 10px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(255,248,235,.55);
}

/* ─── логотип-картинка ─── */
.logo-img {
  display: block; width: 100%; max-width: 430px; height: auto;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.45));
}

/* блок с логотипом — по центру свободного места над кнопками */
.title-screen.photo .title-inner {
  margin-top: 0;
  padding-top: 2px;
  text-align: center;
}
.title-screen.photo .badge { margin-top: 10px; }
.title-screen.photo .logo-img { margin-left: auto; margin-right: auto; }
.title-screen.photo .tagline { text-align: center; }

/* табличка уровня над полем */
.level-sign {
  align-self: center; margin: 2px 0 -2px; padding: 4px 14px;
  background: var(--accent, #c84c0c); color: #fff7e8;
  border: 3px solid var(--ink); border-radius: 9px;
  box-shadow: 0 3px 0 var(--ink);
  font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
}

/* фон уровня на весь экран */
.level-screen { position: relative; overflow: hidden; }
.level-bg {
  position: fixed; left: 0; top: 0; width: 100vw; height: 100vh;
  z-index: 0; display: block;
}
.level-scrim {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,6,4,.5) 0%, rgba(8,6,4,.12) 24%, rgba(8,6,4,0) 55%, rgba(8,6,4,.35) 100%);
}
.level-screen > .level-top,
.level-screen > .hud,
.level-screen > .goals,
.level-screen > .goal-row,
.level-screen > .level-sign,
.level-screen > .board-wrap,
.level-screen > .boosters { position: relative; z-index: 1; }

/* поле прозрачное — сквозь него видно фон */
.level-screen .board-wrap {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.level-screen .level-name { color: #fff7e8; text-shadow: 0 2px 6px rgba(0,0,0,.45); }
.level-screen .level-meta { color: rgba(255,248,235,.78); text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.level-screen #board { background: transparent; }

/* ─── блоки эпохи: игра / фильм / вещь ─── */
.blocks { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding-bottom: 6px; }
.block-head { display: flex; align-items: center; gap: 8px; margin: 0 0 7px; }
.block-tag {
  font-size: 9px; font-weight: 900; letter-spacing: .12em; padding: 3px 8px;
  border: 2.5px solid var(--ink); border-radius: 6px; background: var(--yellow); color: var(--ink);
}
.tag-film { background: #e88c6a; }
.tag-thing { background: #9ad0ff; }
.block-title { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; line-height: 1.1; }
.block-levels { display: flex; flex-direction: column; gap: 8px; }
.block .lvl-card { min-height: 82px; }
.block .lvl-art { width: 76px; height: 76px; }
.block .lvl-name { font-size: 14px; }

/* ─── переключатели музыки и звуков на уровне ─── */
.goal-row { display: flex; align-items: center; gap: 8px; }
.goal-row .goals { flex: 1; min-width: 0; }
.sound-toggles { display: flex; gap: 6px; flex: none; }
.snd-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: var(--white); color: var(--ink);
  border: 2.5px solid var(--ink); border-radius: 11px; box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer; padding: 0;
}
.snd-btn.off { background: #e6e1d5; color: #9a9285; box-shadow: 3px 3px 0 #cfc9bb; }
.snd-btn.off svg { opacity: .55; }
.snd-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ─── карточка: фрагменты ─── */
.prize-art-wrap { position: relative; }
.piece-mask {
  position: absolute; inset: 0; display: flex; pointer-events: none;
}
.piece-mask span {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; letter-spacing: .1em; color: rgba(255,248,235,.55);
  border-right: 2px dashed rgba(255,248,235,.35);
  background: rgba(12,10,8,.62);
}
.piece-mask span:last-child { border-right: none; }
.piece-mask[data-done="1"] span:nth-child(1),
.piece-mask[data-done="2"] span:nth-child(1),
.piece-mask[data-done="2"] span:nth-child(2) { background: transparent; color: transparent; border-color: transparent; }
.prize.partial .prize-title { opacity: .75; }

/* ─── альбом карточек ─── */
.album-card {
  display: flex; gap: 0; background: var(--white); border: 3px solid var(--ink);
  border-radius: 14px; overflow: hidden; box-shadow: 6px 6px 0 var(--ink);
}
.album-card canvas { width: 132px; height: 92px; display: block; border-right: 3px solid var(--ink); }
.album-card-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; justify-content: center; }
.album-card-title { font-size: 14px; font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; line-height: 1; }
.album-card-sub { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.album-progress { margin-top: 3px; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.album-card.partial .album-progress { color: #b98f47; }
.album-card:not(.partial) .album-progress { color: #1f7a4a; }

/* поле — только предметы на фоне, без рамки и подложки */
.level-screen .board-wrap {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
}
.level-screen .board-wrap::after { display: none; }

/* цели: цифра + полоска */
.goal { gap: 6px; }
.goal-info { display: flex; flex-direction: column; line-height: 1.05; }
.goal-info b { font-size: 12px; }
.goal-info .small { font-size: 8px; letter-spacing: .04em; }
.goal-bar { width: 44px; height: 7px; background: #e6e1d5; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; }
.goal-bar i { display: block; height: 100%; width: 0%; background: var(--green); transition: width .2s; }
.goal.done .goal-bar i { background: #1f9d5c; }
.boosters { grid-template-columns: repeat(5, 1fr) !important; }
.boosters .booster { font-size: 8px; }

/* кнопка сброса */
.btn.danger {
  background: #f7d7d2;
  border-color: #a3231b;
  color: #7a1a14;
  box-shadow: 4px 4px 0 #a3231b;
}

/* бустеры-иконки */
.boosters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: end; }
.booster {
  padding: 0; background: none; border: 0; box-shadow: none; cursor: pointer;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.35));
  transition: transform .12s ease;
}
.booster img { width: 100%; height: auto; display: block; }
.booster:active { transform: scale(.92); }
.booster.armed { transform: translateY(-4px) scale(1.06); filter: drop-shadow(0 0 14px #ffdb33); }
.booster:disabled { opacity: .35; filter: grayscale(.6); }

/* +5 ходов в шапке */
.hud-cell.moves { position: relative; }
.plus-moves {
  position: absolute; right: -6px; top: -6px;
  min-width: 26px; height: 22px; padding: 0 5px;
  background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 7px;
  font: 900 10px/1 inherit; color: var(--ink); box-shadow: 2px 2px 0 var(--ink);
}
.plus-moves:disabled { opacity: .4; }
