/*
 * Player-wiki pages (planets, achievements; EN and PT). Loaded after /site.css.
 * Shared by several writers: keep every selector prefixed by its page family
 * (.planets-*, .ach-*, …) so nothing here restyles another page.
 */

/* Planets ------------------------------------------------------------ */

.planets-intro-note {
  font-size: 15.5px;
  color: var(--muted);
}

.planets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
  margin: 14px 0 6px;
  padding: 0;
  list-style: none;
}

.planets-grid > li {
  margin: 0;
}

.planets-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 4px 16px;
  align-items: start;
  height: 100%;
  padding: 16px 16px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
  scroll-margin-top: 120px;
}

.planets-card:target {
  border-color: rgba(90, 209, 255, 0.7);
  background: rgba(90, 209, 255, 0.08);
}

.planets-card h3 {
  margin: 2px 0 2px;
  font-size: 19px;
}

.planets-card p {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.5;
}

.planets-gloss {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

/* A colour swatch built from the skin's three colours: not a game render. */
.planets-swatch {
  --c0: #888;
  --c1: #555;
  --c2: #ccc;
  --glow: #fff;
  position: relative;
  width: 56px;
  height: 56px;
  margin: 6px 4px 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, var(--c2) 0, transparent 38%),
    radial-gradient(circle at 60% 65%, var(--c1) 0, transparent 70%),
    var(--c0);
  box-shadow:
    0 0 14px color-mix(in srgb, var(--glow) 55%, transparent),
    inset -8px -10px 16px rgba(0, 0, 0, 0.45);
}

.planets-swatch.planets-ringed::after {
  content: '';
  position: absolute;
  left: -26%;
  right: -26%;
  top: 40%;
  height: 20%;
  border: 2px solid var(--ring, #ddd);
  border-radius: 50%;
  transform: rotate(-16deg);
  opacity: 0.9;
}

.planets-swatch.planets-glows {
  box-shadow:
    0 0 10px var(--glow),
    0 0 26px color-mix(in srgb, var(--glow) 70%, transparent);
}

.planets-swatch.planets-flat {
  background: var(--c0);
  box-shadow: none;
}

.planets-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 8px;
  padding: 0;
  list-style: none;
}

.planets-tags li {
  margin: 0;
}

.planets-tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(40, 56, 110, 0.35);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

.planets-tag.planets-unlock {
  border-color: rgba(255, 200, 90, 0.7);
  background: linear-gradient(135deg, rgba(255, 150, 40, 0.3), rgba(255, 70, 160, 0.26));
  color: #fff;
}

.planets-tag.planets-free {
  border-color: rgba(90, 230, 160, 0.6);
  background: rgba(40, 160, 110, 0.25);
  color: #fff;
}

.planets-fact {
  padding-left: 10px;
  border-left: 2px solid rgba(179, 107, 255, 0.6);
  color: #dcd3ff;
}

/* Achievements ------------------------------------------------------- */

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
  margin: 14px 0 6px;
  padding: 0;
  list-style: none;
}

.ach-grid > li {
  margin: 0;
}

.ach-card {
  height: 100%;
  padding: 14px 16px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
  scroll-margin-top: 120px;
}

.ach-card:target {
  border-color: rgba(90, 209, 255, 0.7);
  background: rgba(90, 209, 255, 0.08);
}

.ach-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.ach-card h3 {
  margin: 0 0 4px;
  font-size: 18.5px;
}

.ach-xp {
  flex: none;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 800;
  color: #1a0d00;
  background: linear-gradient(135deg, #ffcf3a, #ff9a3b);
  white-space: nowrap;
}

.ach-card p {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.5;
}

.ach-desc {
  color: var(--text);
}

.ach-note {
  font-size: 15px;
  color: var(--muted);
}

.ach-reward {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(90, 209, 255, 0.55);
  background: rgba(90, 209, 255, 0.12);
  font-size: 14.5px;
  font-weight: 700;
}

.ach-table-wrap {
  margin: 12px 0 16px;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.ach-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.45;
}

.ach-table caption {
  padding: 10px 14px 0;
  text-align: left;
  font-size: 15px;
  color: var(--muted);
}

.ach-table th,
.ach-table td {
  padding: 9px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(130, 170, 255, 0.12);
}

.ach-table thead th {
  font-size: 13.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(40, 56, 110, 0.25);
}

.ach-table tbody th {
  color: var(--text);
  font-weight: 700;
}

.ach-table tbody:last-child tr:last-child > * {
  border-bottom: 0;
}

.ach-table th[scope='colgroup'] {
  padding-top: 12px;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sun);
  background: rgba(255, 207, 58, 0.06);
}

.ach-table .ach-num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ach-table var {
  font-style: normal;
  font-weight: 700;
  color: var(--sun);
}

@media (max-width: 560px) {
  .planets-card {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 4px 12px;
    padding: 14px 12px 12px;
  }

  .planets-swatch {
    width: 46px;
    height: 46px;
  }

  .ach-table {
    font-size: 15px;
  }

  .ach-table th,
  .ach-table td {
    padding: 8px 10px;
  }
}

