:root {
  color-scheme: dark;
  --screen-width: 100vw;
  --screen-height: 100dvh;
  --active-bg-image: none;
  --stage-width: 430px;
  --stage-height: 932px;
  --stage-scale: 1;
  --stage-top-offset: calc(env(safe-area-inset-top, 0px) + 54px);
  --stage-bottom-offset: calc(env(safe-area-inset-bottom, 0px) + 18px);
  --text-main: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #0c0c0c;
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, sans-serif;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

body:not(.analytics-page),
body:not(.analytics-page) * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  color: var(--text-main);
}

button {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
}

.app-shell {
  width: 100%;
  min-height: var(--screen-height);
  display: block;
  padding: 0;
  touch-action: manipulation;
}

.game-screen {
  position: relative;
  width: var(--screen-width);
  height: var(--screen-height);
  min-height: var(--screen-height);
  overflow: hidden;
  background: #000;
  overscroll-behavior: none;
  touch-action: manipulation;
}

.game-screen::before {
  content: "";
  position: absolute;
  inset: -40px -40px calc(-68px - env(safe-area-inset-bottom, 0px)) -40px;
  background-image: var(--active-bg-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transform: scale(1.03);
  transform-origin: center center;
  pointer-events: none;
  z-index: 0;
}

.game-background {
  position: absolute;
  inset: -32px -32px calc(-56px - env(safe-area-inset-bottom, 0px)) -32px;
  width: calc(100% + 48px);
  height: calc(100% + 96px + env(safe-area-inset-bottom, 0px));
  object-fit: cover;
  object-position: center center;
  filter: saturate(1.04) contrast(1.03);
  pointer-events: none;
  z-index: 0;
}

.game-background[hidden],
.stage[hidden] {
  display: none;
}

.backdrop-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 224, 118, 0.18), transparent 25%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.26));
  z-index: 1;
}

.hud {
  position: absolute;
  z-index: 2;
}

.stage {
  position: absolute;
  left: 50%;
  top: var(--stage-top-offset);
  width: var(--stage-width);
  height: var(--stage-height);
  transform: translateX(-50%) scale(var(--stage-scale));
  transform-origin: top center;
  z-index: 2;
}

.stage--start {
  z-index: 3;
}

.stage--game {
  z-index: 4;
}

.start-screen {
  position: absolute;
  inset: 0;
}

.start-record {
  position: absolute;
  top: 30px;
  left: 42px;
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 6px 16px 6px 6px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(158, 158, 163, 0.62), rgba(118, 118, 128, 0.56));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 10px 24px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.start-record__score {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 124px;
  height: 44px;
  padding: 0 16px 0 14px;
  margin-right: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffd84f, #ffc91f);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 4px 10px rgba(0, 0, 0, 0.08);
}

.start-record__star {
  margin-right: 8px;
  color: #15110b;
  font-size: 24px;
  line-height: 1;
  transform: translateY(-1px);
}

.start-record__value {
  color: #14110b;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.start-record__label {
  color: rgba(255, 255, 255, 0.94);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.03em;
  transform: translateY(-1px);
}

.start-title {
  position: absolute;
  left: 42px;
  top: 176px;
  width: 348px;
  height: 156px;
  object-fit: contain;
}

.start-rules-composite {
  position: absolute;
  left: -24px;
  top: 290px;
  width: 486px;
  height: auto;
  display: block;
  filter: drop-shadow(0 22px 28px rgba(20, 12, 31, 0.24));
}

.start-actions {
  position: absolute;
  left: 42px;
  right: 42px;
  bottom: 98px;
  display: grid;
  gap: 10px;
}

.start-action {
  position: relative;
  display: block;
  width: 100%;
  height: 60px;
  border-radius: 18px;
  overflow: hidden;
  transform: translateY(0) scale(1);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
}

.start-action img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.start-action--play {
  box-shadow:
    0 18px 30px rgba(71, 46, 177, 0.32),
    0 10px 18px rgba(0, 0, 0, 0.18);
  filter: saturate(1.04);
}

