/* Shared in-play chrome: fixed top bar, pause sheet, play-mode layout */

:root {
  --play-top-inset: 52px;
  --play-shell-z: 10000;
  --play-pause-z: 10050;
}

.arcade-play-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--play-shell-z);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 44px;
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top, 0px));
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  background: linear-gradient(180deg, rgba(8, 10, 22, 0.94), rgba(6, 6, 15, 0.82));
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid rgba(124, 92, 255, 0.22);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.arcade-play-topbar .back-link,
.arcade-play-topbar a.back-link {
  color: #5eead4;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.arcade-play-topbar .back-link:hover {
  text-decoration: underline;
}

.arcade-play-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.arcade-play-topbar .lang-switch {
  display: flex;
  gap: 4px;
}

.arcade-play-pause-btn,
.arcade-play-icon-btn {
  border: 1px solid rgba(124, 92, 255, 0.45);
  background: rgba(124, 92, 255, 0.2);
  color: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.arcade-play-pause-btn:hover,
.arcade-play-icon-btn:hover {
  background: rgba(124, 92, 255, 0.35);
}

body.play-mode {
  overflow: hidden;
}

body.play-mode .arcade-preplay {
  display: none !important;
}

body.play-mode .arcade-play-stage {
  padding-top: calc(var(--play-top-inset, 52px) + 4px);
  box-sizing: border-box;
}

.arcade-play-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.5rem;
}

.arcade-play-hud .hud-pill,
.arcade-play-hud .hud-chip {
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
}

.arcade-play-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.5rem;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
}

.arcade-play-toolbar .min-tap,
.arcade-play-toolbar button,
.arcade-play-toolbar .ui-button {
  min-width: 44px;
  min-height: 44px;
}

/* Pause sheet */
.arcade-pause-sheet {
  position: fixed;
  inset: 0;
  z-index: var(--play-pause-z);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  box-sizing: border-box;
}

.arcade-pause-sheet.open {
  display: flex;
}

.arcade-pause-panel {
  width: min(360px, 100%);
  max-height: min(80vh, 560px);
  overflow: auto;
  padding: 1.25rem;
  border-radius: 16px;
  background: #12121f;
  border: 1px solid rgba(124, 92, 255, 0.35);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.arcade-pause-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  text-align: center;
}

.arcade-pause-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.arcade-pause-actions button {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 255, 0.4);
  background: rgba(124, 92, 255, 0.22);
  color: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.65rem 1rem;
}

.arcade-pause-actions button.primary {
  background: rgba(0, 212, 170, 0.28);
  border-color: rgba(0, 212, 170, 0.55);
}

.arcade-pause-actions button.secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
}

.arcade-pause-lb {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (orientation: landscape) and (max-height: 500px) {
  body.play-mode .arcade-play-stage {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - var(--play-top-inset, 52px));
  }

  body.play-mode canvas {
    flex: 1 1 auto;
    max-height: calc(100dvh - var(--play-top-inset, 52px) - 72px);
    width: auto;
    object-fit: contain;
  }

  body.play-mode .arcade-play-toolbar {
    flex-shrink: 0;
    padding-top: 0.25rem;
    padding-bottom: max(0.25rem, env(safe-area-inset-bottom, 0px));
  }

  .arcade-play-hud {
    padding: 0.2rem 0.4rem;
  }

  .arcade-play-hud .hud-pill {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
  }
}
