.game-root,
.game-root * {
  box-sizing: border-box;
}

.game-root {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 0;
  background: #203049;
  color: #243044;
}

.paronim-game {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(6px, 1vw, 10px);
  padding: max(50px, env(safe-area-inset-top)) clamp(8px, 1.8vw, 22px) clamp(8px, 1.4vw, 14px);
  background-color: #eaf6ff;
  background-position: center;
  background-size: cover;
}

.paronim-hud,
.paronim-status {
  min-width: 0;
}

.paronim-hud {
  width: min(100%, 1260px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.25fr) auto;
  align-items: center;
  gap: clamp(8px, 1.2vw, 16px);
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  padding: clamp(7px, 1vw, 11px);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 34px rgba(30, 48, 72, 0.16);
  backdrop-filter: blur(10px);
}

.paronim-title {
  min-width: 0;
}

.paronim-title h2,
.paronim-win-card h2 {
  margin: 0;
  color: #203049;
  font-size: clamp(18px, 2.35vw, 32px);
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.paronim-kicker {
  margin: 0 0 2px;
  color: #2f7664;
  font-size: clamp(9px, 1vw, 11px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.paronim-progress {
  min-width: 72px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #203049;
  color: #ffffff;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 900;
  box-shadow: inset 0 -4px 0 rgba(255, 255, 255, 0.12);
}

.paronim-status {
  display: flex;
  align-items: center;
  gap: clamp(7px, 1vw, 12px);
  color: #334155;
  font-size: clamp(13px, 1.45vw, 17px);
  font-weight: 800;
  line-height: 1.2;
}

.paronim-listen,
.paronim-start-button,
.paronim-catalog-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0 clamp(12px, 1.5vw, 18px);
  background: #ff745c;
  color: #ffffff;
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(255, 116, 92, 0.28);
  cursor: pointer;
}

.paronim-listen:disabled {
  opacity: 0.54;
  cursor: not-allowed;
}

.paronim-board {
  width: min(100%, 1500px);
  min-height: 0;
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(5px, 0.8vw, 10px);
  align-content: stretch;
  justify-content: center;
  margin-inline: auto;
  overflow: hidden;
}

.paronim-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: clamp(2px, 0.45vw, 4px) solid #ffffff;
  border-radius: 8px;
  padding: clamp(3px, 0.7vw, 9px);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 22px rgba(30, 48, 72, 0.14);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, opacity 300ms ease;
}

.paronim-card:hover:not(:disabled) {
  transform: scale(0.985);
}

.paronim-card img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(30, 48, 72, 0.12));
}

.paronim-card.is-correct {
  border-color: #19a974;
  transform: scale(1.03);
}

.paronim-card.is-wrong {
  border-color: #ef4444;
  animation: paronim-shake 500ms ease;
}

.paronim-card.is-removed {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.72);
}

.paronim-cross {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 31px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.32);
}

.paronim-card.is-wrong .paronim-cross {
  display: inline-flex;
}

.paronim-start,
.paronim-win {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(32, 48, 73, 0.38);
  backdrop-filter: blur(4px);
}

.paronim-start-button {
  min-height: 62px;
  padding-inline: 30px;
  background: #245fd0;
  font-size: 20px;
}

.paronim-win {
  z-index: 6;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 209, 102, 0.7), transparent 28%),
    rgba(32, 48, 73, 0.58);
}

.paronim-win-card {
  position: relative;
  width: min(100%, 520px);
  overflow: hidden;
  border: 3px solid #ffffff;
  border-radius: 8px;
  padding: clamp(26px, 5vw, 46px);
  background: #ffffff;
  text-align: center;
  box-shadow: 0 24px 60px rgba(21, 32, 48, 0.28);
}

.paronim-win-card p {
  margin: 12px auto 22px;
  max-width: 420px;
  color: #64748b;
  font-size: 17px;
  line-height: 1.5;
}

.paronim-burst {
  width: 94px;
  height: 94px;
  margin: 0 auto 18px;
  border-radius: 999px;
  background:
    conic-gradient(from 0deg, #ffd166, #19a974, #4f8cff, #ff745c, #ffd166);
  mask: radial-gradient(circle, transparent 38%, #000 39%);
  animation: paronim-spin 2.8s linear infinite;
}

.paronim-empty {
  width: min(100%, 620px);
  margin: auto;
  border-radius: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  color: #b13d2b;
  font-weight: 800;
  text-align: center;
}

@keyframes paronim-shake {
  0%, 100% {
    transform: translateX(0);
  }
  20%, 60% {
    transform: translateX(-9px);
  }
  40%, 80% {
    transform: translateX(9px);
  }
}

@keyframes paronim-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .paronim-hud {
    grid-template-columns: minmax(160px, 1fr) auto;
  }

  .paronim-status {
    grid-column: 1 / -1;
    order: 3;
  }

  .paronim-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .paronim-game {
    gap: 8px;
    padding: max(58px, env(safe-area-inset-top)) 6px 6px;
  }

  .paronim-hud {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 8px;
    padding: 7px;
  }

  .paronim-title h2 {
    font-size: clamp(16px, 5.2vw, 22px);
  }

  .paronim-progress {
    min-width: 54px;
    min-height: 36px;
    font-size: 18px;
  }

  .paronim-status {
    gap: 8px;
    font-size: 12px;
  }

  .paronim-listen {
    min-height: 34px;
    padding-inline: 10px;
  }

  .paronim-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
  }
}

@media (max-height: 760px) and (min-width: 760px) {
  .paronim-game {
    padding-top: max(46px, env(safe-area-inset-top));
    gap: 6px;
  }

  .paronim-hud {
    grid-template-columns: minmax(180px, 0.9fr) minmax(240px, 1.4fr) auto;
    padding: 7px 9px;
  }

  .paronim-title h2 {
    font-size: clamp(18px, 2vw, 26px);
  }

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

  .paronim-progress {
    min-width: 62px;
    min-height: 36px;
    font-size: 20px;
  }

  .paronim-listen {
    min-height: 34px;
  }
}