.start-action--play::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.02) 36%, rgba(255, 255, 255, 0) 60%);
  z-index: 1;
  pointer-events: none;
}

.start-action--play::after {
  content: "";
  position: absolute;
  left: -18%;
  top: 0;
  width: 44%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
  transform: skewX(-22deg);
  opacity: 0.72;
  pointer-events: none;
  animation: play-button-sheen 3.2s ease-in-out infinite;
}

.start-action--play:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 22px 34px rgba(71, 46, 177, 0.36),
    0 12px 20px rgba(0, 0, 0, 0.2);
}

.start-action--play:active {
  transform: translateY(1px) scale(0.992);
  box-shadow:
    0 10px 18px rgba(71, 46, 177, 0.24),
    0 6px 12px rgba(0, 0, 0, 0.16);
}

.start-action--leaderboard {
  box-shadow:
    0 18px 28px rgba(173, 123, 16, 0.22),
    0 10px 18px rgba(0, 0, 0, 0.16);
}

.start-action--leaderboard:hover {
  transform: translateY(-2px) scale(1.008);
  box-shadow:
    0 22px 32px rgba(173, 123, 16, 0.26),
    0 12px 20px rgba(0, 0, 0, 0.18);
}

.start-action--leaderboard:active {
  transform: translateY(1px) scale(0.992);
}

.leaderboard-screen {
  position: absolute;
  inset: 0;
}

.leaderboard-panel {
  position: absolute;
  left: 28px;
  top: 94px;
  width: 372px;
  height: 726px;
  padding: 20px 16px 18px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.1)),
    linear-gradient(180deg, rgba(57, 43, 51, 0.16), rgba(31, 23, 29, 0.22));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03),
    0 24px 36px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(20px) saturate(1.03);
  -webkit-backdrop-filter: blur(20px) saturate(1.03);
  overflow: hidden;
}

.leaderboard-panel__bg {
  display: none;
}

.leaderboard-back,
.leaderboard-dots,
.leaderboard-title,
.leaderboard-reset-note,
.leaderboard-my-score,
.leaderboard-podium,
.leaderboard-list,
.leaderboard-action {
  position: relative;
  z-index: 2;
}

.leaderboard-back {
  position: absolute;
  left: 10px;
  top: 12px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.leaderboard-back span {
  display: none;
}

.leaderboard-back img {
  width: 28px;
  height: 28px;
}

.leaderboard-dots {
  display: none;
}

.leaderboard-title {
  padding-top: 8px;
  text-align: center;
  font-size: 30px;
  font-weight: 900;
  font-style: italic;
  line-height: 0.94;
  letter-spacing: -0.055em;
  text-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.leaderboard-reset-note {
  margin-top: 6px;
  text-align: center;
  color: rgba(255, 255, 255, 0.56);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.leaderboard-my-score {
  width: 332px;
  margin: 12px auto 0;
  padding: 14px 16px 13px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08)),
    linear-gradient(180deg, rgba(52, 38, 49, 0.52), rgba(27, 19, 25, 0.58));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 18px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.leaderboard-my-score__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.68);
}

.leaderboard-my-score__value {
  margin-top: 5px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  color: rgba(255, 255, 255, 0.98);
}

.leaderboard-my-score__meta {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.78);
}

.leaderboard-podium {
  width: 332px;
  margin: 14px auto 0;
  min-height: 222px;
  display: grid;
  grid-template-columns: 102px 128px 102px;
  align-items: end;
  justify-content: center;
  gap: 0;
}

.podium-slot {
  display: grid;
  justify-items: center;
  align-content: end;
}

.podium-slot--empty {
  min-height: 1px;
}

.podium-slot--1 {
  transform: translateY(-8px);
}

.podium-slot--2 {
  transform: translateY(14px);
}

.podium-slot--3 {
  transform: translateY(14px);
}

.podium-avatar {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: visible;
  background: rgba(255, 255, 255, 0.18);
}

.podium-slot--1 .podium-avatar {
  width: 96px;
  height: 96px;
}

