@font-face {
  font-family: "DemiChalk";
  src: url("./assets/fonts/demi-chalkboard.ttf") format("truetype");
  font-display: swap;
}

:root {
  --cream: #fff6dc;
  --milk: #fffaf0;
  --pink: #ff4d8d;
  --pink-dark: #d5155f;
  --coral: #ff6b4a;
  --orange: #ff9f1c;
  --yellow: #ffd75a;
  --blue: #77d9ff;
  --green: #59d77b;
  --ink: #422132;
  --soft-ink: #7a4d58;
  --panel: rgba(255, 255, 255, 0.86);
  --shadow: 0 14px 28px rgba(134, 45, 58, 0.18);
  --deep-shadow: 0 18px 34px rgba(91, 24, 42, 0.26);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "DemiChalk", "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.55), transparent 34%),
    linear-gradient(135deg, #ff78a9 0%, #ffd36c 48%, #9ee8ff 100%);
  touch-action: manipulation;
  user-select: none;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.phone-shell {
  width: 100vw;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
}

.app {
  position: relative;
  width: 100%;
  height: 100dvh;
  max-width: 470px;
  max-height: 960px;
  overflow: hidden;
  background: var(--cream);
  isolation: isolate;
}

.app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background-image: var(--screen-bg, url("./assets/images/background-main-clean.png"));
  background-size: cover;
  background-position: center;
}

.app::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 246, 220, 0.2)),
    radial-gradient(circle at 10% 18%, rgba(255, 255, 255, 0.62) 0 2px, transparent 3px),
    radial-gradient(circle at 86% 14%, rgba(255, 255, 255, 0.7) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 72%, rgba(255, 255, 255, 0.55) 0 2px, transparent 3px);
}

.loading-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #74243d;
  text-align: center;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.92), rgba(255, 246, 220, 0.72) 42%, rgba(255, 133, 169, 0.5)),
    var(--screen-bg, url("./assets/images/background-main-clean.png"));
  background-size: cover;
  background-position: center;
}

.loading-card {
  width: min(100%, 330px);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--deep-shadow);
  animation: loading-card-in 420ms ease both;
}

.loading-title {
  margin: 0;
  color: #74243d;
  font-size: clamp(34px, 7dvh, 48px);
  line-height: 1;
  font-weight: 1000;
}

.loading-subtitle {
  min-height: 22px;
  margin: 0;
  color: #713041;
  font-size: 17px;
  font-weight: 900;
}

.loading-track {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 2px 6px rgba(94, 25, 44, 0.16);
}

.loading-fill {
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff5b9b, #ffd75a, #59d77b);
  box-shadow: 0 0 14px rgba(255, 91, 155, 0.22);
  transition: width 220ms ease;
}

.loading-percent {
  min-height: 18px;
  color: #8a2c49;
  font-size: 14px;
  font-weight: 1000;
}

@keyframes loading-card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 720px) {
  body {
    padding: 0;
  }

  .phone-shell {
    padding: 22px;
  }

  .app {
    height: min(100dvh - 44px, 900px);
    border: 10px solid rgba(255, 255, 255, 0.58);
    border-radius: 34px;
    box-shadow: 0 24px 80px rgba(65, 16, 32, 0.3);
  }
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: calc(18px + var(--safe-top)) 18px calc(18px + var(--safe-bottom));
  opacity: 0;
  transform: translateY(14px) scale(0.99);
  animation: screen-in 280ms ease forwards;
}

.screen.is-game {
  padding: calc(12px + var(--safe-top)) 14px calc(12px + var(--safe-bottom));
}

@keyframes screen-in {
  to {
    opacity: 1;
    transform: none;
  }
}

.top-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.top-row #statusMount {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
}

.top-row #walletMount {
  flex: 0 0 auto;
  display: flex;
}

.sound-button,
.back-button,
.mini-button,
.wallet-button {
  min-width: 48px;
  min-height: 48px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(121, 38, 50, 0.16), inset 0 -3px 0 rgba(223, 83, 75, 0.16);
  transition: transform 120ms ease, filter 120ms ease;
}

.sound-button img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.wallet-button {
  grid-template-columns: 30px auto;
  gap: 2px;
  min-width: 78px;
  padding: 0 9px;
  color: #74243d;
  font-size: 16px;
  font-weight: 1000;
}

.wallet-button img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.back-button {
  padding: 0 14px;
  font-weight: 900;
}

.mini-button {
  padding: 0 12px;
  font-weight: 900;
  font-size: 14px;
}

.rating-board-button {
  position: relative;
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "kicker score"
    "title score";
  align-items: center;
  column-gap: 8px;
  width: clamp(148px, 32vw, 236px);
  min-width: 0;
  flex: 1 1 clamp(148px, 32vw, 236px);
  padding: 5px 10px 6px 12px;
  color: #74243d;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 245, 202, 0.82));
  box-shadow: 0 8px 18px rgba(121, 38, 50, 0.14), inset 0 -3px 0 rgba(255, 159, 28, 0.13);
  overflow: hidden;
  transition: transform 120ms ease, filter 120ms ease;
}

.profile-avatar-button {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 2px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 238, 184, 0.82));
  box-shadow: 0 8px 18px rgba(121, 38, 50, 0.15), inset 0 -3px 0 rgba(255, 159, 28, 0.12);
  transition: transform 120ms ease, filter 120ms ease;
}

.profile-avatar-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 2px 2px rgba(86, 27, 43, 0.14));
}

.rating-board-button::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -45%;
  width: 46%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.86), transparent);
  transform: rotate(18deg);
  animation: status-shine 2.8s ease-in-out infinite;
}

.status-kicker {
  grid-area: kicker;
  font-size: 10px;
  line-height: 1;
  font-weight: 1000;
  opacity: 0.75;
  text-align: left;
}

.rating-board-button strong {
  grid-area: title;
  min-width: 0;
  font-size: 13px;
  line-height: 1.02;
  font-weight: 1000;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rating-mini {
  grid-area: score;
  min-width: 36px;
  min-height: 28px;
  display: grid;
  place-items: center;
  color: #fffdf0;
  font-size: 12px;
  font-weight: 1000;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
  text-shadow: 0 1px 0 rgba(102, 29, 36, 0.2);
  box-shadow: inset 0 -3px 0 rgba(145, 31, 34, 0.24);
}

@keyframes status-shine {
  0%,
  45% {
    transform: translateX(0) rotate(18deg);
  }

  78%,
  100% {
    transform: translateX(360%) rotate(18deg);
  }
}

.sound-button:active,
.back-button:active,
.mini-button:active,
.wallet-button:active,
.profile-avatar-button:active,
.rating-board-button:active,
.pause-button:active,
.help-button:active,
.action-button:active,
.image-button:active,
.hero-card:active,
.booster-button:active {
  transform: translateY(2px) scale(0.97);
}

.start-screen {
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  overflow: hidden;
}

.logo-wrap {
  width: min(92vw, 390px, 46dvh);
  height: min(42dvh, 390px);
  max-height: 42dvh;
  aspect-ratio: auto;
  margin: clamp(2px, 1dvh, 10px) auto 0;
  animation: floaty 3.4s ease-in-out infinite;
  overflow: visible;
}

.logo {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 18px rgba(111, 30, 45, 0.22));
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

.start-copy {
  width: 100%;
  margin-top: clamp(8px, 2dvh, 18px);
  padding: 0 8px;
}

.start-title-card {
  position: relative;
  width: min(100%, 390px);
  display: grid;
  justify-items: center;
  gap: 11px;
  margin: 0 auto;
  padding: clamp(14px, 2.3dvh, 20px) clamp(16px, 5vw, 26px) clamp(15px, 2.5dvh, 22px);
  overflow: hidden;
  color: #74243d;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 30px;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.95), transparent 30%),
    radial-gradient(circle at 88% 0%, rgba(255, 91, 155, 0.2), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 246, 212, 0.86));
  box-shadow: 0 16px 30px rgba(122, 45, 58, 0.14), inset 0 -5px 0 rgba(255, 159, 28, 0.08);
}

.start-title-card::before,
.start-title-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.start-title-card::before {
  width: 96px;
  height: 96px;
  right: -38px;
  top: -44px;
  background: rgba(255, 91, 155, 0.16);
}

