@font-face {
  font-family: 'DaysOne';
  src: url('../assets/fonts/DaysOne-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Minecraft';
  src: url('../assets/fonts/Minecraft.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-primary: #b0b0b0;
  --color-bg: #ffffff;
  --color-accent: #5a8f00;
  --font-main: 'DaysOne', sans-serif;
}

*, *::before, *::after {
  cursor: none !important;
}

/* Если сайт посчитал устройство сенсорным (html.is-touch — см. main.js,
   IS_TOUCH), кастомный курсор вообще не создаётся, а правило выше
   всё равно прятало системный — в итоге не было видно НИКАКОГО курсора.
   На части десктопов с 2K/4K экраном это условие иногда матчится
   ошибочно (например, в эмуляции или при нестандартном вводе), поэтому
   на всякий случай возвращаем обычный системный курсор в этом случае. */
html.is-touch, html.is-touch *, html.is-touch *::before, html.is-touch *::after {
  cursor: auto !important;
}

#custom-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 999999;
  width: 62px;
  height: 62px;
  top: 0;
  left: 0;
  will-change: transform;
}

/* На 2K/4K всё вокруг (плеер, диски, бумажки) сильно увеличено, и
   курсор фиксированных 62px на этом фоне почти незаметен — увеличиваем
   и его, отдельно для каждого разрешения. Классы res-2k/res-4k
   выставляются в main.js по реальному физическому разрешению экрана
   (screen.width * devicePixelRatio), а не по window.innerWidth — иначе
   масштабирование ОС на 4K-мониторах (150%/200%, обычное дело) делает
   innerWidth меньше 3840, и min-width никогда не срабатывает. */
html.res-2k #custom-cursor {
  width: 85px;
  height: 85px;
}

html.res-4k #custom-cursor {
  width: 100px;
  height: 100px;
}

#custom-cursor img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#disc-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: contain;
  transform: translate(-20%, -50%) scale(1) rotate(-8deg);
  will-change: left, top;
  filter: drop-shadow(0 8px 22px rgba(0,0,0,0.42));
  transition: filter 0.15s ease, transform 0.15s ease;
}

#disc-cursor.over-drop {
  transform: translate(-20%, -50%) scale(1.15) rotate(0deg);
  filter: drop-shadow(0 0 16px rgba(245,200,0,0.85)) drop-shadow(0 8px 22px rgba(0,0,0,0.42));
}

#player-wrap.drop-target {
  filter: drop-shadow(0 0 14px rgba(245,200,0,0.55));
  transition: filter 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
img, video { max-width: 100%; display: block; }

img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
* {
  user-select: none;
  -webkit-user-select: none;
}
p, h1, h2, h3 {
  user-select: text;
  -webkit-user-select: text;
}

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-primary);
  height: 100vh;
  height: 100dvh;
  height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  height: calc(var(--vh, 1vh) * 100);
}

#desktop {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ТЕЛЕФОН (landscape, короткая сторона < 600px — как и другие
   телефонные правила в этом файле). На телефонах адресная строка
   браузера отъедает часть экрана и скрывается только когда страницу
   реально можно проскроллить — а раньше body/#app были ровно по высоте
   вьюпорта и overflow:hidden, поэтому скроллить было нечего, и адресная
   строка никогда не пряталась. Добавляем небольшой запас высоты снизу
   (просто обои — визуально всё равно перекрыт фиксированным
   #ticker-screen, который сам подстроится под увеличившийся вьюпорт),
   чтобы можно было чуть-чуть проскроллить вниз и спрятать адресную строку. */
@media (pointer: coarse) and (max-height: 599px) {
  body {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: calc(var(--vh, 1vh) * 100);
    overflow-y: auto;
    overflow-x: hidden;
  }

  body::after {
    content: '';
    display: block;
    height: 90px;
    background: #ffffff url('../assets/images/wallpaper.webp') center center / cover no-repeat;
  }
}

#splash {
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
}

