/* =========================================================================
   ПУАНТОКРЫЛ — оформление
   Сцена: чернильный зал, кремовая бумага, атласный розовый и золото.
   Никаких неоновых градиентов и эмодзи: типографика, воздух, тонкие линии.
   ========================================================================= */

:root {
  --ink: #0a0710;
  --ink-2: #140d1c;
  --ink-3: #1d1126;
  --paper: #fbf4ec;
  --paper-2: #f2e8dc;
  --ivory: #fdf8f4;
  --blush: #ffc2cf;
  --blush-deep: #e8879f;
  --gold: #e6c9a5;
  --muted: #a999a9;
  --mist: rgba(253, 248, 244, 0.62);
  --line: rgba(253, 248, 244, 0.12);
  --display: Georgia, "Times New Roman", "PT Serif", serif;
  --ui: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

.app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(4, 2, 8, 0.55) 100%),
    linear-gradient(to bottom, rgba(4, 2, 8, 0.5), transparent 22%);
  z-index: 2;
}

.is-hidden {
  display: none !important;
}

/* ------------------------------- Кнопки ------------------------------- */

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ivory);
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 13px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease),
    transform 0.18s var(--ease), color 0.18s var(--ease);
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 194, 207, 0.08);
  border-color: rgba(255, 194, 207, 0.5);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.btn--primary {
  background: var(--blush);
  border-color: transparent;
  color: #3d1521;
  box-shadow: 0 10px 34px rgba(232, 135, 159, 0.28);
}

.btn--primary:hover {
  background: #ffd6df;
  border-color: transparent;
}

.btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--mist);
  padding-inline: 10px;
}

.btn--quiet:hover {
  background: transparent;
  color: var(--ivory);
  border-color: transparent;
}

.btn--small {
  padding: 9px 16px;
  font-size: 13px;
  border-color: var(--line);
}

.eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

/* ------------------------------- Титул -------------------------------- */

.screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  align-content: safe center;
  justify-items: center;
  padding: clamp(20px, 4vw, 56px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: radial-gradient(120% 90% at 50% 0%, rgba(12, 7, 18, 0.9), rgba(7, 4, 11, 0.95));
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.32s var(--ease), transform 0.32s var(--ease), visibility 0.32s;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.screen--title {
  background: linear-gradient(100deg, rgba(7, 4, 11, 0.92) 0%, rgba(7, 4, 11, 0.7) 38%, rgba(7, 4, 11, 0.08) 72%);
  justify-items: stretch;
  align-content: center;
}

.screen--title.is-active {
  padding-inline: clamp(24px, 6vw, 88px);
}

.title-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.78fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.title-copy {
  display: grid;
  gap: 22px;
  max-width: 560px;
}

.logo {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(52px, 8.4vw, 112px);
  line-height: 0.86;
  letter-spacing: -0.01em;
  display: grid;
  gap: 0.04em;
}

.logo__line--italic {
  font-style: italic;
  color: var(--blush);
  padding-left: 0.08em;
}

.lede {
  max-width: 44ch;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.62;
  color: rgba(253, 248, 244, 0.72);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.progress-line {
  display: flex;
  gap: clamp(24px, 4vw, 56px);
  margin-top: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.progress-line dt {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.progress-line dd {
  font-family: var(--display);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  color: var(--ivory);
}

.hint-key {
  font-size: 13.5px;
  letter-spacing: 0.08em;
  color: rgba(253, 248, 244, 0.4);
}

/* Референс-плейт: кремовая карточка-программа. */
.plate {
  justify-self: center;
  width: min(100%, 400px);
  transform: rotate(-1.4deg);
  transition: transform 0.6s var(--ease);
}

.plate:hover {
  transform: rotate(-0.4deg) translateY(-3px);
}

.plate__paper {
  background: #fdf9f3;
  padding: 14px 14px 10px;
  border-radius: 3px;
  box-shadow:
    0 42px 80px rgba(0, 0, 0, 0.55),
    0 2px 0 rgba(255, 255, 255, 0.5) inset;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.plate__paper img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1px;
}

/* Титул без карточки: крылатые пуанты прямо на сцене. */
.plate--bare {
  width: min(100%, 520px);
  transform: none;
}

.plate--bare:hover {
  transform: translateY(-3px);
}

.plate--bare canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
}

.plate--bare .plate__tag {
  color: rgba(255, 214, 150, 0.62);
}

.plate--bare .plate__caption {
  color: rgba(253, 248, 244, 0.72);
}

/* Сцена под софитами вместо белой карточки-референса. */
.plate__paper--stage {
  background: #0b0712;
  padding: 0;
  border: 1px solid rgba(255, 214, 150, 0.18);
  border-radius: 14px;
  box-shadow:
    0 42px 80px rgba(0, 0, 0, 0.62),
    0 0 70px rgba(255, 120, 150, 0.12),
    0 0 90px rgba(0, 0, 0, 0.55) inset;
  overflow: hidden;
}

.plate__paper--stage ~ figcaption .plate__tag {
  color: rgba(255, 214, 150, 0.62);
}

.plate__paper--stage ~ figcaption .plate__caption {
  color: rgba(253, 248, 244, 0.72);
}

.plate__paper--stage canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
}

.plate figcaption {
  display: grid;
  gap: 4px;
  padding: 12px 4px 4px;
}

.plate__tag {
  font-size: 12.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #9a7f84;
}

.plate__caption {
  font-family: var(--display);
  font-style: italic;
  font-size: 18px;
  color: #5f4a50;
}

/* ------------------------------ Секции -------------------------------- */

.sheet {
  width: 100%;
  max-width: 980px;
  display: grid;
  gap: clamp(16px, 2.2vw, 26px);
  padding: clamp(14px, 2vw, 28px) 0;
  animation: rise 0.4s var(--ease);
}

.sheet--wide {
  max-width: 1080px;
}

.sheet--narrow {
  max-width: 720px;
}

#screen-skins .sheet {
  max-width: 1180px;
}

#screen-levels .sheet {
  max-width: 1040px;
}