.podium-avatar__frame {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.16),
    inset 0 0 0 4px rgba(255, 255, 255, 0.82);
}

.podium-avatar__frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.podium-rank {
  position: absolute;
  left: 50%;
  bottom: -10px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  transform: translateX(-50%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.podium-slot--1 .podium-rank {
  background: #7a63ff;
}

.podium-slot--2 .podium-rank {
  background: #ff7b2f;
}

.podium-slot--3 .podium-rank {
  background: #8de16a;
}

.podium-card {
  width: 102px;
  margin-top: 6px;
  border-radius: 18px 18px 14px 14px;
  padding: 30px 10px 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.94);
  color: #2c2536;
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.podium-slot--1 .podium-card {
  width: 128px;
  min-height: 138px;
  background: linear-gradient(180deg, #8b73ff, #6c59ef);
  color: #fff;
}

.podium-slot--2 .podium-card,
.podium-slot--3 .podium-card {
  min-height: 88px;
}

.podium-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}

.podium-slot--1 .podium-name {
  font-size: 14px;
}

.podium-score {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.podium-slot--1 .podium-score {
  font-size: 16px;
}

.podium-slot--2 .podium-score {
  color: #ff6a1a;
}

.podium-slot--3 .podium-score {
  color: #57b84c;
}

.leaderboard-list {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 458px;
  bottom: 144px;
  padding: 12px 0 6px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(45, 30, 35, 0.16), rgba(28, 19, 24, 0.22));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 18px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}

.leaderboard-my-place {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 84px;
  min-height: 52px;
  padding: 10px 14px 12px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08)),
    linear-gradient(180deg, rgba(55, 41, 49, 0.44), rgba(30, 22, 28, 0.48));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 18px rgba(0, 0, 0, 0.08);
}

.leaderboard-my-place__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.56);
}

.leaderboard-my-place__body {
  margin-top: 7px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.leaderboard-my-place__rank {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.98);
}

.leaderboard-my-place__name {
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-my-place__score {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.98);
}

.leaderboard-list__scroll {
  max-height: none;
  height: 100%;
  overflow-y: auto;
  padding: 0 18px 4px;
}

.leaderboard-row {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
}

.leaderboard-row + .leaderboard-row::before {
  content: "";
  position: absolute;
  left: 58px;
  right: 0;
  top: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.leaderboard-row__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.leaderboard-row__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.leaderboard-row__meta {
  min-width: 0;
}

.leaderboard-row__name {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.96);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-row__rank {
  margin-top: 3px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.34);
}

.leaderboard-row__score {
  font-size: 17px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.04em;
}

.leaderboard-row.is-self {
  margin: 0 -8px;
  padding: 0 8px;
  border-radius: 16px;
  background: rgba(129, 100, 255, 0.14);
}

.leaderboard-empty {
  padding: 34px 22px 28px;
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  line-height: 1.35;
}

.leaderboard-action {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.09));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 10px 18px rgba(0, 0, 0, 0.08);
  color: rgba(255, 255, 255, 0.94);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.leaderboard-action.is-danger {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.1));
  color: rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 20px rgba(0, 0, 0, 0.09);
}

.leaderboard-action:disabled {
  opacity: 0.6;
}

.leaderboard-consent {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.leaderboard-consent.status-overlay--confirm {
  gap: 16px;
  padding: 34px 34px;
  background:
    radial-gradient(circle at center, rgba(255, 226, 140, 0.14), transparent 36%),
    rgba(16, 13, 20, 0.48);
  backdrop-filter: blur(18px) saturate(0.96);
  -webkit-backdrop-filter: blur(18px) saturate(0.96);
}

.leaderboard-consent.status-overlay--confirm::before {
  content: "";
  position: absolute;
  left: 36px;
  right: 36px;
  top: 50%;
  min-height: 296px;
  transform: translateY(-50%);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08)),
    linear-gradient(180deg, rgba(63, 47, 58, 0.72), rgba(33, 24, 31, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03),
    0 18px 34px rgba(0, 0, 0, 0.22);
}