#splash.exit {
  animation: splashExit 1.4s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

@keyframes splashExit {
  0%   { opacity: 1; }
  100% { opacity: 0; pointer-events: none; }
}

.splash-logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DaysOne', sans-serif;
  font-size: clamp(64px, 12vw, 140px);
  letter-spacing: -0.02em;
  color: #b0b0b0;
  white-space: nowrap;
  z-index: 2;
}

.splash-logo-inner {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.splash-o {
  display: inline-block;
  transform-origin: center center;
  will-change: transform;
}

.splash-rest-wrap {
  display: inline-block;
  overflow: hidden;
  width: 0;
  vertical-align: middle;
}

.splash-rest {
  display: inline-block;
  white-space: nowrap;
  transform: translateX(-20px);
  opacity: 0;
}

.splash-nicks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.splash-nick {
  position: absolute;
  font-family: 'DaysOne', sans-serif;
  font-size: clamp(20px, 3vw, 42px);
  color: #c0c0c0;
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: lowercase;

  opacity: 0;
  will-change: transform, opacity;
}

#ticker-screen {
  position: fixed;
  inset: 0;
  background: #ffffff url('../assets/images/wallpaper.webp') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  z-index: 9998;
  overflow: clip;
  visibility: hidden;
}

.ticker-row {
  display: none !important;
}

#ticker-screen.visible {
  visibility: visible;
  animation: tickerScreenIn 1.4s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

@keyframes tickerScreenIn {
  0%   { clip-path: inset(100% 0 0 0); }
  100% { clip-path: inset(0% 0 0 0); }
}

.ticker-row.row-in {
  animation: rowSlideIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--row-delay, 0s);
}

@keyframes rowSlideIn {
  0%   { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}

.ticker-row:nth-child(odd)  .ticker-track { animation: tickerLeft  130s linear infinite; }
.ticker-row:nth-child(even) .ticker-track { animation: tickerRight 160s linear infinite; }

.ticker-track {
  display: flex;
  align-items: center;
  height: 100%;
  will-change: transform;
  flex-shrink: 0;
}

@keyframes tickerLeft  { from { transform: translateX(0);    } to { transform: translateX(-50%); } }
@keyframes tickerRight { from { transform: translateX(-50%); } to { transform: translateX(0);    } }

.ticker-word {
  font-family: 'DaysOne', sans-serif;
  font-size: calc(12.5vh * 1.2);
  letter-spacing: 0.01em;
  padding: 0 2.5vw;
  text-transform: uppercase;
  line-height: 1;
  flex-shrink: 0;
  color: #b0b0b0;
}

.ticker-sep { display: none; }

#header {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

#desk-scene {
  position: absolute;
  bottom: 0; right: 0;
  width: 100%;
  pointer-events: none;
  z-index: 10;

  isolation: isolate;
}

.desk-item {
  position: absolute;
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
}

.desk-item--dragging,
.desk-item--dragging:hover {
  transition: none !important;
  filter: drop-shadow(0 26px 22px rgba(0,0,0,0.45)) !important;
  z-index: 999;
}

.desk-item--landing {
  transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1),
              filter 0.42s ease,
              opacity 0.3s ease;
}

.desk-item--falling {
  transition: transform 1.6s cubic-bezier(0.37, 0, 0.63, 1),
              opacity 1.6s ease-in;
}

.desk-item--returning {
  transition: left 0.48s cubic-bezier(0.34, 1.56, 0.64, 1),
              top  0.48s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mark-peek {
  position: absolute;
  width: clamp(150px, 22vw, 320px);
  height: auto;
  pointer-events: none;
  z-index: -1;
  transform: translateX(-50%) translateY(0%);
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.mark-peek.mark-peek--in {
  transform: translateX(-50%) translateY(-72%);
}

.mark-peek.mark-peek--out {
  transform: translateX(-50%) translateY(0%);
  transition: transform 0.35s cubic-bezier(0.55, 0, 1, 0.45);
}

#desk-table {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: -3%;
  margin-left: auto;

  position: relative;
  z-index: 5;
}

#player-wrap {
  position: absolute;
  bottom: 5%;
  right: 2%;
  width: 36vw;
  height: 36vw;
  min-width: 300px;
  min-height: 300px;
  max-width: 520px;
  max-height: 520px;
  pointer-events: none;
  z-index: 6;
}

