/* The page /play/: the game in the browser, in the colours of the site
   (css/site.css): a steel plate with the button over a frame of the game,
   then the picture of the game itself in the same place. */

.play-page .top-logo { opacity: 1; }
.play-page main.play { max-width: none; padding: 64px 16px 0; }

/* the place of the game: the window below the bar, the picture keeps the
   shape of the screen (play.js sizes the canvas) */
.stage {
  position: relative;
  padding: 0;
  height: calc(100vh - 64px - 52px);
  height: calc(100svh - 64px - 52px);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.screen {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1920px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000 url(../assets/trailer.webp) center / cover no-repeat;
  border: 1px solid #000;
  box-shadow: inset 0 0 0 1px var(--line), 0 18px 50px rgba(0, 0, 0, 0.55);
}
.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(18, 13, 11, 0.25), rgba(18, 13, 11, 0.8) 75%);
  pointer-events: none;
}
.screen.running { background: #000; }
.screen.running::before { display: none; }
#canvas { position: relative; display: block; outline: none; background: #000; cursor: none; }

/* full screen: the stage alone, black around the picture */
.stage:fullscreen { height: 100vh; padding: 0; background: #000; }
.stage:fullscreen .screen { max-width: none; border: 0; box-shadow: none; }

/* ------------------------------------------------------------ before the start */
.gate, .loading, .fail {
  position: relative;
  z-index: 2;
  width: min(560px, calc(100% - 32px));
  padding: 26px 30px 22px;
  text-align: center;
}
.loading, .fail {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.gate-title { margin: 0 auto; width: min(340px, 70%); }
.gate-title img { width: 100%; height: auto; filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.85)); }
.gate-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 18px;
  font: 700 15px/1 var(--head);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--rust);
}
.gate .btn-big { min-width: 220px; font-size: 26px; letter-spacing: 0.16em; }
.gate .btn[disabled] { filter: grayscale(0.85) brightness(0.7); cursor: default; transform: none; }
.gate-size { margin: 10px 0 0; font-size: 14px; color: var(--bone-dim); }
.gate-req {
  list-style: none;
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--bone-dim);
}
.gate-req li { margin: 2px 0; }
.gate-alt { margin: 10px 0 0; font: 500 15px/1.3 var(--head); letter-spacing: 0.08em; text-transform: uppercase; }
.gate-warn, .gate-refuse { margin: 14px 0 0; font-size: 15px; color: var(--bone); }
.gate-warn { color: var(--rust); }

/* ------------------------------------------------------------ loading */
.loading-what { margin: 0 0 12px; font: 700 20px/1.2 var(--head); letter-spacing: 0.08em; text-transform: uppercase; }
.bar {
  position: relative;
  height: 14px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid #000;
  box-shadow: inset 0 0 0 1px var(--line);
}
.bar span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--blood-dark), var(--blood) 70%, var(--rust));
  transition: width 0.2s linear;
}
.loading-num { margin: 10px 0 0; font-size: 14px; color: var(--bone-dim); font-variant-numeric: tabular-nums; }
/* the game starts: the full bar keeps moving (a transform runs while the
   page itself stands still under the start of the game) */
.bar.busy { overflow: hidden; }
.bar.busy::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 190, 150, 0.55), transparent);
  animation: bar-busy 1.1s linear infinite;
  will-change: transform;
}
@keyframes bar-busy {
  from { transform: translateX(-100%); }
  to { transform: translateX(434%); }
}
.loading-slow { margin: 14px 0 0; font-size: 14px; color: var(--bone); }
.loading-slow p { margin: 0 0 12px; }
.loading-slow[hidden] { display: none; }
.fail p { margin: 0 0 16px; }