.start-title-card::after {
  width: 86px;
  height: 12px;
  left: 24px;
  bottom: 10px;
  background: linear-gradient(90deg, rgba(255, 91, 155, 0.24), rgba(255, 215, 90, 0.24));
}

.start-kicker {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  padding: 3px 11px 4px;
  color: #a32055;
  border-radius: 999px;
  background: rgba(255, 248, 226, 0.86);
  box-shadow: inset 0 -2px 0 rgba(255, 159, 28, 0.09);
  font-size: clamp(11px, 1.8dvh, 13px);
  line-height: 1;
  font-weight: 1000;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  display: inline-block;
  padding: 4px 13px 9px;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 20px rgba(122, 45, 58, 0.12);
  font-size: clamp(38px, 7dvh, 58px);
  line-height: 0.95;
  color: #74243d;
  text-shadow: none;
}

.start-title {
  position: relative;
  z-index: 1;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: clamp(40px, 6.8dvh, 58px);
  line-height: 0.96;
  text-wrap: balance;
}

h2 {
  padding: 6px 13px 9px;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 20px rgba(122, 45, 58, 0.11);
  font-size: clamp(26px, 5dvh, 38px);
  line-height: 1;
  color: #74243d;
  text-align: center;
  text-shadow: none;
}

.subtitle,
.small-note {
  font-weight: 900;
  color: #6e3142;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.subtitle {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  margin-top: 10px;
  font-size: clamp(17px, 2.8dvh, 22px);
  line-height: 1.2;
}

.start-subtitle {
  position: relative;
  z-index: 1;
  max-width: 29ch;
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #7d344b;
  font-size: clamp(15px, 2.25dvh, 19px);
  line-height: 1.28;
  text-wrap: balance;
}

.small-note {
  margin-top: 10px;
  font-size: 14px;
}

.image-button {
  width: min(86vw, 330px);
  min-height: 76px;
  margin: 12px auto 0;
  padding: 0;
  background: transparent;
  transition: transform 130ms ease, filter 130ms ease;
  filter: drop-shadow(0 14px 16px rgba(126, 21, 58, 0.28));
}

.image-button img {
  display: block;
  width: 100%;
  height: auto;
}

.utility-actions {
  width: min(100%, 330px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px auto 0;
}

.utility-button {
  min-height: 44px;
  color: #74243d;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 18px rgba(121, 38, 50, 0.13), inset 0 -3px 0 rgba(223, 83, 75, 0.12);
}

.action-button {
  min-height: 56px;
  padding: 0 22px;
  color: #fffdf0;
  font-weight: 1000;
  font-size: 18px;
  letter-spacing: 0;
  border-radius: 20px;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
  box-shadow:
    inset 0 -5px 0 rgba(145, 31, 34, 0.34),
    0 12px 22px rgba(134, 45, 58, 0.24);
  text-shadow: 0 2px 0 rgba(102, 29, 36, 0.28);
  transition: transform 120ms ease, filter 120ms ease;
}

.action-button.secondary {
  color: #6b233a;
  background: linear-gradient(180deg, #fff8d9, #ffd76c);
  text-shadow: none;
  box-shadow:
    inset 0 -5px 0 rgba(219, 125, 21, 0.22),
    0 10px 18px rgba(134, 45, 58, 0.18);
}

.action-button.full {
  width: 100%;
}

@media (hover: hover) {
  .top-row button:hover,
  .hud button:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.04) saturate(1.04);
  }

  .action-button:hover,
  .image-button:hover,
  .sound-button:hover,
  .wallet-button:hover,
  .hero-card:hover,
  .back-button:hover,
  .mini-button:hover,
  .booster-button:hover {
    filter: brightness(1.04);
    transform: translateY(-2px);
  }
}

.hero-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 2px 4px;
  scrollbar-width: none;
}

.difficulty-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 7px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 18px rgba(121, 38, 50, 0.13);
}

.difficulty-option {
  min-height: 40px;
  color: #74243d;
  font-size: 14px;
  font-weight: 1000;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 -3px 0 rgba(223, 83, 75, 0.08);
}

.difficulty-option.active {
  color: #fffdf0;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
  text-shadow: 0 2px 0 rgba(102, 29, 36, 0.18);
}

.hero-list::-webkit-scrollbar {
  display: none;
}

.select-screen {
  gap: 10px;
}

.game-sections {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.main-game-zone,
.mini-games-zone {
  min-height: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 2px solid rgba(255, 255, 255, 0.48);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(82, 30, 49, 0.14), rgba(82, 30, 49, 0.08)),
    rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 0 0 2px rgba(102, 36, 58, 0.06),
    inset 0 12px 26px rgba(91, 24, 42, 0.09),
    0 12px 22px rgba(121, 38, 50, 0.08);
}

.mini-games-zone {
  grid-template-rows: auto minmax(0, 1fr);
}

.section-label {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 13px 7px;
  color: #74243d;
  font-size: 16px;
  line-height: 1;
  font-weight: 1000;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 18px rgba(121, 38, 50, 0.13);
}

.coin-section-label img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 3px 3px rgba(88, 37, 16, 0.2));
}

.main-hero-list {
  overflow: visible;
}

.mini-hero-list {
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 10px;
}

.hero-card {
  position: relative;
  min-height: 154px;
  display: grid;
  grid-template-columns: 40% 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
  overflow: hidden;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, filter 160ms ease;
  text-align: left;
  animation: card-in 360ms ease both;
}

.main-game-card {
  min-height: 174px;
  border-color: rgba(255, 255, 255, 0.94);
  background:
    radial-gradient(circle at 86% 16%, rgba(255, 215, 90, 0.42), transparent 36%),
    rgba(255, 255, 255, 0.9);
}

.mini-game-card {
  min-height: 142px;
  grid-template-columns: 32% 1fr;
  padding: 10px 12px;
}

.card-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-bottom: 4px;
  padding: 3px 8px 4px;
  color: #9b1f4d;
  font-size: 11px;
  line-height: 1;
  font-weight: 1000;
  border-radius: 999px;
  background: rgba(255, 248, 219, 0.86);
  box-shadow: inset 0 -2px 0 rgba(255, 159, 28, 0.08);
}

.hero-card:nth-child(2) {
  animation-delay: 70ms;
}

.hero-card:nth-child(3) {
  animation-delay: 140ms;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, rgba(255, 78, 142, 0.22), rgba(255, 212, 78, 0.32));
}

.hero-card img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(80, 23, 33, 0.18));
}

.main-game-card::before {
  background: linear-gradient(135deg, rgba(255, 78, 142, 0.34), rgba(255, 215, 90, 0.38), rgba(89, 215, 123, 0.18));
}

.main-game-card img {
  height: 148px;
}

.mini-game-card img {
  height: 98px;
}

.mini-game-card h3 {
  font-size: 21px;
}

.mini-game-card p {
  font-size: 15px;
}

.mini-game-card .select-pill {
  min-height: 34px;
  margin-top: 7px;
  padding-inline: 14px;
}

.hero-card h3 {
  font-size: 23px;
  line-height: 1;
}

.hero-card p {
  margin-top: 5px;
  color: #704052;
  font-weight: 800;
  line-height: 1.16;
}

.hero-card .select-pill {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  margin-top: 10px;
  padding: 0 16px;
  color: #fffdf0;
  font-weight: 1000;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
  box-shadow: inset 0 -3px 0 rgba(118, 29, 35, 0.2);
}

.hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  grid-template-areas:
    "title score help pause"
    "status status status lives";
  align-items: center;
  gap: 8px;
  min-height: 48px;
}

.mini-game-hud {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  grid-template-areas: "title lives help pause";
}

.game-title {
  grid-area: title;
  min-width: 0;
  min-height: 58px;
  padding: 7px 10px 8px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(121, 38, 50, 0.13);
}

.game-title strong {
  display: block;
  font-size: 19px;
  line-height: 1;
  color: #74243d;
  text-shadow: none;
}

.game-title span {
  display: block;
  margin-top: 3px;
  color: #713041;
  font-size: 13px;
  line-height: 1.08;
  font-weight: 900;
}