/* ТЕЛЕФОН (landscape — портрет блокируется rotate-gate).
   Смотрим на ВЫСОТУ вьюпорта в landscape — это и есть короткая
   физическая сторона устройства. Ширина ненадёжна: у многих телефонов
   в landscape она больше 767px, и раньше они ошибочно попадали
   в настройки планшета. */
@media (pointer: coarse) and (max-height: 599px) {
  #player-wrap {
    width: 32vw;
    height: 32vw;
    min-width: 260px;
    min-height: 260px;
    max-width: 380px;
    max-height: 380px;
    bottom: 4%;
    right: 1%;
  }
}

/* ПЛАНШЕТ (landscape) — короткая сторона устройства (высота в landscape) от 600px, как и в main.js (isTabletSize) */
@media (pointer: coarse) and (min-height: 600px) {
  #player-wrap {
    width: 40vw;
    height: 40vw;
    min-width: 340px;
    min-height: 340px;
    max-width: 480px;
    max-height: 480px;
    bottom: 5%;
    right: 1%;
  }
}

/* ДЕСКТОП — ноутбук и обычный монитор (до 2K). Один clamp() растёт
   непрерывно на этом диапазоне, без скачков. */
@media (min-width: 1024px) {
  #player-wrap {
    width: clamp(300px, 30vw, 680px);
    height: clamp(300px, 30vw, 680px);
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
  }
}

/* 2K / QHD и 4K — отдельные параметры, независимо друг от друга.
   Классы res-2k/res-4k выставляются в main.js по реальному физическому
   разрешению (screen.width * devicePixelRatio), см. комментарий у
   #custom-cursor выше — обычный min-width тут не работал из-за
   масштабирования ОС на реальных 4K-мониторах. */
html.res-2k #player-wrap {
  width: 700px;
  height: 700px;
}

html.res-4k #player-wrap {
  width: 1100px;
  height: 1100px;
}

#player-base {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: auto;
  touch-action: none;
}

/* Ник владельца диска теперь показывается справа от миниатюры диска
   прямо в карусели выбора дисков — см. .disc-item / .disc-label ниже. */

#btn-vol-up   { position: absolute; top: 47%;    left:  9%; width:  9%; height:  9%; pointer-events: auto; }
#btn-vol-down { position: absolute; top: 57%;    left:  9%; width:  9%; height:  9%; pointer-events: auto; }
#btn-prev     { position: absolute; top: 70%;    left: 14%; width: 19%; height: 14%; pointer-events: auto; }
#btn-play     { position: absolute; top: 77.79%; left: 28%; width: 19%; height:  8%; pointer-events: auto; }
#btn-next     { position: absolute; top: 79.4%;  left: 43%; width: 19%; height:  8%; pointer-events: auto; }
#btn-open     { position: absolute; top: 66%;    left: 60%; width: 18%; height: 11%; pointer-events: auto; }

.player-btn {
  cursor: pointer;
  display: flex;
  align-items: stretch;
  min-width: 0;
  pointer-events: auto;
  touch-action: none;
}

.player-btn img {
  width: 100%; height: 100%;
  object-fit: fill;
  pointer-events: none;
  transition: filter 0.08s ease, transform 0.08s ease;
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  .player-btn:hover img {
    filter: drop-shadow(0 0 3px #f5c800) drop-shadow(0 0 7px #f5c80088);
  }
}

.player-btn.pressed img {
  filter: drop-shadow(0 0 2px #f59000) brightness(0.68);
  transform: scale(0.92) translateY(2px);
}

#player-base.is-open {
  transform: scale(1.56) translateX(2.9%);
  transform-origin: bottom center;
}

#disc-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: clamp(450px, 68vw, 780px);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-right: none;
  box-shadow: none;

  pointer-events: none;
  opacity: 0;
  transform: translateX(-100%);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 10000;
  overflow: visible;
}

