/* =========================================================================
   ui.css — компоненты интерфейса: кнопки, панели, карта уровней, HUD,
   бустеры, квесты, достижения, модальные окна, тосты и туториал.
   ========================================================================= */

/* ------------------------------------------------------------- кнопки */

.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(56, 36, 112, 0.78), rgba(28, 17, 62, 0.86));
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  transition: transform 0.16s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
  user-select: none;
  -webkit-user-select: none;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--panel-border-strong);
  box-shadow: var(--shadow-soft), var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.btn__icon {
  font-size: 1.18em;
  filter: drop-shadow(0 0 8px rgba(255, 210, 122, 0.45));
}

.btn--primary {
  background: linear-gradient(180deg, rgba(150, 104, 255, 0.92), rgba(84, 46, 178, 0.95));
  border-color: rgba(226, 196, 255, 0.5);
  color: #fff;
}
.btn--primary:hover:not(:disabled) {
  box-shadow: 0 12px 40px rgba(4, 2, 14, 0.55), 0 0 34px rgba(169, 124, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn--big {
  padding: 17px 24px;
  font-size: 18px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.btn--gold {
  background: linear-gradient(180deg, rgba(255, 214, 132, 0.95), rgba(196, 132, 32, 0.95));
  border-color: rgba(255, 244, 214, 0.6);
  color: #2a1600;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn--ghost {
  background: rgba(24, 14, 52, 0.55);
}

.btn--danger {
  background: linear-gradient(180deg, rgba(180, 52, 74, 0.85), rgba(110, 24, 46, 0.9));
  border-color: rgba(255, 150, 160, 0.4);
}

.btn--sm {
  padding: 9px 15px;
  font-size: 13px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}
.icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--panel-border-strong);
  background: rgba(48, 30, 96, 0.7);
}
.icon-btn:active {
  transform: scale(0.94);
}

.badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff8a5c, #d8322f);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 0 14px rgba(255, 110, 80, 0.6);
  animation: pulseGlow 2.4s ease-in-out infinite;
}

/* ------------------------------------------------------------- панели */

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 15px;
  margin-top: 12px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
}

.panel--about h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  color: var(--gold);
  letter-spacing: 0.07em;
  font-size: 16px;
}

.rules {
  margin: 0;
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 13.6px;
  line-height: 1.65;
}
.rules b {
  color: var(--text);
}

.hint-text {
  margin: 0 0 12px;
  color: var(--text-faint);
  font-size: 12.6px;
  line-height: 1.5;
}

/* ------------------------------------------------------------ профиль */

.profile {
  display: flex;
  gap: 14px;
  align-items: center;
}

.profile__avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: linear-gradient(160deg, rgba(150, 104, 255, 0.4), rgba(40, 24, 88, 0.7));
  border: 1px solid var(--panel-border-strong);
  box-shadow: inset 0 0 22px rgba(169, 124, 255, 0.3);
}

.profile__info {
  flex: 1;
  min-width: 0;
}

.profile__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 7px;
}

.profile__level {
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  font-size: 15px;
}
.profile__level b {
  color: var(--gold-bright);
}

.profile__xp {
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

.bar {
  height: 9px;
  border-radius: 999px;
  background: rgba(10, 6, 26, 0.7);
  overflow: hidden;
  border: 1px solid rgba(168, 138, 255, 0.18);
}

.bar__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--violet-bright), var(--gold));
  box-shadow: 0 0 14px rgba(169, 124, 255, 0.6);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.profile__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 9px;
  font-size: 12.6px;
  color: var(--text-dim);
}
.profile__stats b {
  color: var(--text);
}

/* -------------------------------------------------------------- квесты */

.quest-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quest {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
  transition: border-color 0.25s ease, transform 0.2s ease;
}
.quest.is-done {
  border-color: rgba(255, 210, 122, 0.55);
  box-shadow: 0 0 22px rgba(255, 210, 122, 0.16);
}
.quest.is-claimed {
  opacity: 0.55;
}

.quest__icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 21px;
  background: rgba(12, 7, 30, 0.65);
  border: 1px solid var(--panel-border);
}

.quest__body {
  flex: 1;
  min-width: 0;
}

.quest__text {
  font-size: 13.8px;
  margin-bottom: 7px;
  line-height: 1.3;
}