.leaderboard-consent.status-overlay--confirm > * {
  position: relative;
  z-index: 1;
}

.leaderboard-consent.status-overlay--confirm strong {
  max-width: 248px;
  font-size: 26px;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.leaderboard-consent.status-overlay--confirm span {
  max-width: 248px;
  font-size: 16px;
  line-height: 1.34;
  color: rgba(255, 255, 255, 0.92);
  text-wrap: balance;
}

.leaderboard-consent .confirm-actions {
  margin-top: 12px;
}

.leaderboard-consent .confirm-button {
  min-width: 116px;
  height: 44px;
  border-radius: 15px;
}

.game-ui[hidden] {
  display: none;
}

.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  top: 28px;
  left: 16px;
  right: 16px;
}

.icon-button img {
  display: block;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 15px 0 13px;
  border-radius: 12px;
  background: #ffcf33;
  color: #14110b;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

.hud-level {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px 0 10px;
  border-radius: 12px;
  background: rgba(20, 15, 24, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.94);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hud-level__icon {
  position: relative;
  width: 16px;
  height: 16px;
  transform: rotate(45deg);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(255, 219, 116, 0.94), rgba(255, 190, 62, 0.92));
  box-shadow:
    0 2px 6px rgba(255, 190, 62, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.hud-level__icon::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 2px;
  background: rgba(255, 248, 220, 0.9);
}

.hud-level__value {
  min-width: 10px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
}

.score-badge__star {
  font-size: 25px;
  line-height: 1;
  transform: translateY(-1px);
}

.score-badge__value {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hud-sound {
  display: none;
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.hud-button {
  flex: 0 0 44px;
}

.icon-button {
  position: relative;
  width: 44px;
  height: 44px;
  opacity: 0.72;
  transform: scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease;
}

.icon-button.is-active {
  opacity: 1;
  transform: scale(1);
}

.icon-button img {
  width: 44px;
  height: 44px;
}

.audio-toggle,
.close-button {
  border-radius: 12px;
  background: transparent;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

.pause-toggle {
  border-radius: 12px;
  background: #8164ff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

.pause-icon,
.pause-icon::before,
.pause-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  content: "";
  transform: translate(-50%, -50%);
}

.pause-toggle.is-paused .pause-icon::before,
.pause-toggle.is-paused .pause-icon::after {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #ffffff;
  border-right: 0;
  border-radius: 0;
}

.pause-toggle.is-paused .pause-icon::after {
  display: none;
}

.pause-toggle:not(.is-paused) .pause-icon::before,
.pause-toggle:not(.is-paused) .pause-icon::after {
  width: 5px;
  height: 16px;
  border-radius: 999px;
  background: #ffffff;
}

.pause-toggle:not(.is-paused) .pause-icon::before {
  margin-left: -5px;
}

.pause-toggle:not(.is-paused) .pause-icon::after {
  margin-left: 5px;
}

.board-area {
  position: absolute;
  top: 150px;
  left: 17px;
  width: 395px;
  z-index: 2;
}

.achievement-layer {
  position: absolute;
  left: 14px;
  right: 14px;
  top: -50px;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 5;
}

.achievement-bubble {
  max-width: 300px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(25, 22, 29, 0.66);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.96);
  text-align: center;
  animation: achievement-bubble 3450ms ease forwards;
}

.achievement-bubble strong {
  display: none;
}

.achievement-bubble span {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.board-shell {
  position: relative;
  width: 395px;
  height: 516px;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.28));
  border-radius: 22px;
  overflow: hidden;
}

.board-shell.is-obscured .board-tiles,
.board-shell.is-obscured .board-fx,
.board-shell.is-obscured::before {
  filter: blur(12px) saturate(0.82) brightness(0.78);
}

.board-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(54, 40, 57, 0.48), rgba(26, 23, 29, 0.6));
  backdrop-filter: blur(12px) saturate(0.95);
  -webkit-backdrop-filter: blur(12px) saturate(0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: filter 180ms ease;
}

.board-tiles {
  position: absolute;
  inset: 15px 15px 15px 16px;
}

.board-fx,
.board-tiles {
  z-index: 1;
  position: absolute;
  inset: 15px 15px 15px 16px;
  transition: filter 180ms ease;
}

.board-tiles {
  touch-action: none;
  user-select: none;
}

.board-fx {
  z-index: 2;
  pointer-events: none;
  overflow: visible;
}

.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  background: rgba(16, 14, 22, 0.26);
  text-align: center;
}

.pause-overlay.is-visible {
  display: grid;
}

.pause-overlay > * {
  position: relative;
  z-index: 1;
}

.pause-overlay strong {
  font-size: 28px;
  line-height: 1;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.26);
}