#disc-menu::before {
  content: none;
}

#disc-menu .disc-stage {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: clamp(450px, 68vw, 780px);
  background: transparent;
  pointer-events: auto;
}

#disc-menu.disc-menu-visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.disc-stage {
  position: relative;
  width: 100%;
  height: 100%;
  /* overflow: hidden было причиной обрезки ника активного диска на части
     форматов/разрешений: .disc-label позиционируется абсолютно справа от
     картинки диска (left: 100% + margin-left) и на узких экранах
     (clamp(450px, 68vw, 780px) даёт стадии меньше места) вылезает за
     правый край стадии — а overflow: hidden обрезал его жёстко, без
     многоточия, т.к. это обрезка предком, а не собственным
     text-overflow: ellipsis лейбла. Ни диски, ни их обёртки горизонтально
     за пределы стадии не выходят (их ширина всегда <= currentStageW - 32,
     см. discSize в applyDiscStyle), а вертикально стадия и так занимает
     весь inset (#disc-menu), так что реальный clip тут был не нужен —
     оставляем overflow: visible всегда, а не только в старом
     медиа-запросе для pointer: coarse + landscape ниже. */
  overflow: visible;
  z-index: 1;
  touch-action: none;
}

.disc-stage::before,
.disc-stage::after {
  content: none;
}

.disc-item {
  position: absolute;
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  pointer-events: none;
  padding: 0 16px;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  touch-action: none;
}

.disc-menu-visible .disc-item {
  pointer-events: auto;
}

/* Плавный переход прозрачности только для события "диск занял/освободил
   место в плеере" — включается на время JS-хелпером refreshDiscMenuGhosting,
   а не постоянно, чтобы не портить покадровую (без transition) анимацию
   пролистывания карусели. */
.disc-item--ghost-fade {
  transition: opacity 0.45s ease;
}

.disc-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
}

.disc-img-inner {
  width: 100%;
  height: 100%;
}

.disc-img-inner--clip {
  border-radius: 50%;
  overflow: hidden;
}

.disc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Ник диска (+ опционально название трека под ним) — блок абсолютно
   спозиционирован поверх правого края миниатюры диска и не участвует в
   потоке flex-раскладки .disc-item, поэтому его появление/исчезновение
   никак не сдвигает сам диск по горизонтали. Сам .disc-label — просто
   flex-колонка-контейнер, ellipsis/overflow повешены на каждую строку
   отдельно (.disc-label-name / .disc-label-track), а не на контейнер:
   так вторая строка не мешает первой обрезаться по своей ширине. */
.disc-label {
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  margin-left: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15em;
  max-width: 45vw;
  pointer-events: none;
}

.disc-label-name,
.disc-label-track {
  font-family: 'Minecraft', 'DaysOne', sans-serif;
  color: #fff;
  text-shadow:
    2px 2px 0 #000, -2px -2px 0 #000,
    2px -2px 0 #000, -2px 2px 0 #000,
    0 2px 0 #000, 0 -2px 0 #000,
    2px 0 0 #000, -2px 0 0 #000;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.disc-label-name {
  font-size: clamp(26px, 3.6vw, 56px);
  -webkit-text-stroke: 1.5px #000;
}

/* Название трека — заметно мельче ника (примерно вполовину) и с чуть
   более тонкой обводкой, чтобы на мелком кегле она не "съедала" буквы. */
.disc-label-track {
  font-size: clamp(13px, 1.8vw, 26px);
  -webkit-text-stroke: 1px #000;
  opacity: 0.9;
}