.sheet__head {
  display: grid;
  gap: 10px;
}

.sheet__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 1;
  letter-spacing: -0.01em;
}

.sheet__lead {
  max-width: 62ch;
  color: rgba(253, 248, 244, 0.62);
  font-size: 15px;
  line-height: 1.6;
}

.sheet__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.sheet__note {
  font-size: 13.5px;
  color: rgba(253, 248, 244, 0.42);
  letter-spacing: 0.02em;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------- Классы студии ---------------------------- */

.classes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.class {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  grid-template-areas:
    "art head"
    "art blurb"
    "bar bar"
    "foot foot";
  align-items: center;
  gap: 4px 14px;
  padding: 14px 16px;
  text-align: left;
  background: rgba(20, 13, 28, 0.66);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.class:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 194, 207, 0.42);
  background: rgba(34, 21, 43, 0.82);
}

.class:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.class.is-active {
  border-color: rgba(255, 214, 150, 0.56);
  background:
    radial-gradient(110% 100% at 0% 0%, rgba(255, 214, 150, 0.12), transparent 62%),
    rgba(30, 20, 34, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 214, 150, 0.18) inset, 0 14px 40px rgba(0, 0, 0, 0.3);
}

.class__art {
  grid-area: art;
  width: 104px;
  height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.45));
}

.class__head {
  grid-area: head;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.class__name {
  font-family: var(--display);
  font-size: clamp(19px, 1.9vw, 23px);
  line-height: 1.05;
}

.class__style {
  font-size: 11.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--blush);
  font-weight: 600;
}

.class__blurb {
  grid-area: blurb;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(253, 248, 244, 0.5);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.class__bar {
  grid-area: bar;
  height: 3px;
  border-radius: 2px;
  background: rgba(253, 248, 244, 0.1);
  overflow: hidden;
  margin-top: 8px;
}

.class__bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blush), var(--gold));
}

.class__foot {
  grid-area: foot;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(253, 248, 244, 0.4);
}

.levels__label {
  margin: 4px 0 -8px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 214, 150, 0.68);
}

