/* Embed page — loaded inside iframe or standalone; frame fills the viewport. */
html,
body {
  height: 100%;
  margin: 0;
  background-color: #0d0d12;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-embed {
  position: relative;
  aspect-ratio: 9 / 20;
  width: min(100vw, calc(100vh * 9 / 20));
  height: min(100vh, calc(100vw * 20 / 9));
  max-width: 540px;
  max-height: 1200px;
  overflow: hidden;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  background-color: #111118;
}

#embed-html {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  line-height: 0;
}

#embed-html canvas {
  display: block;
  outline: none;
  cursor: default;
}

/* Boot progress overlay (hidden when canvas is ready). */
.web-load-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: radial-gradient(circle at 50% 20%, rgba(56, 189, 248, 0.12), transparent 55%),
    #0d0d12;
  color: #e2e8f0;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  text-align: center;
  transition: opacity 0.35s ease;
}

.web-load-overlay--done {
  opacity: 0;
  pointer-events: none;
}

.web-load-logo {
  width: 88px;
  height: 88px;
  border-radius: 1rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.web-load-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.web-load-status {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
}

.web-load-track {
  width: min(88%, 280px);
  height: 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.web-load-fill {
  width: 0%;
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #38bdf8, #a78bfa);
  transition: width 0.15s ease-out;
}

.web-load-pct {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
}

.gdx-preloader {
  color: #e2e8f0;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}

.gdx-meter {
  width: min(88%, 280px);
  margin: 0.5rem auto;
}

/* Fullscreen mobile web — no phone chrome, edge-to-edge frame */
html.fullscreen,
html.fullscreen body {
  height: 100%;
  width: 100%;
}

html.fullscreen #game-embed {
  width: min(100vw, calc(100vh * 9 / 20));
  height: min(100vh, calc(100vw * 20 / 9));
  max-width: none;
  max-height: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* Desktop iframe embed — fill parent exactly (no inner letterbox frame). */
html.desktop-embed,
html.desktop-embed body {
  width: 100%;
  height: 100%;
}

html.desktop-embed #game-embed {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
