:root {
  color-scheme: dark;
  background: #0b0820;
  font-family: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0b0820;
}

body {
  min-height: 100dvh;
  padding: 0;
  touch-action: manipulation;
}

#blockblast-game {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: #0b0820 url("/assets/blockblast-bg-001-clay.jpg") center / cover no-repeat;
}

#blockblast-game .game-canvas {
  display: block;
  width: min(620px, calc(100vw - 16px)) !important;
  height: auto !important;
  max-width: 100%;
  max-height: none;
  margin: 0;
  object-fit: contain;
  background: transparent;
  touch-action: none;
}

#blockblast-game .blockblast-stuck-title,
#blockblast-game .blockblast-stuck-sub {
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

#blockblast-game .blockblast-stuck-buttons .btn-green {
  min-width: 132px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 6px;
  padding: 8px 14px;
  color: #fff;
  background: #267a45;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22);
  font: 400 16px Georgia, "Times New Roman", serif;
}

#blockblast-game .blockblast-stuck-buttons {
  margin-top: 10px;
}

#blockblast-game .blockblast-stuck-buttons .btn-green:hover,
#blockblast-game .blockblast-stuck-buttons .btn-green:focus-visible {
  background: #329858;
}

#blockblast-game .blockblast-stuck-actions {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  text-align: center;
  isolation: isolate;
}

#blockblast-game .blockblast-stuck-actions::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(330px, calc(100% - 32px));
  height: 148px;
  border: 2px solid rgba(255, 255, 255, .18);
  border-radius: 4px;
  background: rgba(0, 0, 0, .78);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .42);
}

#blockblast-game .blockblast-stuck-actions > * {
  position: relative;
  z-index: 1;
}

#blockblast-game .blockblast-stuck-actions.is-visible {
  display: flex;
}

#blockblast-game .blockblast-stuck-title {
  color: #ff3b55;
  font: 900 clamp(20px, 4vw, 34px)/1 Georgia, "Times New Roman", serif;
  text-shadow: 3px 3px 0 #080510, -1px -1px 0 #080510;
}

#blockblast-game .blockblast-stuck-sub {
  color: #fff0dc;
  font: 900 clamp(12px, 2.2vw, 18px)/1.1 Georgia, "Times New Roman", serif;
  text-shadow: 2px 2px 0 #080510;
}

#blockblast-game .blockblast-stuck-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  pointer-events: auto;
}

#blockblast-game.blockblast-game-over {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
}

#blockblast-game.blockblast-game-over .game-canvas {
  visibility: hidden;
}

#blockblast-game.blockblast-game-over .blockblast-stuck-actions {
  background:
    linear-gradient(rgba(0, 0, 0, .58), rgba(0, 0, 0, .58)),
    url("/assets/blockblast-no-space-clay.jpg?v=2") center / cover no-repeat;
}

#blockblast-game:not(.blockblast-mount) .blockblast-stuck-actions,
#blockblast-game .blockblast-stuck-actions:not(.is-visible) {
  display: none !important;
}

noscript {
  position: fixed;
  inset: 1rem;
  color: #fff;
  text-align: center;
}

@media (max-width: 700px) {
  #blockblast-game {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    overflow: hidden;
  }

  #blockblast-game .game-canvas {
    width: min(620px, calc(100vw - 16px), calc(65.96dvh - 10.5px)) !important;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
}

/* Keep the full game visible on tablets and desktop without changing mobile. */
@media (min-width: 701px) {
  #blockblast-game {
    overflow: hidden;
    padding: 8px;
  }

  #blockblast-game .game-canvas {
    width: min(620px, calc(100vw - 16px), calc(81.58dvh - 13px)) !important;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
}
