:root {
  color-scheme: dark;
  font-family: "Trebuchet MS", "Arial Narrow", sans-serif;
  background: #071927;
  color: #fff4d4;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  overflow: hidden;
  background: #000;
}

.game-shell {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.game-frame {
  position: relative;
  width: min(100vw, calc(100dvh * 1.7786667));
  aspect-ratio: 1334 / 750;
  max-height: 100dvh;
  overflow: hidden;
  background: #092a3b;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
  cursor: pointer;
}

canvas:focus-visible {
  box-shadow: inset 0 0 0 3px #fff2bb;
}

.social-input {
  display: none;
  position: absolute;
  z-index: 2;
  border: 1px solid #8c6b3d;
  border-radius: 2px;
  padding: 2px 6px;
  background: #fffdf0;
  color: #241a10;
  font: 16px Arial, sans-serif;
}

.native-input {
  position: absolute;
  z-index: 3;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0 6px;
  background: transparent;
  color: transparent;
  caret-color: #5a3a10;
  font: 16px Arial, sans-serif;
}

.native-input:focus {
  outline: 1px solid #ffd75a;
}

.native-input.canvas-caret {
  caret-color: transparent;
}

.native-volume {
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  cursor: pointer;
  touch-action: none;
}

.native-volume::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid #806029;
  border-radius: 5px;
  background: linear-gradient(to right, #d6a53c var(--volume), #766e51 var(--volume));
}

.native-volume::-moz-range-track {
  height: 8px;
  border: 1px solid #806029;
  border-radius: 5px;
  background: linear-gradient(to right, #d6a53c var(--volume), #766e51 var(--volume));
}

.native-volume::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -9px;
  border: 2px solid #806029;
  border-radius: 50%;
  background: #fff0b9;
}

.native-volume::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 2px solid #806029;
  border-radius: 50%;
  background: #fff0b9;
}

textarea.native-input {
  resize: none;
  padding: 8px 12px;
  color: #383838;
  text-align: center;
  line-height: 1.25;
}

.fullscreen-button {
  position: fixed;
  z-index: 4;
  top: max(4px, env(safe-area-inset-top));
  right: max(4px, env(safe-area-inset-right));
  padding: 6px 10px;
  border: 1px solid #c9a56a;
  border-radius: 4px;
  background: #241a10;
  color: #fff4d4;
}

@media (pointer: coarse), (display-mode: standalone) {
  .game-shell {
    padding: env(safe-area-inset-top) env(safe-area-inset-right)
      env(safe-area-inset-bottom) env(safe-area-inset-left);
  }

  .game-frame {
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* The asset import gate deliberately needs no packaged artwork or fonts. */
body.asset-importing { overflow: auto; }
.asset-import {
  max-width: 46rem;
  margin: 3rem auto;
  padding: 1.5rem;
  color: #eee;
  background: #222;
  font: 1rem/1.5 system-ui, sans-serif;
  overflow-wrap: anywhere;
}
.asset-import input, .asset-import progress { display: block; width: 100%; margin: 1rem 0; }
.asset-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.asset-actions button { padding: .6rem 1rem; cursor: pointer; }
.asset-import [hidden], .game-shell[hidden] { display: none; }
.asset-manage { color: #ddd; position: fixed; bottom: .25rem; right: .5rem; font: .75rem system-ui; }