#tutorial-screen {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(80, 75, 70, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

#tutorial-screen.tut-in {
  opacity: 1;
  pointer-events: auto;
}

#tutorial-screen.tut-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.tut-card {
  background: transparent;
  border-radius: 20px;
  border: none;
  padding: 0;
  box-shadow: none;
  transform: translateY(22px) scale(0.96);
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  display: flex;
  max-width: 90vw;
  max-height: 90vh;
}

#tutorial-screen.tut-in .tut-card {
  transform: translateY(0) scale(1);
}

.tut-instructions-img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(68vw, 1100px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 20px;
}

#top-right-controls {
  position: absolute;
  top: 24px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 60;
}

#help-btn,
#mute-btn {
  position: static;
  width: 80px;
  height: 80px;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
}

#help-btn img,
#mute-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  transition: filter 0.08s ease, transform 0.08s ease;
}

#mute-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

#mute-btn img {
  width: 66%;
  height: 66%;
  margin-top: 6px;
}

@media (hover: hover) and (pointer: fine) {
  #help-btn:hover img,
  #mute-btn:hover img {
    filter: drop-shadow(0 0 3px #f5c800) drop-shadow(0 0 7px #f5c80088);
  }
}

#help-btn.pressed img,
#mute-btn.pressed img {
  filter: drop-shadow(0 0 2px #f59000) brightness(0.68);
  transform: scale(0.92) translateY(2px);
}

.tut-title {
  font-family: 'DaysOne', sans-serif;
  font-size: clamp(26px, 3.4vw, 38px);
  color: #1a1a1a;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.tut-headphone-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,0.38);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 13px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.tut-headphone-svg {
  flex-shrink: 0;
  width: 58px;
  height: 58px;
}

.tut-headphone-text {
  font-family: 'DaysOne', sans-serif;
  font-size: clamp(12px, 1.4vw, 16px);
  color: #2a2a2a;
  line-height: 1.55;
  letter-spacing: 0.01em;
}

.tut-intro {
  font-family: 'DaysOne', sans-serif;
  font-size: clamp(12px, 1.4vw, 16px);
  color: #444;
  line-height: 1.6;
  margin-bottom: 20px;
  letter-spacing: 0.01em;
}

.tut-divider {
  height: 1px;
  background: rgba(0,0,0,0.12);
  margin-bottom: 18px;
}

.tut-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.tut-step {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.tut-step-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(100, 96, 90, 0.55);
  color: #fff;
  font-family: 'DaysOne', sans-serif;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
  border: 1px solid rgba(255,255,255,0.4);
}

.tut-step-text {
  font-family: 'DaysOne', sans-serif;
  font-size: clamp(12px, 1.4vw, 16px);
  color: #1e1e1e;
  line-height: 1;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.tut-btn-img {
  display: inline-block;
  height: 32px;
  width: auto;
  vertical-align: middle;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.18));
}

.tut-disc-img {
  display: inline-block;
  height: 38px;
  width: 38px;
  vertical-align: middle;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.22));
}

.tut-footer {
  text-align: center;
}

.tut-hint {
  font-family: 'DaysOne', sans-serif;
  font-size: clamp(10px, 1.1vw, 13px);
  color: rgba(60,55,50,0.65);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  animation: hintPulse 2.2s ease-in-out infinite;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 1;    }
}

#disc-blur-overlay {
  display: none;
}

.desk-item {
  transition: filter 0.15s ease, transform 0.15s ease;
}

