/* Orbit Breaker — page styles. The arena itself is drawn on two canvases (static sky + live layer). */

.ob-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ---------- HUD in the stage corners (never over the arena on phones) */
.ob-hud {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  z-index: 2;
}
.ob-lv,
.ob-lives,
.ob-powers {
  position: absolute;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.ob-lv { top: 6px; left: 14px; align-items: flex-start; max-width: 46%; }
.ob-lives { top: 6px; right: 14px; align-items: flex-end; }
.ob-powers { bottom: 10px; right: 12px; flex-direction: row; gap: 8px; align-items: center; }
[dir="rtl"] .ob-lv { left: auto; right: 14px; align-items: flex-end; }
[dir="rtl"] .ob-lives { right: auto; left: 14px; align-items: flex-start; }
[dir="rtl"] .ob-powers { right: auto; left: 12px; }

.ob-lv__n,
.ob-lives__label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
html[lang="ar"] .ob-lv__n,
html[lang="ar"] .ob-lives__label { letter-spacing: 0; text-transform: none; font-size: 12px; }
.ob-lv__name {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 600;
  color: var(--parchment);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ob-lives__dots { display: flex; gap: 6px; margin-top: 6px; }
.ob-life {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, #FFF8E6 0, #F3D497 34%, #E8B65A 62%, #B5873A 100%);
  box-shadow: 0 0 8px rgba(232, 182, 90, 0.45);
  transition: transform 0.3s var(--ease-out), opacity 0.3s linear;
}
.ob-life.is-gone {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(242, 234, 216, 0.28);
}
.ob-life.is-new { animation: ob-pop 0.5s var(--ease-out); }

.ob-pw {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(17, 30, 90, 0.82);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.ob-pw[hidden] { display: none; }
.ob-pw svg { width: 18px; height: 18px; }
.ob-pw i {
  position: absolute;
  left: 7px; right: 7px; bottom: -6px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 1));
}
[dir="rtl"] .ob-pw i { transform-origin: 100% 50%; }
.ob-pw--wide { color: var(--gold); }
.ob-pw--slow { color: var(--sky); }
.ob-pw--shield { color: var(--turquoise); }

/* ---------- centre card (level intro, level clear, lives left) */
.ob-card {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: var(--card-w, 260px);
  padding: 18px 16px 16px;
  border-radius: 22px;
  background: radial-gradient(closest-side, rgba(7, 13, 44, 0.9), rgba(7, 13, 44, 0.78) 70%, rgba(7, 13, 44, 0) 100%);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 0.35s linear, transform 0.45s var(--ease-out);
}
.ob-card.is-on { opacity: 1; transform: translate(-50%, -50%); }
.ob-card__eyebrow {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
html[lang="ar"] .ob-card__eyebrow { letter-spacing: 0; text-transform: none; font-size: 13px; }
.ob-card__title {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--parchment);
}
.ob-card__text {
  margin: 6px auto 0;
  max-width: 17em;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--mist);
  text-wrap: balance;
}
.ob-card__text:empty,
.ob-card__eyebrow:empty { display: none; }
.ob-card.is-gold .ob-card__text { color: var(--gold-soft); font-weight: 650; font-size: 1.05rem; }

/* ---------- launch hint, pinned just inside the arena below the core */
.ob-hint {
  position: absolute;
  left: var(--hint-x, 50%);
  top: var(--hint-y, 70%);
  max-width: var(--hint-w, 90%);
  text-align: center;
  z-index: 3;
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(7, 13, 44, 0.82);
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--parchment);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) translateY(6px);
  transition: opacity 0.25s linear, transform 0.35s var(--ease-out);
}
.ob-hint.is-on { opacity: 1; transform: translate(-50%, -50%); animation: ob-breathe 2.4s ease-in-out 0.4s infinite; }

/* ---------- panels */
.ob-art { width: 168px; height: 126px; }
.ob-planet { width: 84px; height: 84px; }

@keyframes ob-pop { 0% { transform: scale(0.2); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes ob-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }

/* Narrow phones: the title needs the room more than the best chip (best shows in the panels). */
@media (max-width: 359px) {
  .ob-best-chip { display: none; }
}
@media (max-height: 420px) {
  .ob-card__title { font-size: 1.6rem; }
  .ob-card { padding: 12px 12px 10px; }
}
/* Short portrait screens (iPhone SE with Safari's toolbars): keep every panel's buttons on screen. */
@media (max-height: 620px) and (orientation: portrait) {
  .fa-panel { padding-top: 20px; }
  .fa-menu { gap: 6px; }
  .fa-menu .fa-row { min-height: 46px; }
  .fa-menu-overlay .fa-panel__title { font-size: 1.6rem; margin-bottom: 6px; }
  .fa-panel__actions { gap: 8px; }
}
@media (max-height: 540px) and (orientation: portrait) {
  .fa-panel__art { display: none; }
  .fa-menu-overlay .fa-panel__title { display: none; }
  .fa-panel__title { font-size: 1.65rem; }
  .fa-howto { gap: 7px; margin-bottom: 14px; }
  .fa-stats { margin-bottom: 12px; }
}
/* Landscape phones: panels go wide and short so the main button is visible without scrolling. */
@media (max-height: 520px) and (orientation: landscape) {
  .fa-panel { max-width: 580px; padding: 18px 22px 16px; }
  .fa-panel__art { display: none; }
  .fa-panel__title { font-size: 1.6rem; margin: 2px 0 6px; }
  .fa-panel__text { margin-bottom: 10px; }
  .fa-howto { gap: 6px; margin-bottom: 14px; }
  .fa-stats { margin-bottom: 12px; }
  .fa-stats > div { padding: 6px 6px 5px; }
  .fa-panel__actions { flex-direction: row; }
  .fa-panel__actions > .fa-btn { flex: 1 1 0; min-width: 0; }
  .fa-menu { grid-template-columns: 1fr 1fr; grid-auto-flow: row dense; margin-bottom: 12px; }
  .fa-menu > div.fa-row { grid-column: 1 / -1; }
  .fa-menu .fa-row { min-height: 46px; }
  .fa-menu-overlay .fa-panel__title { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ob-hint.is-on { animation: none; }
}
@media (max-height: 320px) and (orientation: landscape) {
  .fa-overlay { padding-top: calc(var(--safe-t) + 8px); padding-bottom: calc(var(--safe-b) + 8px); }
  .fa-panel { padding: 12px 20px 12px; }
  .fa-panel__title { font-size: 1.4rem; }
  .fa-howto { gap: 3px; font-size: 0.92rem; line-height: 1.35; margin-bottom: 10px; }
  .fa-menu .fa-row { min-height: 44px; }
  .fa-menu { gap: 6px; }
}