@media (max-width: 900px) {
  .classes {
    grid-template-columns: 1fr;
  }

  .class {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .class__art {
    width: 86px;
    height: 98px;
  }
}

/* ------------------------------ Треки --------------------------------- */

.levels {
  display: grid;
  gap: 12px;
}

@media (min-width: 1180px) {
  .levels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.level {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
  width: 100%;
  text-align: left;
  padding: clamp(14px, 1.8vw, 20px) clamp(16px, 2vw, 24px);
  background: rgba(22, 14, 30, 0.66);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.level:hover:not([disabled]) {
  transform: translateY(-2px);
  border-color: rgba(255, 194, 207, 0.42);
  background: rgba(34, 21, 43, 0.82);
}

.level:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.level[disabled] {
  cursor: not-allowed;
  opacity: 0.52;
}

.level__no {
  font-family: var(--display);
  font-size: 26px;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.level__body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.level__style {
  font-size: 11.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--blush);
  font-weight: 600;
}

.level__title {
  font-family: var(--display);
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.05;
}

.level__theme {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 150, 0.26);
  background: rgba(255, 214, 150, 0.07);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 226, 176, 0.78);
}

.level__theme i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.level__brief {
  font-size: 13px;
  color: rgba(253, 248, 244, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
}

.level__meta {
  display: grid;
  justify-items: end;
  gap: 7px;
  text-align: right;
}

.level__best {
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: rgba(253, 248, 244, 0.62);
  font-variant-numeric: tabular-nums;
}

.level__lock {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(253, 248, 244, 0.36);
}

.level--lesson .level__no {
  font-size: 24px;
}

.level--lesson .level__title {
  font-size: clamp(19px, 1.9vw, 25px);
}

.level__diff {
  display: inline-flex;
  gap: 4px;
  margin-top: 2px;
}

.level__diff i {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: rgba(253, 248, 244, 0.16);
  font-style: normal;
}

.level__diff i.is-on {
  background: linear-gradient(90deg, #ff7d92, #ffd166);
  box-shadow: 0 0 8px rgba(255, 170, 140, 0.35);
}

.stars {
  display: inline-flex;
  gap: 4px;
}

.stars i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(253, 248, 244, 0.18);
  font-style: normal;
}

.stars i.is-on {
  background: var(--gold);
  box-shadow: 0 0 10px rgba(230, 201, 165, 0.55);
}

/* ------------------------------ Скины --------------------------------- */

.skins {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  gap: 14px;
}

@media (min-width: 1180px) {
  .skins {
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  }
}

.skin {
  display: grid;
  gap: 10px;
  padding: 14px 14px 16px;
  background: rgba(22, 14, 30, 0.66);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: left;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}

.skin:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 194, 207, 0.4);
}

.skin:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.skin.is-selected {
  border-color: rgba(230, 201, 165, 0.7);
  background: rgba(38, 24, 44, 0.82);
}

.skin[data-locked="true"] {
  cursor: not-allowed;
}

.skin[data-locked="true"] .skin__canvas {
  filter: grayscale(0.75) brightness(0.7);
}

.skin__canvas {
  width: 100%;
  height: 112px;
  display: block;
  border-radius: 12px;
  background: radial-gradient(90% 80% at 50% 60%, rgba(255, 154, 180, 0.1), rgba(0, 0, 0, 0));
}

.skin__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.skin__name {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.1;
}

.skin__state {
  font-size: 12.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

.skin__tagline {
  font-size: 14px;
  color: rgba(253, 248, 244, 0.52);
  line-height: 1.45;
}

.skin__bar {
  height: 2px;
  background: rgba(253, 248, 244, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.skin__bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blush-deep), var(--gold));
}

.skin__foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: rgba(253, 248, 244, 0.42);
  font-variant-numeric: tabular-nums;
}

.skin__ref {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px dashed rgba(230, 201, 165, 0.28);
  border-radius: 14px;
}

.skin__ref img {
  width: 88px;
  height: 66px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--paper);
}

.skin__ref p {
  font-size: 14px;
  color: rgba(253, 248, 244, 0.5);
  line-height: 1.5;
}

.skin__ref b {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
  color: var(--ivory);
  font-weight: 400;
}

/* ----------------------------- Как играть ----------------------------- */

.howto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

