/* The Solarian Arcade: four windows onto floating worlds, in deep space under a
   rising sun. Hovering a window pops it out, lights its sides and turns it
   toward the cursor; its island lifts and the layers slide apart for depth.
   The background stays still; the only thing always moving is the islands'
   gentle float, so slow computers cope. */
.picker {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: #05060d;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
html:has(.picker) { background: #05060d; }

/* ---- Space -------------------------------------------------------------------- */
.space { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.stars {
  position: absolute;
  inset: -20% -10%;
  background-repeat: repeat;
}
.stars.far {
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255, 255, 255, 0.8), transparent 60%),
    radial-gradient(1px 1px at 120px 80px, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1px 1px at 70px 150px, rgba(200, 220, 255, 0.7), transparent 60%),
    radial-gradient(1px 1px at 170px 190px, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 40px 210px, rgba(255, 230, 200, 0.6), transparent 60%);
  background-size: 220px 240px;
  opacity: 0.7;
}
.stars.near {
  background-image:
    radial-gradient(1.6px 1.6px at 50px 60px, rgba(255, 255, 255, 0.9), transparent 60%),
    radial-gradient(1.4px 1.4px at 260px 140px, rgba(255, 240, 210, 0.8), transparent 60%),
    radial-gradient(1.8px 1.8px at 160px 300px, rgba(210, 230, 255, 0.9), transparent 60%);
  background-size: 340px 380px;
  opacity: 0.6;
}
/* the sun rising behind the title */
.sun {
  position: absolute;
  left: 50%;
  top: -62vmax;
  width: 90vmax;
  height: 90vmax;
  margin-left: -45vmax;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 214, 120, 0.4) 0%, rgba(255, 150, 60, 0.2) 34%, rgba(255, 90, 40, 0.06) 52%, rgba(255, 60, 30, 0) 66%);
}

/* ---- Header -------------------------------------------------------------------- */
.bar, .lineup, .foot { position: relative; z-index: 1; }
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 6px max(18px, env(safe-area-inset-left));
}
.brand { display: flex; align-items: center; gap: 12px; }
.sun-mark { width: clamp(38px, 4vw, 52px); height: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 0.9; }
.brand-text b {
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #ffc94a;
}
.brand-text span { margin-top: 5px; font-size: 12px; font-weight: 900; letter-spacing: 0.62em; color: #c9bfa8; }

/* the Backups button, next to the coins */
.bar-end { display: flex; align-items: center; gap: 10px; }
.bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 5px 9px;
  border: 0;
  border-radius: 7px;
  background: rgba(43, 47, 54, 0.85);
  color: var(--sign-white);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--asphalt-2), inset 0 0 0 3.5px rgba(247, 247, 242, 0.75), 0 3px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease;
}
.bar-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bar-btn:hover { transform: translateY(-1px); }
.bar-btn:active { transform: translateY(2px); }
@media (max-width: 420px) { .bar-btn span { display: none; } .bar-btn { padding: 7px 8px 6px; } }

/* ---- The lineup --------------------------------------------------------------- */
.lineup {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
  align-content: center;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 18px max(18px, env(safe-area-inset-right)) 18px max(18px, env(safe-area-inset-left));
}

.panel {
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 30%;
  --px: 0;
  --py: 0;
  position: relative;
  display: block;
  height: clamp(400px, 72vh, 680px);
  color: var(--sign-white);
  text-decoration: none;
  border-radius: 10px;
  outline: none;
  transform: perspective(1100px) translateY(0) scale(1);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  -webkit-user-drag: none;
}
.panel-tilt {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #0a0b14;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 14px 34px rgba(0, 0, 0, 0.55);
  transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.18s ease-out, box-shadow 0.3s ease;
  isolation: isolate;
}

