/* OrbitFlip v202 — responsive layout, controls, and dialogs. */

:root {
  color-scheme: dark;
  --mint: #8cffd3;
  --muted: #8994ac;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #090d18;
  color: #f4f7ff;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  min-height: 100svh;
  display: flex;
  justify-content: center;
}
main {
  width: min(100%, 640px);
  padding: 24px 20px 18px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-weight: 850;
  letter-spacing: -1px;
  font-size: 23px;
}
.brand span {
  color: var(--mint);
}
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid #303b50;
  background: #151e30;
  color: #e6edff;
  border-radius: 12px;
  padding: 11px 16px;
  touch-action: manipulation;
}
button:hover {
  border-color: var(--mint);
}
button:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}
.icon {
  font-size: 12px;
}
.modes {
  display: flex;
  gap: 8px;
  margin: 25px 0 18px;
}
.modes button {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  padding: 8px 6px;
  line-height: 1.15;
}
.modes .active {
  background: #203c38;
  border-color: #68c5a5;
  color: var(--mint);
}
.hud {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 0 12px;
}
.label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.score {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -3px;
}
.best {
  text-align: right;
  font-size: 25px;
  font-weight: 700;
}
.arena {
  position: relative;
  margin-top: 8px;
  aspect-ratio: 1;
  max-height: 560px;
  width: 100%;
  border: 1px solid #202b40;
  border-radius: 28px;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #172139 0%, #0c1221 68%);
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 25px;
  background: #0a1021b8;
  backdrop-filter: blur(5px);
}
.overlay[hidden] {
  display: none;
}
h1 {
  font-size: clamp(34px, 8vw, 54px);
  letter-spacing: -2px;
  line-height: 1;
  margin: 12px 0;
}
h2 {
  font-size: 38px;
  letter-spacing: -1.5px;
  margin: 10px 0;
}
.eyebrow {
  color: var(--mint);
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 750;
}
.overlay p {
  color: #b5c1d9;
  line-height: 1.6;
  max-width: 300px;
  margin: 12px 0 22px;
}
.primary {
  background: var(--mint);
  color: #09251b;
  border: none;
  font-weight: 800;
  padding: 15px 32px;
  min-width: 190px;
}
.secondary {
  margin-top: 10px;
  min-width: 190px;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 17px 0;
}
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}
.footer button {
  padding: 7px 10px;
  font-size: 11px;
}
.notice {
  min-height: 20px;
  text-align: center;
  color: var(--mint);
  font-size: 12px;
  margin: 8px;
}
.challenge {
  color: var(--mint);
  font-size: 12px;
  min-height: 18px;
  text-align: center;
}
.result {
  font-size: 72px;
  font-weight: 850;
  letter-spacing: -4px;
  color: var(--mint);
  line-height: 1.1;
}
.tiny {
  font-size: 11px !important;
  margin: 14px 0 0 !important;
}
@media (max-height: 750px) {
  main {
    padding-top: 14px;
  }
  .modes {
    margin: 15px 0 12px;
  }
  .score {
    font-size: 40px;
  }
  .arena {
    max-width: 440px;
    margin: 8px auto 0;
  }
  .hint {
    margin: 10px 0;
  }
}
.player-entry {
  width: min(100%, 250px);
  margin: 0 0 14px;
  text-align: left;
}
.player-entry label {
  display: block;
  color: #b5c1d9;
  font-size: 12px;
  margin-bottom: 7px;
}
.player-entry input {
  width: 100%;
  border: 1px solid #53627c;
  background: #101a2c;
  color: #f4f7ff;
  border-radius: 10px;
  padding: 11px 13px;
  font: inherit;
  font-size: 16px;
  min-height: 44px;
}
.player-entry input:focus {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}
.player-entry small {
  display: block;
  color: #a3b1cb;
  font-size: 11px;
  margin-top: 5px;
}
.player-entry[hidden] {
  display: none;
}
.change-player {
  border: 0;
  background: transparent;
  padding: 8px;
  color: #b5c1d9;
  font-size: 12px;
}
.overlay h1 {
  font-size: clamp(30px, 7vw, 46px);
}
.overlay p {
  margin: 10px 0 14px;
}
.player-tag {
  color: var(--mint);
  overflow-wrap: anywhere;
  font-size: 12px;
  margin-top: 8px;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.lives {
  text-align: center;
  color: var(--mint);
  font-size: 20px;
  letter-spacing: 4px;
  margin: 8px 0;
}
.lives span {
  font-size: 11px;
  letter-spacing: 1px;
  color: #b5c1d9;
  margin-left: 8px;
}
.pickup-legend {
  text-align: center;
  color: #ffd76b;
  font-size: 12px;
  margin-top: 12px;
}
.pickup-legend span {
  color: var(--muted);
}
.sr-score {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.hud {
  justify-content: flex-end;
}
.hud > div {
  text-align: right;
}
.safe-hint {
  text-align: center;
  color: #c7808d;
  font-size: 12px;
  margin: 12px 0 0;
}
.game-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.game-controls button {
  min-height: 44px;
  font-size: 13px;
}
.bomb-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  vertical-align: middle;
  touch-action: auto;
}
.slow-status {
  min-height: 20px;
  margin-top: 8px;
  text-align: center;
  color: #7dcfff;
  font-size: 13px;
}
#ballStatus {
  font-size: 13px;
  color: #ffe66d;
  margin-top: 8px;
}
.power-status {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  min-height: 24px;
  margin-top: 8px;
}
.shield-status {
  color: #c5a0ff;
  font-size: 13px;
  margin-top: 8px;
}
.hud {
  justify-content: space-between;
  align-items: flex-end;
}
.hud .lives {
  text-align: left;
  margin: 0 0 0 0;
  line-height: 1.2;
}
.player-tag {
  line-height: 24px;
  margin-top: 8px;
}
.hud {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 12px;
}
.hud .lives {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  text-align: left;
  margin: 0;
  line-height: 24px;
}
.hud .personal-record {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  text-align: right;
  min-width: 0;
}
.icon {
  font-size: 20px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  line-height: 1;
}
.credit {
  text-align: center;
  font-size: 12px;
  color: #8994ac;
  margin: 10px 0 4px;
}
.credit span {
  color: #dd8095;
  margin-left: 3px;
}
.hud {
  grid-template-columns: 72px minmax(0, 1fr) minmax(72px, 96px);
  gap: 8px;
}
.hud .lives {
  font-size: 18px;
  letter-spacing: 1px;
}
.hud .personal-record {
  grid-column: 3;
  max-width: 100%;
}
.hud .rank-panel {
  grid-column: 2;
  grid-row: 1;
  text-align: center;
  min-width: 0;
  position: relative;
  align-self: end;
  padding-bottom: 2px;
}
.rank-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
}
.rank-track {
  height: 7px;
  background: #253147;
  border-radius: 4px;
  overflow: hidden;
  margin: 3px 0 4px;
}
.rank-fill {
  width: 0;
  height: 100%;
  background: #80cba5;
  transition:
    width 0.25s ease,
    background 0.5s ease;
}
.rank-panel.celebrating .rank-name {
  animation: rank-glow 0.7s ease-in-out;
}
.rank-panel.celebrating::after {
  content: "✧ ✦ ✧";
  position: absolute;
  inset: -12px 0 auto;
  color: #d7c58a;
  font-size: 12px;
  pointer-events: none;
  animation: rank-sparkle 1.2s ease-out forwards;
}
@keyframes rank-glow {
  50% {
    text-shadow: 0 0 14px currentColor;
    transform: scale(1.05);
  }
}
@keyframes rank-sparkle {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-9px);
  }
}
@media (max-width: 360px) {
  .hud {
    padding: 0 4px;
    grid-template-columns: 64px minmax(0, 1fr) 82px;
    gap: 6px;
  }
  .rank-name {
    font-size: 11px;
  }
  .hud .lives {
    font-size: 17px;
    letter-spacing: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rank-fill {
    transition: none;
  }
  .rank-panel.celebrating .rank-name,
  .rank-panel.celebrating::after {
    animation: none;
  }
  .rank-panel.celebrating::after {
    opacity: 1;
  }
}
.rank-name {
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 16px;
  font-size: 12px;
  min-height: 16px;
  margin-bottom: 5px;
  text-wrap: balance;
}
.rank-track {
  position: relative;
  height: 12px;
  background: #1c2940;
  overflow: hidden;
  border-radius: 5px;
  margin: 3px 0 5px;
}
.rank-track::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent calc(20% - 2px),
    #101827 calc(20% - 2px),
    #101827 20%
  );
}
.rank-fill {
  position: relative;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 #ffffff35;
  transition:
    width 0.35s ease,
    background 0.5s ease;
}
.rank-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 25%,
    #ffffff45 48%,
    transparent 70%
  );
  transform: translateX(-120%);
  animation: energy-sweep 2.8s ease-in-out infinite;
}
.rank-fill::before {
  content: "";
  position: absolute;
  right: 1px;
  top: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f2f7ff;
  box-shadow: 0 0 8px #f2f7ff;
  opacity: 0.8;
}
.rank-panel.celebrating .rank-track {
  animation: energy-burst 1s ease-out;
}
.rank-panel.celebrating .rank-name {
  animation: rank-glow 0.8s ease-in-out;
}
@keyframes energy-sweep {
  0%,
  20% {
    transform: translateX(-120%);
  }
  75%,
  100% {
    transform: translateX(120%);
  }
}
@keyframes energy-burst {
  0% {
    box-shadow: 0 0 0 #8cffd300;
  }
  30% {
    box-shadow: 0 0 14px #8cffd38c;
  }
  100% {
    box-shadow: 0 0 0 #8cffd300;
  }
}
@media (max-width: 360px) {
  .rank-name {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rank-fill::after,
  .rank-panel.celebrating .rank-track {
    animation: none;
  }
  .rank-fill::after {
    transform: none;
    opacity: 0.3;
  }
}
.hud .rank-panel {
  padding-bottom: 5px;
}
.rank-track {
  margin-bottom: 0;
}

/* Keep start/pause/result content inside the arena, including enlarged text. */
.overlay {
  overflow-y: auto;
  justify-content: flex-start;
  justify-content: safe center;
}
.overlay > * {
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .overlay {
    padding: 20px 16px;
  }
  .overlay h1 {
    font-size: 30px;
    line-height: 1.05;
    margin: 9px 0;
  }
  .overlay .eyebrow {
    font-size: 10px;
    letter-spacing: 2px;
    line-height: 1.4;
  }
  .overlay p {
    font-size: 14px;
    line-height: 1.45;
    margin: 8px 0 12px;
  }
  .overlay .player-entry {
    margin-bottom: 12px;
  }
  .overlay .primary {
    padding: 12px 24px;
    min-height: 44px;
  }
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #090d18;
  padding: 8px 0;
}
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-controls #pause {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 13px;
}
.arena {
  aspect-ratio: 1;
  min-height: 0;
  max-height: none;
}
.arena canvas {
  aspect-ratio: 1;
  height: auto;
}
main:has(.overlay:not([hidden])) .arena {
  display: none;
}
.overlay {
  position: relative;
  inset: auto;
  margin-top: 8px;
  max-height: calc(100svh - 110px);
  overflow-y: auto;
  justify-content: flex-start;
  border: 1px solid #202b40;
  border-radius: 24px;
  min-height: 0;
}
.overlay > * {
  flex-shrink: 0;
}
.overlay[hidden],
.pickup-legend[hidden] {
  display: none;
}
.safe-hint {
  line-height: 1.5;
}
@media (prefers-reduced-motion: reduce) {
  .rank-panel.celebrating .rank-name,
  .rank-panel.celebrating::after {
    animation: none;
    transform: none;
  }
  .rank-fill {
    transition: none;
  }
  .rank-fill::after {
    display: none;
  }
}
.rank-panel.celebrating .rank-name {
  animation: rank-glow 0.8s ease-in-out 5;
}
.rank-panel.celebrating .rank-track {
  animation: energy-burst 1s ease-out 4;
}
.rank-panel.celebrating::after {
  content: "✦ ✨ ✧ ✨ ✦";
  font-size: 14px;
  animation: rank-sparkle 1s ease-out 4 forwards;
}
.rank-panel.celebrating .rank-fill {
  box-shadow:
    0 0 12px currentColor,
    inset 0 1px 0 #ffffff65;
}
@media (prefers-reduced-motion: reduce) {
  .rank-panel.celebrating .rank-name,
  .rank-panel.celebrating .rank-track,
  .rank-panel.celebrating::after {
    animation: none;
  }
  .rank-panel.celebrating::after {
    opacity: 1;
  }
}
/* Event updates must never introduce a banner above the arena. */
.event-status { display: none; }
.hazard-hint {
  font-size: 12px;
  color: #b5c1d9;
  text-align: center;
  line-height: 1.5;
  margin: 8px 0;
}
.modes {
  gap: 6px;
}
 .modes #tutorial,
