/* Страница мини-игры «Сырная лихорадка» (event-game.html, assets/fair-game-page.js):
   лаборатория-сыроварня с зелёным порталом, выбор героя, герой ловит сыр. */
body.game-body #site-footer { display: none; }
html:has(body.game-body), body.game-body { overflow: hidden; height: 100%; touch-action: none; overscroll-behavior: none; }
.gp { position: fixed; inset: 0; overflow: hidden; background: #0d1a12; user-select: none; -webkit-user-select: none; }
.gp-bg { position: absolute; inset: 0; background: url("fair/art/game-bg.webp") center / cover no-repeat; }
.gp-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 70% at 50% 30%, transparent 40%, rgba(0, 10, 4, .55)); }
/* портал на стене лаборатории крутится и дышит; в «лихорадке» ревёт */
.gp-portal { position: absolute; left: 50%; top: 30%; width: 24vmax; max-width: none; transform: translate(-50%, -50%); mix-blend-mode: screen; opacity: .85;
  animation: gp-spin 6s linear infinite; filter: drop-shadow(0 0 30px rgba(80, 255, 90, .6)); }
@keyframes gp-spin { to { transform: translate(-50%, -50%) rotate(-1turn); } }
html.gp-fever .gp-portal { animation-duration: 1.4s; width: 30vmax; opacity: 1; filter: drop-shadow(0 0 60px rgba(120, 255, 90, .95)) saturate(1.4); }
html.gp-fever .gp::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 140px rgba(100, 255, 80, .5); }
/* герой и предметы рисуются на одном холсте (assets/fair-game-page.js) */
.gp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
@keyframes gp-bop { 50% { translate: 0 -10px; } }

.gp-hud { position: absolute; z-index: 4; left: 0; right: 0; top: calc(14px + env(safe-area-inset-top, 0px)); display: flex; align-items: center; gap: 14px;
  padding: 0 80px 0 150px; opacity: 0; transition: opacity .3s; pointer-events: none; }