.score-pill,
.lives-pill,
.pause-button,
.help-button {
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  white-space: nowrap;
  font-weight: 1000;
  font-size: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 18px rgba(121, 38, 50, 0.14), inset 0 -3px 0 rgba(223, 83, 75, 0.12);
}

.hud #statusMount {
  grid-area: status;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
}

.score-pill {
  grid-area: score;
}

.lives-pill {
  grid-area: lives;
  justify-self: end;
}

.pause-button {
  grid-area: pause;
}

.help-button {
  grid-area: help;
}

.hud .rating-board-button {
  min-height: 40px;
  width: clamp(138px, 28vw, 208px);
  flex-basis: clamp(138px, 28vw, 208px);
  padding: 4px 8px 5px 10px;
}

.hud .rating-board-button strong {
  font-size: 12px;
}

.hud .status-kicker {
  font-size: 9px;
}

.hud .rating-mini {
  min-width: 32px;
  min-height: 25px;
  font-size: 11px;
}

.pause-button,
.help-button {
  min-width: 42px;
  padding: 0;
  color: #74243d;
  font-size: 17px;
  background: transparent;
  box-shadow: none;
}

.menu-help-button {
  min-width: 48px;
  min-height: 48px;
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(121, 38, 50, 0.16), inset 0 -3px 0 rgba(223, 83, 75, 0.16);
}

.pause-button img,
.help-button img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 3px 3px rgba(80, 23, 33, 0.16));
}

.play-area {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 252, 232, 0.5), rgba(255, 173, 92, 0.16)),
    rgba(255, 255, 255, 0.36);
  box-shadow: var(--shadow);
  touch-action: none;
}

.field-toast-stack {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 70;
  width: min(250px, 62%);
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  pointer-events: none;
}

.air-stage .field-toast-stack {
  left: 14px;
  right: auto;
  align-items: flex-start;
}

.coffee-stage .field-toast-stack {
  top: 12px;
  right: 12px;
  width: min(220px, 48%);
}

.game-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.progress-panel {
  min-height: 58px;
  display: grid;
  gap: 7px;
  padding: 9px 14px 11px;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 18px rgba(121, 38, 50, 0.13), inset 0 -3px 0 rgba(255, 159, 28, 0.11);
}

.progress-label {
  color: #74243d;
  font-size: 15px;
  line-height: 1;
  font-weight: 1000;
  text-align: center;
}

.progress-track {
  height: 15px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 139, 163, 0.42), rgba(255, 224, 122, 0.5));
  box-shadow: inset 0 2px 6px rgba(94, 25, 44, 0.16);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff5b9b, #ffd75a, #59d77b);
  box-shadow: 0 0 12px rgba(255, 91, 155, 0.25);
  transition: width 260ms ease;
}

.progress-panel.no-bar {
  min-height: 48px;
  align-content: center;
}

.progress-panel.no-bar .progress-track {
  display: none;
}

.shake {
  animation: shake 280ms ease both;
}

@keyframes shake {
  20% {
    transform: translateX(-7px);
  }

  45% {
    transform: translateX(6px);
  }

  70% {
    transform: translateX(-4px);
  }
}

.air-stage {
  height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 58%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 208, 87, 0.72), transparent 54%);
}

.air-block {
  position: absolute;
  width: 112px;
  height: 132px;
  display: grid;
  place-items: center;
  filter: none;
  transition: transform 160ms cubic-bezier(.2, 1.45, .35, 1);
}

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

.air-block.current {
  z-index: 4;
}

.air-block.landed {
  z-index: 3;
  transition: left 120ms ease, top 160ms ease, transform 160ms cubic-bezier(.2, 1.45, .35, 1);
}

.air-ground {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 12px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.54);
}

.blender-stage {
  height: 100%;
}

.blender-preview {
  position: absolute;
  left: 12px;
  bottom: 10px;
  width: 116px;
  height: 168px;
  z-index: 5;
  display: grid;
  place-items: end center;
  pointer-events: none;
}

.blender-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(70, 22, 33, 0.22));
}

.falling-item {
  position: absolute;
  width: var(--item-size, 66px);
  height: var(--item-size, 66px);
  display: grid;
  place-items: center;
  z-index: 4;
  padding: 0;
  border-radius: 20px;
  background: transparent;
  touch-action: none;
  animation: tiny-wiggle 1s ease-in-out infinite alternate;
}

.falling-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 7px 8px rgba(70, 22, 33, 0.2));
  pointer-events: none;
}

@keyframes tiny-wiggle {
  from {
    rotate: -5deg;
  }

  to {
    rotate: 6deg;
  }
}

.coffee-stage {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(170px, 1fr) auto;
  gap: 10px;
  padding: 12px;
}

.coffee-visual {
  position: relative;
  z-index: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  align-items: end;
  gap: 2px;
  overflow: hidden;
}

#coffeeMachine,
#coffeeCup {
  min-height: 0;
  height: 100%;
  display: grid;
  align-items: end;
}

.coffee-visual img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(70, 22, 33, 0.2));
}

.coffee-visual .cup-img {
  align-self: end;
  max-height: 48%;
}

.timing-panel {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 -4px 0 rgba(255, 159, 28, 0.12);
}

.stage-name {
  text-align: center;
  font-weight: 1000;
  color: #6c263d;
}

.timing-bar {
  position: relative;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff8d9d, #fff1a7, #63d985, #fff1a7, #ff8d9d);
  box-shadow: inset 0 3px 8px rgba(97, 38, 47, 0.18);
  overflow: hidden;
}

.timing-target {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 42%;
  width: 16%;
  background: rgba(54, 192, 94, 0.38);
  border-inline: 3px solid rgba(24, 138, 66, 0.68);
}

.timing-center {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 2px);
  width: 4px;
  background: rgba(255, 255, 255, 0.86);
}

.timing-pointer {
  position: absolute;
  top: -3px;
  left: 0;
  width: 16px;
  height: 40px;
  border-radius: 999px;
  background: #6b203b;
  box-shadow: 0 3px 8px rgba(44, 14, 26, 0.26);
  transform: translateX(-50%);
}

.match-prep-screen {
  text-align: center;
}

.match-prep-card {
  display: grid;
  grid-template-columns: minmax(120px, 0.72fr) 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.match-prep-hero img {
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(70, 22, 33, 0.18));
}

.match-prep-copy {
  display: grid;
  gap: 8px;
  color: #74243d;
  text-align: left;
}

.match-prep-copy strong {
  font-size: 22px;
  line-height: 1.05;
}

.match-prep-copy span {
  color: #794152;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 900;
}

.inventory-preview {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: none;
}

.inventory-preview::-webkit-scrollbar {
  display: none;
}

.inventory-chip {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 6px 9px;
  color: #74243d;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 -3px 0 rgba(255, 159, 28, 0.1);
  font-size: 12px;
  font-weight: 1000;
}

.inventory-chip img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.inventory-chip span {
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-chip strong {
  min-width: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  color: #fffdf0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
}

.match-prep-actions {
  display: grid;
  gap: 10px;
}

.shop-open-button {
  display: inline-grid;
  grid-auto-flow: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.shop-open-button img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.match-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
}

.match-status {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 66px;
  padding: 6px 8px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 -3px 0 rgba(255, 159, 28, 0.1);
}

.match-character {
  min-width: 0;
  display: grid;
  place-items: center;
}

.match-character img {
  width: 74px;
  height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(70, 22, 33, 0.18));
}

.match-goals {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.goal-chip {
  min-width: 70px;
  min-height: 40px;
  display: grid;
  grid-template-columns: 32px auto;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  color: #74243d;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  font-size: 15px;
  font-weight: 1000;
  box-shadow: 0 5px 10px rgba(94, 25, 44, 0.09);
}

.goal-chip.done {
  color: #fffdf0;
  background: linear-gradient(180deg, #59d77b, #23b65a);
}

.goal-chip img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.match-board {
  align-self: center;
  justify-self: center;
  width: min(100%, 330px);
  max-height: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 8px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.78), transparent 58%),
    rgba(255, 242, 184, 0.58);
  box-shadow: inset 0 -5px 0 rgba(255, 159, 28, 0.12), 0 12px 22px rgba(121, 38, 50, 0.12);
}

