/* Мини-игра: падающие эмодзи */

.game-cooldown-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-btn);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--rose-line);
  font-size: 0.9rem;
}

.game-cooldown-bar[hidden] {
  display: none !important;
}

.game-cooldown-bar__label {
  color: var(--ink-muted);
  font-weight: 600;
}

.game-cooldown-bar__time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.game-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-page) 0%, var(--bg-page-2) 55%, #ebe2e6 100%);
  display: flex;
  flex-direction: column;
  padding: max(10px, env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));
}

.game-page__inner {
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
}

.game-back {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.game-back:hover,
.game-back:focus-visible {
  color: var(--accent-hover);
}

.game-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  text-align: right;
  flex: 1;
}

.game-hud {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.game-hud__cell {
  background: var(--surface);
  border-radius: var(--radius-btn);
  padding: 10px 12px;
  box-shadow: var(--shadow-card);
  font-size: 0.9rem;
}

.game-hud__cell--wide {
  grid-column: 1 / -1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.05rem;
}

.game-hud__muted {
  color: var(--ink-muted);
  font-size: 0.75rem;
  display: block;
  margin-bottom: 2px;
}

.game-field-wrap {
  position: relative;
  flex: 1;
  min-height: 280px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px var(--rose-line);
  overflow: hidden;
  touch-action: manipulation;
}

.game-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.game-fly {
  --fall-dist: 420px;
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  top: -56px;
  left: 0;
  width: 52px;
  height: 52px;
  margin: 0 0 0 -26px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  line-height: 1;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: game-fall linear forwards;
  z-index: 2;
}

.game-fly:focus {
  outline: none;
}

.game-fly:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.game-fly:active {
  transform: scale(0.92);
}

@keyframes game-fall {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(var(--fall-dist, 420px));
    opacity: 0.85;
  }
}

.game-fly--caught {
  animation: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
  transform: scale(1.35);
  opacity: 0;
  pointer-events: none;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(243, 232, 236, 0.92);
  z-index: 10;
  text-align: center;
}

.game-overlay[hidden] {
  display: none !important;
}

.game-overlay__box {
  background: var(--surface);
  padding: 22px 20px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  max-width: 320px;
}

.game-overlay__box h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.game-overlay__box p {
  margin: 0 0 16px;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.game-end-back {
  margin-bottom: 0 !important;
  margin-top: 8px;
  text-align: center;
}

.game-end-back .game-back {
  font-size: 0.95rem;
}

.game-intro p {
  margin: 0 0 12px;
  color: var(--ink);
  line-height: 1.55;
}

.game-intro p:last-of-type {
  margin-bottom: 16px;
}

.game-btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-family: inherit;
}

.game-btn:hover,
.game-btn:focus-visible {
  background: var(--accent-hover);
}

.game-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

