:root {
  color-scheme: dark;
  --page-bg: #10100e;
  --panel-bg: #151816;
  --rim: rgba(255, 255, 255, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(6, 12, 10, 0.28), rgba(6, 10, 9, 0.48)),
    url("./assets/generated/cakefight-page-background.png") center / cover no-repeat,
    var(--page-bg);
  color: #fff;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  touch-action: none;
  user-select: none;
}

.game-shell {
  --safe-top: max(10px, env(safe-area-inset-top));
  --safe-right: max(10px, env(safe-area-inset-right));
  --safe-bottom: max(10px, env(safe-area-inset-bottom));
  --safe-left: max(10px, env(safe-area-inset-left));
  width: 100vw;
  height: 100dvh;
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}

@media (orientation: portrait) {
  .game-shell {
    place-items: start center;
  }
}

.boot-status {
  position: absolute;
  inset: auto auto calc(var(--safe-bottom) + 22px) auto;
  min-width: 112px;
  padding: 8px 14px;
  border: 1px solid var(--rim);
  background: rgba(12, 16, 14, 0.78);
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
}

.boot-status[hidden] {
  display: none;
}

.install-banner {
  position: absolute;
  z-index: 4;
  inset: auto var(--safe-right) calc(var(--safe-bottom) + 12px) var(--safe-left);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(460px, calc(100vw - var(--safe-left) - var(--safe-right)));
  margin: 0 auto;
  padding: 10px 10px 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(13, 17, 15, 0.9);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(10px);
  touch-action: manipulation;
  pointer-events: auto;
}

.install-banner[hidden] {
  display: none;
}

.install-banner__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.install-banner__copy strong {
  overflow-wrap: anywhere;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.25;
}

.install-banner__copy span {
  overflow-wrap: anywhere;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 1.35;
}

.install-banner__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.install-banner button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.install-banner__button {
  padding: 0 12px;
  background: #1c6b5b;
  font-size: 13px;
}

.install-banner__dismiss {
  width: 34px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 420px) {
  .install-banner {
    align-items: stretch;
  }

  .install-banner__actions {
    gap: 6px;
  }

  .install-banner__button {
    padding: 0 10px;
  }
}

#game {
  display: block;
  width: min(
    calc(100vw - var(--safe-left) - var(--safe-right)),
    calc((100dvh - var(--safe-top) - var(--safe-bottom)) * 0.75),
    720px
  );
  height: auto;
  max-width: 720px;
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom));
  aspect-ratio: 3 / 4;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--panel-bg);
  border: 1px solid var(--rim);
  box-shadow: 0 18px 80px rgba(0, 0, 0, 0.45);
  cursor: crosshair;
}