@media (min-height: 780px) and (max-width: 520px) {
  .match-board {
    width: min(100%, 360px);
  }
}

.match-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 2px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 -3px 0 rgba(255, 127, 80, 0.11), 0 3px 7px rgba(90, 24, 41, 0.08);
  transition: background 180ms ease, box-shadow 180ms ease, transform 160ms ease;
  touch-action: none;
}

.match-cell.clearing,
.match-cell.clearing-special,
.match-cell.clearing-bomb {
  z-index: 25;
  pointer-events: none;
}

.match-cell.tile-new {
  animation: tile-new 260ms ease-out both;
}

.match-cell.clearing {
  animation: tile-clear 300ms ease-out forwards;
}

.match-cell.clearing-special {
  animation: tile-special-clear 360ms ease-out forwards;
}

.match-cell.clearing-bomb {
  animation: tile-bomb-clear 360ms ease-out forwards;
}

.match-cell.clearing::after,
.match-cell.clearing-special::after,
.match-cell.clearing-bomb::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 215, 90, 0.55) 42%, transparent 70%);
  animation: clear-flash 340ms ease-out forwards;
}

.match-cell.clearing-special::after {
  inset: -12px;
  background: radial-gradient(circle, rgba(255, 255, 255, 1), rgba(255, 91, 155, 0.48) 38%, rgba(89, 215, 123, 0.36) 58%, transparent 75%);
}

.match-cell.clearing-bomb::after {
  inset: -14px;
  background: radial-gradient(circle, rgba(255, 255, 255, 1), rgba(255, 141, 34, 0.62) 35%, rgba(255, 91, 155, 0.48) 62%, transparent 78%);
}

@keyframes tile-settle {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.99);
  }

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

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes tile-new {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
  }

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

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes tile-clear {
  0% {
    transform: scale(1);
  }

  52% {
    transform: scale(1.035);
  }

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

@keyframes tile-special-clear {
  0% {
    transform: scale(1);
  }

  46% {
    transform: scale(1.055);
  }

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

@keyframes tile-bomb-clear {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.05);
  }

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

@keyframes clear-flash {
  from {
    opacity: 0;
    transform: scale(0.86);
  }

  45% {
    opacity: 0.75;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(1.12);
  }
}

.match-cell.selected,
.match-cell:active {
  transform: translateY(-2px) scale(1.05);
  background: #fff8cc;
  box-shadow: 0 0 0 3px rgba(255, 91, 155, 0.35), inset 0 -3px 0 rgba(255, 127, 80, 0.11);
}

.match-cell.dragging {
  background: #fff8cc;
  box-shadow: 0 10px 16px rgba(94, 25, 44, 0.2), 0 0 0 3px rgba(255, 91, 155, 0.34);
  transition: none;
  will-change: transform;
}

.match-cell.drag-target {
  background: rgba(255, 244, 168, 0.9);
  box-shadow: 0 0 0 3px rgba(89, 215, 123, 0.38), inset 0 -3px 0 rgba(255, 127, 80, 0.11);
}

.match-cell.blocker {
  background: transparent;
  box-shadow: none;
}

.match-cell.blocker:active,
.match-cell.blocker.selected {
  transform: none;
  background: transparent;
  box-shadow: none;
}

.match-cell.blocker img {
  width: 105%;
  height: 105%;
}

.match-cell img {
  width: 94%;
  height: 94%;
  object-fit: contain;
  pointer-events: none;
}

.match-cell.special-star,
.match-cell.special-heart {
  background: linear-gradient(180deg, #fff5ba, #ffffff);
}

.booster-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.booster-button {
  position: relative;
  min-height: 50px;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 -3px 0 rgba(255, 159, 28, 0.12);
}

.booster-button.active {
  background: #fff4a8;
  box-shadow: 0 0 0 3px rgba(255, 91, 155, 0.28), inset 0 -3px 0 rgba(255, 159, 28, 0.12);
}

.booster-button:disabled {
  opacity: 0.46;
  filter: grayscale(0.35);
}

.booster-button img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.booster-button span {
  position: absolute;
  right: -4px;
  top: -5px;
  min-width: 22px;
  min-height: 22px;
  display: grid;
  place-items: center;
  color: #fffdf0;
  font-size: 11px;
  font-weight: 1000;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
  box-shadow: 0 3px 7px rgba(94, 25, 44, 0.16);
}

.shop-modal {
  position: absolute;
  inset: 0;
  z-index: 135;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(80, 28, 44, 0.28);
  backdrop-filter: blur(5px);
}

.shop-card {
  position: relative;
  width: min(100%, 390px);
  max-height: min(92dvh, 720px);
  display: grid;
  gap: 12px;
  padding: 16px;
  overflow: hidden;
  color: #74243d;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 215, 90, 0.34), transparent 42%),
    rgba(255, 255, 255, 0.94);
  box-shadow: var(--deep-shadow);
  animation: result-bounce 420ms cubic-bezier(.22, 1.25, .38, 1) both;
}

.shop-head {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 10px;
  padding-right: 40px;
}

.shop-character img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 9px 12px rgba(70, 22, 33, 0.18));
}

.shop-head h3 {
  font-size: 28px;
  line-height: 1;
}

.shop-head p {
  margin-top: 4px;
  color: #794152;
  font-size: 14px;
  line-height: 1.12;
  font-weight: 900;
}

.shop-balance {
  width: fit-content;
  min-height: 34px;
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 2px 10px;
  color: #fffdf0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
  font-weight: 1000;
}

.shop-balance img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.shop-grid {
  min-height: 0;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
}

.shop-grid::-webkit-scrollbar {
  display: none;
}

.shop-item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 72px;
  padding: 8px;
  border-radius: 19px;
  background: rgba(255, 246, 220, 0.76);
  box-shadow: inset 0 -3px 0 rgba(255, 159, 28, 0.1);
}

.shop-item.unavailable {
  position: relative;
  opacity: 0.62;
  filter: saturate(0.5);
  background: rgba(102, 56, 72, 0.16);
}

.shop-item.unavailable > img {
  filter: grayscale(0.45);
}

.shop-item.unavailable::after {
  content: "Не хватает монет";
  position: absolute;
  right: 76px;
  bottom: 7px;
  padding: 3px 7px 4px;
  color: #fffdf0;
  border-radius: 999px;
  background: rgba(116, 36, 61, 0.8);
  font-size: 10px;
  line-height: 1;
  font-weight: 1000;
}

.shop-item > img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.shop-item div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.shop-item strong {
  font-size: 16px;
  line-height: 1;
}

.shop-item span,
.shop-item em {
  color: #794152;
  font-size: 12px;
  line-height: 1.1;
  font-style: normal;
  font-weight: 900;
}

.mini-buy {
  min-width: 52px;
  min-height: 40px;
  display: grid;
  place-items: center;
  color: #fffdf0;
  font-size: 15px;
  font-weight: 1000;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
  box-shadow: inset 0 -3px 0 rgba(145, 31, 34, 0.24);
}

.mini-buy::before {
  content: "";
  width: 20px;
  height: 20px;
  margin-right: 2px;
  display: inline-block;
  vertical-align: -5px;
  background: url("./assets/images/coin.png") center / contain no-repeat;
}

.mini-buy:disabled {
  color: #7a4d58;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 -3px 0 rgba(94, 25, 44, 0.06);
}

.pop {
  position: absolute;
  z-index: 90;
  left: var(--pop-x, 50%);
  top: var(--pop-y, 50%);
  color: #fffdf0;
  font-size: 20px;
  font-weight: 1000;
  text-shadow: 0 2px 0 #bd1b4f, 0 6px 10px rgba(77, 19, 38, 0.18);
  -webkit-text-stroke: 0.45px rgba(116, 36, 61, 0.7);
  pointer-events: none;
  animation: pop-up 800ms ease forwards;
}

.field-toast-stack .pop,
.field-toast-stack .phrase-pop {
  position: relative;
  left: auto;
  top: auto;
  max-width: 100%;
  padding: 5px 9px 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 7px 14px rgba(94, 25, 44, 0.14);
  transform: none;
  animation: toast-in 1100ms ease forwards;
}

