/* /pro - the Quoridors Pro page.

   Flat on purpose: the site's own surfaces and green, one warm gold for the
   word "Pro", the analyzer's real grade colours in the preview, and no
   shadows or decorative motion. Hover is a 150 ms colour change and nothing
   moves the layout. Everything is prefixed .pro- so none of it leaks. */

.pro-page {
  max-width: 1080px;
  --pro-gold: #e8c25a;
  --pro-line: rgba(255, 255, 255, 0.08);
  --pro-dim: #a3a39b;          /* muted text that still clears 4.5:1 on #272727 */
}

.pro-page h1, .pro-page h2, .pro-page h3 { margin: 0; letter-spacing: -0.01em; }
.pro-page section { margin-top: 72px; }
.pro-page section:first-of-type { margin-top: 8px; }

.pro-ic {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---- Hero ---------------------------------------------------------------- */

.pro-hero {
  display: grid; gap: 40px; align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .pro-hero { grid-template-columns: 1.05fr 1fr; gap: 56px; }
}

.pro-eyebrow {
  margin: 0 0 14px; color: var(--pro-gold);
  font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.pro-title {
  font-size: clamp(34px, 5.2vw, 54px); line-height: 1.06; font-weight: 800;
  color: var(--color-text-primary);
}
.pro-lede {
  margin: 20px 0 0; max-width: 34em;
  font-size: 18px; line-height: 1.55; color: var(--pro-dim);
}
.pro-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.pro-fine { margin: 14px 0 0; font-size: 14px; color: var(--pro-dim); }
.pro-fine b { color: var(--color-text-primary); }

/* The preview card: a review, as the analyzer draws one. */
.pro-preview {
  margin: 0; padding: 18px;
  background: var(--color-surface); border: 1px solid var(--pro-line);
  border-radius: var(--radius-lg);
}
/* The board itself is the site's (.board-frame/.board from styles.css); here it
   only gets a width, since the game sizes it from --board-size instead. */
.pro-board-wrap { display: flex; gap: 10px; align-items: stretch; }
.pro-evalbar { width: 14px; flex: none; }
.pro-board-frame { width: auto; flex: 1; min-width: 0; }
.pro-board-frame .board { box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.pro-preview-body { padding: 16px 4px 2px; }

.pro-acc { display: flex; gap: 28px; padding-bottom: 14px; border-bottom: 1px solid var(--pro-line); }
.pro-acc > div { display: flex; flex-direction: column; gap: 2px; }
.pro-acc-n { font-size: 26px; font-weight: 800; color: var(--color-text-primary); font-variant-numeric: tabular-nums; }
.pro-acc-n.dim { color: var(--pro-dim); }
.pro-acc-l { font-size: 13px; color: var(--pro-dim); }

.pro-moves { list-style: none; margin: 0; padding: 6px 0; }
.pro-moves li {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center;
  padding: 8px 0; font-size: 15px;
}
.pro-moves li + li { border-top: 1px solid var(--pro-line); }
.pro-mn { color: var(--pro-dim); font-variant-numeric: tabular-nums; }
.pro-mv { color: var(--color-text-primary); }
.pro-g { font-weight: 700; font-size: 14px; }

.pro-solve {
  display: flex; align-items: center; gap: 8px; margin: 6px 0 0;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: #1f2e1b; color: var(--color-text-primary); font-size: 14px;
}
.pro-solve .pro-ic { width: 18px; height: 18px; color: var(--grade-best); }

/* ---- What you get: one screenshot per feature ------------------------------ */

.pro-show-title { font-size: 28px; font-weight: 800; color: var(--color-text-primary); margin-bottom: 8px; }
.pro-row {
  display: grid; gap: 24px; align-items: center; grid-template-columns: 1fr;
  padding: 40px 0; border-top: 1px solid var(--pro-line);
}
.pro-row:first-of-type { border-top: 0; padding-top: 24px; }
@media (min-width: 880px) {
  .pro-row { grid-template-columns: 1.7fr 1fr; gap: 44px; padding: 48px 0; }
  /* Alternate sides, so the eye zig-zags down the page instead of down one edge. */
  .pro-row:nth-of-type(even) { grid-template-columns: 1fr 1.7fr; }
  .pro-row:nth-of-type(even) .pro-shot { order: 2; }
}
.pro-shot {
  margin: 0; padding: 8px; border-radius: var(--radius-lg);
  background: var(--color-surface); border: 1px solid var(--pro-line);
}
.pro-shot img {
  display: block; width: 100%; height: auto; border-radius: 10px;
  background: #1e1e1e;
}
.pro-tag {
  margin: 0 0 10px; color: var(--pro-gold);
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.pro-row-copy h3 { font-size: 26px; line-height: 1.15; font-weight: 800; color: var(--color-text-primary); }
.pro-row-copy p:not(.pro-tag):not(.pro-plan-line) {
  margin: 14px 0 0; font-size: 16px; line-height: 1.6; color: var(--pro-dim); max-width: 34em;
}
.pro-row-copy b { color: var(--color-text-primary); }
.pro-row-copy b.c-terrible { color: var(--grade-terrible); }
.pro-plan-line {
  display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 0;
  font-size: 14px; font-weight: 600; color: var(--pro-dim);
}
.pro-plan-line .is-pro { color: var(--color-accent-hover); }

/* ---- Plans --------------------------------------------------------------- */

.pro-sec-head {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.pro-page section > h2, .pro-sec-head h2 { font-size: 28px; font-weight: 800; color: var(--color-text-primary); }

.pro-toggle {
  display: inline-flex; padding: 4px; gap: 4px;
  background: var(--color-surface); border: 1px solid var(--pro-line); border-radius: 999px;
}
.pro-toggle button {
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px;
  background: transparent; color: var(--pro-dim);
  transition: background-color .15s ease, color .15s ease;
}
.pro-toggle button:hover { color: var(--color-text-primary); }
.pro-toggle button[aria-pressed="true"] { background: var(--color-surface-raised); color: var(--color-text-primary); }
.pro-save { color: var(--grade-best); font-weight: 700; margin-left: 4px; }

.pro-cards { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .pro-cards { grid-template-columns: 1fr 1fr; } }
/* Stacked, the plan being sold comes first. */
@media (max-width: 719px) { .pro-card.is-pro { order: -1; } }

.pro-card {
  display: flex; flex-direction: column;
  padding: 28px 26px; border-radius: var(--radius-lg);
  background: var(--color-surface); border: 1px solid var(--pro-line);
}
.pro-card.is-pro { border: 2px solid var(--color-accent); padding: 27px 25px; }
.pro-card h3 { font-size: 20px; font-weight: 700; color: var(--color-text-primary); }
.pro-card.is-pro h3 { color: var(--pro-gold); }
.pro-price { margin: 14px 0 0; display: flex; align-items: baseline; gap: 6px; }
.pro-amt { font-size: 44px; font-weight: 800; color: var(--color-text-primary); font-variant-numeric: tabular-nums; }
.pro-per { font-size: 16px; color: var(--pro-dim); }
.pro-price-sub { margin: 4px 0 0; font-size: 14px; color: var(--pro-dim); min-height: 1.5em; }

.pro-list { list-style: none; margin: 22px 0 26px; padding: 0; flex: 1; }
.pro-list li {
  position: relative; padding: 7px 0 7px 28px;
  font-size: 15px; color: var(--color-text-primary);
}
.pro-list li::before {
  content: ""; position: absolute; left: 2px; top: 13px;
  width: 11px; height: 6px; border: solid var(--grade-best);
  border-width: 0 0 2px 2px; transform: rotate(-45deg);
}
.pro-card-btn { width: 100%; }
.pro-status { margin: 10px 0 0; font-size: 14px; color: var(--pro-dim); text-align: center; min-height: 1.4em; }

/* ---- Comparison ---------------------------------------------------------- */

.pro-compare h2 { margin-bottom: 18px; }
.pro-table {
  width: 100%; border-collapse: collapse; table-layout: fixed;
  background: var(--color-surface); border-radius: var(--radius-lg); overflow: hidden;
  font-size: 15px;
}
.pro-table th, .pro-table td { padding: 14px 16px; text-align: left; border-top: 1px solid var(--pro-line); }
.pro-table thead th { border-top: 0; font-size: 14px; color: var(--pro-dim); font-weight: 600; }
.pro-table thead th:last-child { color: var(--pro-gold); }
.pro-table tbody th { font-weight: 500; color: var(--color-text-primary); }
.pro-table td { color: var(--pro-dim); width: 26%; }
.pro-table td:last-child { background: rgba(90, 158, 63, 0.07); color: var(--color-text-primary); }
.pro-yes { color: var(--grade-best); font-weight: 800; }
.pro-no { color: #6f6f68; }
@media (max-width: 520px) {
  .pro-table th, .pro-table td { padding: 12px 10px; font-size: 14px; }
  .pro-table td { width: 25%; }
}

/* ---- FAQ ----------------------------------------------------------------- */

.pro-faq { max-width: 760px; }
.pro-faq h2 { margin-bottom: 12px; }
.pro-faq details { border-bottom: 1px solid var(--pro-line); }
.pro-faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 56px; cursor: pointer; list-style: none;
  font-size: 17px; font-weight: 600; color: var(--color-text-primary);
  transition: color .15s ease;
}
.pro-faq summary::-webkit-details-marker { display: none; }
.pro-faq summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--pro-dim); }
.pro-faq details[open] summary::after { content: "–"; }
.pro-faq summary:hover { color: var(--color-accent-hover); }
.pro-faq details p { margin: 0 0 18px; font-size: 16px; line-height: 1.6; color: var(--pro-dim); max-width: 40em; }

/* ---- Closing band -------------------------------------------------------- */

.pro-final {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between;
  padding: 32px 30px; border-radius: var(--radius-lg);
  background: #1f2e1b; border: 1px solid #3f6a35;
}
.pro-final h2 { font-size: 24px; font-weight: 800; color: var(--color-text-primary); max-width: 22em; }

/* No hover lift on this page: nothing moves the layout. */
.pro-page .btn:hover, .pro-page .btn:active { transform: none; }
.pro-page .btn.primary { box-shadow: none; }
.pro-page a:focus-visible, .pro-page button:focus-visible, .pro-page summary:focus-visible {
  outline: 2px solid var(--color-accent-hover); outline-offset: 3px;
}

/* ---- States ------------------------------------------------------------------ */

.pro-notice {
  margin: 0 0 24px; padding: 14px 18px; border-radius: var(--radius-md);
  background: #1f2e1b; border: 1px solid #3f6a35;
  color: var(--color-text-primary); font-size: 15px; font-weight: 600;
}
.pro-card-btn[aria-busy="true"] { opacity: .7; cursor: progress; }

/* ---- Checkout, on the page ------------------------------------------------- */
/* In the plan cards' place: the plan on the left, Stripe's form on the right. */
.pro-plans.is-paying .pro-cards,
.pro-plans.is-paying .pro-toggle { display: none; }
.pro-pay { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 860px) { .pro-pay { grid-template-columns: 300px 1fr; gap: 32px; } }
.pro-pay[hidden] { display: none; }
.pro-pay-side {
  padding: 24px; border-radius: var(--radius-lg);
  background: var(--color-surface); border: 2px solid var(--color-accent);
}
.pro-back {
  margin: 0 0 18px; padding: 0; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--pro-dim);
}
.pro-back:hover { color: var(--color-text-primary); }
.pro-pay-tag { margin: 0; color: var(--pro-gold); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pro-pay-plan { margin: 6px 0 0; font-size: 26px; font-weight: 800; color: var(--color-text-primary); }
.pro-pay-price { margin: 2px 0 0; font-size: 16px; color: var(--pro-dim); }
.pro-pay-notes { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pro-pay-notes li { font-size: 14px; line-height: 1.5; color: var(--pro-dim); padding-left: 16px; position: relative; }
.pro-pay-notes li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 2px; background: var(--color-accent); }
/* The form: a card of the page's own, the same surface as the plan beside it.
   Inside it only the card fields are Stripe's, drawn in these same colours
   (pro-page.js, APPEARANCE). */
.pro-pay-main {
  padding: 24px; border-radius: var(--radius-lg);
  background: var(--color-surface); border: 1px solid var(--pro-line);
}
.pro-modal-form { margin-top: 14px; }
.pf { display: flex; flex-direction: column; gap: 18px; }
.pf-wait { margin: 0; padding: 36px 0; text-align: center; color: var(--pro-dim); font-size: 15px; }
.pf-email {
  display: flex; align-items: baseline; gap: 14px; padding-bottom: 16px;
  border-bottom: 1px solid var(--pro-line); font-size: 15px; min-width: 0;
}
.pf-email span { color: var(--pro-dim); font-weight: 600; font-size: 13px; flex: none; }
.pf-email b { color: var(--color-text-primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-fields { min-height: 120px; }
.pf-express[hidden] { display: none; }
.pf-or {
  display: flex; align-items: center; gap: 12px; margin: 16px 0 0;
  color: var(--pro-dim); font-size: 13px; font-weight: 600;
}
.pf-or::before, .pf-or::after { content: ""; flex: 1; height: 1px; background: var(--pro-line); }
.pf-promo { border-top: 1px solid var(--pro-line); padding-top: 14px; }
.pf-promo summary {
  list-style: none; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--color-accent-hover);
}
.pf-promo summary::-webkit-details-marker { display: none; }
.pf-promo summary:hover { text-decoration: underline; }
.pf-promo-row { display: flex; gap: 8px; margin-top: 10px; }
.pf-promo-input {
  flex: 1; min-width: 0; height: 42px; box-sizing: border-box; padding: 0 12px;
  background: #1c1c1c; color: var(--color-text-primary); font: inherit; font-size: 15px;
  border: 1px solid rgba(255, 255, 255, .10); border-radius: 10px; outline: none;
}
.pf-promo-input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 1px var(--color-accent); }
.pf-promo-btn { height: 42px; border-radius: 10px; }
.pf-promo-msg { margin: 8px 0 0; font-size: 13px; color: #e0796b; }
.pf-promo-msg:empty { display: none; }
.pf-promo-msg.is-ok { color: var(--color-accent-hover); }
.pf-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 16px; border-top: 1px solid var(--pro-line);
}
.pf-total span { font-size: 15px; font-weight: 600; color: var(--pro-dim); }
.pf-total b { font-size: 24px; font-weight: 800; color: var(--color-text-primary); font-variant-numeric: tabular-nums; }
.pf-submit { width: 100%; }
.pf-submit:disabled { opacity: .55; cursor: default; }
.pf-submit[aria-busy="true"] { cursor: progress; }
.pf-err { margin: -6px 0 0; color: #e0796b; font-size: 14px; font-weight: 600; }
.pf-err:empty { display: none; }
.pf-fine { margin: -4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--pro-dim); }
/* A phone: the plan in one short block, so the form starts on the first screen. */
@media (max-width: 859px) {
  .pro-pay-side { padding: 16px 18px; }
  .pro-back { margin-bottom: 10px; }
  .pro-pay-plan { font-size: 21px; }
  .pro-pay-notes { display: none; }
}

/* ---- Your subscription ------------------------------------------------------- */
.pro-page .pro-billing { margin-top: 8px; }
.pro-page .pro-billing[hidden] + .pro-hero { margin-top: 8px; }
.pro-billing {
  padding: 24px 26px; border-radius: var(--radius-lg);
  background: var(--color-surface); border: 2px solid var(--color-accent);
}
.pro-billing-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.pro-billing-head h2 { font-size: 24px; font-weight: 800; color: var(--color-text-primary); }
.pro-billing-state {
  font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: rgba(90, 158, 63, .16); color: var(--color-accent-hover);
}
.pro-billing-state.is-ending { background: rgba(230, 180, 85, .14); color: #e6b455; }
.pro-billing-state.is-trouble { background: rgba(224, 121, 107, .14); color: #e0796b; }
.pro-billing-state:empty { display: none; }
.pro-billing-wait, .pro-billing-error { margin: 16px 0 0; color: var(--pro-dim); font-size: 15px; }
.pb-grid { display: grid; gap: 14px 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 20px; }
.pb-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pb-l { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pro-dim); }
.pb-v { font-size: 17px; font-weight: 700; color: var(--color-text-primary); }
.pb-s { font-size: 14px; color: var(--pro-dim); }
.pb-link {
  align-self: flex-start; margin-top: 6px; padding: 0; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--color-accent-hover);
}
.pb-link:hover { text-decoration: underline; }
.pb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--pro-line); }
.pb-actions .btn { height: 40px; }
.pb-actions .pb-cancel { background: transparent; color: var(--pro-dim); }
.pb-actions .pb-cancel:hover { color: #e0796b; border-color: rgba(224, 121, 107, .5); background: transparent; }
.pb-receipts { margin-top: 22px; }
.pb-receipts h3 { font-size: 14px; font-weight: 700; color: var(--pro-dim); letter-spacing: .06em; text-transform: uppercase; }
.pb-receipts ol { list-style: none; margin: 8px 0 0; padding: 0; }
.pb-receipts li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--pro-line); font-size: 15px; color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
}
.pb-receipts li:first-child { border-top: 0; }
.pb-receipts .pb-paid { color: var(--pro-dim); font-size: 14px; }
.pb-receipts a { color: var(--color-accent-hover); font-weight: 700; font-size: 14px; text-decoration: none; }
.pb-receipts a:hover { text-decoration: underline; }

