/* Penelope's Arcade / Penny's Solitaire
   The look follows the game: its felt-green table, the icon's pink and gold lettering
   with a dark outline, cream playing cards, and SF Rounded (the app's typeface; other
   systems fall back to a similar rounded face). */

:root {
  --felt-hi:   #13863f;
  --felt:      #0b5a2b;
  --felt-lo:   #05301a;
  --felt-ink:  #02190c;
  --cream:     #fff8ec;
  --card:      #fffdf6;
  --ink:       #1d2a24;
  --ink-soft:  #55635c;
  --red:       #d7263d;
  --pink:      #ff4d97;
  --pink-lo:   #d61f73;
  --gold:      #ffc23a;
  --gold-lo:   #f08c12;
  --outline:   #2b1747;
  --line:      rgba(255,248,236,.16);

  --easy:      #2e9e4f;
  --medium:    #2f6fdb;
  --hard:      #d93a3a;
  --expert:    #8a3ad9;
  --unsolvable:#1b1b1f;

  --round: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Arial Rounded MT Bold", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
img { max-width: 100%; height: auto; display: block; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--cream);
  font: 17px/1.6 var(--round);
  background-color: var(--felt-lo);
  background-image:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(255,236,160,.16) 0%, transparent 60%),
    radial-gradient(ellipse 140% 90% at 50% 20%, var(--felt-hi) 0%, var(--felt) 45%, var(--felt-lo) 100%);
  background-attachment: fixed;
}

a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #ffd76a; }

/* min-width: 0 stops wide content (the screenshot strip) from widening the page:
   flex items default to their content's minimum width. */
main { flex: 1; width: 100%; min-width: 0; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; }

/* ------------------------------------------------------------------ header / footer */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}
.lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  text-decoration: none;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.1;
}
.lockup img { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.lockup small { display: block; font-weight: 600; font-size: 12px; color: rgba(255,248,236,.7); letter-spacing: .02em; }
.site-nav { display: flex; gap: 18px; font-weight: 700; font-size: 15px; }
.site-nav a { color: rgba(255,248,236,.85); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--gold); }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 28px 16px 40px;
  text-align: center;
  font-size: 14px;
  color: rgba(255,248,236,.7);
}
.site-footer nav { display: flex; justify-content: center; gap: 22px; margin-bottom: 10px; font-weight: 700; }
.site-footer nav a { color: var(--cream); text-decoration: none; }

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  text-align: center;
  padding: 12px 0 8px;
  isolation: isolate;
}
.hero-penny {
  width: min(78vw, 400px);
  margin: 0 auto;
  filter: drop-shadow(0 16px 26px rgba(0,0,0,.4));
}
.wordmark {
  display: block;
  width: min(92vw, 560px);
  height: auto;
  margin: -9% auto 0;
  position: relative;
  overflow: visible;
}
.tagline {
  font-size: clamp(18px, 4.6vw, 22px);
  font-weight: 700;
  line-height: 1.4;
  max-width: 560px;
  margin: 10px auto 22px;
  color: var(--cream);
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0 0 8px; }

