@font-face {
  font-family: TabbyRound;
  src: url('./cloud/assets/fonts/tabby-soft-round.ttf') format('truetype');
  font-display: swap;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #eee7dc;
  color: #503a2b;
  font: 15px TabbyRound, system-ui, sans-serif;
}
main {
  display: flex;
  flex-direction: column;
  width: min(100%, 460px);
  height: 100vh;
  height: 100dvh;
  margin: auto;
  background: #fffbf5;
}
#stage { position: relative; flex: 1; min-height: 0; }
#actions { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#actions button { position: absolute; border: 0; background: transparent; pointer-events: none; }
#actions button:focus-visible { outline: 2px solid #773f1a; outline-offset: -2px; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; }
#preview-tools:not([hidden]) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-bottom: 1px solid #ead6c0;
  background: #fff7eb;
}
#preview-tools label { color: #654831; font-size: 14px; font-weight: 700; }
#edition { color: #77563e; font-size: 12px; }
.level-picker { position: relative; display: grid; min-width: 0; }
.level-picker::after {
  content: '';
  position: absolute;
  top: 50%; right: 15px;
  width: 7px; height: 7px;
  border: solid #98572a;
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
#levels {
  appearance: none;
  display: block;
  width: 100%; height: 38px;
  padding: 0 34px 0 12px;
  border: 1px solid #ceab88; border-radius: 10px;
  background: #fffbf5; color: #503727;
  font: inherit; line-height: 1.4; text-overflow: ellipsis;
  cursor: pointer;
}
#levels:hover:enabled { border-color: #aa7242; }
#levels:focus-visible { outline: 2px solid #a85e25; outline-offset: 2px; }
#levels:disabled { color: #816d5c; cursor: wait; }
@media (pointer: fine) {
  @supports (appearance: base-select) {
    #levels, #levels::picker(select) { appearance: base-select; }
    #levels { display: flex; align-items: center; }
    #levels::picker-icon { display: none; }
    #levels::picker(select) {
      margin-block: 4px; padding: 4px;
      max-height: min(52dvh, 24rem);
      border: 1px solid #ceab88; border-radius: 10px;
      background: #fffbf5; color: #503727;
      box-shadow: 0 4px 12px #5037271a;
      font: inherit;
    }
    #levels option:disabled { margin-bottom: 4px; }
    #levels optgroup { padding-top: 6px; color: #875331; font-size: 13px; }
    #levels option { padding: 7px 10px; border-radius: 6px; color: #503727; font-size: 15px; }
    #levels option:is(:checked, :focus-visible, :hover) { background: #ffe5be; }
  }
}
#notice:not(:empty) {
  position: absolute;
  top: 12%; left: 50%; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 8px;
  background: #503a2b; color: white; pointer-events: none;
}

#arcade-home { display: none; }
@media (display-mode: standalone), (display-mode: fullscreen) {
  .at-game-home #arcade-home { position: absolute; z-index: 2; top: max(2px, env(safe-area-inset-top)); right: 6px; display: grid; place-items: center; min-width: 44px; min-height: 44px; color: #73563b; font-size: 13px; }
}