/* layers, far to near; each slides a different amount when the panel turns */
.panel-sky {
  position: absolute;
  inset: -4%;
  background:
    radial-gradient(1px 1px at 14% 18%, #fff, transparent 70%),
    radial-gradient(1px 1px at 72% 12%, #fff, transparent 70%),
    radial-gradient(1.4px 1.4px at 86% 34%, #fff, transparent 70%),
    radial-gradient(1px 1px at 38% 28%, rgba(255, 255, 255, 0.7), transparent 70%),
    radial-gradient(1px 1px at 58% 42%, rgba(255, 255, 255, 0.6), transparent 70%),
    radial-gradient(1.2px 1.2px at 24% 48%, rgba(255, 255, 255, 0.7), transparent 70%),
    linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 100%);
  transform: translate(calc(var(--px) * 6px), calc(var(--py) * 6px));
  transition: transform 0.18s ease-out;
}
.panel-island {
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: 9%;
  top: 27%;
  transform: translate(calc(var(--px) * -16px), calc(var(--py) * -10px)) scale(1);
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  pointer-events: none;
}
.panel-island img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 60%;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.45));
  user-select: none;
  animation: float 7s ease-in-out infinite;
}
.panel:nth-child(2) .panel-island img { animation-delay: -1.7s; }
.panel:nth-child(3) .panel-island img { animation-delay: -3.4s; }
.panel:nth-child(4) .panel-island img { animation-delay: -5.1s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* dark at the top so the title always reads */
.panel-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 6, 13, 0.78) 0%, rgba(5, 6, 13, 0.3) 24%, rgba(5, 6, 13, 0) 40%),
    linear-gradient(0deg, rgba(5, 6, 13, 0.6) 0%, rgba(5, 6, 13, 0) 18%);
  pointer-events: none;
}
.panel-glare {
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 45% at var(--mx) var(--my), rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0) 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
/* the others step back (a dark veil: cheaper than a filter) */
.panel-tilt::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(5, 6, 13, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.panel-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: clamp(14px, 1.6vw, 22px) clamp(14px, 1.6vw, 22px) 0;
  transform: translate(calc(var(--px) * -8px), calc(var(--py) * -5px));
  transition: transform 0.18s ease-out;
}
.panel-text h2 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 38px);
  font-weight: 900;
  line-height: 0.98;
  text-wrap: balance;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.panel-text p {
  margin: 10px 0 0;
  max-width: 24ch;
  font-size: clamp(14px, 1.15vw, 17px);
  font-weight: 700;
  line-height: 1.25;
  color: #d7dbe2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}
.panel-stat {
  position: absolute;
  left: clamp(14px, 1.6vw, 22px);
  bottom: clamp(12px, 1.4vw, 18px);
  display: flex;
  flex-direction: column;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}
.panel-stat span { font-size: 10px; font-weight: 900; letter-spacing: 0.18em; color: #aeb4be; }
.panel-stat b { margin-top: 3px; font-size: clamp(22px, 2vw, 30px); font-weight: 900; font-variant-numeric: tabular-nums; }

/* ---- Hover / focus ------------------------------------------------------------------ */
.panel:hover, .panel:focus-visible { z-index: 2; transform: perspective(1100px) translateY(-8px) scale(1.045); }
.panel:hover .panel-tilt, .panel:focus-visible .panel-tilt {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), -18px 0 46px -16px var(--glow), 18px 0 46px -16px var(--glow), 0 26px 50px rgba(0, 0, 0, 0.6);
}
.panel:hover .panel-glare { opacity: 1; }
/* the island lifts toward you */
.panel:hover .panel-island, .panel:focus-visible .panel-island { transform: translate(calc(var(--px) * -16px), calc(var(--py) * -10px - 14px)) scale(1.07); }
.lineup:has(.panel:hover) .panel:not(:hover) { transform: perspective(1100px) scale(0.975); }
.lineup:has(.panel:hover) .panel:not(:hover) .panel-tilt::before { opacity: 1; }
.panel:active { transform: perspective(1100px) translateY(-2px) scale(1.02); }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 4px 18px max(18px, env(safe-area-inset-bottom));
  font-size: 13px;
  font-weight: 700;
  color: #8a8fa0;
  text-align: center;
}

/* ---- Smaller screens: two by two ------------------------------------------------- */
@media (max-width: 900px) {
  .lineup { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel { height: clamp(270px, 43vh, 470px); }
  .panel-text h2 { font-size: clamp(20px, 4.6vw, 32px); }
  .panel-text p { font-size: clamp(12px, 2.6vw, 15px); margin-top: 6px; }
  .panel-island { top: 33%; left: -4%; right: -4%; bottom: 10%; }
}
@media (max-width: 900px) and (max-height: 560px) { /* phone held sideways: back to one row */
  .lineup { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .panel { height: 72vh; }
  .panel-text p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .panel-tilt, .panel-island, .panel-sky, .panel-text { transform: none !important; }
  .panel-island img { animation: none !important; }
}

/* ---- Backups ---------------------------------------------------------------------- */
.picker .screen { position: fixed; z-index: 20; }
body.modal-open { overflow: hidden; }
.bk-card { width: min(560px, 100%); }
.bk-card .card-head span:last-child { font-size: 11px; letter-spacing: 0.12em; color: #aeb4be; }
.bk-card .card-body { gap: 18px; }
.bk-intro { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--ink-soft); }
.bk-sec { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 2px solid rgba(22, 24, 28, 0.1); }
.bk-sec h3 { margin: 0; font-size: 13px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.bk-or { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.bk-code {
  width: 100%;
  min-height: 64px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: #eef0f3;
  color: var(--ink);
  font: 600 12px/1.45 var(--font-mono);
  word-break: break-all;
  resize: vertical;
  box-shadow: inset 0 0 0 1.5px #d4d8df;
}
.bk-code:focus { outline: none; box-shadow: inset 0 0 0 2px var(--sign-blue); }
.bk-msg { margin: 0; min-height: 0; font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--ink-soft); }
.bk-msg:empty { display: none; }
.bk-msg.good { color: #1d6b3a; }
.bk-msg.bad { color: var(--sign-red); }
.bk-note { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink-soft); }
.bk-preview { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; border-radius: 8px; background: #fff7d6; box-shadow: inset 0 0 0 1.5px #e8cf7a; }
.bk-from { margin: 0; font-size: 15px; font-weight: 900; }
.bk-compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.bk-compare th, .bk-compare td { padding: 5px 0 4px; border-bottom: 1.5px dashed #e3cf8f; text-align: right; }
.bk-compare th[scope='row'], .bk-compare thead th:first-child { text-align: left; font-weight: 700; color: var(--ink-soft); }
.bk-compare thead th { font-size: 11px; font-weight: 900; letter-spacing: 0.12em; color: var(--ink-soft); }
.bk-compare td { font-weight: 900; font-variant-numeric: tabular-nums; padding-left: 14px; }
.bk-compare td.less { color: var(--sign-red); }
.bk-warn { margin: 0; font-size: 13px; font-weight: 700; line-height: 1.4; color: #7a5200; }
.bk-foot { padding: 0 18px 18px; }