@media (min-width: 900px) {
  .howto {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  background: rgba(20, 13, 28, 0.66);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(18px, 2.4vw, 26px);
  display: grid;
  gap: 14px;
  align-content: start;
}

.card h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.15;
}

.card__note {
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(253, 248, 244, 0.45);
}

.card--accent {
  border-color: rgba(255, 194, 207, 0.3);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(255, 154, 180, 0.12), transparent 60%),
    rgba(24, 14, 30, 0.72);
}

.card--accent p {
  color: rgba(253, 248, 244, 0.78);
  font-size: 14px;
  line-height: 1.6;
}

.card--accent b {
  color: var(--blush);
  font-weight: 600;
}

.keys {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 13px;
  color: rgba(253, 248, 244, 0.7);
}

.keys li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--ui);
  font-size: 12.5px;
  color: var(--ivory);
}

.swipe {
  font-size: 13.5px;
  color: rgba(253, 248, 244, 0.55);
  border-bottom: 1px dotted rgba(253, 248, 244, 0.25);
}

.note-types {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.note-types li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.note-types b {
  display: block;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 400;
  margin-bottom: 2px;
}

.note-types span {
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(253, 248, 244, 0.5);
}

.note-icon {
  width: 72px;
  height: 60px;
}

/* Список трёх классов в справке. */
.class-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.class-list li {
  display: grid;
  gap: 2px;
  padding-left: 11px;
  border-left: 2px solid rgba(255, 214, 150, 0.35);
}

.class-list b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 17px;
  color: var(--ivory);
}

.class-list span {
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(253, 248, 244, 0.55);
}

.beat-demo {
  display: flex;
  gap: 6px;
  align-items: center;
}

.beat-demo__beat {
  height: 3px;
  flex: 1;
  border-radius: 2px;
  background: rgba(253, 248, 244, 0.18);
}

.beat-demo__beat.is-strong {
  background: var(--gold);
  box-shadow: 0 0 12px rgba(230, 201, 165, 0.5);
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.score-table th {
  text-align: left;
  font-weight: 400;
  color: rgba(253, 248, 244, 0.55);
  padding: 7px 0;
}

.score-table td {
  text-align: right;
  color: var(--ivory);
  font-variant-numeric: tabular-nums;
  padding: 7px 0;
}

.score-table tr + tr {
  border-top: 1px solid rgba(253, 248, 244, 0.07);
}

/* ----------------------------- Настройки ------------------------------ */

.settings {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.setting {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.setting--row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.setting__label {
  display: grid;
  gap: 4px;
}

.setting__label b {
  font-weight: 500;
  font-size: 15px;
}

.setting__label span {
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(253, 248, 244, 0.45);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  justify-self: start;
}

.segmented button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mist);
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.segmented button.is-on {
  background: var(--blush);
  color: #3d1521;
}

.segmented button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.slider {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 14px;
  align-items: center;
}

.slider input[type="range"] {
  width: 100%;
  accent-color: var(--blush);
  height: 22px;
}

.slider output {
  font-size: 13px;
  text-align: right;
  color: var(--ivory);
  font-variant-numeric: tabular-nums;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.switch__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(253, 248, 244, 0.14);
  transition: background 0.2s var(--ease);
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ivory);
  transition: transform 0.2s var(--ease);
}

.switch input:checked + .switch__track {
  background: var(--blush-deep);
}

.switch input:checked + .switch__track::after {
  transform: translateX(20px);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* -------------------------------- HUD --------------------------------- */

.hud {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 6;
  padding: clamp(18px, 2.2vw, 26px) clamp(16px, 3.2vw, 44px) 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(6, 4, 10, 0.62), transparent);
}

.hud__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 18px;
}

.hud__left {
  display: flex;
  align-items: flex-end;
  gap: clamp(14px, 2.4vw, 30px);
}

.score-block {
  display: grid;
  gap: 2px;
}

.score-block__value {
  font-family: var(--display);
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}

.score-block__label {
  font-size: 12.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(253, 248, 244, 0.4);
}

.combo-block {
  display: grid;
  gap: 1px;
  padding-bottom: 2px;
}

.combo-block__mult {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(24px, 2.6vw, 31px);
  color: var(--blush);
  line-height: 1;
}