.quest__meter {
  display: flex;
  align-items: center;
  gap: 9px;
}
.quest__meter .bar {
  flex: 1;
  height: 7px;
}
.quest__count {
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.quest__reward {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
}

/* ---------------------------------------------------------------- лавка */

.shop {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.shop__item {
  padding: 13px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  text-align: center;
  backdrop-filter: blur(8px);
}
.shop__icon {
  font-size: 27px;
  filter: drop-shadow(0 0 10px rgba(255, 210, 122, 0.4));
}
.shop__name {
  font-size: 13.5px;
  font-weight: 700;
  margin: 5px 0 2px;
}
.shop__desc {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-bottom: 9px;
  min-height: 2.4em;
  line-height: 1.25;
}
.shop__own {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 7px;
}

/* ---------------------------------------------------------- достижения */

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.ach {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 11px;
  border-radius: var(--radius-sm);
  background: rgba(18, 11, 40, 0.55);
  border: 1px solid rgba(168, 138, 255, 0.14);
  opacity: 0.55;
  filter: grayscale(0.7);
  transition: opacity 0.3s ease, filter 0.3s ease, border-color 0.3s ease;
}
.ach.is-done {
  opacity: 1;
  filter: none;
  border-color: rgba(255, 210, 122, 0.45);
  box-shadow: 0 0 18px rgba(255, 210, 122, 0.14);
}
.ach__icon {
  font-size: 24px;
  flex: 0 0 auto;
}
.ach__name {
  font-size: 12.8px;
  font-weight: 700;
  line-height: 1.2;
}
.ach__desc {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.25;
  margin-top: 2px;
}

/* --------------------------------------------------------- карта уровней */

.map-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--violet-dim) transparent;
}
.map-scroll::-webkit-scrollbar {
  width: 8px;
}
.map-scroll::-webkit-scrollbar-thumb {
  background: var(--violet-dim);
  border-radius: 8px;
}

.map-inner {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 20px 0 60px;
  /* мягкая «колонна» под тропой, чтобы карта не тонула в пустоте на десктопе */
  background: linear-gradient(
    180deg,
    rgba(38, 24, 82, 0) 0%,
    rgba(38, 24, 82, 0.34) 6%,
    rgba(30, 18, 66, 0.34) 94%,
    rgba(30, 18, 66, 0) 100%
  );
  box-shadow: inset 1px 0 0 rgba(168, 138, 255, 0.12), inset -1px 0 0 rgba(168, 138, 255, 0.12);
}

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

.map-path .trail {
  fill: none;
  stroke: rgba(168, 138, 255, 0.18);
  stroke-width: 16;
  stroke-linecap: round;
  stroke-dasharray: 2 26;
}
.map-path .trail-done {
  fill: none;
  stroke: rgba(255, 210, 122, 0.42);
  stroke-width: 16;
  stroke-linecap: round;
  stroke-dasharray: 2 26;
  filter: drop-shadow(0 0 8px rgba(255, 210, 122, 0.5));
}

.map-nodes {
  position: relative;
}

.node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-family: inherit;
}

.node__disc {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  background: radial-gradient(circle at 32% 28%, rgba(126, 86, 224, 0.95), rgba(34, 20, 76, 0.95));
  border: 2px solid rgba(200, 168, 255, 0.42);
  box-shadow: 0 8px 24px rgba(4, 2, 14, 0.6), inset 0 0 18px rgba(169, 124, 255, 0.35);
  transition: transform 0.18s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.node:hover .node__disc {
  transform: scale(1.09);
  box-shadow: 0 10px 30px rgba(4, 2, 14, 0.6), 0 0 26px rgba(169, 124, 255, 0.6), inset 0 0 18px rgba(169, 124, 255, 0.4);
}

.node.is-locked {
  cursor: not-allowed;
}
.node.is-locked .node__disc {
  background: radial-gradient(circle at 32% 28%, rgba(60, 52, 90, 0.85), rgba(20, 14, 40, 0.9));
  border-color: rgba(120, 110, 160, 0.28);
  color: var(--text-faint);
  box-shadow: 0 6px 18px rgba(4, 2, 14, 0.5);
}
.node.is-locked:hover .node__disc {
  transform: none;
}

.node.is-current .node__disc {
  border-color: var(--gold-bright);
  background: radial-gradient(circle at 32% 28%, rgba(255, 210, 122, 0.95), rgba(150, 84, 20, 0.95));
  color: #2a1600;
  animation: pulseGlow 2.2s ease-in-out infinite;
}

.node.is-cleared .node__disc {
  border-color: rgba(255, 210, 122, 0.6);
}

.node__stars {
  display: flex;
  gap: 2px;
  font-size: 11px;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(255, 210, 122, 0.55));
}
.node__stars .off {
  opacity: 0.22;
  filter: grayscale(1);
}