.pause-overlay span {
  max-width: 238px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
}

.overlay-goals {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.overlay-goal {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.overlay-goal__badge {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffcf33;
  font-size: 15px;
  font-weight: 800;
}

.overlay-goal img {
  width: 40px;
  height: 40px;
}

.overlay-goal span {
  text-align: left;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
}

.overlay-goal strong {
  font-size: 16px;
}

.status-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  align-content: center;
  justify-items: center;
  gap: 10px;
  background:
    radial-gradient(circle at center, rgba(255, 225, 132, 0.16), transparent 42%),
    rgba(22, 19, 27, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: center;
}

.status-overlay.is-visible {
  display: grid;
}

.status-overlay strong {
  font-size: 28px;
  line-height: 1;
}

.status-overlay span {
  max-width: 220px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.88);
}

.status-overlay--confirm {
  gap: 12px;
  padding: 24px;
}

.confirm-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.confirm-button {
  min-width: 112px;
  height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: transform 140ms ease, opacity 140ms ease, background-color 140ms ease;
}

.confirm-button:active {
  transform: scale(0.98);
}

.confirm-button--secondary {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.94);
}

.confirm-button--danger {
  background: #ffcf33;
  color: #1b1509;
}

.tile {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  transition:
    transform 180ms cubic-bezier(0.2, 0.9, 0.24, 1),
    filter 120ms ease,
    scale 120ms ease,
    opacity 120ms ease;
  transform-origin: center;
  scale: 1;
  backface-visibility: hidden;
}

.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.tile.is-dragging,
.tile.is-preview {
  transition: none;
}

.tile.is-dragging {
  z-index: 4;
  scale: 1.035;
  filter: drop-shadow(0 10px 14px rgba(23, 6, 32, 0.24));
}

.tile.is-preview {
  z-index: 3;
  scale: 0.99;
  opacity: 0.99;
}

.tile.is-settling {
  scale: 1.01;
  filter: drop-shadow(0 4px 8px rgba(23, 6, 32, 0.1));
}

.tile.is-clearing {
  scale: 1.06;
  opacity: 0;
  filter:
    drop-shadow(0 0 8px rgba(255, 235, 170, 0.8))
    drop-shadow(0 0 14px rgba(255, 221, 118, 0.38));
}

.tile.is-spawning {
  scale: 0.94;
  opacity: 0.15;
  filter:
    drop-shadow(0 0 8px rgba(255, 233, 171, 0.32))
    saturate(1.05);
}

.sparkle-burst {
  position: absolute;
  width: 58px;
  height: 58px;
  margin-left: -29px;
  margin-top: -29px;
  border-radius: 50%;
  pointer-events: none;
  animation: sparkle-burst 420ms ease-out forwards;
}

.sparkle-burst::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 247, 205, 0.95) 0%, rgba(255, 223, 132, 0.72) 38%, rgba(255, 223, 132, 0) 72%);
  filter: blur(1px);
}

.sparkle-burst::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 235, 165, 0.4) 0%, rgba(255, 235, 165, 0) 70%);
}

.sparkle-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  margin-top: -3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 248, 225, 1) 0%, rgba(255, 222, 133, 0.88) 58%, rgba(255, 222, 133, 0) 100%);
  animation: sparkle-dot 460ms ease-out forwards;
}

@keyframes sparkle-burst {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.3);
  }
}

