/* Развлечения — психологические мини-игры (лёгкие, без тяжёлых ML) */

.entertainment-hero .lead {
  max-width: 640px;
}

.entertainment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 18px;
}

.fun-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 0 18px;
  overflow: hidden;
  border: 1px solid rgba(185, 144, 89, 0.28);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(15, 118, 110, 0.08), transparent 42%),
    linear-gradient(165deg, #fffdf8, #f7f2e8);
  box-shadow: 0 14px 34px rgba(74, 58, 35, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fun-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(74, 58, 35, 0.12);
}

.fun-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f0ebe3;
}

.fun-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fun-card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 18px;
}

.fun-card__badge {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 1;
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  color: #0f766e;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(31, 47, 58, 0.1);
}

.fun-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  color: var(--blue-dark, #1f2f3a);
}

.fun-card p {
  margin: 0;
  flex: 1;
  color: var(--muted, #6b6560);
  font-size: 14px;
  line-height: 1.5;
}

.fun-card .button {
  align-self: flex-start;
}

/* Sequence pad */
.fun-seq-pad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
}

.fun-seq-btn {
  aspect-ratio: 1;
  border: 0;
  border-radius: 18px;
  background: var(--seq-color, #0f766e);
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.fun-seq-btn.is-lit {
  opacity: 1;
  transform: scale(1.04);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.35), 0 10px 24px rgba(0, 0, 0, 0.15);
}

.fun-seq-btn:disabled {
  cursor: default;
}

/* Go/No-go */
.fun-gonogo-stim {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 180px;
  border: 0;
  border-radius: 18px;
  background: #e5e7eb;
  color: #374151;
  font: inherit;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.fun-gonogo-stim.is-go {
  background: #0f766e;
  color: #fff;
}

.fun-gonogo-stim.is-nogo {
  background: #9a4c39;
  color: #fff;
}

/* Odd one */
.fun-odd-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}

.fun-odd-cell {
  aspect-ratio: 1;
  border: 1px solid rgba(185, 144, 89, 0.3);
  border-radius: 14px;
  background: #fff;
  font-size: 28px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.fun-odd-cell:hover {
  transform: scale(1.04);
  border-color: #0f766e;
}

/* Compass */
.fun-compass-wrap {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.fun-compass-dial {
  position: relative;
  width: min(200px, 60vw);
  height: min(200px, 60vw);
  border-radius: 50%;
  border: 3px solid rgba(185, 144, 89, 0.45);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 253, 248, 0.95), rgba(240, 235, 224, 0.9));
  box-shadow: inset 0 0 0 10px rgba(15, 118, 110, 0.06);
}

.fun-compass-needle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 42%;
  margin: 0;
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(180deg, #9a4c39 0 55%, #b99059 55% 100%);
  transform-origin: 50% 85%;
  transform: translate(-50%, -70%) rotate(0deg);
  transition: transform 0.35s ease;
}

.fun-compass-needle::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #5c4a36;
  transform: translateX(-50%);
}

/* Game stage modal */
.fun-stage {
  position: fixed;
  inset: 0;
  z-index: 1450;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) 12px 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.fun-stage.is-open {
  opacity: 1;
  pointer-events: auto;
}

.fun-stage__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 31, 45, 0.48);
  backdrop-filter: blur(8px);
}

.fun-stage__dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(92dvh, calc(100dvh - 24px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px 20px 24px;
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 28px 70px rgba(21, 31, 45, 0.24);
}

.fun-stage__close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(247, 250, 250, 0.98);
  color: var(--blue-dark, #1f2f3a);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.fun-stage__title {
  margin: 0 40px 6px 0;
  font-size: clamp(20px, 3vw, 26px);
  color: var(--blue-dark, #1f2f3a);
}

.fun-stage__hint {
  margin: 0 0 16px;
  color: var(--muted, #6b6560);
  font-size: 14px;
  line-height: 1.45;
}

.fun-stage__board {
  min-height: 280px;
  margin-bottom: 14px;
}

.fun-stage__status {
  min-height: 1.4em;
  margin: 0 0 12px;
  color: #0f766e;
  font-size: 14px;
  font-weight: 500;
}

.fun-stage__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Shared game UI */
.fun-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.fun-choice {
  min-width: 110px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid rgba(185, 144, 89, 0.35);
  border-radius: 14px;
  background: #fff;
  color: var(--blue-dark, #1f2f3a);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.fun-choice:hover,
.fun-choice:focus-visible {
  transform: translateY(-1px);
  border-color: #0f766e;
  outline: none;
}

.fun-choice:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.fun-stimulus {
  display: grid;
  place-items: center;
  min-height: 120px;
  margin: 12px 0;
  padding: 20px;
  border-radius: 16px;
  background: rgba(255, 250, 241, 0.9);
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 700;
  text-align: center;
  user-select: none;
}

.fun-score {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--blue-dark, #1f2f3a);
}

.fun-score strong {
  color: #0f766e;
}

/* Memory grid */
.fun-memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
}

.fun-memory-card {
  aspect-ratio: 1;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, #0f766e, #115e59);
  color: transparent;
  font-size: 28px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.fun-memory-card.is-open,
.fun-memory-card.is-matched {
  background: #fff;
  color: inherit;
  box-shadow: 0 4px 14px rgba(74, 58, 35, 0.1);
}

.fun-memory-card.is-matched {
  opacity: 0.75;
  cursor: default;
}

.fun-memory-card:disabled {
  cursor: default;
}

/* Reaction */
.fun-reaction-pad {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 200px;
  border: 0;
  border-radius: 18px;
  background: #e5e7eb;
  color: #374151;
  font: inherit;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.08s linear;
  user-select: none;
}

.fun-reaction-pad.is-wait {
  background: #fef3c7;
  color: #92400e;
}

.fun-reaction-pad.is-go {
  background: #0f766e;
  color: #fff;
}

.fun-reaction-pad.is-fail {
  background: #fecaca;
  color: #991b1b;
}

/* Breathing */
.fun-breath-wrap {
  display: grid;
  place-items: center;
  min-height: 260px;
}

.fun-breath-orb {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #5eead4, #0f766e 70%);
  box-shadow: 0 0 40px rgba(15, 118, 110, 0.35);
  transform: scale(0.72);
  will-change: transform;
}

.fun-breath-label {
  margin-top: 18px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: #0f766e;
}

.fun-disclaimer {
  margin-top: 28px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(185, 144, 89, 0.1);
  color: var(--muted, #6b6560);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .fun-memory-grid {
    gap: 8px;
  }

  .fun-memory-card {
    font-size: 22px;
  }

  .fun-stage__dialog {
    padding: 16px 14px 20px;
  }
}

body.fun-stage-open {
  overflow: hidden;
}
