/* ==========================================================================
   Polypharmacy — Sea of Knowledge game: launch view + full-window player.
   Namespaced under .pg- so it can't collide with app styles. Uses the
   Atlas's own tokens (--tx, --tx3, --ac, --serif, --ap-card-*) so it follows
   the light and dark themes.
   ========================================================================== */
.pg-wrap { max-width: 1120px; margin: 0 auto; padding: 4px 0 40px; }

/* hero: a live screenshot of the sea with the title over it */
.pg-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
  margin-bottom: 30px;
  border-radius: 20px;
  background: #0d2b3b;
  border: 1px solid color-mix(in srgb, var(--ac, #3f7568) 18%, var(--bdr, #d8e2dc));
  box-shadow: var(--ap-card-shadow, 0 10px 30px rgba(10, 30, 40, .18));
}
.pg-cover {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 55%;
  transform: scale(1.02);
  transition: transform 8s ease;
}
.pg-hero:hover .pg-cover { transform: scale(1.07); }
.pg-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(5, 22, 32, .9) 0%, rgba(5, 22, 32, .66) 40%, rgba(5, 22, 32, .1) 74%),
    linear-gradient(0deg, rgba(5, 22, 32, .55), transparent 55%);
}
.pg-hero-in { max-width: 640px; padding: 34px 34px 32px; color: #f2f8f6; }
.pg-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #a6dccd;
}
.pg-title {
  margin: 8px 0 10px;
  font-family: var(--serif, Georgia, serif);
  font-size: 46px;
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.02em;
  color: #fff;
}
.pg-sub { max-width: 54ch; margin: 0 0 16px; font-size: 15.5px; line-height: 1.55; color: rgba(242, 248, 246, .88); }
.pg-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.pg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .24);
  background: rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.pg-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pg-play {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px 14px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(180deg, #ffd977, #f3a93b);
  color: #3a2500;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(243, 169, 59, .35), inset 0 -3px 0 rgba(0, 0, 0, .14);
  transition: transform .16s ease, box-shadow .16s ease;
}
.pg-play svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pg-play:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(243, 169, 59, .45), inset 0 -3px 0 rgba(0, 0, 0, .14); }
.pg-play:active { transform: translateY(0); }
.pg-play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.pg-ghost {
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .36);
  border-radius: 12px;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background .16s ease;
}
.pg-ghost:hover { background: rgba(255, 255, 255, .1); }

/* how it works */
.pg-section {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tx3);
}
.pg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 14px; }
.pg-step {
  padding: 18px 18px 20px;
  border-radius: var(--ap-r, 16px);
  border: 1px solid var(--ap-card-bdr, var(--bdr, #d8e2dc));
  background: var(--ap-card-bg, var(--bg2, #fff));
  box-shadow: var(--ap-card-shadow, none);
}
.pg-step-ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 11px;
  border-radius: 11px;
  background: color-mix(in srgb, #1b8db0 13%, transparent);
  color: #1b7fa0;
}
body[data-theme="dark"] .pg-step-ico { background: color-mix(in srgb, #4fb6d8 18%, transparent); color: #8fd3ea; }
.pg-step-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pg-step b { display: block; margin-bottom: 4px; font-family: var(--serif, Georgia, serif); font-size: 17px; font-weight: 600; color: var(--tx); }
.pg-step p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--tx3); }
.pg-note { margin: 22px 2px 0; font-size: 13.5px; line-height: 1.6; color: var(--tx3); }
.pg-note a { color: var(--ac); font-weight: 600; }

/* Revision Hub card colour */
.revhub-card.revhub-poly { --rk: #1b8db0; }

/* full-window player */
body.pg-open { overflow: hidden !important; }
.pg-player {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  background: #06141d;
  opacity: 0;
  transition: opacity .25s ease;
}
.pg-player.in { opacity: 1; }
.pg-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) calc(12px + env(safe-area-inset-right, 0px)) 8px calc(12px + env(safe-area-inset-left, 0px));
  background: #0b2230;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #e6f2ee;
}
.pg-back {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pg-back:hover { background: rgba(255, 255, 255, .14); }
.pg-back:focus-visible, .pg-pop:focus-visible { outline: 2px solid #8fd3ea; outline-offset: 2px; }
.pg-bar-t { flex: 1; min-width: 0; text-align: center; font-family: var(--serif, Georgia, serif); font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-bar-t span { font-weight: 400; opacity: .6; }
.pg-pop { color: #cfe7ff !important; font-size: 13px; text-decoration: none !important; opacity: .85; white-space: nowrap; }
.pg-pop:hover { opacity: 1; }
.pg-stage { position: relative; flex: 1 1 auto; min-height: 0; }
.pg-frame { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: transparent; }
.pg-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(#bfe8f3, #9ddbe6);
  color: #0f3a4a;
  font-size: 15px;
  font-weight: 600;
}
.pg-spin {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(15, 58, 74, .2);
  border-top-color: #0f3a4a;
  border-radius: 50%;
  animation: pg-spin .9s linear infinite;
}
@keyframes pg-spin { to { transform: rotate(360deg); } }
.pg-player.ready .pg-loading { display: none; }

@media (max-width: 640px) {
  .pg-hero { min-height: 470px; }
  .pg-shade { background: linear-gradient(180deg, rgba(5, 22, 32, .15) 0%, rgba(5, 22, 32, .7) 38%, rgba(5, 22, 32, .92) 100%); }
  .pg-hero-in { padding: 22px 20px 22px; }
  .pg-title { font-size: 36px; }
  .pg-bar-t span, .pg-pop { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pg-cover, .pg-play, .pg-player { transition: none; }
  .pg-hero:hover .pg-cover { transform: scale(1.02); }
  .pg-spin { animation: none; }
}