.combo-block__count {
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(253, 248, 244, 0.4);
}

.combo-block.is-pulse .combo-block__mult {
  animation: comboPulse 0.35s var(--ease);
}

@keyframes comboPulse {
  0% {
    transform: scale(1.32);
    color: #fff;
  }
  100% {
    transform: scale(1);
    color: var(--blush);
  }
}

.hud__center {
  text-align: center;
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.beat-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
  height: 10px;
}

.beat-dots span {
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: rgba(253, 248, 244, 0.18);
  transition: background 0.12s linear, transform 0.12s linear;
}

.beat-dots span.is-on {
  background: var(--blush);
  transform: scaleY(2.4);
}

.beat-dots span.is-on.is-strong {
  background: var(--gold);
}

.track {
  font-size: clamp(16px, 1.38vw, 21px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(253, 248, 244, 0.42);
}

.hud__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 1.8vw, 20px);
}

.lives {
  display: flex;
  gap: 5px;
}

.lives svg {
  width: 22px;
  height: 22px;
  display: block;
  filter: drop-shadow(0 0 8px rgba(255, 154, 180, 0.45));
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.lives svg.is-off {
  opacity: 0.22;
  filter: none;
  transform: scale(0.86);
}

.charge {
  display: flex;
  gap: 5px;
  align-items: center;
  padding-bottom: 4px;
}

.charge span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 246, 214, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 214, 0.18);
  transition: background 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}

.charge span.is-on {
  background: #ffe6a8;
  box-shadow: 0 0 10px rgba(255, 230, 168, 0.9);
  transform: scale(1.15);
}

.forte {
  justify-self: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffe0a0, #fff2c4);
  color: #4a2f12;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(255, 230, 168, 0.55);
  font-variant-numeric: tabular-nums;
}

.forte[hidden] {
  display: none !important;
}

/* Призы: броня и призрак в HUD. */
.buffs {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-height: 18px;
}

.buff {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.buff[hidden] {
  display: none !important;
}

.buff b {
  font-variant-numeric: tabular-nums;
}

.buff--armor {
  color: #1d2a3c;
  background: linear-gradient(90deg, #dfeaff, #f7fbff);
  box-shadow: 0 0 16px rgba(190, 220, 255, 0.6);
}

.buff--ghost {
  color: #08202c;
  background: linear-gradient(90deg, #bfe9ff, #e8fbff);
  box-shadow: 0 0 16px rgba(140, 220, 255, 0.55);
}

.buff.is-pulse {
  animation: buffPulse 0.45s var(--ease);
}

@keyframes buffPulse {
  0% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

.perfect-count {
  font-size: 13.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(253, 248, 244, 0.44);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pause-btn {
  pointer-events: auto;
  appearance: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(10, 7, 16, 0.5);
  display: grid;
  grid-auto-flow: column;
  place-content: center;
  gap: 3px;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}

.pause-btn span {
  width: 3px;
  height: 11px;
  background: var(--ivory);
  border-radius: 1px;
}

.pause-btn:hover {
  border-color: rgba(255, 194, 207, 0.55);
  background: rgba(255, 194, 207, 0.1);
}

.hud__bar {
  margin-top: 14px;
  height: 3px;
  background: rgba(253, 248, 244, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.hud__bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 194, 207, 0.7), var(--gold));
  transition: width 0.25s linear;
}

/* Босс финала: плашка под HUD. */
.boss {
  position: fixed;
  left: 50%;
  bottom: clamp(46px, 8vh, 86px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 14px);
  padding: 9px clamp(12px, 1.6vw, 18px);
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 150, 0.42);
  background: rgba(24, 10, 18, 0.74);
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45), 0 0 26px rgba(255, 190, 120, 0.12);
  pointer-events: none;
  z-index: 7;
}

.boss[hidden] {
  display: none !important;
}

.boss__tag {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 230, 176, 0.6);
}

.boss__name {
  font-family: var(--display);
  font-size: clamp(13px, 1.2vw, 16px);
  color: #fff2d8;
  white-space: nowrap;
}

.boss__bar {
  width: clamp(84px, 15vw, 190px);
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 246, 214, 0.16);
  overflow: hidden;
}

