/* ===== BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body.play-body {
  background: #07070b;
  color: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  overflow: hidden;
}


/* ===== TOP BAR ===== */
.play-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;

  background: rgba(10,10,14,0.78);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(8px);

  /* Don’t steal game clicks except on buttons */
  pointer-events: none;
}

.play-topbar .topbar-btn,
.play-topbar a {
  pointer-events: auto;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title {
  display: grid;
  line-height: 1.05;
  min-width: 0;
}

.topbar-kicker {
  font-size: 0.70rem;
  opacity: 0.65;
}

.topbar-name {
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.92);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.topbar-btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.22);
}

.topbar-btn-quiet {
  opacity: 0.85;
}

.play-topbar.is-hidden {
  transform: translateY(-120%);
  transition: transform 0.25s ease;
}

.play-topbar:not(.is-hidden) {
  transition: transform 0.25s ease;
}


/* ===== STAGE ===== */
.play-stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

/* Prevent MV auto elements from being constrained */
#stage, #stage * {
  max-width: none;
  max-height: none;
}

/* MV canvas */
.play-stage canvas {
  display: block;
  outline: none;
}


/* ===== LOADING ===== */
.play-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(
    ellipse at center,
    rgba(0,0,0,0.15),
    rgba(0,0,0,0.85)
  );
  z-index: 10;
  text-align: center;
  padding: 24px;
}

.spinner {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: rgba(255,255,255,0.75);
  animation: spin 0.9s linear infinite;
  margin: 0 auto 12px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-weight: 650;
  margin-bottom: 8px;
}

.loading-sub {
  opacity: 0.70;
  font-size: 0.92rem;
  max-width: 56ch;
}

.play-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  opacity: 0.85;
  z-index: 12;
}


/* ===== FULLSCREEN FIX ===== */
/* DO NOT use 100vw / 100vh here */
#stage:fullscreen,
#stage:-webkit-full-screen {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}


@media (max-width: 520px) {
  .topbar-name { max-width: 160px; }
  .topbar-btn { padding: 9px 10px; }
}


/* ===== AGE GATE ===== */
.agegate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.agegate.is-open {
  display: block;
}

.agegate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
}

.agegate-modal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 92vw);
  border-radius: 16px;
  padding: 22px 20px;
  background: rgba(12,12,18,0.94);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
}
