

:root {
  --green: #00b83f;
  --green-dark: #009f36;
  --mint: #c5ffd7;
  --text: #132618;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

*::before,
*::after {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

img,
svg,
canvas,
button {
  touch-action: manipulation;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--text);
  font-family: "SB Sans Display", Arial, Helvetica, sans-serif;
  background: #eee2d7;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.game {
  --controls-bottom: 25px;
  --box-controls-gap: 28px;
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-image: url("assets/bg/bg.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  touch-action: none;
}



.intro {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  padding: clamp(72px, 12vw, 140px) 24px 32px;
  background: rgba(239, 228, 217, 0.2);
}

.intro[hidden] {
  display: none;
}

.intro-card {
  position: relative;
  width: min(624px, calc(100vw - 48px));
  padding: clamp(46px, 5.2vw, 58px) clamp(24px, 4.5vw, 52px) clamp(24px, 3.8vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(178, 255, 204, 0.94), rgba(255, 255, 255, 0.96));
  box-shadow: 0 22px 80px rgba(55, 38, 24, 0.12);
  text-align: center;
}

.intro-icon {
  position: absolute;
  top: 0;
  left: 50%;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  transform: translate(-50%, -50%);
}

.intro-icon img {
  width: 76px;
  height: 64px;
  object-fit: contain;
}

.box-sequence {
  position: relative;
  width: 76px;
  height: 64px;
  display: block;
}

.box-sequence img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  animation: boxSequence 1400ms steps(1, end) infinite;
}

.box-sequence img:nth-child(1) {
  animation-delay: 0ms;
}

.box-sequence img:nth-child(2) {
  animation-delay: 280ms;
}

.box-sequence img:nth-child(3) {
  animation-delay: 560ms;
}

.box-sequence img:nth-child(4) {
  animation-delay: 840ms;
}

.box-sequence img:nth-child(5) {
  animation-delay: 1120ms;
}

.intro p {
  margin: 0;
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.18;
  letter-spacing: 0;
  font-family: "SB Sans Display SemiBold", "SB Sans Display", Arial, Helvetica, sans-serif;
}

.intro h1 {
  font-weight: 600;
}

.intro p {
  margin-top: 12px;
  font-weight: 700;
}

.intro-bad-items {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: clamp(18px, 2.6vw, 26px);
}

.intro-bad-item {
  width: clamp(39px, 4.5vw, 64px);
  height: clamp(39px, 4.5vw, 64px);
  display: grid;
  place-items: center;
  border: 2px solid #ff1f1f;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.intro-bad-item img {
  width: 92%;
  height: 92%;
  object-fit: contain;
}

.start-button {
  min-width: clamp(200px, 18vw, 278px);
  min-height: clamp(40px, 4.5vw, 54px);
  margin-top: clamp(18px, 2.6vw, 24px);
  padding: 0 32px;
  border: 0;
  border-radius: 12px;
  background: #00A321;
  color: #ffffff;
  font: inherit;
  font-size: clamp(13px, 1.6vw, 18px);
  font-weight: 400;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 184, 63, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.start-button:hover,
.start-button:focus-visible {
  background: var(--green-dark);
  box-shadow: 0 14px 30px rgba(0, 159, 54, 0.3);
  transform: translateY(-2px);
}

.start-button:disabled {
  cursor: default;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

.start-button:active {
  transform: translateY(0);
}

.game.is-intro .score,
.game.is-intro .field-layer,
.game.is-intro .box,
.game.is-intro .controls {
  opacity: 0;
  visibility: hidden;
}

.score {
  position: absolute;
  top: calc(clamp(36px, 7.2vw, 72px) + clamp(14px, 4.4vh, 34px));
  left: 50%;
  z-index: 10;
  min-width: clamp(109px, 8vw, 116px);
  min-height: clamp(40px, calc(37.573px + 0.647vw), 50px);
  padding: clamp(8px, 1.5vw, 14px) clamp(18px, 3vw, 35px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: var(--mint);
  color: var(--green-dark);
  font-size: clamp(12px, 1.55vw, 20px);
  font-weight: 700;
  line-height: clamp(20px, 2.1vw, 24px);
  text-align: center;
  transform: translateX(-50%);
}

.field-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.item,
.effect,
.box {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform, opacity;
}

.item,
.effect {
  pointer-events: none;
}

.item {
  z-index: 3;
  object-fit: contain;
}

.item.is-caught {
  transition: opacity 1000ms ease, transform 1000ms ease;
}

.effect {
  z-index: 5;
  object-fit: contain;
}

.box {
  z-index: 2;
  object-fit: contain;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  transform-origin: 50% 70%;
}

.box.is-dragging {
  cursor: grabbing;
}

.controls {
  position: absolute;
  left: 50%;
  bottom: max(var(--controls-bottom), env(safe-area-inset-bottom));
  z-index: 12;
  display: flex;
  gap: clamp(8px, 1.4vw, 20px);
  transform: translateX(-50%);
}

.control-button {
  width: var(--button-size, 65px);
  height: var(--button-size, 65px);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

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

.control-button:focus-visible {
  outline: 3px solid rgba(0, 184, 63, 0.45);
  outline-offset: 4px;
}

.result {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: clamp(72px, 12vw, 140px) 24px 24px;
  background: rgba(239, 228, 217, 0.22);
}

.result[hidden] {
  display: none;
}

.result-card {
  position: relative;
  width: min(745px, calc(100vw - 48px));
  min-height: clamp(118px, 18vw, 220px);
  padding: clamp(48px, 7vw, 76px) clamp(24px, 6vw, 72px) clamp(24px, 4.5vw, 52px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(178, 255, 204, 0.92), rgba(255, 255, 255, 0.96));
  box-shadow: 0 22px 80px rgba(55, 38, 24, 0.12);
  text-align: center;
}

.result-icon {
  position: absolute;
  top: 0;
  left: 50%;
  width: clamp(56px, 8vw, 84px);
  height: clamp(56px, 8vw, 84px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  transform: translate(-50%, -50%);
}

.result-icon img {
  width: 68%;
  height: 68%;
  object-fit: contain;
}

.result-icon .box-sequence {
  width: 68%;
  height: 68%;
}

.result-icon .box-sequence img {
  width: 100%;
  height: 100%;
}

.result h2 {
  margin: 0 0 clamp(18px, 3vw, 30px);
  font-size: clamp(15px, 2.3vw, 24px);
  line-height: 1.18;
  font-weight: 500;
  letter-spacing: 0;

}

.next-button {
  min-width: clamp(136px, 22vw, 260px);
  min-height: clamp(36px, 5vw, 52px);
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #ffffff;
  font: inherit;
  font-size: clamp(12px, 1.5vw, 18px);
  font-weight: 500;
  cursor: pointer;
}

.next-button:hover,
.next-button:focus-visible {
  background: var(--green-dark);
}

@media (max-width: 1200px) and (min-width: 861px) {
  .game {
    --controls-bottom: 38px;
    --box-controls-gap: 44px;
  }

  .intro-card {
    width: min(624px, calc(100vw - 64px));
  }

  .intro p {
    font-size: clamp(16px, 1.65vw, 19px);
    line-height: 1.2;
  }
}

@media (max-width: 860px) and (min-width: 561px) {
  .game {
    --controls-bottom: 40px;
    --box-controls-gap: 46px;
  }

  .intro-card {
    width: min(624px, calc(100vw - 48px));
    padding: 50px 28px 26px;
  }

  .intro p {
    font-size: clamp(15px, 2.2vw, 18px);
    line-height: 1.22;
  }

  .controls {
    gap: 18px;
  }
}

@media (max-width: 1200px) and (min-width: 561px) {
  .score {
    top: clamp(44px, 8.4vh, 76px);
    min-width: 118px;
    min-height: 50px;
    font-size: 20px;
  }

  .control-button {
    filter: drop-shadow(0 10px 18px rgba(38, 26, 16, 0.16));
  }
}

@media (max-width: 560px) {
  .game {
    --controls-bottom: 24px;
    --box-controls-gap: 24px;
  }

  .brand-bar {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 0 16px;
    font-size: 7px;
  }

  .brand-rambler,
  .brand-domclick {
    font-size: 9px;
  }

  .intro {
    padding: 62px 10px 18px;
    place-items: center;
  }

  .intro-card {
    width: min(350px, calc(100vw - 20px));
    max-height: calc(100dvh - 84px);
    margin-top: 0;
    padding: 42px 14px 18px;
    border-radius: 18px;
  }

  .intro-icon .box-sequence {
    width: 72px;
    height: 60px;
  }

  .intro h1,
  .intro p {
    font-size: clamp(11px, 3.35vw, 14px);
    line-height: 1.22;
  }

  .intro p {
    margin-top: 8px;
  }

  .intro-bad-items {
    gap: 8px;
    margin-top: 14px;
  }

  .intro-bad-item {
    width: clamp(34px, 10.5vw, 42px);
    height: clamp(34px, 10.5vw, 42px);
    border-width: 2px;
  }

  .start-button {
    min-height: 42px;
    margin-top: 14px;
    font-size: 13px;
  }

  .result-card {
    border-radius: 16px;
  }

  .result h1 br {
    display: none;
  }
  .box{
    top: -20px;
  }
}

@keyframes boxSequence {
  0%,
  22% {
    opacity: 1;
  }
  22.01%,
  100% {
    opacity: 0;
  }
}