.boss__bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff9f57, #ffe6a8);
  transition: width 0.2s linear;
}

.boss__cue {
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ffe6a8;
  white-space: nowrap;
  animation: bossCue 1.1s var(--ease) infinite;
}

@keyframes bossCue {
  50% { opacity: 0.4; }
}

.hud.is-damaged {
  animation: hudHit 0.34s var(--ease);
}

@keyframes hudHit {
  0% {
    background-color: rgba(255, 60, 90, 0.18);
  }
  100% {
    background-color: transparent;
  }
}

/* ------------------------------ Оверлеи ------------------------------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 4, 10, 0.82);
  backdrop-filter: blur(10px) saturate(0.9);
  -webkit-backdrop-filter: blur(10px) saturate(0.9);
  animation: fadeIn 0.22s var(--ease);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dialog {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  display: grid;
  gap: 18px;
  padding: clamp(24px, 3.4vw, 40px);
  background: linear-gradient(160deg, rgba(32, 20, 40, 0.96), rgba(16, 10, 23, 0.98));
  border: 1px solid rgba(253, 248, 244, 0.12);
  border-radius: 22px;
  box-shadow: 0 50px 120px rgba(0, 0, 0, 0.6);
  animation: popIn 0.3s var(--ease);
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dialog--small {
  width: min(440px, 100%);
}

.dialog__title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
}

.dialog__lead {
  color: rgba(253, 248, 244, 0.58);
  font-size: 14px;
  line-height: 1.6;
  margin-top: -6px;
}

.dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.dialog--result {
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: start;
  gap: clamp(20px, 3vw, 36px);
}

.grade {
  font-family: var(--display);
  font-size: clamp(96px, 14vw, 150px);
  line-height: 0.8;
  color: var(--gold);
  text-align: center;
  text-shadow: 0 0 60px rgba(230, 201, 165, 0.35);
  padding-top: 6px;
}

.grade[data-grade="S"] {
  color: #ffe6b8;
}

.grade[data-grade="F"] {
  color: rgba(255, 140, 160, 0.85);
}

.result-copy {
  display: grid;
  gap: 14px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-stats dt {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(253, 248, 244, 0.4);
  margin-bottom: 4px;
}

.result-stats dd {
  font-family: var(--display);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.unlock {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(230, 201, 165, 0.4);
  border-radius: 12px;
  background: rgba(230, 201, 165, 0.08);
}

.unlock b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 18px;
  color: var(--gold);
}

.unlock span {
  font-size: 13.5px;
  color: rgba(253, 248, 244, 0.6);
}

.unlock[hidden] {
  display: none !important;
}

/* ------------------------------- Тост --------------------------------- */

.toast {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 12px);
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  background: var(--paper);
  color: #3f2a31;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast__tag {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #a4808a;
  white-space: nowrap;
}

.toast__text {
  font-size: 13px;
  line-height: 1.4;
}

/* --------------------------- Мобильная сцена -------------------------- */

.rotate-hint {
  display: none;
}

@media (max-width: 980px) {
  .title-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }

  .plate {
    width: min(78vw, 360px);
    justify-self: start;
    transform: rotate(-1deg);
  }

  .screen--title {
    background: linear-gradient(to bottom, rgba(7, 4, 11, 0.94), rgba(7, 4, 11, 0.86));
  }

  .dialog--result {
    grid-template-columns: minmax(0, 1fr);
  }

  .grade {
    text-align: left;
    font-size: 96px;
  }

  .hud__row {
    grid-template-columns: 1fr auto;
  }

  .hud__center {
    display: none;
  }
}

