*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  height: 100%;
  height: 100dvh;
  height: -webkit-fill-available;
}

body {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, #ffe8d2 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(255, 170, 190, 0.22), transparent 50%),
    radial-gradient(ellipse 40% 35% at 0% 90%, rgba(120, 210, 200, 0.18), transparent 50%),
    #fff4e8;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
}

.gfa-back {
  position: fixed;
  z-index: 30;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  color: #6a3a24;
  font: 700 12px/1 system-ui, sans-serif;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 248, 240, 0.82);
  border: 1px solid rgba(180, 110, 70, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.15s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(160, 80, 40, 0.08);
}
.gfa-back:active {
  transform: scale(0.97);
  background: rgba(255, 236, 214, 0.95);
}

#game-container {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background:
    radial-gradient(ellipse at 50% 10%, rgba(255, 220, 170, 0.45), transparent 50%),
    #fff4e8;
}

#game-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  touch-action: none;
  image-rendering: auto;
}

#orient-hint {
  display: none;
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255, 248, 240, 0.88);
  color: #6a3a24;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(180, 110, 70, 0.18);
}

body.show-orient-hint #orient-hint {
  display: block;
}

@media (min-width: 900px) {
  #game-container canvas {
    border-radius: 16px;
    box-shadow:
      0 0 0 1px rgba(200, 130, 80, 0.16),
      0 18px 50px rgba(180, 90, 40, 0.16);
    max-width: min(100%, 1100px);
    max-height: min(100%, 640px);
    width: auto !important;
    height: auto !important;
  }
}