/* ------------------------------------------------------------ the mouse is free */
.lock {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(18, 13, 11, 0.35);
  cursor: pointer;
}
.lock[hidden] { display: none !important; }
.lock-play {
  font: 700 clamp(22px, 3vw, 34px)/1 var(--head);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone);
  background: var(--rivets), linear-gradient(rgba(168, 25, 15, 0.92), rgba(125, 16, 9, 0.92));
  border: 1px solid #000;
  box-shadow: inset 0 0 0 1px rgba(255, 170, 140, 0.35), 0 6px 22px rgba(0, 0, 0, 0.6);
  padding: 18px 34px;
  cursor: pointer;
  text-shadow: 0 1px 2px #000;
}
.lock-play:hover, .lock-play:focus-visible { color: var(--bone); box-shadow: inset 0 0 0 1px var(--rust), 0 0 30px rgba(199, 26, 15, 0.55); }
.lock-wait { margin: 0; padding: 6px 12px; font-size: 14px; color: var(--bone); background: rgba(18, 13, 11, 0.8); }

/* ------------------------------------------------------------ under the picture */
.bar-under {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1920px;
  min-height: 52px;
  margin: 0 auto;
  font-size: 14px;
  color: var(--bone-dim);
}
.bar-under p { margin: 0; }
.hint { flex: 1; }
.maps-state { font-variant-numeric: tabular-nums; }
.open-link { color: var(--rust); font-weight: 600; }
.open-link[hidden] { display: none; }
.full-btn {
  font: 500 14px/1 var(--head);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone);
  background: rgba(18, 13, 11, 0.6);
  border: 1px solid var(--line-2);
  padding: 9px 12px;
  cursor: pointer;
}
.full-btn:hover:not([disabled]) { color: var(--rust); border-color: var(--rust); }
.full-btn[disabled] { opacity: 0.45; cursor: default; }

/* no game on this device: the text, the requirements and the installer */
.refused .bar-under { display: none; }
.refused .gate-alt a { color: var(--rust); }

@media (max-width: 760px) {
  .stage { height: auto; min-height: 0; padding: 0; }
  .screen { min-height: 70vh; padding: 16px 0; }
  .bar-under { flex-wrap: wrap; padding: 8px 0; }
}

/* ------------------------------------------------------------ the roll (docs/web.md, "Барабан") */
/* the modes go round in a window of one line and stop on the one rolled */
.roll { margin: 0 0 16px; }
.roll[hidden], .roll-now[hidden], .roll-map[hidden] { display: none; }
.reel {
  position: relative;
  height: 52px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.45);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}
.reel-strip { list-style: none; margin: 0; padding: 0; will-change: transform; }
.reel-strip li {
  height: 52px;
  font: 700 34px/52px var(--head);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.reel-strip li.hit { color: var(--bone); text-shadow: 0 0 18px rgba(200, 40, 30, 0.85); }
.reel-strip li.mode-love.hit { text-shadow: 0 0 18px rgba(255, 80, 160, 0.9); }
.reel-strip li.mode-dacha.hit { text-shadow: 0 0 18px rgba(120, 200, 70, 0.8); }
.reel-strip li.mode-banya.hit { text-shadow: 0 0 18px rgba(255, 150, 60, 0.85); }
.roll-now {
  margin: 14px 0 4px;
  font: 700 clamp(22px, 2.6vw, 30px)/1.1 var(--head);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rust);
}
.roll-map { margin: 0; font-size: 15px; color: var(--bone); }

/* the question of blood, over the download */
.ask {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100% - 32px));
  padding: 28px 30px 24px;
  text-align: center;
}
.ask[hidden] { display: none; }
.ask-q { margin: 0 0 12px; font: 700 24px/1.2 var(--head); letter-spacing: 0.08em; text-transform: uppercase; }
.ask-note { margin: 0 0 20px; font-size: 15px; color: var(--bone-dim); }
.ask-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.ask-btns .btn { min-width: 120px; }
.ask-close {
  position: absolute;
  right: 8px;
  top: 6px;
  padding: 4px 10px;
  border: 0;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--bone-dim);
  cursor: pointer;
}
.ask-close:hover { color: var(--bone); }

/* the download goes on under the question, out of sight */
.screen.asking .loading { visibility: hidden; }
