html {
  color-scheme: light;
  background: var(--theme);
}
body {
  color: #202637;
  overflow: hidden;
}
.layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  padding: var(--inset-top, env(safe-area-inset-top, 0px))
           var(--inset-right, env(safe-area-inset-right, 0px))
           var(--inset-bottom, env(safe-area-inset-bottom, 0px))
           var(--inset-left, env(safe-area-inset-left, 0px));
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 10px;
  background: #ffffff;
  border-bottom: 1px solid #20263730;
}
.top a, .top button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  font-size: 14px;
  font-weight: 650;
}
.top button {
  padding: 0 10px;
  border: 1px solid #737b89;
  border-radius: 8px;
  background: #ffffff;
}
.arena {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
}
.surface { position: relative; }
canvas {
  display: block;
  image-rendering: pixelated;
  touch-action: none;
}
.actions, .paused {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.actions button {
  position: absolute;
  border: 0;
  padding: 0;
  background: transparent;
  pointer-events: auto;
}
.actions button:focus-visible {
  outline: 3px solid #273b8f;
  outline-offset: 1px;
}
.actions button:disabled {
  pointer-events: none;
}
.actions button { min-width: 44px; min-height: 44px; }
.surface:has(.shop) { touch-action: auto; }
.actions.shop {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 6px;
  padding: 10px;
  overflow: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
  background: #f7fbf0;
}
.shop h2, .shop p, .shop button:last-child { grid-column: 1 / -1; }
.shop h2, .shop p { margin: 0; text-align: center; }
.shop h2 { color: #a52840; font-size: 20px; }
.shop p { margin-bottom: 4px; font-size: 14px; }
.shop button {
  position: static;
  padding: 4px;
  border: 1px solid #566456;
  border-radius: 6px;
  background: #ffe9a8;
  color: #202637;
  font-size: 13px;
  font-weight: 650;
}
.shop button:disabled { background: #eeece1; opacity: 1; }
.shop button span { display: block; color: #6c4b00; font-size: 12px; }
.shop button:last-child { background: #a52840; color: #ffffff; }
.rotate-message { display: none; font-weight: 650; }
@media (orientation: landscape) {
  .rotate-message { display: block; }
  .arena .surface, #pause { display: none; }
}
.paused {
  width: 100%;
  border: 0;
  display: grid;
  place-items: center;
  background: #202637bb;
  color: #ffffff;
  font-weight: bold;
  pointer-events: auto;
}