.desk-item.desk-item--hover {
  filter: drop-shadow(0 0 3px #9a9a9a) drop-shadow(0 0 6px #9a9a9a66);
}

.desk-item.pressed {
  filter: drop-shadow(0 0 2px #7a7a7a) brightness(0.92);
}

.desk-item[data-item="jar"]:not([data-dented="true"]).desk-item--hover,
.desk-item[data-item="plate-collapsed"].desk-item--hover,
.desk-item[data-item="outline"].desk-item--hover,
.desk-item[data-item="chips"].desk-item--hover,
.desk-item[data-item="chip1"].desk-item--hover,
.desk-item[data-item="chip2"].desk-item--hover,
.desk-item[data-item="chip3"].desk-item--hover {
  filter: drop-shadow(0 0 4px #f5c800) drop-shadow(0 0 10px #f5c80088);
}

.desk-item[data-item="jar"]:not([data-dented="true"]).pressed,
.desk-item[data-item="plate-collapsed"].pressed,
.desk-item[data-item="outline"].pressed,
.desk-item[data-item="chips"].pressed,
.desk-item[data-item="chip1"].pressed,
.desk-item[data-item="chip2"].pressed,
.desk-item[data-item="chip3"].pressed {
  filter: drop-shadow(0 0 3px #f59000) brightness(0.85);
}

.desk-item--denting {
  animation: dentPop 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dentPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.82) rotate(-4deg); }
  100% { transform: scale(1); }
}

.desk-item--shake-light {
  animation: shakeLight 0.22s ease-in-out infinite;
}

@keyframes shakeLight {
  0%, 100% { transform: translate(0, 0) rotate(var(--base-rotate, 0deg)); }
  25%      { transform: translate(-1px, 0.5px) rotate(calc(var(--base-rotate, 0deg) - 0.6deg)); }
  50%      { transform: translate(1px, -0.5px) rotate(calc(var(--base-rotate, 0deg) + 0.6deg)); }
  75%      { transform: translate(-0.5px, 1px) rotate(calc(var(--base-rotate, 0deg) - 0.3deg)); }
}

.desk-item--shake-strong {
  animation: shakeStrong 0.12s ease-in-out infinite;
}

@keyframes shakeStrong {
  0%, 100% { transform: translate(0, 0) rotate(var(--base-rotate, 0deg)); }
  25%      { transform: translate(-3px, 1.5px) rotate(calc(var(--base-rotate, 0deg) - 2deg)); }
  50%      { transform: translate(3px, -1.5px) rotate(calc(var(--base-rotate, 0deg) + 2deg)); }
  75%      { transform: translate(-2px, 2px) rotate(calc(var(--base-rotate, 0deg) - 1.2deg)); }
}

#plate-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(80, 75, 70, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

#plate-modal.tut-in {
  opacity: 1;
  pointer-events: auto;
}

#plate-modal.tut-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.plate-modal-card {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  transform: translateY(22px) scale(0.96);
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

#plate-modal.tut-in .plate-modal-card {
  transform: translateY(0) scale(1);
}

.plate-modal-img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(74vw, 1200px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
}

#outline-note-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(80, 75, 70, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

#outline-note-modal.tut-in {
  opacity: 1;
  pointer-events: auto;
}

#outline-note-modal.tut-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.outline-note-card {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  transform: translateY(22px) scale(0.96);
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

#outline-note-modal.tut-in .outline-note-card {
  transform: translateY(0) scale(1);
}

.outline-note-img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(74vw, 1200px);
  max-height: 90vh;
  object-fit: contain;
  pointer-events: none;
}

.outline-note-zone {
  position: absolute;
  cursor: pointer;
}

.outline-note-yes {
  left: 0;
  top: 33%;
  width: 47.5%;
  height: 67%;
}

.outline-note-no {
  left: 47.5%;
  top: 33%;
  width: 52.5%;
  height: 67%;
}

#rotate-screen {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background: #0d0d0d;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8vw;
  cursor: none !important;
}

#rotate-screen.visible {
  display: flex;
}

.rotate-icon {
  width: clamp(96px, 26vw, 190px);
  height: auto;
  margin-bottom: 6vh;
  animation: rotateIconPulse 2.6s ease-in-out infinite;
}

.rotate-icon path,
.rotate-icon rect {
  stroke: #ffffff;
}