/* ---- The dialog: cancel, switch plan, a new card ------------------------------ */
.pro-modal {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0, 0, 0, .62);
}
.pro-modal[hidden] { display: none; }
.pro-modal-card {
  position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 26px 24px 22px; border-radius: 16px;
  background: #272727; border: 1px solid var(--pro-line);
}
.pro-modal-card.is-wide { max-width: 560px; }
.pro-modal-card h3 { margin: 0 28px 0 0; font-size: 21px; font-weight: 800; color: var(--color-text-primary); }
.pro-modal-x {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; padding: 0;
  background: none; border: 0; border-radius: 8px; color: var(--pro-dim); font-size: 16px; cursor: pointer;
}
.pro-modal-x:hover { background: var(--color-surface-raised); color: var(--color-text-primary); }
.pro-modal-body { margin-top: 10px; font-size: 15px; line-height: 1.55; color: var(--pro-dim); }
.pro-modal-body p { margin: 0 0 10px; }
.pro-modal-body b { color: var(--color-text-primary); }
.pro-modal-form { margin-top: 14px; min-height: 300px; }
.pro-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.pro-modal-actions:empty { display: none; }
.pro-modal-actions .btn { flex: 1 1 160px; height: 44px; }
.pro-modal-actions .pb-danger { background: #c0392b; border-color: transparent; color: #fff; }
.pro-modal-actions .pb-danger:hover { background: #a93226; }
.pro-modal-err { margin: 12px 0 0; color: #e0796b; font-size: 14px; font-weight: 600; }
.pro-modal-err:empty { display: none; }

/* The app sells nothing: no prices, no buttons, no plans - one plain line. */
.pro-app-note { display: none; }
body.is-app .pro-app-note {
  display: block; margin: 0 0 24px; color: var(--pro-dim); font-size: 15px;
}
body.is-app .pro-hero-cta, body.is-app .pro-fine, body.is-app #plans,
body.is-app #compare, body.is-app .pro-final, body.is-app .pro-plan-line,
body.is-app .pro-billing { display: none; }