.field-toast-stack .pop {
  align-self: flex-end;
  font-size: 18px;
}

.air-stage .field-toast-stack .pop {
  align-self: flex-start;
}

.phrase-pop {
  position: absolute;
  z-index: 92;
  left: var(--pop-x, 50%);
  top: var(--pop-y, 50%);
  max-width: min(230px, 72%);
  padding: 0;
  color: #9b1f4d;
  font-size: 15px;
  line-height: 1.08;
  font-weight: 1000;
  text-align: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.94), 0 5px 8px rgba(94, 25, 44, 0.14);
  -webkit-text-stroke: 0.25px rgba(255, 255, 255, 0.72);
  pointer-events: none;
  animation: phrase-pop 1300ms ease forwards;
}

.phrase-pop.bad {
  color: #d62f47;
  background: rgba(255, 255, 255, 0.8);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.9), 0 5px 8px rgba(94, 25, 44, 0.14);
}

@keyframes phrase-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.84);
  }

  16%,
  76% {
    opacity: 1;
    transform: translate(-50%, -6px) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -20px) scale(0.96);
  }
}

@keyframes pop-up {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.7);
  }

  18% {
    opacity: 1;
    transform: translate(-50%, -8px) scale(1.12);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -48px) scale(1);
  }
}

@keyframes toast-in {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.92);
  }

  18%,
  78% {
    opacity: 1;
    transform: none;
  }

  100% {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

.result-screen {
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  overflow: hidden;
}

.pause-modal {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(80, 28, 44, 0.28);
  backdrop-filter: blur(5px);
}

.pause-card {
  width: min(100%, 330px);
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--deep-shadow);
}

.pause-card h3 {
  color: #74243d;
  font-size: 30px;
  line-height: 1;
  text-align: center;
}

.help-modal {
  position: absolute;
  inset: 0;
  z-index: 138;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(66, 22, 38, 0.55);
  backdrop-filter: blur(2px);
}

.help-dialog {
  position: relative;
  z-index: 2;
  width: min(100%, 410px);
  max-height: min(84dvh, 620px);
  overflow: auto;
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  color: #74243d;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 224, 0.94)),
    radial-gradient(circle at 18% 0%, rgba(255, 215, 90, 0.2), transparent 42%),
    rgba(255, 255, 255, 0.94);
  box-shadow: var(--deep-shadow);
  animation: help-dialog-in 360ms ease-out both;
}

.help-dialog.below {
  transform: none;
}

.help-dialog.above {
  transform: none;
}

.help-character {
  align-self: center;
  display: grid;
  place-items: center;
  width: 82px;
  height: 96px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 246, 220, 0.9), rgba(255, 255, 255, 0.76));
  box-shadow: inset 0 -4px 0 rgba(255, 159, 28, 0.08);
  overflow: hidden;
}

.help-character img {
  width: 88px;
  height: 96px;
  object-fit: contain;
  object-position: center bottom;
  filter: none;
}

.help-copy {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.help-copy h3 {
  margin: 0;
  padding-right: 34px;
  font-size: 25px;
  line-height: 1;
}

.help-steps {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
}

.help-steps span {
  display: block;
  padding: 7px 10px 8px;
  color: #673244;
  border-radius: 15px;
  background: rgba(255, 248, 226, 0.86);
  font-size: 14px;
  line-height: 1.18;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.help-copy p {
  padding: 9px 11px 10px;
  color: #9b1f4d;
  border-radius: 16px;
  background: rgba(255, 236, 185, 0.72);
  font-size: 13px;
  line-height: 1.18;
  font-weight: 1000;
  overflow-wrap: anywhere;
}

.help-dialog .action-button {
  grid-column: 1 / -1;
  min-height: 48px;
}

.select-dialog-modal {
  display: grid;
  align-items: center;
  padding: 18px;
  background: rgba(66, 22, 38, 0.54);
  backdrop-filter: blur(2px);
}

.select-help-panel {
  position: relative;
  width: min(100%, 410px);
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  grid-template-areas:
    "character intro"
    "bubble bubble"
    "button button";
  gap: 10px 12px;
  align-items: center;
  margin: 0 auto;
  padding: 16px;
  color: #74243d;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 224, 0.94)),
    radial-gradient(circle at 16% 0%, rgba(255, 215, 90, 0.18), transparent 40%),
    rgba(255, 255, 255, 0.95);
  box-shadow: var(--deep-shadow);
  animation: help-dialog-in 320ms ease-out both;
}

.select-help-character {
  grid-area: character;
  display: grid;
  place-items: center;
  width: 88px;
  height: 106px;
  min-height: 0;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 246, 220, 0.9), rgba(255, 255, 255, 0.76));
  box-shadow: inset 0 -4px 0 rgba(255, 159, 28, 0.08);
}

.select-help-character img {
  width: 92px;
  height: 108px;
  object-fit: contain;
  object-position: center bottom;
  transform: none;
  filter: none;
}

.select-help-bubble {
  grid-area: bubble;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 248, 226, 0.9);
  box-shadow: inset 0 -3px 0 rgba(255, 159, 28, 0.09);
}

.select-help-panel::before {
  content: "Добро пожаловать на кухню!";
  grid-area: intro;
  align-self: center;
  color: #74243d;
  font-size: 25px;
  line-height: 0.95;
  font-weight: 1000;
}

.select-help-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.select-help-tab {
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  color: #8b4a5c;
  font-size: 12px;
  line-height: 1;
  font-weight: 1000;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.select-help-tab.active {
  color: #fffdf0;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
  text-shadow: 0 1px 0 rgba(102, 29, 36, 0.18);
}

.select-help-bubble p {
  margin: 0;
  color: #74243d;
  font-size: 17px;
  line-height: 1.16;
  font-weight: 1000;
  text-align: left;
}

.select-help-panel .action-button {
  grid-area: button;
  min-height: 52px;
}

@keyframes help-dialog-in {
  from {
    opacity: 0;
    translate: 0 12px;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

.status-modal,
.profile-modal,
.leaderboard-modal {
  position: absolute;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(80, 28, 44, 0.26);
  backdrop-filter: blur(5px);
}

.leaderboard-modal {
  z-index: 136;
}

.profile-modal {
  z-index: 138;
}

.status-card,
.profile-card,
.leaderboard-card {
  position: relative;
  width: min(100%, 350px);
  display: grid;
  gap: 11px;
  justify-items: center;
  padding: 20px 18px 18px;
  color: #74243d;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 215, 90, 0.32), transparent 44%),
    rgba(255, 255, 255, 0.93);
  box-shadow: var(--deep-shadow);
  animation: result-bounce 420ms cubic-bezier(.22, 1.25, .38, 1) both;
}

.leaderboard-card {
  width: min(100%, 410px);
  max-height: min(88dvh, 690px);
  overflow: hidden;
  align-content: start;
  gap: 12px;
}

.leaderboard-card h3 {
  font-size: clamp(31px, 5dvh, 42px);
}

.rating-summary {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "main main"
    "points place";
  gap: 12px;
  padding: 14px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 240, 181, 0.76)),
    radial-gradient(circle at 90% 0%, rgba(255, 91, 155, 0.18), transparent 42%);
  box-shadow: inset 0 -4px 0 rgba(255, 159, 28, 0.09), 0 10px 18px rgba(121, 38, 50, 0.1);
  justify-items: stretch;
}

.rating-summary-main {
  grid-area: main;
  min-width: 0;
  display: grid;
  gap: 3px;
  justify-items: center;
  text-align: center;
}

.rating-summary-main span,
.rating-stat span {
  color: #8b4a5c;
  font-size: 12px;
  line-height: 1;
  font-weight: 1000;
}

.rating-summary-main strong {
  color: #74243d;
  font-size: 24px;
  line-height: 1;
  font-weight: 1000;
  text-align: center;
}

.rating-summary-main p {
  margin: 0;
  color: #794152;
  font-size: 13px;
  line-height: 1.16;
  font-weight: 900;
  text-align: center;
  max-width: 31ch;
}

.rating-summary-note {
  display: inline-block;
  max-width: 34ch;
  margin-top: 4px;
  color: #a32055;
  font-size: 11px;
  line-height: 1.18;
  font-weight: 1000;
  text-align: center;
}

.rating-stat {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 -2px 0 rgba(255, 159, 28, 0.08);
  text-align: left;
}

.rating-stat strong {
  min-width: 0;
  color: #74243d;
  font-size: clamp(15px, 3.5vw, 18px);
  line-height: 1.02;
  font-weight: 1000;
  overflow-wrap: anywhere;
}

.rating-stat.points {
  grid-area: points;
}

.rating-stat.place {
  grid-area: place;
}

.profile-card {
  text-align: left;
}

.profile-card h3 {
  font-size: clamp(27px, 4.4dvh, 34px);
}

.profile-card h3,
.leaderboard-card h3 {
  width: calc(100% - 42px);
  margin: 0 auto;
  font-size: clamp(28px, 5dvh, 38px);
  line-height: 1;
  text-align: center;
}

.profile-card p,
.leaderboard-card p {
  color: #794152;
  font-size: 15px;
  line-height: 1.18;
  font-weight: 900;
  text-align: center;
}

.profile-card label {
  width: 100%;
  display: grid;
  gap: 5px;
  color: #74243d;
  font-size: 13px;
  font-weight: 1000;
}

.profile-section-title {
  width: 100%;
  margin-bottom: -4px;
  color: #74243d;
  font-size: 14px;
  line-height: 1;
  font-weight: 1000;
  text-align: left;
}

.profile-card input,
.profile-card select {
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  color: #5e2236;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: 16px;
  outline: none;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 3px 8px rgba(94, 25, 44, 0.08);
  font-size: 16px;
  font-weight: 900;
}

.profile-card select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #8a2c49 50%) calc(100% - 18px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, #8a2c49 50%, transparent 50%) calc(100% - 12px) 50% / 7px 7px no-repeat,
    rgba(255, 255, 255, 0.86);
}