@keyframes rotateIconPulse {
  0%, 100% { transform: rotate(0deg) scale(1); }
  45%      { transform: rotate(-84deg) scale(1.04); }
  55%      { transform: rotate(-84deg) scale(1.04); }
}

.rotate-text {
  font-family: var(--font-main);
  font-size: clamp(15px, 5.2vw, 26px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f2f2f2;
  max-width: 92vw;
  line-height: 1.5;
}

@media (pointer: coarse) and (orientation: landscape) {
  #top-right-controls {
    top: 14px;
    right: 14px;
    gap: 10px;
  }

  #help-btn,
  #mute-btn {
    width: 56px;
    height: 56px;
  }

  .tut-card,
  .plate-modal-card {
    max-width: 84vw;
  }

  /* .disc-stage теперь всегда overflow: visible (см. базовое правило
     выше), так что отдельный оверрайд здесь больше не нужен. */
}

/* Small-height phones in forced landscape mode: the player/table/discs
   were previously sized only from width and could be taller than the
   screen itself. Shrink the floor sizes so everything fits and is
   actually reachable. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  #player-wrap {
    min-width: 220px;
    min-height: 220px;
  }

  #disc-menu,
  #disc-menu .disc-stage {
    width: clamp(320px, 68vw, 780px);
  }
}
/* 2K — иконки сверху справа и бумажки. Классы res-2k/res-4k
   выставляются в main.js по реальному физическому разрешению экрана,
   см. комментарий у #custom-cursor выше. */
html.res-2k #help-btn,
html.res-2k #mute-btn {
  width: 125px;
  height: 125px;
}

/* Текст интро в окне подсказки — чуть крупнее базовых 16px */
html.res-2k .tut-intro {
  font-size: 18px;
}

/* Ник диска и название трека справа от диска — чуть крупнее на 2K */
html.res-2k .disc-label-name {
  font-size: clamp(30px, 4vw, 64px);
}

html.res-2k .disc-label-track {
  font-size: clamp(15px, 2vw, 30px);
}

html.res-2k .disc-label {
  max-width: 50vw;
}

/* Раньше max-width рос, а картинка всё равно не увеличивалась —
   потому что .tut-instructions-img/.plate-modal-img/.outline-note-img
   (и их карточки-контейнеры) ограничены ещё и по max-height: 90vh,
   а эта высота и была настоящим потолком. Снимаем её здесь. */
html.res-2k .tut-card,
html.res-2k .plate-modal-card,
html.res-2k .outline-note-card {
  max-height: none;
}

html.res-2k .tut-instructions-img,
html.res-2k .plate-modal-img,
html.res-2k .outline-note-img {
  max-height: none;
}

/* Отдельный буст размеров специально для 4K — иконки сверху справа и
   "бумажки" (подсказка, список на столе, записка dprofile). */
html.res-4k #help-btn,
html.res-4k #mute-btn {
  width: 150px;
  height: 150px;
}

/* Ник диска и название трека справа от диска — чуть крупнее на 4K */
html.res-4k .disc-label-name {
  font-size: clamp(32px, 4.2vw, 70px);
}

html.res-4k .disc-label-track {
  font-size: clamp(16px, 2.1vw, 32px);
}

html.res-4k .disc-label {
  max-width: 52vw;
}

html.res-4k .tut-instructions-img {
  max-width: 1500px;
}

html.res-4k .plate-modal-img,
html.res-4k .outline-note-img {
  max-width: 1600px;
}

/* Текст интро в окне подсказки — чуть крупнее */
html.res-4k .tut-intro {
  font-size: 22px;
}

/* То же самое: снимаем max-height: 90vh, иначе высота остаётся
   потолком независимо от того, насколько увеличен max-width. */
html.res-4k .tut-card,
html.res-4k .plate-modal-card,
html.res-4k .outline-note-card {
  max-height: none;
}

html.res-4k .tut-instructions-img,
html.res-4k .plate-modal-img,
html.res-4k .outline-note-img {
  max-height: none;
}