@media (max-width: 640px) {
  .screen {
    padding: 16px;
    align-content: start;
  }

  .sheet {
    padding-top: 20px;
  }

  .level {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .level__meta {
    grid-column: 2;
    justify-items: start;
    text-align: left;
    grid-auto-flow: column;
    gap: 12px;
    align-items: center;
  }

  .result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-line {
    flex-wrap: wrap;
    gap: 18px;
  }

  .hud {
    padding-top: 10px;
  }

  .perfect-count {
    display: none;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .plate {
    display: none;
  }

  .title-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .title-copy {
    gap: 12px;
  }

  .logo {
    font-size: clamp(40px, 11vh, 72px);
  }

  .hint-key,
  .progress-line {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boss__cue {
    animation: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  .screen {
    transform: none;
  }
}

.reduce-motion .screen,
.reduce-motion .dialog,
.reduce-motion .toast,
.reduce-motion .btn {
  transition-duration: 0.001ms;
  animation: none;
}


/* ===================== Крупные подписи и призы ===================== */

/* Подпись трека сверху раунда — главная строка, её видно издалека. */
.track {
  color: rgba(253, 248, 244, 0.74);
  letter-spacing: 0.14em;
  font-weight: 600;
  text-shadow: 0 0 18px rgba(255, 220, 180, 0.25);
}

.buff {
  padding: 5px 13px;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.buff--armor {
  color: #3a2200;
  border: 1px solid rgba(255, 236, 180, 0.95);
  background: linear-gradient(90deg, #ffe3a4, #fffaea);
  box-shadow:
    0 0 22px rgba(255, 206, 110, 0.85),
    0 0 46px rgba(255, 176, 60, 0.35);
}

.buff--ghost {
  color: #04202c;
  border: 1px solid rgba(200, 246, 255, 0.9);
  background: linear-gradient(90deg, #b8ecff, #ecfdff);
  box-shadow:
    0 0 22px rgba(140, 226, 255, 0.7),
    0 0 40px rgba(90, 190, 255, 0.25);
}

/* Крупное слово приза по центру: «БРОНЯ» / «ПРИЗРАК». */
.prize-pop {
  position: fixed;
  left: 50%;
  top: 27%;
  z-index: 45;
  display: grid;
  justify-items: center;
  gap: 8px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  text-align: center;
  padding: 0 16px;
}

.prize-pop[hidden] {
  display: none !important;
}

.prize-pop__word {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(52px, 7.2vw, 108px);
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prize-pop__note {
  font-size: clamp(13px, 1.35vw, 18px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
}

.prize-pop--armor .prize-pop__word {
  color: #fff8e2;
  text-shadow:
    0 0 24px rgba(255, 216, 128, 0.95),
    0 0 58px rgba(255, 178, 60, 0.7),
    0 3px 0 rgba(110, 60, 0, 0.35);
}

.prize-pop--armor .prize-pop__note {
  color: #ffe7b0;
}

.prize-pop--ghost .prize-pop__word {
  color: #ecfeff;
  text-shadow:
    0 0 24px rgba(160, 238, 255, 0.9),
    0 0 58px rgba(80, 190, 255, 0.6),
    0 3px 0 rgba(10, 60, 90, 0.35);
}

.prize-pop--ghost .prize-pop__note {
  color: #c8f4ff;
}

.prize-pop.is-on .prize-pop__word {
  animation: prizeWord 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.prize-pop.is-on .prize-pop__note {
  animation: prizeNote 0.5s 0.08s ease-out both;
}

@keyframes prizeWord {
  0% { opacity: 0; transform: scale(0.55) translateY(12px); }
  60% { opacity: 1; transform: scale(1.08) translateY(0); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes prizeNote {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: none; }
}

/* Автопереход после урока. */
.result-auto {
  margin: 2px 0 0;
  font-size: 13.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold);
}

.result-auto[hidden] {
  display: none !important;
}


/* ======================= Запуск «Соте» из зала ====================== */

.is-embed .screen {
  display: none !important;
}

.embed-launch {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 42px);
  background:
    radial-gradient(80% 70% at 50% 26%, rgba(46, 16, 36, 0.96), rgba(5, 2, 8, 0.995));
}

.embed-launch[hidden] {
  display: none !important;
}

.embed-launch__card {
  width: min(560px, 100%);
  display: grid;
  gap: 12px;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(255, 214, 150, 0.12), transparent 58%),
    rgba(20, 13, 28, 0.92);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55);
  text-align: left;
}

.embed-launch__title {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 400;
  line-height: 1.02;
  color: var(--ivory);
}

.embed-launch__sub {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.embed-launch__note {
  margin: 4px 0 8px;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(253, 248, 244, 0.66);
}

.embed-launch__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
