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

* {
  box-sizing: border-box;
}

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

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

.game {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-image: url("assets/bg/strophe_gpt-image-2_2026-06-02_16-26 1.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  touch-action: none;
}

.score {
  position: absolute;
  top: clamp(14px, 4.4vh, 34px);
  left: 50%;
  z-index: 10;
  min-width: clamp(58px, 8vw, 118px);
  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: 1;
  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;
  pointer-events: none;
  will-change: transform, opacity;
}

.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;
  transform-origin: 50% 70%;
}

.controls {
  position: absolute;
  left: 50%;
  bottom: max(18px, 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, 48px);
  height: var(--button-size, 48px);
  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: 24px;
  background: rgba(239, 228, 217, 0.22);
}

.result[hidden] {
  display: none;
}

.result-card {
  position: relative;
  width: min(645px, 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 h1 {
  margin: 0 0 clamp(18px, 3vw, 30px);
  font-size: clamp(15px, 2.3vw, 24px);
  line-height: 1.18;
  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: 700;
  cursor: pointer;
}

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

@media (max-width: 560px) {
  .result-card {
    border-radius: 16px;
  }

  .result h1 br {
    display: none;
  }
}