.node__name {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* ------------------------------------------------------------------ HUD */

.screen--game {
  padding-inline: 10px;
}

.hud {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 10px;
  flex: 0 0 auto;
}

.hud__goals {
  flex: 1;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}

.goal {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  font-size: 12.5px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  white-space: nowrap;
}
.goal.is-done {
  border-color: rgba(166, 245, 127, 0.6);
  box-shadow: 0 0 16px rgba(166, 245, 127, 0.22);
  color: var(--leaf);
}
.goal__icon {
  font-size: 14px;
}

/* Иконка самоцвета: та же форма, что и на поле — цель читается с одного взгляда */
.gem-icon {
  display: block;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 3px rgba(4, 2, 14, 0.7));
}

.modal__goal .gem-icon {
  filter: drop-shadow(0 2px 6px rgba(4, 2, 14, 0.8));
}

.hud__right {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.hud__score,
.hud__moves {
  min-width: 74px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  text-align: center;
  backdrop-filter: blur(8px);
}

.hud__label {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.hud__score b,
.hud__moves b {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.hud__moves.is-low {
  border-color: rgba(255, 120, 100, 0.65);
  box-shadow: 0 0 18px rgba(255, 106, 77, 0.3);
}
.hud__moves.is-low b {
  color: #ff8a5c;
}

/* ------------------------------------------------------------- поле игры */

.board-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: block;
}

#board {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* -------------------------------------------------------------- бустеры */

.boosters {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px 4px 4px;
  flex: 0 0 auto;
}

.booster {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 82px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.25s ease;
  font-family: inherit;
}
.booster:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--panel-border-strong);
  box-shadow: var(--shadow-glow);
}
.booster:active:not(:disabled) {
  transform: scale(0.95);
}
.booster:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.booster.is-armed {
  border-color: var(--gold-bright);
  box-shadow: 0 0 24px rgba(255, 210, 122, 0.5);
}
.booster__icon {
  font-size: 22px;
  filter: drop-shadow(0 0 8px rgba(255, 210, 122, 0.4));
}
.booster__name {
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.booster__count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a97cff, #5a2fb0);
  border: 1px solid rgba(226, 196, 255, 0.55);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0 5px;
}
.booster__count.is-buy {
  background: linear-gradient(180deg, #ffd27a, #b8802a);
  color: #2a1600;
  font-size: 10px;
}

/* ------------------------------------------------------------- туториал */

.tutorial {
  flex: 0 0 auto;
  width: min(460px, 100%);
  margin: 0 auto 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(52, 34, 104, 0.94), rgba(26, 15, 58, 0.96));
  border: 1px solid var(--panel-border-strong);
  box-shadow: var(--shadow-soft), 0 0 30px rgba(126, 86, 224, 0.35);
  font-size: 13.4px;
  line-height: 1.4;
  text-align: center;
  animation: popIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  cursor: pointer;
}
.tutorial::after {
  content: 'нажми, чтобы продолжить';
  display: block;
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ------------------------------------------------------------- модалки */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 3, 18, 0.72);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.25s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  position: relative;
  width: min(430px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(44, 28, 92, 0.96), rgba(18, 10, 42, 0.98));
  border: 1px solid var(--panel-border-strong);
  box-shadow: 0 30px 80px rgba(2, 1, 8, 0.75), 0 0 60px rgba(126, 86, 224, 0.28);
  animation: popIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
  text-align: center;
  scrollbar-width: thin;
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 25px;
  margin: 0 0 4px;
  letter-spacing: 0.07em;
  color: var(--gold-bright);
  text-shadow: 0 0 22px rgba(255, 210, 122, 0.3);
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0 0 12px;
  color: var(--text);
  letter-spacing: 0.05em;
}

.modal p {
  margin: 0 0 14px;
  color: var(--text-dim);
  font-size: 13.6px;
  line-height: 1.5;
}

.modal__actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 16px;
}

.modal__actions--row {
  flex-direction: row;
}
.modal__actions--row .btn {
  flex: 1;
}

.modal__goals {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
  text-align: left;
}

.modal__goal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: rgba(12, 7, 30, 0.55);
  border: 1px solid var(--panel-border);
  font-size: 13.4px;
}
.modal__goal.is-done {
  border-color: rgba(166, 245, 127, 0.5);
  color: var(--leaf);
}