.modes #endless,
.modes #daily,
.modes #hangarOpen {
  flex: 1;
  min-width: 0;
  padding: 8px 6px;
  font-size: 11px;
}
 .modes #help {
  flex: 0 0 38px;
  width: 38px;
  min-height: 40px;
  padding: 6px 0;
  font-size: 18px;
  line-height: 14px;
  font-weight: 750;
  color: #8cffd3;
  border-color: #5b9e89;
  background: #19352f;
  margin: 0;
}
.help-dialog {
  width: min(92vw, 460px);
  max-height: 85svh;
  overflow-y: auto;
  border: 1px solid #46536c;
  border-radius: 20px;
  background: #10182a;
  color: #eef3ff;
  padding: 22px;
  box-shadow: 0 20px 80px #0009;
}
.build-version {
  font-size: 10px;
  color: #8994ac;
  margin-left: 0;
}
.help-dialog::backdrop {
  background: #050912cc;
}
.help-dialog h2 {
  font-size: 26px;
  margin: 0 0 14px;
}
.help-dialog h3 {
  font-size: 15px;
  color: #8cffd3;
  margin: 18px 0 8px;
}
.help-dialog p {
  font-size: 13px;
  line-height: 1.6;
  color: #bec9df;
  margin: 8px 0;
}
.help-pickups {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  display: grid;
  gap: 10px;
}
.help-pickups li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.help-pickups canvas {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.help-dialog .help-close {
  width: 100%;
  margin-top: 18px;
}
.help-star {
  width: 28px;
  text-align: center;
  color: #ffd76b;
  font-size: 24px;
}
.help-note {
  color: #ffe66d !important;
}
.leaderboard-controls {
  margin: 18px 0 8px;
  border: 1px solid #303b50;
  border-radius: 16px;
  padding: 15px;
  background: #10182a;
}
.leaderboard-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.leaderboard-buttons button {
  min-height: 44px;
  font-size: 14px;
}
.score-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: #e6edff;
  line-height: 1.5;
  cursor: pointer;
}
.score-consent input {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin: 1px 0 0;
  accent-color: #8cffd3;
}
.leaderboard-small {
  font-size: 12px !important;
  line-height: 1.6;
  color: #aab7ce;
  margin: 7px 0;
}
.leaderboard-message {
  font-size: 13px;
  line-height: 1.5;
  color: #8cffd3;
  margin: 10px 0 0;
  overflow-wrap: anywhere;
}
.score-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.score-actions:has(button:not([hidden])) {
  display: flex;
}
.score-actions button {
  font-size: 14px;
  min-height: 44px;
}
.score-actions button[hidden] {
  display: none;
}
.leaderboard-dialog {
  width: min(94vw, 560px);
  padding: 20px;
  max-height: 88svh;
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.dialog-heading h2 {
  font-size: 24px !important;
  line-height: 1.25;
  letter-spacing: -0.5px;
  overflow-wrap: anywhere;
}
.dialog-heading button {
  min-height: 44px;
  font-size: 14px;
  padding: 9px 12px;
}
.board-switch {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}
.board-switch button {
  flex: 1;
  min-height: 44px;
  font-size: 15px;
}
.board-switch [aria-pressed="true"] {
  background: #203c38;
  color: #8cffd3;
  border-color: #68c5a5;
}
.reset-countdown {
  color: #8cffd3 !important;
  font-variant-numeric: tabular-nums;
}
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
  margin-top: 15px;
}
.leaderboard-table th,
.leaderboard-table td {
  text-align: left;
  padding: 11px 8px;
  border-bottom: 1px solid #303b50;
  overflow-wrap: anywhere;
}
.leaderboard-table th:first-child {
  width: 64px;
}
.leaderboard-table th:last-child {
  width: 85px;
}
.leaderboard-table th:last-child,
.leaderboard-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.leaderboard-table th {
  color: #aab7ce;
  font-size: 13px;
}
.leaderboard-table tbody tr:nth-child(-n + 3) td:first-child {
  color: #ffd76b;
  font-weight: 800;
}
.delete-confirm {
  padding: 12px;
  border: 1px solid #dd8095;
  border-radius: 12px;
  margin-top: 14px;
}
.delete-confirm[hidden] {
  display: none;
}
#confirmDelete {
  border-color: #dd8095;
  color: #ffd1dc;
}
#privacyStatus {
  color: #8cffd3;
}
.leaderboard-dialog p {
  font-size: 14px;
  line-height: 1.65;
}
.leaderboard-dialog h3 {
  font-size: 16px;
}
body:has(dialog[open]) {
  overflow: hidden;
}