/* Gravity (.phys-*) and modes (.modes-*) ----------------------------- */

/* The sticky header would hide a section's heading after an in-page jump. */
.phys-main .section,
.modes-main .section {
  scroll-margin-top: 110px;
}

.phys-toc,
.modes-toc {
  margin: 26px 0 0;
  padding: 16px 20px 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(12, 16, 38, 0.55);
}

.phys-toc-title,
.modes-toc-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.phys-toc ol,
.modes-toc ol {
  columns: 2 250px;
  column-gap: 28px;
  margin: 0;
  padding-left: 24px;
  font-size: 16px;
}

.phys-toc li,
.modes-toc li {
  margin: 3px 0 5px;
  break-inside: avoid;
}

/* Key numbers as small tiles. */
.phys-stats,
.modes-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
  padding: 0;
  list-style: none;
}

.phys-stats li,
.modes-stats li {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
}

.phys-stats b,
.modes-stats b {
  display: block;
  margin-bottom: 4px;
  font-family: var(--display);
  font-size: 23px;
  letter-spacing: 0.02em;
  color: var(--sun);
}

/* Data tables. */
.phys-table-wrap,
.modes-table-wrap {
  margin: 12px 0 16px;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.phys-table,
.modes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.45;
}

.phys-table caption,
.modes-table caption {
  padding: 10px 14px 4px;
  text-align: left;
  font-size: 15px;
  color: var(--muted);
}

.phys-table th,
.phys-table td,
.modes-table th,
.modes-table td {
  padding: 9px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(130, 170, 255, 0.12);
}

.phys-table thead th,
.modes-table thead th {
  font-size: 13.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(40, 56, 110, 0.25);
}

.phys-table tbody th,
.modes-table tbody th {
  color: var(--text);
  font-weight: 700;
}

.phys-table tbody tr:last-child > *,
.modes-table tbody tr:last-child > * {
  border-bottom: 0;
}

.phys-num,
.modes-num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Diagrams (inline SVG) and their numbered legends. */
.phys-fig,
.modes-fig {
  margin: 18px 0 8px;
}

.phys-fig svg,
.modes-fig svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: radial-gradient(ellipse 70% 80% at 50% 58%, rgba(60, 40, 110, 0.4), rgba(5, 6, 15, 0.92) 75%);
}

.phys-fig figcaption,
.modes-fig figcaption {
  margin-top: 8px;
  font-size: 15px;
  color: var(--muted);
}

.phys-legend {
  counter-reset: phys-leg;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  color: var(--body);
}

.phys-legend li {
  position: relative;
  margin: 8px 0;
  padding-left: 36px;
}

.phys-legend li::before {
  content: counter(phys-leg);
  counter-increment: phys-leg;
  position: absolute;
  left: 0;
  top: 0;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--panel-solid);
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}

.modes-fig svg.modes-timeline {
  max-width: 600px;
}

.modes-key {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border-radius: 4px;
  vertical-align: -2px;
}

.modes-key-hold {
  border: 1px solid var(--accent);
  background: rgba(90, 209, 255, 0.3);
}

.modes-key-shrink {
  margin-left: 12px;
  border: 1px solid #ff9a7a;
  background: #e2543f;
}

/* "For the curious": the exact rules. */
.phys-curious,
.modes-curious {
  margin: 16px 0 8px;
  padding: 14px 18px 8px;
  border-radius: 16px;
  border: 1px dashed rgba(179, 107, 255, 0.6);
  background: rgba(179, 107, 255, 0.07);
}

.phys-curious-title,
.modes-curious-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d9c2ff;
}

.phys-curious p,
.phys-curious li,
.modes-curious p,
.modes-curious li {
  font-size: 16.5px;
}

.phys-formula {
  display: inline-block;
  max-width: 100%;
  padding: 1px 8px;
  border-radius: 8px;
  background: rgba(5, 6, 15, 0.6);
  border: 1px solid rgba(179, 107, 255, 0.3);
  color: var(--text);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace;
  font-size: 15px;
  line-height: 1.6;
}

.phys-rules {
  display: grid;
  grid-template-columns: minmax(0, 12em) minmax(0, 1fr);
  gap: 10px 18px;
  margin: 8px 0 12px;
}

.phys-rules dt {
  color: var(--text);
  font-weight: 700;
}

.phys-rules dd {
  margin: 0;
}

.phys-note,
.modes-note {
  font-size: 15.5px;
  color: var(--muted);
}

@media (max-width: 560px) {
  .phys-toc,
  .modes-toc {
    padding: 14px 14px 8px;
  }

  .phys-stats b,
  .modes-stats b {
    font-size: 20px;
  }

  .phys-table,
  .modes-table {
    font-size: 15px;
  }

  .phys-table th,
  .phys-table td,
  .modes-table th,
  .modes-table td {
    padding: 8px 10px;
  }

  .phys-curious,
  .modes-curious {
    padding: 12px 14px 6px;
  }

  .phys-rules {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .phys-rules dd {
    margin-bottom: 10px;
  }
}