.stars-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 6px 0 14px;
  font-size: 46px;
  line-height: 1;
}
.stars-row span {
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255, 210, 122, 0.85), 0 2px 0 rgba(140, 82, 12, 0.7);
  filter: drop-shadow(0 0 14px rgba(255, 210, 122, 0.7));
  animation: starPop 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.stars-row span:nth-child(2) {
  animation-delay: 0.16s;
  font-size: 1.22em;
  margin-top: -8px;
}
.stars-row span:nth-child(3) {
  animation-delay: 0.32s;
}
.stars-row .off {
  opacity: 0.2;
  filter: grayscale(1);
}

.score-big {
  font-family: var(--font-display);
  font-size: 38px;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 0 28px rgba(255, 210, 122, 0.5);
  font-variant-numeric: tabular-nums;
}

.reward-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255, 210, 122, 0.12);
  border: 1px solid rgba(255, 210, 122, 0.35);
  font-weight: 700;
  color: var(--gold-bright);
}

.pick-boosters {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin: 14px 0 4px;
}

/* --------------------------------------------------------------- тосты */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-b) + 90px);
  transform: translateX(-50%) translateY(14px);
  z-index: 30;
  padding: 11px 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(52, 34, 104, 0.96), rgba(26, 15, 58, 0.96));
  border: 1px solid var(--panel-border-strong);
  box-shadow: var(--shadow-soft), 0 0 26px rgba(126, 86, 224, 0.35);
  font-size: 13.4px;
  font-weight: 700;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* -------------------------------------------------------- переключатели */

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 2px;
  font-size: 14.5px;
  cursor: pointer;
}
.switch-row + .switch-row {
  border-top: 1px solid rgba(168, 138, 255, 0.14);
}
.switch-row__icon {
  margin-right: 8px;
}

.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 50px;
  height: 28px;
  border-radius: 999px;
  background: rgba(10, 6, 26, 0.8);
  border: 1px solid var(--panel-border);
  position: relative;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
  flex: 0 0 auto;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #cdbdff, #7a5cd0);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease;
}
.switch:checked {
  background: rgba(126, 86, 224, 0.5);
  border-color: var(--panel-border-strong);
}
.switch:checked::after {
  transform: translateX(22px);
  background: linear-gradient(180deg, #fff2cf, var(--gold));
}

/* ------------------------------------------------------------- адаптив */

@media (max-width: 560px) {
  .booster {
    width: 74px;
  }
  .node__disc {
    width: 50px;
    height: 50px;
    font-size: 18px;
  }
  .node__name {
    max-width: 96px;
    font-size: 10px;
  }
  .hud__score,
  .hud__moves {
    min-width: 62px;
    padding: 4px 9px;
  }
  .hud__score b,
  .hud__moves b {
    font-size: 17px;
  }
  .goal {
    padding: 5px 9px;
    font-size: 11.5px;
  }
  .modal {
    padding: 18px 16px;
  }
  .stars-row {
    font-size: 38px;
  }
  .score-big {
    font-size: 32px;
  }
}

@media (max-width: 380px) {
  .booster {
    width: 66px;
    padding: 6px 4px;
  }
  .booster__icon {
    font-size: 19px;
  }
  .boosters {
    gap: 7px;
  }
  .hud {
    gap: 6px;
  }
  .goal {
    font-size: 11px;
    padding: 4px 8px;
    gap: 5px;
  }
}

/* Широкий экран: контент не растягиваем на всю ширину — читать проще колонкой */
@media (min-width: 900px) {
  .screen--game {
    padding-inline: 24px;
  }
  .hud,
  .boosters,
  .board-wrap,
  .tutorial {
    width: min(760px, 100%);
    margin-inline: auto;
  }
  .topbar,
  .scroll-body > *,
  .scroll-body {
    max-width: 860px;
    margin-inline: auto;
  }
  .map-inner {
    max-width: 720px;
  }
}

/* Ландшафтная ориентация на телефоне: компактнее по вертикали */
@media (max-height: 520px) and (orientation: landscape) {
  .hud {
    padding-bottom: 5px;
  }
  .boosters {
    padding-top: 5px;
  }
  .booster {
    flex-direction: row;
    width: auto;
    gap: 7px;
    padding: 6px 11px;
  }
  .booster__name {
    display: none;
  }
  .title-sigil {
    display: none;
  }
  .screen--title {
    gap: 10px;
  }
}