.avatar-picker {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.avatar-option {
  position: relative;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 5px 7px;
  color: #74243d;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 18px;
  background: rgba(255, 246, 220, 0.72);
  box-shadow: inset 0 -3px 0 rgba(255, 159, 28, 0.08);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.avatar-option.active {
  border-color: rgba(255, 91, 155, 0.72);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 226, 119, 0.78));
  transform: translateY(-2px);
}

.avatar-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.avatar-option img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 3px 3px rgba(86, 27, 43, 0.12));
}

.avatar-option span {
  max-width: 100%;
  color: #74243d;
  font-size: 11px;
  line-height: 1;
  font-weight: 1000;
  text-align: center;
}

.leaderboard-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.leaderboard-tab {
  min-height: 42px;
  color: #74243d;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 -3px 0 rgba(223, 83, 75, 0.1);
  font-size: 14px;
  font-weight: 1000;
}

.leaderboard-tab.active {
  color: #fffdf0;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
  text-shadow: 0 1px 0 rgba(102, 29, 36, 0.22);
}

.leaderboard-tab:disabled {
  opacity: 0.48;
  cursor: default;
}

.leaderboard-list {
  width: 100%;
  min-height: 0;
  display: grid;
  gap: 7px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: none;
}

.leaderboard-list::-webkit-scrollbar {
  display: none;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 34px 42px minmax(0, 1fr) auto;
  grid-template-areas:
    "place avatar player score"
    "place avatar player rounds";
  align-items: center;
  column-gap: 8px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255, 246, 220, 0.78);
  box-shadow: inset 0 -3px 0 rgba(255, 159, 28, 0.09);
}

.leaderboard-avatar {
  grid-area: avatar;
  width: 40px;
  height: 40px;
  object-fit: contain;
  object-position: center bottom;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 -2px 0 rgba(255, 159, 28, 0.08);
}

.leaderboard-row strong {
  grid-area: place;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #fffdf0;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
}

.leaderboard-row div {
  grid-area: player;
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: left;
}

.leaderboard-row span,
.leaderboard-row b {
  color: #74243d;
  font-size: 15px;
  line-height: 1;
  font-weight: 1000;
}

.leaderboard-row em,
.leaderboard-row small {
  color: #794152;
  font-size: 12px;
  line-height: 1.05;
  font-style: normal;
  font-weight: 900;
}

.leaderboard-row b {
  grid-area: score;
  justify-self: end;
}

.leaderboard-row small {
  grid-area: rounds;
  justify-self: end;
}

.leaderboard-empty {
  padding: 18px 14px;
  color: #794152;
  border-radius: 18px;
  background: rgba(255, 246, 220, 0.78);
  font-size: 15px;
  line-height: 1.18;
  font-weight: 900;
  text-align: center;
}

.leaderboard-local-note {
  padding: 12px 14px;
  color: #8b4a5c;
  border-radius: 16px;
  background: rgba(255, 248, 226, 0.86);
  font-size: 13px;
  line-height: 1.15;
  font-weight: 900;
  text-align: center;
}

.leaderboard-row.local {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 236, 185, 0.82));
}

.global-toast {
  position: absolute;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 160;
  max-width: min(86%, 360px);
  padding: 10px 14px 12px;
  color: #fffdf0;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(116, 36, 61, 0.92);
  box-shadow: var(--deep-shadow);
  font-size: 15px;
  font-weight: 1000;
  line-height: 1.1;
  text-align: center;
  transform: translateX(-50%);
  animation: toast-in 1800ms ease forwards;
}

.status-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #74243d;
  font-size: 24px;
  font-weight: 1000;
  border-radius: 14px;
  background: rgba(255, 246, 220, 0.9);
  box-shadow: inset 0 -3px 0 rgba(223, 83, 75, 0.12);
}

.status-orbit {
  min-width: 72px;
  min-height: 72px;
  display: grid;
  place-items: center;
  color: #fffdf0;
  font-size: 24px;
  font-weight: 1000;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
  box-shadow: 0 12px 22px rgba(134, 45, 58, 0.22), inset 0 -5px 0 rgba(145, 31, 34, 0.28);
  text-shadow: 0 2px 0 rgba(102, 29, 36, 0.22);
}

.status-card h3 {
  margin: 0;
  font-size: clamp(28px, 5dvh, 38px);
  line-height: 1;
}

.status-card p {
  max-width: 290px;
  color: #794152;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
}

.status-meter {
  width: min(100%, 290px);
  height: 15px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 139, 163, 0.36), rgba(255, 224, 122, 0.42));
  box-shadow: inset 0 2px 6px rgba(94, 25, 44, 0.16);
}

.status-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff5b9b, #ffd75a, #59d77b);
}

.status-details,
.status-next {
  width: min(100%, 300px);
  padding: 9px 11px;
  border-radius: 16px;
  background: rgba(255, 246, 220, 0.78);
  color: #6e3142;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 900;
}

.status-next {
  color: #9b1f4d;
  background: rgba(255, 255, 255, 0.82);
}

.result-card {
  width: 100%;
  display: grid;
  gap: clamp(10px, 1.6dvh, 16px);
  place-items: center;
  min-height: 0;
  min-width: 0;
  margin: 0;
  padding: clamp(10px, 1.8dvh, 16px);
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  border: 2px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--deep-shadow);
}

#resultHero {
  position: relative;
  width: min(46vw, 28dvh, 178px);
  height: min(46vw, 28dvh, 178px);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.result-copy {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: clamp(8px, 1.4dvh, 12px);
  place-items: center;
  text-align: center;
  overflow: hidden;
}

.result-card h2 {
  width: min(100%, 340px);
  min-height: 66px;
  display: grid;
  place-items: center;
  padding: 9px 14px 12px;
  font-size: clamp(25px, 3.8dvh, 34px);
  line-height: 1.04;
}

.result-hero {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(80, 23, 33, 0.2));
  animation: result-bounce 800ms cubic-bezier(.22, 1.4, .38, 1) both;
}