@keyframes sparkle-dot {
  0% {
    opacity: 0;
    transform: rotate(var(--angle)) translateX(0) scale(0.6);
  }

  20% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: rotate(var(--angle)) translateX(var(--distance)) scale(0.1);
  }
}

@keyframes achievement-bubble {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }

  12% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  82% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
  }
}

@keyframes play-button-sheen {
  0%,
  68%,
  100% {
    transform: translateX(0) skewX(-22deg);
    opacity: 0;
  }

  12%,
  28% {
    transform: translateX(220%) skewX(-22deg);
    opacity: 0.82;
  }
}

.goals-panel {
  position: absolute;
  z-index: 2;
  width: 306px;
  min-height: 92px;
  left: 62px;
  top: 690px;
}

.goals-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 9px;
}

.moves-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(20, 15, 24, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.moves-chip strong {
  margin-left: 4px;
  color: #ffcf33;
}

.goals-list {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  min-height: 64px;
}

.goal {
  width: 62px;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.goal-count {
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.36);
}

.goal img {
  width: 58px;
  height: 58px;
  display: block;
}

.goal-badge {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffcf33;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 10px 16px rgba(0, 0, 0, 0.1);
  font-size: 18px;
  font-weight: 800;
}

.goals-panel.is-endless {
  width: 220px;
  left: 105px;
}

.goals-panel.is-endless .goals-list {
  min-height: 0;
}

.endless-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(20, 15, 24, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

@media (max-width: 380px) {
  .score-badge__value {
    font-size: 17px;
  }
}

html.is-telegram-miniapp .game-background {
  filter: none;
}

html.is-telegram-miniapp .start-record,
html.is-telegram-miniapp .achievement-bubble,
html.is-telegram-miniapp .board-shell::before,
html.is-telegram-miniapp .pause-overlay,
html.is-telegram-miniapp .status-overlay {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html.is-telegram-miniapp .leaderboard-list,
html.is-telegram-miniapp .leaderboard-back {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html.is-telegram-miniapp .board-shell.is-obscured .board-tiles,
html.is-telegram-miniapp .board-shell.is-obscured .board-fx,
html.is-telegram-miniapp .board-shell.is-obscured::before {
  filter: blur(9px) saturate(0.8) brightness(0.8);
}

html.is-telegram-miniapp .start-record {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 6px 14px rgba(0, 0, 0, 0.12);
}

html.is-telegram-miniapp .start-rules-composite,
html.is-telegram-miniapp .board-shell,
html.is-telegram-miniapp .tile.is-dragging,
html.is-telegram-miniapp .tile.is-settling,
html.is-telegram-miniapp .tile.is-clearing,
html.is-telegram-miniapp .tile.is-spawning {
  filter: none;
}

html.is-telegram-miniapp .start-action,
html.is-telegram-miniapp .start-action--play,
html.is-telegram-miniapp .audio-toggle,
html.is-telegram-miniapp .close-button,
html.is-telegram-miniapp .pause-toggle,
html.is-telegram-miniapp .score-badge {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
}

html.is-telegram-miniapp .start-action--play::after {
  animation: none;
  opacity: 0;
}

html.is-telegram-miniapp .tile {
  transition:
    transform 130ms cubic-bezier(0.2, 0.9, 0.24, 1),
    opacity 90ms ease,
    scale 90ms ease;
}

html.is-telegram-miniapp .tile.is-dragging {
  scale: 1.02;
}

html.is-telegram-miniapp .tile.is-preview,
html.is-telegram-miniapp .tile.is-settling {
  scale: 1;
}

html.is-telegram-miniapp .sparkle-dot {
  display: none;
}

html.is-telegram-miniapp .sparkle-burst {
  animation-duration: 260ms;
}

html.is-telegram-miniapp .sparkle-burst::before {
  inset: 14px;
  filter: none;
}

html.is-telegram-miniapp .sparkle-burst::after {
  display: none;
}

html.is-telegram-miniapp .achievement-bubble {
  animation-duration: 1800ms;
}