html.gp-playing .gp-hud { opacity: 1; }
.gp-hud b { font-family: var(--f-display); font-weight: 900; font-size: clamp(34px, 6vw, 60px); color: #d9ff9c; text-shadow: 0 0 20px rgba(80, 255, 90, .7), 0 4px 0 rgba(0, 0, 0, .35); font-variant-numeric: tabular-nums; }
.gp-hud span { font-family: var(--f-display); font-weight: 800; font-size: 22px; color: #fff; }
.gp-time { flex: 1; max-width: 340px; height: 12px; margin-left: auto; border-radius: 6px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.gp-time i { display: block; height: 100%; background: linear-gradient(90deg, #6dff4a, #d9ff9c); transform-origin: left; }
/* подпись «Лихорадка!» — класс отличается от состояния html.gp-fever: одинаковое имя
   превращало сам <html> в повёрнутую прозрачную плашку (чёрный экран при серии 15) */
.gp-fever-tag { position: absolute; z-index: 4; left: 50%; top: 16%; transform: translate(-50%, -20px) rotate(-4deg); font-family: var(--f-display); font-weight: 900;
  font-size: clamp(34px, 8vw, 84px); color: #d9ff9c; text-transform: uppercase; text-shadow: 0 0 30px #3dff4a, 0 5px 0 #1d6b12; opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .4s cubic-bezier(.2, .9, .3, 1.4); }
html.gp-fever .gp-fever-tag { opacity: 1; transform: translate(-50%, 0) rotate(-4deg); animation: fair-pulse .5s ease-in-out infinite alternate; }

.gp-screen { position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100% - 28px));
  padding: 26px clamp(16px, 4vw, 34px); border-radius: 26px; text-align: center; color: #eaffd9;
  background: rgba(6, 20, 10, .78); backdrop-filter: blur(10px); border: 2px solid rgba(120, 255, 100, .45); box-shadow: 0 0 60px rgba(60, 255, 80, .25), 0 40px 90px -20px rgba(0, 0, 0, .8); }
.gp-screen[hidden] { display: none; }
.gp-screen h1 { margin: 0 0 8px; font-family: var(--f-display); font-weight: 900; font-size: clamp(30px, 5.4vw, 56px); line-height: 1; letter-spacing: -.03em; color: #d9ff9c;
  text-shadow: 0 0 24px rgba(80, 255, 90, .6), 0 4px 0 #1d6b12; text-transform: uppercase; }
.gp-screen p { margin: 0 0 16px; font-size: 16px; line-height: 1.5; }
.gp-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gp-card { position: relative; display: grid; justify-items: center; gap: 4px; padding: 14px 10px 16px; border: 2px solid rgba(120, 255, 100, .35); border-radius: 20px; cursor: pointer;
  background: radial-gradient(90% 70% at 50% 30%, rgba(120, 255, 100, .18), rgba(0, 0, 0, .2)); color: #eaffd9; font: inherit;
  transition: transform .3s cubic-bezier(.2, 1.4, .4, 1), border-color .2s, box-shadow .2s; }
.gp-card img { height: min(34svh, 260px); filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .6)); transition: transform .35s cubic-bezier(.2, 1.6, .4, 1); }
.gp-card b { font-family: var(--f-display); font-weight: 900; font-size: 24px; color: #d9ff9c; }
.gp-card small { font-size: 13.5px; opacity: .85; }
.gp-card:hover, .gp-card:focus-visible { transform: translateY(-6px); border-color: #6dff4a; box-shadow: 0 0 40px rgba(80, 255, 90, .45); outline: none; }
.gp-card:hover img { transform: rotate(-4deg) scale(1.06); }
.gp-card.chosen { animation: gp-chosen .45s ease-in forwards; }
@keyframes gp-chosen { to { transform: scale(1.15); opacity: 0; filter: brightness(2) hue-rotate(40deg); } }
.gp-best, .gp-best2 { margin: 12px 0 0 !important; font-size: 14px; opacity: .8; }
.gp-result { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px; text-align: left; }
.gp-winner { height: min(46svh, 360px); filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .6)); animation: gp-bop .6s ease-in-out infinite; }
.gp-rank { margin: 0 !important; font-family: var(--f-display); font-weight: 800; font-size: 18px; }
.gp-final { display: block; font-family: var(--f-display); font-weight: 900; font-size: clamp(70px, 13vw, 130px); line-height: .9; color: #d9ff9c; text-shadow: 0 0 30px rgba(80, 255, 90, .6); }
.gp-result.record .gp-best2 { color: #ffe08a; font-weight: 700; opacity: 1; }
.gp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.gp-btn { min-height: 52px; padding: 0 22px; border: 0; border-radius: 15px; cursor: pointer; font-family: var(--f-display); font-weight: 800; font-size: 15px;
  background: linear-gradient(#b6ff5c, #4fd12f); color: #0d2a06; box-shadow: 0 5px 0 #2a7a14, 0 12px 26px rgba(0, 0, 0, .45); }
.gp-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #2a7a14; }
.gp-btn.alt { background: rgba(255, 255, 255, .12); color: #eaffd9; box-shadow: none; }
.gp-back { position: absolute; z-index: 6; left: calc(14px + env(safe-area-inset-left, 0px)); top: calc(14px + env(safe-area-inset-top, 0px)); display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 16px 0 12px; border-radius: 14px; background: rgba(6, 20, 10, .65); backdrop-filter: blur(8px); color: #eaffd9; text-decoration: none;
  font-family: var(--f-display); font-weight: 700; font-size: 14px; border: 1px solid rgba(120, 255, 100, .35); }
.gp-back svg { width: 20px; height: 20px; }
.gp-sound { position: absolute; z-index: 6; right: calc(14px + env(safe-area-inset-right, 0px)); top: calc(14px + env(safe-area-inset-top, 0px)); color: #d9ff9c; }
@media (max-width: 640px) {
  .gp-hud { padding: 0 64px 0 64px; }
  .gp-back span { display: none; }
  .gp-cards { gap: 8px; }
  .gp-card img { height: 24svh; }
  .gp-card small { font-size: 12px; }
  .gp-result { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .gp-winner { height: 26svh; }
  .gp-actions { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .gp-portal, .gp-winner { animation: none; } }