@keyframes result-bounce {
  from {
    transform: translateY(16px) scale(0.82);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

.score-big {
  font-size: clamp(42px, 9dvh, 70px);
  line-height: 0.9;
  color: #ff4d8d;
  font-weight: 1000;
  text-shadow: 0 4px 0 #fff2a9, 0 8px 14px rgba(94, 25, 44, 0.18);
}

.coin-total {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  max-width: 100%;
  padding: 7px 16px 9px;
  color: #fffdf0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
  box-shadow: inset 0 -5px 0 rgba(145, 31, 34, 0.25), 0 10px 18px rgba(121, 38, 50, 0.16);
  font-size: clamp(20px, 3.6dvh, 26px);
  line-height: 1;
  font-weight: 1000;
  text-shadow: 0 2px 0 rgba(102, 29, 36, 0.22);
}

.coin-total img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.rank {
  width: min(100%, 340px);
  font-size: clamp(20px, 3.2dvh, 24px);
  font-weight: 1000;
  color: #5e2236;
  text-align: center;
}

.result-phrase {
  width: min(100%, 360px);
  color: #794152;
  font-weight: 900;
  line-height: 1.2;
  font-size: clamp(15px, 2.25dvh, 18px);
  text-align: center;
}

.result-note {
  width: min(100%, 340px);
  text-align: center;
  overflow-wrap: anywhere;
}

.coin-reward {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  max-width: 100%;
  padding: 4px 12px 5px;
  color: #fffdf0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
  box-shadow: inset 0 -3px 0 rgba(145, 31, 34, 0.22);
  font-size: 16px;
  font-weight: 1000;
  line-height: 1;
}

.coin-reward img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.coin-pop {
  position: absolute;
  z-index: 42;
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 4px 9px 5px;
  color: #fffdf0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff5b9b, #ff8d22);
  box-shadow: inset 0 -3px 0 rgba(145, 31, 34, 0.22), 0 8px 14px rgba(91, 24, 42, 0.18);
  font-size: 17px;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(102, 29, 36, 0.22);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: coin-pop-up 1150ms ease-out forwards;
}

.coin-pop img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(88, 37, 16, 0.2));
}

@keyframes coin-pop-up {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) scale(0.72);
  }

  20% {
    opacity: 1;
    transform: translate(-50%, -8px) scale(1.08);
  }

  72% {
    opacity: 1;
    transform: translate(-50%, -24px) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -42px) scale(0.96);
  }
}

.result-actions {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 10px;
}

.confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 30;
}

.confetti {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 14px;
  border-radius: 4px;
  background: var(--confetti-color);
  animation: confetti-fall var(--fall-time, 1300ms) linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translate3d(var(--fall-x, 0), 108dvh, 0) rotate(560deg);
  }
}

.asset-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #7a3047;
  font-weight: 1000;
  text-align: center;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 20px;
}

@media (max-height: 690px) {
  .screen {
    gap: 10px;
    padding-inline: 14px;
  }

  .logo-wrap {
    width: min(72vw, 250px, 38dvh);
    height: min(38dvh, 250px);
    margin-top: 0;
  }

  h1 {
    font-size: clamp(32px, 6dvh, 44px);
  }

  .subtitle {
    font-size: 17px;
  }

  .hero-card {
    min-height: 132px;
    padding: 9px;
  }

  .hero-card img {
    height: 108px;
  }

  .main-game-card {
    min-height: 138px;
  }

  .main-game-card img {
    height: 116px;
  }

  .mini-game-card {
    min-height: 92px;
  }

  .mini-game-card img {
    height: 76px;
  }

  .hero-card h3 {
    font-size: 20px;
  }

  .hero-card p {
    font-size: 13px;
  }

  .card-kicker {
    font-size: 10px;
  }

  .coffee-stage {
    grid-template-rows: minmax(138px, 1fr) auto;
  }

  .blender-preview {
    width: 92px;
    height: 136px;
  }

  .image-button {
    width: min(76vw, 292px);
    margin-top: 8px;
  }
}

@media (min-width: 720px) and (max-height: 820px) {
  .start-screen {
    gap: 7px;
  }

  .logo-wrap {
    width: min(310px, 40dvh);
    height: min(40dvh, 310px);
  }

  .start-copy {
    margin-top: 4px;
  }

  .start-title-card {
    max-width: 340px;
    padding: 12px 18px 14px;
    border-radius: 24px;
    gap: 8px;
  }

  h1 {
    font-size: 38px;
    white-space: nowrap;
  }

  .start-title {
    font-size: clamp(34px, 6dvh, 46px);
    line-height: 0.98;
    white-space: normal;
  }

  .start-copy .subtitle {
    font-size: 17px;
    margin-top: 6px;
  }

  .start-copy .start-subtitle {
    max-width: 29ch;
    margin-top: 0;
    font-size: 15px;
    line-height: 1.25;
  }

  .image-button {
    width: 292px;
    margin-top: 8px;
  }

  .small-note {
    margin-top: 6px;
  }
}

@media (max-height: 760px) {
  .screen {
    gap: 8px;
    padding-block: calc(12px + var(--safe-top)) calc(12px + var(--safe-bottom));
  }

  .screen.is-game {
    gap: 8px;
  }

  .top-row {
    min-height: 44px;
  }

  .sound-button,
  .back-button,
  .mini-button,
  .wallet-button {
    min-width: 44px;
    min-height: 44px;
    border-radius: 16px;
  }

  .sound-button img {
    width: 31px;
    height: 31px;
  }

  .wallet-button {
    min-width: 68px;
    grid-template-columns: 26px auto;
    padding-inline: 7px;
    font-size: 14px;
  }

  .wallet-button img {
    width: 26px;
    height: 26px;
  }

  .rating-board-button {
    width: clamp(132px, 34vw, 172px);
    flex-basis: clamp(132px, 34vw, 172px);
    min-height: 40px;
    padding: 4px 8px 5px 10px;
    border-radius: 16px;
  }

  .profile-avatar-button {
    width: 42px;
    height: 42px;
  }

  .rating-board-button strong {
    font-size: 12px;
  }

  .status-kicker {
    font-size: 9px;
  }

  .rating-mini {
    min-width: 31px;
    min-height: 24px;
    font-size: 10px;
  }

  .logo-wrap {
    width: min(68vw, 280px, 36dvh);
    height: min(36dvh, 280px);
  }

  .start-copy {
    margin-top: 2px;
  }

  .start-title-card {
    max-width: 320px;
    padding: 11px 16px 13px;
    border-radius: 22px;
    gap: 7px;
  }

  .start-kicker {
    min-height: 22px;
    padding-inline: 9px;
    font-size: 10px;
  }

  h1 {
    font-size: clamp(30px, 6dvh, 42px);
  }

  .start-title {
    font-size: clamp(30px, 5.8dvh, 42px);
    line-height: 0.98;
  }

  h2,
  .result-card h2 {
    font-size: clamp(24px, 4.5dvh, 34px);
    line-height: 1.02;
    padding: 5px 10px 8px;
  }

  .subtitle {
    margin-top: 6px;
    font-size: 16px;
  }

  .start-subtitle {
    max-width: 29ch;
    margin-top: 0;
    font-size: 14px;
    line-height: 1.25;
  }

  .small-note {
    margin-top: 4px;
    font-size: 13px;
  }

  .image-button {
    width: min(70vw, 270px);
    min-height: 58px;
    margin-top: 6px;
  }

  .action-button {
    min-height: 50px;
    font-size: 17px;
    border-radius: 18px;
  }

  .result-screen {
    justify-content: flex-start;
  }

  .result-card {
    gap: 6px;
    padding: 10px;
    border-radius: 22px;
  }

  #resultHero {
    width: min(40vw, 25dvh, 150px);
    height: min(40vw, 25dvh, 150px);
  }

  .score-big {
    font-size: clamp(38px, 7dvh, 56px);
  }

  .rank {
    font-size: clamp(18px, 3dvh, 22px);
  }

  .result-phrase {
    font-size: 14px;
  }

  .result-card .small-note {
    margin-top: 0;
  }

  .result-actions {
    gap: 8px;
  }

  .progress-panel {
    min-height: 50px;
    gap: 6px;
    padding: 8px 12px 9px;
  }

  .field-toast-stack {
    top: 10px;
    right: 10px;
    width: min(210px, 58%);
    min-height: 74px;
  }

  .match-status {
    grid-template-columns: 70px 1fr;
    min-height: 62px;
    padding: 6px;
  }

  .match-character img {
    width: 70px;
    height: 58px;
  }

  .goal-chip {
    min-width: 60px;
    min-height: 34px;
    grid-template-columns: 27px auto;
    padding: 3px 7px;
    font-size: 13px;
  }

  .goal-chip img {
    width: 27px;
    height: 27px;
  }

  .match-board {
    width: min(100%, 330px);
    gap: 3px;
    padding: 6px;
    border-radius: 21px;
  }

  .match-cell {
    border-radius: 12px;
  }

  .booster-button {
    min-height: 44px;
    border-radius: 14px;
  }

  .booster-button img {
    width: 30px;
    height: 30px;
  }

  .coffee-stage .field-toast-stack {
    width: min(190px, 46%);
  }
}

