/* hud */

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

.game-hud__cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-line);
  background: var(--bg-0);
  overflow: hidden;
}

.game-hud__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

.game-hud__value {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  line-height: 1.1;
  color: var(--text-0);
  font-variant-numeric: tabular-nums;
}

.game-hud__cell--time .game-hud__value {
  color: var(--accent);
}

.game-hud__track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--surface-line);
}

.game-hud__track i {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left center;
}



/* field */

.game-field {
  position: relative;
  height: min(60vh, 520px);
  border-radius: var(--r-lg);
  border: 1px solid var(--surface-line);
  background-color: #070707;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  overflow: hidden;
  touch-action: none;
}

.game-field::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  border-bottom: 1px dashed rgba(255, 99, 99, 0.3);
  pointer-events: none;
}

.game-field canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.game-field__hint {
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--text-2);
}

.game-countdown {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.78);
}

.game-countdown.is-active {
  display: flex;
}

.game-countdown__num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3rem, 12vw, 7rem);
  line-height: 1;
  text-transform: uppercase;
  color: var(--text-0);
}

.game-countdown__hash {
  max-width: 560px;
  text-align: center;
  font-size: 12px;
  color: var(--text-2);
}

.game-countdown__hash code {
  display: block;
  margin-top: 6px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  color: var(--accent);
  word-break: break-all;
}

.game-mute {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--surface-line);
  background: var(--bg-1);
  color: var(--text-1);
}

.game-mute svg {
  width: 18px;
  height: 18px;
}

.game-mute .game-mute__cross {
  display: none;
}

.game-mute.is-muted .game-mute__wave {
  display: none;
}

.game-mute.is-muted .game-mute__cross {
  display: block;
}



/* arena */

body.is-playing {
  overflow: hidden;
}

body.is-playing .header,
body.is-playing .sticky-cta,
body.is-playing .mobile-menu {
  opacity: 0;
  pointer-events: none;
}

.game-stage.is-arena {
  position: fixed;
  inset: 0;
  z-index: 120;
  min-height: 0;
  padding: clamp(12px, 2vw, 22px);
  border: none;
  border-radius: 0;
  background: var(--bg-0);
}

.game-stage.is-arena [data-screen="play"] {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.game-stage.is-arena .game-hud,
.game-stage.is-arena .game-field__hint {
  flex: 0 0 auto;
}

.game-stage.is-arena .game-field {
  flex: 1;
  height: auto;
}

.game-escape {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 130;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--surface-line);
  background: var(--bg-1);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.game-escape svg {
  width: 14px;
  height: 14px;
}

.game-escape:hover {
  color: var(--text-0);
  border-color: var(--surface-line-strong);
}

.game-stage.is-arena .game-escape {
  display: inline-flex;
}

@media (hover: hover) and (pointer: fine) {
  .game-stage.is-arena .game-field {
    cursor: none;
  }
}

@media (max-width: 640px) {
  .game-field {
    height: min(66vh, 460px);
  }

  .game-hud {
    gap: 6px;
    margin-bottom: 10px;
  }

  .game-hud__cell {
    padding: 7px 10px;
    border-radius: 10px;
  }

  .game-hud__label {
    font-size: 9px;
    letter-spacing: 0.04em;
  }

  .game-hud__value {
    font-size: 1.1rem;
  }

  .game-stage.is-arena {
    padding: 10px 10px 8px;
  }

  .game-stage.is-arena .game-field__hint {
    display: none;
  }

  .game-stage.is-arena .game-hud {
    margin-top: 34px;
  }
}
