:root {
  color-scheme: dark;
  font-family: Inter, system-ui, Arial, sans-serif;
  background: #07090d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #07090d;
}

body {
  min-width: 280px;
  min-height: 420px;
  overscroll-behavior: none;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(100%, 620px);
  height: 100dvh;
  min-height: 420px;
  margin: 0 auto;
  background: #0a0d12;
  box-shadow: 0 0 42px rgba(0, 0, 0, 0.64);
}

.game-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0);
  background: #0a0d12;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.ad-region {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 82px;
  padding: 6px 8px max(6px, env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  border-top: 1px solid rgba(195, 160, 83, 0.2);
  background: #10131a;
}

.ad-slot {
  width: 100%;
  min-height: 68px;
}

.adbut-interstitial-region {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 7, 10, 0.84);
}

.adbut-interstitial-slot {
  width: min(100%, 520px);
  min-height: 1px;
}

.game-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  color: #f4f5f7;
  background: rgba(5, 7, 10, 0.96);
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
}

@media (max-height: 620px) {
  .ad-region {
    min-height: 68px;
    padding-top: 2px;
    padding-bottom: max(2px, env(safe-area-inset-bottom, 0px));
  }

  .ad-slot {
    min-height: 60px;
  }
}
