:root {
  --sai-top: env(safe-area-inset-top, 0px);
  --sai-right: env(safe-area-inset-right, 0px);
  --sai-bottom: env(safe-area-inset-bottom, 0px);
  --sai-left: env(safe-area-inset-left, 0px);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;

  font-family: monospace;
  color: #fff;
  background: #050510;
}
#gameContainer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: calc(10px + var(--sai-top)) var(--sai-right) calc(10px + var(--sai-bottom)) var(--sai-left);
}
#gameCanvas {
  display: block;
  background: #0a0a1a;
  image-rendering: pixelated;
  image-rendering: crisp-edges;

}

.homeBtn {
  position: fixed;
  top: max(10px, var(--sai-top));
  left: max(10px, var(--sai-left));
  width: 132px;   
  height: 42px;   
  background: url('assets/chrome/home_btn.png') no-repeat 0 0;
  background-size: 132px 42px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  font-size: 0;
  color: transparent;
  text-decoration: none;
  z-index: 300;
  user-select: none;
  -webkit-user-select: none;
}
.homeBtn:active {
  background-image: url('assets/chrome/home_btn_pressed.png');
}

.pxloader {
  width: 96px;
  height: 96px;
  background: url('assets/chrome/loader_strip.png') no-repeat 0 0;
  background-size: 768px 96px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  animation: pxbolt 0.8s steps(8) infinite;
}
@keyframes pxbolt { to { background-position: -768px 0; } }
.pxloadword {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

@media (max-width: 480px) {
  #gameContainer {

    padding: calc(4px + var(--sai-top)) var(--sai-right) calc(4px + var(--sai-bottom)) var(--sai-left);
  }
}

#mobileNotice {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 16, 0.85);
  padding: 18px;
}
#mobileNotice.show { display: flex; }
.mn-panel {
  background: #14142a;
  border: 3px solid #ffdd22;
  box-shadow: 6px 6px 0 #000;
  max-width: 340px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.mn-panel img {
  width: 144px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  animation: mnspin 2.6s linear infinite;
}
@keyframes mnspin {
  to { transform: rotate(360deg); }
}
.mn-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ffdd22;
}
.mn-body {
  font-size: 13px;
  line-height: 1.6;
  color: #b8b8d0;
}
.mn-btn {
  display: inline-block;
  font-family: monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
  color: #0a0a1a;
  background: #ffdd22;
  border: 2px solid #000;
  box-shadow: 3px 3px 0 #000;
  padding: 10px 18px;
  cursor: pointer;
}
.mn-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #000;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