.developer-panel {
  padding: 16px;
  margin: 14px 0;
  border: 1px solid #e2b962;
  border-radius: 16px;
  background: #201c17;
}
.developer-panel[hidden],
.test-mode-badge[hidden],
.developer-status[hidden] {
  display: none;
}
.developer-panel h2 {
  font-size: 20px;
  margin: 0 0 8px;
  letter-spacing: 0;
}
.developer-panel p,
.developer-status {
  font-size: 13px;
  line-height: 1.6;
  color: #e2c99c;
}
.developer-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.developer-presets button {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 14px;
}
.developer-score-row {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 14px 0;
}
.developer-score-row label {
  font-size: 14px;
  flex: 1;
  min-width: 0;
}
.developer-score-row input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px;
  min-height: 44px;
  border: 1px solid #e2b962;
  border-radius: 9px;
  background: #10182a;
  color: white;
  font: inherit;
  font-size: 16px;
}
.developer-score-row button {
  min-height: 44px;
  font-size: 14px;
}
.test-mode-badge {
  position: sticky;
  top: 59px;
  z-index: 9;
  padding: 7px 10px;
  background: #503c12;
  color: #ffe3a8;
  border: 1px solid #e2b962;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  margin: 4px 0 10px;
}
.developer-panel button:focus-visible,
.developer-panel input:focus-visible {
  outline: 3px solid #e2b962;
  outline-offset: 2px;
}