/* Floating suits and stars behind the hero, as on the splash screen. */
.confetti { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.confetti svg { position: absolute; width: var(--s, 34px); height: var(--s, 34px); transform: rotate(var(--r, 0deg)); filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
@media (prefers-reduced-motion: no-preference) {
  .confetti svg { animation: drift 7s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
  @keyframes drift { to { transform: rotate(calc(var(--r, 0deg) + 14deg)) translateY(-10px); } }
}

/* ------------------------------------------------------------------ buttons */

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 800 17px/1 var(--round);
  color: #fff;
  text-decoration: none;
  padding: 16px 26px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff82bd 0%, var(--pink) 45%, var(--pink-lo) 100%);
  border: 3px solid var(--outline);
  box-shadow: 0 5px 0 var(--outline), 0 12px 24px rgba(0,0,0,.35);
  text-shadow: 0 1px 1px rgba(43,23,71,.5);
  transition: transform .12s ease, box-shadow .12s ease;
}
.cta:hover { color: #fff; transform: translateY(-1px); }
.cta:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--outline), 0 6px 14px rgba(0,0,0,.3); }
.cta.gold { background: linear-gradient(180deg, #ffe38a 0%, var(--gold) 45%, var(--gold-lo) 100%); color: var(--outline); text-shadow: none; }
.cta.soon, .cta[aria-disabled="true"] {
  background: rgba(255,248,236,.12);
  color: rgba(255,248,236,.8);
  border-color: rgba(255,248,236,.28);
  box-shadow: none;
  text-shadow: none;
  cursor: default;
  transform: none;
}
.cta img { width: 26px; height: 26px; border-radius: 7px; }

/* ------------------------------------------------------------------ sections */

section { padding: 48px 0 0; }
.section-title {
  font-weight: 900;
  font-size: clamp(26px, 6vw, 36px);
  line-height: 1.15;
  text-align: center;
  margin: 0 0 8px;
  color: var(--gold);
  text-shadow: 0 3px 0 var(--outline), 0 8px 18px rgba(0,0,0,.35);
}
.section-lede { text-align: center; max-width: 620px; margin: 0 auto 28px; color: rgba(255,248,236,.88); }

/* Playing-card panels: cream, rounded, a suit index in the corners. */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}
.playcard {
  position: relative;
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 30px 24px 26px 58px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(0,0,0,.06);
  transform: rotate(var(--tilt, 0deg));
  transition: transform .18s ease;
}
.playcard:nth-child(odd)  { --tilt: -1deg; }
.playcard:nth-child(even) { --tilt: 1deg; }
.playcard:hover { transform: rotate(0deg) translateY(-4px); }
.playcard h3 { font-size: 20px; font-weight: 900; margin: 0 0 8px; line-height: 1.2; color: var(--ink); }
.playcard p { margin: 0; color: var(--ink-soft); font-size: 16px; }
.pip {
  position: absolute;
  width: 26px;
  height: 26px;
  left: 18px;
  top: 28px;
}
.pip.red { color: var(--red); }
.pip.black { color: var(--ink); }
.pip.corner { left: auto; top: auto; right: 16px; bottom: 16px; width: 18px; height: 18px; transform: rotate(180deg); opacity: .55; }

.tiers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tier {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--c);
}
.tier.easy { --c: var(--easy); }
.tier.medium { --c: var(--medium); }
.tier.hard { --c: var(--hard); }
.tier.expert { --c: var(--expert); }
.tier.gm { background: linear-gradient(90deg, #b17bff, var(--pink)); }
.tier.unsolvable { --c: var(--unsolvable); }

/* Challenge pitch: a mocked-up message thread beside the three steps. */
.pitch { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; max-width: 900px; margin: 0 auto; }
.message-mock { display: grid; gap: 10px; justify-items: end; max-width: 420px; margin: 0 auto; width: 100%; }
.bubble-out, .bubble-in {
  font-size: 16px;
  line-height: 1.35;
  padding: 11px 16px;
  border-radius: 20px;
  max-width: 82%;
}
.bubble-out { background: #2b9d4f; color: #fff; border-bottom-right-radius: 6px; }
.bubble-in { background: rgba(255,248,236,.16); color: var(--cream); justify-self: start; border-bottom-left-radius: 6px; }
.bubble-out .link { color: #dff5e4; text-decoration: underline; font-size: 15px; }
.preview {
  width: 82%;
  border-radius: 16px;
  overflow: hidden;
  background: #11331f;
  box-shadow: 0 10px 22px rgba(0,0,0,.35);
}
.preview img { width: 100%; height: auto; }
.preview-text { padding: 10px 14px; display: grid; gap: 2px; }
.preview-text strong { font-size: 15px; color: var(--cream); }
.preview-text span { font-size: 13px; color: rgba(255,248,236,.6); }
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps li { position: relative; padding-left: 52px; color: rgba(255,248,236,.88); }
.steps li b { color: var(--cream); }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
  color: var(--outline);
  background: linear-gradient(180deg, #ffe38a, var(--gold));
  box-shadow: 0 3px 0 rgba(43,23,71,.6);
}

/* Jadzia's card. */
.art { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center; max-width: 820px; margin: 0 auto; justify-items: center; }
.art-card {
  width: min(52vw, 220px);
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(0,0,0,.45);
  transform: rotate(-3deg);
}
.art p { color: rgba(255,248,236,.88); }
.art p:last-child { margin-bottom: 0; }

/* Phone screenshots. */
.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 260px);
  justify-content: start;
  gap: 26px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 10px 16px 24px;
  margin: 0 -16px;
}
.shots figure { margin: 0; scroll-snap-align: center; text-align: center; }
.phone {
  border-radius: 34px;
  border: 7px solid #111;
  overflow: hidden;
  box-shadow: 0 22px 44px rgba(0,0,0,.45), 0 0 0 2px rgba(255,255,255,.08);
  background: #111;
}
.shots figcaption { margin-top: 12px; font-weight: 700; font-size: 15px; color: rgba(255,248,236,.9); }

/* Meet Penny. */
.meet {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 8px 28px;
  max-width: 820px;
  margin: 0 auto;
}
.meet .pair { display: flex; align-items: flex-end; gap: 0; }
.meet .pair img { height: min(52vw, 300px); width: auto; filter: drop-shadow(0 12px 20px rgba(0,0,0,.4)); }
.meet .pair img + img { margin-left: -18px; }
.meet .bubble {
  background: linear-gradient(135deg, rgba(255,77,151,.92), rgba(138,58,217,.9));
  border-radius: 26px;
  padding: 22px 24px;
  box-shadow: 0 10px 26px rgba(255,77,151,.25);
  font-weight: 600;
  align-self: center;
}
.meet .bubble p { margin: 0 0 10px; color: #fff; }
.meet .bubble p:last-child { margin: 0; }

/* Closing band. */
.band {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 36px 20px;
  margin-top: 56px;
  border-radius: 28px;
  background: rgba(2,25,12,.4);
  box-shadow: inset 0 0 0 1px var(--line);
}
.band img.icon { width: 104px; height: 104px; border-radius: 24px; box-shadow: 0 10px 24px rgba(0,0,0,.45); }
.band h2 { margin: 0; font-size: 26px; font-weight: 900; }
.band p { margin: 0; color: rgba(255,248,236,.85); }

/* ------------------------------------------------------------------ prose pages */

.page-title {
  font-weight: 900;
  font-size: clamp(32px, 8vw, 46px);
  line-height: 1.1;
  margin: 24px 0 18px;
  color: var(--gold);
  text-shadow: 0 3px 0 var(--outline), 0 8px 18px rgba(0,0,0,.35);
}
.paper {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.paper h2 { font-size: 20px; font-weight: 900; margin: 28px 0 8px; color: var(--ink); }
.paper h2:first-child { margin-top: 0; }
.paper p { color: #36443d; margin: 0 0 14px; }
.paper a { color: #b0125b; }
.paper .lede { font-size: 18px; color: var(--ink); font-weight: 600; }
.updated { font-size: 14px; color: rgba(255,248,236,.7); margin: -8px 0 18px; }

/* ------------------------------------------------------------------ challenge page */

.challenge {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0;
  padding-top: 8px;
}
/* small on phones so the challenge itself is on the first screen */
.challenge-penny { width: min(28vw, 118px); margin-bottom: -22px; position: relative; z-index: 1; filter: drop-shadow(0 12px 20px rgba(0,0,0,.4)); }
.challenge .playcard { width: 100%; max-width: 520px; padding: 34px 28px 28px; --tilt: 0deg; text-align: left; }
.challenge .playcard:hover { transform: none; }
.challenge .pip { left: 18px; top: 18px; }
.challenger {
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 4px 26px;
  font-weight: 800;
}
.target {
  font-size: clamp(56px, 16vw, 84px);
  line-height: 1;
  font-weight: 900;
  color: var(--red);
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}
.target-label { font-size: 15px; color: var(--ink-soft); margin: 0 0 16px; font-weight: 700; }
#fallback { color: #36443d; margin: 0; }
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 16px 0 0;
  border-top: 1px dashed rgba(29,42,36,.18);
}
.fact {
  font-size: 14px;
  color: var(--ink-soft);
  background: rgba(29,42,36,.06);
  border-radius: 999px;
  padding: 5px 12px;
}
.fact b { color: var(--ink); font-weight: 800; }
.challenge .cta-row { margin-top: 26px; flex-direction: column; align-items: center; }
.note { font-size: 14px; color: rgba(255,248,236,.75); margin: 2px 0 0; text-align: center; }
.challenge-copy { text-align: center; max-width: 560px; margin: 30px auto 0; color: rgba(255,248,236,.88); }
.seed { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: rgba(255,248,236,.5); margin-top: 24px; text-align: center; word-break: break-all; }

/* ------------------------------------------------------------------ wider screens */

@media (min-width: 900px) {
  .shots { justify-content: center; } /* all three fit, so centre them */
}

@media (min-width: 820px) {
  .hero { padding-top: 0; }
  .hero-penny { width: 420px; }
  .challenge { grid-template-columns: auto 1fr; align-items: end; justify-items: start; gap: 0 12px; max-width: 760px; margin: 0 auto; }
  .challenge-penny { width: 230px; margin: 0 -40px 0 0; grid-row: 1 / span 2; align-self: end; }
  .challenge .cta-row { flex-direction: row; justify-content: flex-start; }
  .challenge .note { text-align: left; margin-left: 0; }
  .pitch { grid-template-columns: 420px 1fr; gap: 40px; }
  .art { grid-template-columns: 240px 1fr; gap: 40px; justify-items: start; }
}

@media (max-width: 560px) {
  .confetti .low { display: none; } /* would sit on the tagline */
  .site-nav { gap: 14px; font-size: 14px; }
  .lockup small { display: none; }
  .meet { grid-template-columns: 1fr; justify-items: center; }
  .playcard { padding-left: 54px; }
}

/* `hidden` must win over any display rule above (e.g. .facts is flex). */
[hidden] { display: none !important; }