@media (max-width: 420px) {
  .top-row {
    gap: 7px;
  }

  .rating-board-button {
    width: clamp(124px, 32vw, 150px);
    flex-basis: clamp(124px, 32vw, 150px);
  }

  .rating-board-button strong {
    font-size: 12px;
  }

  .wallet-button {
    min-width: 62px;
  }

  .hud {
    gap: 6px;
  }

  .hud .rating-board-button {
    width: clamp(126px, 30vw, 160px);
    flex-basis: clamp(126px, 30vw, 160px);
    padding-inline: 8px;
  }

  .hud .rating-board-button strong {
    max-width: 100px;
  }

  .hud .rating-mini {
    min-width: 29px;
  }
}

@media (min-width: 860px) and (orientation: landscape) {
  .phone-shell {
    padding: 18px;
  }

  .app {
    width: min(calc(100vw - 36px), 1060px);
    height: min(calc(100dvh - 36px), 740px);
    max-width: none;
    max-height: none;
    border-width: 8px;
  }

  .screen {
    gap: 12px;
    padding: calc(16px + var(--safe-top)) 22px calc(16px + var(--safe-bottom));
  }

  .start-screen {
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(300px, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 24px;
    text-align: left;
  }

  .start-screen .top-row {
    grid-column: 1 / -1;
  }

  .logo-wrap {
    width: min(42vw, 460px, 70dvh);
    height: min(58dvh, 430px);
    max-height: min(58dvh, 430px);
    margin: 0 auto;
  }

  .start-screen .logo {
    width: 100%;
    height: 100%;
    max-height: inherit;
    object-fit: contain;
  }

  .start-copy {
    width: min(100%, 440px);
    margin: 0;
    padding: 0;
  }

  .start-title-card {
    width: min(100%, 420px);
    margin-inline: 0;
    padding: 18px 24px 20px;
    border-radius: 30px;
    gap: 12px;
    justify-items: center;
    text-align: center;
  }

  .start-title {
    font-size: clamp(42px, 7dvh, 60px);
    line-height: 0.98;
  }

  .start-subtitle {
    max-width: 30ch;
    font-size: clamp(16px, 2.4dvh, 19px);
    line-height: 1.28;
  }

  h1 {
    font-size: clamp(42px, 8dvh, 64px);
  }

  h2 {
    font-size: clamp(28px, 5dvh, 38px);
  }

  .subtitle {
    font-size: clamp(18px, 3dvh, 22px);
  }

  .image-button {
    width: min(100%, 330px);
    min-height: 68px;
    margin-inline: 0;
  }

  .game-sections {
    grid-template-columns: minmax(290px, 0.82fr) minmax(360px, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
  }

  .main-game-zone,
  .mini-games-zone {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .main-hero-list {
    grid-template-columns: 1fr;
    align-content: stretch;
    overflow: visible;
  }

  .mini-hero-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: stretch;
    overflow: visible;
  }

  .hero-card {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(110px, 1fr) auto;
    text-align: center;
  }

  .main-game-card {
    grid-template-rows: minmax(190px, 1fr) auto;
  }

  .hero-card img {
    height: min(24dvh, 142px);
  }

  .main-game-card img {
    height: min(34dvh, 230px);
  }

  .screen.is-game {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
  }

  .screen.is-game .hud {
    grid-column: 1 / -1;
    grid-template-columns: minmax(220px, 1fr) minmax(150px, auto) auto auto auto auto;
    grid-template-areas: "title status score lives help pause";
    min-width: 0;
  }

  .screen.is-game .hud.mini-game-hud {
    grid-template-columns: minmax(280px, 1fr) auto auto auto;
    grid-template-areas: "title lives help pause";
  }

  .screen.is-game .play-area {
    grid-row: 2;
    min-height: 0;
    min-width: 0;
  }

  .screen.is-game .game-controls {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
  }

  .match-prep-screen {
    display: grid;
    grid-template-columns: minmax(340px, 1fr) minmax(300px, 380px);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    align-items: stretch;
    column-gap: 18px;
    text-align: left;
  }

  .match-prep-screen .top-row,
  .match-prep-screen h2,
  .match-prep-screen .subtitle {
    grid-column: 1 / -1;
  }

  .match-prep-card {
    grid-column: 1;
    grid-row: 3 / 5;
    align-self: stretch;
  }

  .inventory-preview {
    grid-column: 2;
    grid-row: 3;
    align-content: start;
  }

  .match-prep-actions {
    grid-column: 2;
    grid-row: 4;
    align-self: end;
  }

  .match-stage {
    min-height: 0;
  }

  .match-board {
    width: min(100%, 58dvh, 430px);
  }

  .booster-bar {
    grid-template-columns: repeat(3, 1fr);
  }

  .screen.is-game .field-toast-stack {
    width: min(240px, 42%);
  }

  .result-screen {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(270px, 340px);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
    column-gap: 18px;
    text-align: left;
  }

  .result-screen .top-row {
    grid-column: 1 / -1;
    min-height: 46px;
  }

  .result-card {
    grid-column: 1;
    grid-row: 2;
    align-self: stretch;
    grid-template-columns: minmax(120px, 0.56fr) minmax(0, 1fr);
    grid-template-rows: 1fr;
    align-items: center;
    column-gap: 16px;
    text-align: left;
    overflow: hidden;
  }

  #resultHero {
    width: min(22vw, 42dvh, 188px);
    height: min(22vw, 42dvh, 188px);
    grid-row: 1 / -1;
    align-self: center;
  }

  .result-copy {
    grid-column: 2;
    align-content: center;
    justify-items: start;
    gap: 12px;
    text-align: left;
  }

  .score-big,
  .result-card h2,
  .rank,
  .result-phrase,
  .result-card .small-note,
  .result-note {
    justify-self: start;
    text-align: left;
  }

  .score-big {
    font-size: clamp(48px, 8dvh, 76px);
  }

  .coin-total {
    font-size: clamp(19px, 3.2dvh, 26px);
  }

  .result-card h2 {
    min-height: 88px;
    font-size: clamp(27px, 4.6dvh, 42px);
  }

  .result-actions {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
  }
}

@media (min-width: 860px) and (orientation: landscape) and (max-height: 620px) {
  .app {
    height: calc(100dvh - 24px);
  }

  .phone-shell {
    padding: 12px;
  }

  .screen {
    gap: 8px;
    padding: calc(10px + var(--safe-top)) 16px calc(10px + var(--safe-bottom));
  }

  .logo-wrap {
    width: min(36vw, 380px, 66dvh);
    height: min(54dvh, 360px);
    max-height: min(54dvh, 360px);
  }

  .hero-card img {
    height: min(22dvh, 122px);
  }

  .main-game-card img {
    height: min(32dvh, 190px);
  }

  .mini-game-card img {
    height: min(20dvh, 104px);
  }

  .screen.is-game {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
  }

  .screen.is-game .hud {
    grid-template-columns: minmax(190px, 1fr) minmax(128px, auto) auto auto auto auto;
  }

  .screen.is-game .hud.mini-game-hud {
    grid-template-columns: minmax(210px, 1fr) auto auto auto;
    grid-template-areas: "title lives help pause";
  }

  .result-card {
    gap: 6px;
    padding: 10px;
  }

  #resultHero {
    width: min(24vw, 44dvh, 190px);
    height: min(24vw, 44dvh, 190px);
  }
}