.legend-item { display: inline-block; margin: 4px 7px; color: #cad6ef; }

/* Release news belongs only in the start overlay, never above the arena. */
.release-notice {
  width: min(100%, 310px);
  padding: 10px 12px;
  margin: 0 0 14px;
  border: 1px solid #628e9f;
  border-radius: 12px;
  background: linear-gradient(115deg, #15342f, #24243e);
  color: #c9e6ee;
  font-size: 12px;
  line-height: 1.5;
}
.release-notice strong { display: block; color: #8cffd3; margin-bottom: 3px; letter-spacing: .5px; }
.release-notice span { display: block; }
.release-notice[hidden] { display: none; }

/* Progress lives below the arena and is shown only before/after a round. */
.progress-panel { margin: 14px 0; padding: 14px; border: 1px solid #34465c; border-radius: 14px; background: #131e2c; font-size: 13px; }
.progress-panel[hidden] { display: none; }
.progress-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.progress-heading button { padding: 9px 12px; font-size: 13px; min-height: 44px; }
.mission-list { padding-left: 20px; line-height: 1.8; }
.progress-panel select { max-width: 100%; padding: 10px; min-height: 44px; color: #e4f3ee; background: #1c2b3b; border: 1px solid #51647b; border-radius: 8px; font: inherit; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px,1fr)); gap: 9px; }
.album-card { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 8px 4px; border-radius: 12px; background: #162235; border: 1px solid #2f4056; text-align: center; font-size: 12px; color: #7f91aa; }
.album-card.discovered { color: #deeee8; border-color: #507264; }
.album-card canvas { width: 64px; height: 64px; flex-shrink: 0; }
.album-card span { overflow-wrap: anywhere; }
.album-dialog { width: min(620px, calc(100vw - 28px)); }

.lives.celestial-won { color: #ffe4a2; animation: celestial-heart-glow 1s ease-in-out 7; }
@keyframes celestial-heart-glow { 0%,100% { text-shadow: 0 0 6px #ffcb7b; } 50% { text-shadow: 0 0 15px #ffb659, 0 0 26px #f392ba; } }
@media (prefers-reduced-motion: reduce) { .lives.celestial-won { animation: none; text-shadow: 0 0 6px #ffcb7b; } }

/* Header shortcuts remain visible; icon widths do not change on pause/resume. */
header { flex-wrap: wrap; gap: 8px; }
.header-controls { flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
.header-controls #pause, .header-controls #sound { width: 44px; min-width: 44px; height: 44px; padding: 8px; font-size: 20px; }
.header-controls .header-engage { min-height: 44px; padding: 8px 10px; font-size: 13px; white-space: nowrap; }
@media (max-width: 420px) { .header-controls { margin-left: auto; } }

V117: Celestial Heart trial lasts 10 seconds. Countdown, ring and instructions updated.

/* Fixed goal row and marker: updates never move the arena. */
.rank-track { position: relative; }
.best-marker { position:absolute;top:0;bottom:0;width:2px;background:#fff0c9;transform:translateX(-1px); }
.unlock-preview { height:16px;line-height:16px;font-size:10px;color:#a7b7ce;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
@media (prefers-reduced-motion: reduce) { .rank-fill { transition:none; } }

.collectible-explorer { margin-top:16px; border:1px solid #334158; border-radius:14px; background:#101a2c; overflow:hidden; }
.collectible-explorer summary { padding:14px 16px; cursor:pointer; color:#cceee7; font-size:14px; font-weight:700; min-height:44px; box-sizing:border-box; }
.collectible-explorer summary:hover { background:#17253a; }
.collectible-explorer summary:focus-visible { outline:2px solid #8cffd3; outline-offset:-3px; }
.collectible-explorer[open] summary { border-bottom:1px solid #334158; }
.collectible-explorer .pickup-legend { margin:0; padding:12px 10px; display:grid; grid-template-columns:repeat(auto-fit,minmax(185px,1fr)); gap:8px; text-align:left; }
.collectible-explorer .legend-item { margin:0; padding:8px; border-radius:9px; background:#151f32; line-height:1.5; }

/* Accessible meter; curved indicators are drawn in the arena corners. */
.battery-panel { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; pointer-events:none; }
.battery-panel[hidden] { display:none; }


/* Life count is drawn in the bottom-left corner; retain the accessible live count. */
#lives { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; animation:none; }
.hud { grid-template-columns:minmax(0,1fr) minmax(72px,96px); }
.hud .rank-panel { grid-column:1; }
.hud .personal-record { grid-column:2; }
@media (max-width:360px) { .hud { grid-template-columns:minmax(0,1fr) 82px; } }

/* Explore Collectibles: purpose-based sections keep every existing icon/card. */
.collectible-explorer .pickup-legend { display:block; padding:14px 12px; }
.collectible-category + .collectible-category { margin-top:20px; }
.collectible-category h3 { margin:0 0 9px; color:#b8e9e3; font-size:14px; font-weight:700; line-height:1.4; }
.collectible-category-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(185px,100%),1fr)); gap:8px; }
.collectible-category-avoid h3 { color:#ffabb6; }
.collectible-category .legend-item { min-width:0; overflow-wrap:anywhere; }

/* Clear Arsenal reference cards in Explore Collectibles. */
.collectible-category-arsenal h3 { color:#8ce6ff; }
.arsenal-guide { margin:0 0 10px; color:#bccce0; font-size:12px; line-height:1.6; }
.arsenal-note { margin:10px 0 0; }
.collectible-category .arsenal-item { display:flex; align-items:center; gap:8px; }
.arsenal-item canvas { flex:0 0 auto; }
.arsenal-item > span { min-width:0; }
.arsenal-item strong { color:#e1f8ff; font-size:12px; }
.arsenal-item small { display:block; color:#bccce0; font-size:11px; line-height:1.6; }

/* Manual Panic control stays below the arena and apart from orbit taps. */
.panic-controls { display:flex; justify-content:center; margin:10px 0; }
.panic-controls button { min-height:44px; min-width:156px; border:1px solid #695574; background:#1c2130; color:#8e879e; letter-spacing:1px; }
.panic-controls button.loaded { color:#f5d4ff; border-color:#e885ff; background:#372141; box-shadow:0 0 14px #e885ff44; }
.panic-controls button:disabled { opacity:.5; }
.panic-controls button.loaded:disabled { box-shadow:none; }

/* Expandable help: a top Close control avoids focusing the bottom of a long dialog. */
#helpDialog .help-heading { display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;top:0;z-index:2;background:#10182a;padding:12px 0;border-bottom:1px solid #33435a; }
#helpDialog .help-heading h2 { margin:0;font-size:24px; }
#helpCloseTop { flex:0 0 auto;min-height:44px;padding:8px 16px; }
#helpDialog .help-intro { margin:12px 0; }
#helpDialog .help-section { border:1px solid #33435a;border-radius:12px;margin:9px 0;background:#131e30; }
#helpDialog .help-section > summary { cursor:pointer;min-height:44px;padding:12px 14px;color:#8cffd3;font-size:15px;font-weight:700; }
#helpDialog .help-section > summary:focus-visible { outline:2px solid #7ceaff;outline-offset:2px;border-radius:10px; }
#helpDialog .help-section[open] > summary { border-bottom:1px solid #33435a; }
#helpDialog .help-section-content { padding:4px 14px 12px; }

/* Compact flight deck: rank gauge directly touches the arena row. */
main { padding-top:14px; }
.modes { margin:12px 0 8px; }
.challenge:empty { display:none; }
.hud { display:block; padding:0; margin:0; }
.hud .rank-panel { width:100%; padding:0; text-align:center; }
.rank-name { line-height:18px; margin:0 0 3px; }
.rank-track { margin:0; }
.arena { margin-top:5px; }
#unlockPreview, #bestMarker, .power-status, .panic-controls, .game-controls { display:none; }
.header-best { display:flex; align-items:center; gap:4px; font-size:13px; font-weight:750; color:#ffdf94; white-space:nowrap; }
.header-controls { gap:5px; flex-wrap:wrap; }
.header-controls .header-engage { padding:8px; }
.flight-controls { margin-top:10px; text-align:center; }
#flightControl { width:100%; min-height:76px; display:flex; justify-content:center; align-items:center; flex-direction:column; gap:3px; touch-action:none; user-select:none; -webkit-user-select:none; background:#17322f; border-color:#64bda5; color:#b8ffe4; font-weight:750; }
#flightControl:disabled { opacity:.45; cursor:default; }
#flightPanic { font-size:11px; color:#9cabc0; font-weight:600; }
#flightControl.loaded { border-color:#e885ff; box-shadow:0 0 16px #c459ed44; }
#flightControl.loaded #flightPanic { color:#f0b4ff; }
#flightHint { margin:6px 0 0; color:#a6b5cd; font-size:11px; }
@media(max-width:420px) { main { padding:12px 12px 16px; } header { gap:4px; } .header-controls { gap:4px; } .header-controls .header-engage { font-size:12px; padding:7px; } }

#flightControl { margin-inline:auto; }

/* Full arena-width flight control with its instructions inside. */
#flightHint { margin:3px 0 0; font-size:12px; line-height:1.4; white-space:normal; }
.header-best { min-height:44px; padding:8px; border:1px solid #303b50; border-radius:12px; background:#151e30; box-sizing:border-box; font-size:13px; line-height:normal; }
@media(max-width:420px) { .header-best { padding:7px; font-size:12px; } }

#flightPanic:empty { display:none; }

.flight-controls[hidden], main:has(.overlay:not([hidden])) .flight-controls { display:none; }

.tutorial-panel { position:absolute; z-index:2; left:50%; bottom:3%; transform:translateX(-50%); width:74%; max-height:46%; overflow-y:auto; overscroll-behavior:contain; margin:0; padding:8px 10px; border:1px solid #4f827d; border-radius:14px; background:#0b202deb; box-shadow:0 3px 16px #0005; }
.tutorial-panel[hidden] { display:none; }
.tutorial-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
#tutorialProgress { font-size:11px; font-weight:800; color:#a7ffe0; letter-spacing:.7px; }
#tutorialSkip { min-height:36px; padding:5px 12px; font-size:12px; }
.tutorial-panel h2 { font-size:17px; margin:4px 0; }
#tutorialText { margin:4px 0; font-size:12px; line-height:1.45; color:#d2e7ef; }
.tutorial-panel.success { border-color:#b3ffe0; }
main:has(.tutorial-panel:not([hidden])[data-focus="control"]) .flight-controls #flightControl { box-shadow:0 0 18px #8cffd355; }
.rank-panel.training-focus .rank-track { box-shadow:0 0 10px #ffe58a; }
#tutorialNext { margin-top:6px; width:100%; background:#20483e; border-color:#8cffd3; }
#tutorialNext[hidden] { display:none; }

/* First Flight floats within the arena; no lesson rows alter game/control layout. */
.tutorial-heading { position:sticky; top:-8px; z-index:1; background:#0b202d; padding:0 0 3px; }
.tutorial-panel h2 { font-size:14px; line-height:1.2; margin:3px 0; }
#tutorialSkip { min-height:30px; padding:3px 9px; }
#tutorialProgress { font-size:10px; letter-spacing:.3px; }
#tutorialNext { min-height:34px; padding:5px 10px; font-size:12px; }
@media(max-width:360px) { .tutorial-panel { width:78%; padding:6px 8px; max-height:48%; } }

/* Compact Help joins the mode buttons without adding another row. */
.modes #help { flex:0 0 40px; min-width:40px; min-height:44px; padding:6px; font-size:20px; font-weight:800; border-radius:12px; }

.header-controls #endGame { min-width:44px; min-height:44px; padding:8px; font-size:12px; font-weight:750; }
.header-controls #endGame:disabled { opacity:.45; cursor:default; }

/* Unified rank/name label and progress: fixed height throughout all celebrations. */
.hud .rank-panel { padding:0; }
.rank-track { height:36px; margin:0; border-radius:10px; background:#172237; isolation:isolate; }
.rank-name { position:absolute; inset:0; z-index:3; margin:0; padding:0 10px; min-height:0; line-height:36px; font-size:12px; font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:center; color:#f4f7ff; text-shadow:0 1px 3px #000,0 0 5px #000b; }
.rank-fill { height:100%; opacity:.65; border-radius:9px; }
.rank-fill::before, .rank-fill::after { display:none; }
.rank-track::after { z-index:1; background:none; }
.rank-panel.celebrating::after { display:none; }
.rank-panel.celebrating .rank-track { animation:none; }
.rank-panel.celebrating .rank-fill { box-shadow:inset 0 1px 0 #ffffff65; }
.rank-panel.celebrating .rank-track::before { content:""; position:absolute; inset:0; z-index:1; background:currentColor; pointer-events:none; animation:rank-full-flash 4s ease-out forwards; }
.rank-panel.celebrating .rank-track::after { content:""; position:absolute; inset:0; z-index:2; background:linear-gradient(105deg,transparent 25%,#ffffff80 48%,transparent 70%); transform:translateX(-120%); animation:rank-bar-sweep 1s ease-in-out 4; }
.rank-panel.celebrating .rank-name { animation:rank-label-pulse .8s ease-in-out 5; }
@keyframes rank-full-flash { 0%,12% { opacity:.65; } 30% { opacity:.35; } 100% { opacity:0; } }
@keyframes rank-bar-sweep { from { transform:translateX(-120%); } to { transform:translateX(120%); } }
@keyframes rank-label-pulse { 50% { text-shadow:0 1px 3px #000,0 0 9px #fff; } }
@media(max-width:360px) { .rank-name { font-size:11px; padding:0 7px; } }
@media(prefers-reduced-motion:reduce) { .rank-panel.celebrating .rank-name, .rank-panel.celebrating .rank-track::before, .rank-panel.celebrating .rank-track::after { animation:none; } .rank-panel.celebrating .rank-track::before { opacity:.25; } .rank-panel.celebrating .rank-track::after { display:none; } }

/* Slanted segments stay beneath the label and celebration sweep. */
.rank-fill::before { display:block; position:absolute; inset:0; width:auto; height:auto; border-radius:0; background:repeating-linear-gradient(115deg,transparent 0px,transparent 10px,#07101b80 10px,#07101b80 14px); box-shadow:none; opacity:1; pointer-events:none; }

.rank-help-table { width:100%; border-collapse:collapse; margin:12px 0 16px; font-size:12px; line-height:1.5; }
.rank-help-table caption { text-align:left; color:#b6ffe2; font-weight:750; padding-bottom:6px; }
.rank-help-table th, .rank-help-table td { padding:7px 8px; border-bottom:1px solid #34445c; text-align:left; }
.rank-help-table th { color:#b9cddd; }
.rank-help-table td:last-child { white-space:nowrap; }

/* Curved Panic panel hugs the lower-right window corner, outside Arsenal. */
.panic-circle { position:absolute; right:0; bottom:0; left:auto; top:auto; transform:none; width:20%; aspect-ratio:1; min-width:0; padding:0; border:0; border-radius:0; background:none; color:#a18791; box-shadow:none; z-index:2; touch-action:manipulation; clip-path:polygon(8% 98%,32% 81%,55% 62%,78% 37%,98% 8%,98% 70%,96% 83%,90% 92%,80% 97%,70% 98%); }
.panic-panel-art { display:block; width:100%; height:100%; overflow:visible; pointer-events:none; }
.panic-fill-light { stop-color:#59303b; }
.panic-fill-dark { stop-color:#25151c; }
.panic-panel-shape { fill:url(#panicPanelFill); stroke:#70414c; stroke-width:1.5; }
.panic-panel-label { fill:currentColor; font:800 10px system-ui; letter-spacing:1px; }
#panicCount, #panicCountLeft { fill:currentColor; font:900 18px system-ui; }
.panic-circle.loaded:enabled { color:#fff3ee; cursor:pointer; filter:drop-shadow(0 0 4px #ff304950); }
.panic-circle.loaded:enabled .panic-fill-light { stop-color:#ff7064; }
.panic-circle.loaded:enabled .panic-fill-dark { stop-color:#9c1025; }
.panic-circle.loaded:enabled .panic-panel-shape { stroke:#ff8279; }
.panic-circle:disabled { opacity:.65; cursor:default; }
.panic-circle.loaded:enabled:active { filter:brightness(1.25); }
.panic-circle:focus-visible .panic-panel-shape { stroke:#fff; stroke-width:3; }

.quick-guide ul { margin:0; padding:12px 16px 14px 32px; color:#c4d4e7; font-size:12px; line-height:1.55; }
.quick-guide li + li { margin-top:7px; }
.quick-guide strong { color:#b6ffe2; }

.panic-circle-left { left:0; right:auto; clip-path:polygon(2% 8%,22% 37%,45% 62%,68% 81%,92% 98%,30% 98%,20% 97%,10% 92%,4% 83%,2% 70%); }
.panic-circle-left .panic-panel-shape { fill:url(#panicPanelFillLeft); }

.legend-item[hidden], .help-pickups li[hidden] { display:none; }

/* Shared edges for the rank bar, arena and flight control at every viewport. */
:root { --play-max-width:600px; }
@media (max-height:750px) { :root { --play-max-width:440px; } }
.hud, .arena, .flight-controls, .overlay {
  width:min(100%,var(--play-max-width));
  max-width:none;
  margin-inline:auto;
}
.hud .rank-panel, .rank-track, #flightControl { width:100%; }

/* Mark's Hangar stays in a dialog; arena and controls never shift on shop entry. */
.hangar-dialog{box-sizing:border-box;width:min(760px,96vw);max-height:92dvh;padding:22px;background:#0c1627;color:#d3e5ef;border:1px solid #497284;border-radius:20px;overflow:auto}.hangar-dialog::backdrop{background:#030812d9}.hangar-heading,.mark-welcome{display:flex;align-items:center;justify-content:space-between;gap:16px}.hangar-heading h2{margin:4px 0;color:#b1f3ef}.hangar-heading small{color:#82a9ba;letter-spacing:2px}.mark-welcome{justify-content:flex-start;margin:18px 0}.mark-welcome svg{flex-shrink:0}.mark-welcome p{font-size:17px;color:#c1e5e6}.hangar-sticky-view{position:sticky;top:-22px;z-index:5;background:linear-gradient(#0c1627 88%,#0c162700);padding:8px 0 12px;margin-bottom:8px}.hangar-balance{font-weight:700;color:#ffde99}.hangar-dialog progress{width:100%;height:10px;accent-color:#72e3d1}.hangar-dialog canvas{display:block;width:100%;height:auto;border:1px solid #284b60;border-radius:14px}.hangar-rules,#hangarPreviewCaption,#hangarGoalText{font-size:13px;color:#a4bece;line-height:1.55}#hangarFeedback{color:#9af0d5;min-height:22px}.hangar-tier{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px;margin:26px 0}.hangar-tier h3{grid-column:1/-1;font-size:15px;color:#b9e0ef;border-bottom:1px solid #30475a;padding-bottom:8px}.hangar-category-intro{grid-column:1/-1;margin:-2px 0 6px;font-size:13px;line-height:1.5;color:#9bb6c7}.hangar-card{border:1px solid #355065;border-left:3px solid var(--item-color);border-radius:10px;padding:14px;background:#101f32}.hangar-card strong{color:var(--item-color)}.hangar-card p{min-height:45px;font-size:13px;line-height:1.5;color:#b1c5d0}.hangar-card button{margin:4px 6px 0 0;padding:10px;font-size:13px;min-height:42px}.hangar-dialog button:focus-visible{outline:2px solid #99ffee;outline-offset:3px}.header-controls{flex-wrap:wrap}@media(max-width:480px){.hangar-dialog{padding:14px}.hangar-sticky-view{top:-14px}.hangar-tier{grid-template-columns:1fr}.mark-welcome p{font-size:15px}}

/* v204 Mark's Hangar catalog tabs */
.hangar-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:14px 0 8px;position:static;padding:0;background:none}
.hangar-tab{min-height:46px;padding:9px 8px;border:1px solid #35566d;border-radius:12px;background:#101f32;color:#b9d3df;font-weight:800;font-size:13px;cursor:pointer;transition:.15s transform,.15s border-color,.15s background}
.hangar-tab:hover{transform:translateY(-1px);border-color:#72daca}.hangar-tab.is-active{background:#15364a;color:#d9ffff;border-color:#72e3d1;box-shadow:0 0 0 1px #72e3d133 inset,0 0 18px #3ce0d51c}
.hangar-category-intro{grid-column:1/-1;margin:0 0 2px;color:#96b9c8;font-size:13px;line-height:1.45}.hangar-card .hangar-meta{min-height:0;margin:7px 0;color:#7999aa;font-size:11px;text-transform:uppercase;letter-spacing:.65px}.hangar-card .hangar-badge{display:inline-block;margin-left:6px;padding:2px 6px;border:1px solid currentColor;border-radius:999px;color:var(--item-color)}
@media(max-width:620px){.hangar-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}.hangar-tab{font-size:12px}.hangar-tier{grid-template-columns:1fr}}
