/* Shared by the four smaller pages: account, showcases, terms, receipt.
 * One file rather than four near-identical ones, because four copies of a page
 * header is four places for it to drift. Same rule as the shell: no colour, no
 * duration, no radius that is not a token. */

.phead {
  padding: var(--s-6) var(--s-6) var(--s-5);
  border-bottom: 1px solid var(--ln);
  position: relative; overflow: hidden;
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 0%), var(--spot), transparent 62%);
}
.phead > * { position: relative; z-index: 2; }
.phead h1 { margin: 0 0 7px; font-size: var(--t-h2); }
.phead .sub { margin: 0; color: var(--mut); font-size: var(--t-sm); max-width: 62ch; }
.hint { color: var(--mut); font-size: var(--t-sm); max-width: 56ch; margin: 0 0 var(--s-4); }
.pane { padding: var(--s-6); }
.empty { padding: var(--s-10) var(--s-6); text-align: center; color: var(--mut); font-size: var(--t-sm); }
.empty b { display: block; color: var(--fg); font-size: var(--t-h3); margin-bottom: 6px; font-weight: 600; }
.empty .cta { display: flex; gap: var(--s-2); justify-content: center; flex-wrap: wrap; margin-top: var(--s-5); }

/* ── purchase history ───────────────────────────────────────────────────── */

.recrow {
  display: grid; grid-template-columns: 1fr auto auto auto;
  gap: var(--s-4); align-items: center;
  padding: var(--s-3) var(--s-2); border-bottom: 1px solid var(--ln);
  position: relative;
  transition: background-color var(--t-tint) ease, padding var(--t-move) var(--ease);
}
.recrow:last-child { border-bottom: 0; }
.recrow:hover { background: var(--hov); padding-inline: var(--s-4); }
.recrow b { font-weight: 500; }
.recrow small { display: block; color: var(--mut); font-size: var(--t-xs); margin-top: 2px; }
.recwhen { color: var(--mut); font-size: var(--t-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.recvia {
  color: var(--mut); font-size: var(--t-label); letter-spacing: var(--track-label);
  text-transform: uppercase; white-space: nowrap;
}
.recamt { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 620px) {
  .recrow { grid-template-columns: 1fr auto; row-gap: var(--s-1); }
  .recwhen { grid-column: 1; }
  .recvia { display: none; }
}

.kv { display: flex; justify-content: space-between; gap: var(--s-4); font-size: var(--t-sm); padding: 7px 0; border-bottom: 1px solid var(--ln); }
.kv:last-of-type { border-bottom: 0; }
.kv span { color: var(--mut); }
.kv b { font-weight: 500; font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }

/* ── account ────────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ln); border-bottom: 1px solid var(--ln); }
.stat { padding: var(--s-5) var(--s-6); position: relative; transition: background-color var(--t-tint) ease; }
.stat::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: var(--acc); box-shadow: 0 0 10px -1px var(--acc);
  transform: scaleX(0); transform-origin: center;
  transition: transform var(--t-move) var(--ease);
}
.stat:hover { background: var(--hov); }
.stat:hover::before { transform: scaleX(1); }
.stat + .stat { border-left: 1px solid var(--ln); }
.stat b { display: block; font-size: clamp(23px, 3.2vw, 32px); font-weight: 600; letter-spacing: -0.025em; margin-bottom: 1px; }
.stat span { color: var(--mut); }
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat + .stat { border-left: 0; }
  .stat:nth-child(even) { border-left: 1px solid var(--ln); }
  .stat:nth-child(n+3) { border-top: 1px solid var(--ln); }
}

.keyrow {
  display: grid; grid-template-columns: 1fr auto auto; gap: var(--s-4); align-items: center; min-width: 0;
  padding: var(--s-3) var(--s-2); border-bottom: 1px solid var(--ln); position: relative;
  transition: background-color var(--t-tint) ease, padding var(--t-move) var(--ease);
}
.keyrow::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--acc); box-shadow: 0 0 12px -1px var(--acc);
  transform: scaleY(0); transform-origin: top;
  transition: transform var(--t-move) var(--ease);
}
.keyrow:hover { background: var(--hov); padding-left: var(--s-4); }
.keyrow:hover::before { transform: scaleY(1); }
.keyrow code { font-family: var(--mono); font-size: var(--t-sm); display: block; }
.keyrow small { color: var(--mut); font-size: var(--t-xs); }

/* The row leads with what the licence covers, and the reference follows it.
   It used to be the other way round: the reference was the heading, and the
   only line naming the licence said "per-game", so four licences looked
   identical. Both still fit on one line on a phone because the name wraps and
   the reference does not. */
.keyrow .lic-name {
  display: block; font-weight: 600; font-size: var(--t-sm); color: var(--fg);
  overflow-wrap: anywhere;
}
.keyrow .lic-ref {
  color: var(--mut); font-size: var(--t-xs); letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 6px;
}
/* The label that stops the reference reading as a key. Set apart rather than
   run into it, so the eye separates "ref" from the value at a glance and does
   not select the word along with it when copying for support. */
.keyrow .lic-reflabel {
  flex: none; text-transform: uppercase; letter-spacing: var(--track-label);
  font-size: 9px; color: var(--mut); opacity: .8;
  border: 1px solid var(--ln); border-radius: var(--rad-pill);
  padding: 1px 6px;
}
@media (max-width: 700px) { .keyrow { grid-template-columns: 1fr auto; } .keyrow .rst { grid-column: 1 / -1; } }

/* ── showcases ──────────────────────────────────────────────────────────── */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--s-4); padding: var(--s-5) var(--s-6) var(--s-6); }
.shot { position: relative; }
.frame {
  aspect-ratio: 1; background: var(--inp); border: 1px solid var(--ln); border-radius: var(--rad-large);
  position: relative; display: grid; place-items: center; overflow: hidden;
  box-shadow: inset 0 1px 0 var(--edge);
}
.frame .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.7) brightness(0.62); transition: filter var(--t-move) ease, transform 0.62s var(--ease); }
.shot:hover .frame .art { filter: saturate(1) brightness(0.78); transform: scale(1.04); }
.frame span {
  width: 46px; height: 46px; border: 1px solid var(--ln); border-radius: var(--rad-soft);
  display: grid; place-items: center; color: var(--mut); position: relative; z-index: 2;
  background: var(--scrim-mid); backdrop-filter: blur(2px);
  transition: color var(--t-tint) ease, border-color var(--t-tint) ease, box-shadow var(--t-move) var(--ease), transform var(--t-move) var(--ease);
}
.shot:hover .frame span { color: var(--acc-txt); border-color: var(--acc); box-shadow: 0 0 26px -8px var(--acc); transform: scale(1.08); }
.shot h4 { margin: var(--s-3) 0 3px; font-size: var(--t-sm); font-weight: 500; line-height: 1.4; }
.shot small { color: var(--mut); font-size: var(--t-xs); font-family: var(--mono); }

/* ── terms ──────────────────────────────────────────────────────────────── */
.doc { display: grid; grid-template-columns: 220px 1fr; }
@media (max-width: 820px) { .doc { grid-template-columns: 1fr; } .toc { border-right: 0; border-bottom: 1px solid var(--ln); position: static; } }
.toc { border-right: 1px solid var(--ln); padding: var(--s-6) 0; align-self: start; position: sticky; top: 0; }
.toc a {
  font-size: var(--t-xs); color: var(--mut); display: block; padding: 7px var(--s-6);
  position: relative; text-decoration: none;
  transition: color var(--t-tint) ease, padding var(--t-move) var(--ease);
}
.toc a::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px;
  background: var(--acc); box-shadow: 0 0 10px -1px var(--acc);
  transform: scaleY(0); transition: transform var(--t-move) var(--ease);
}
.toc a:hover { color: var(--fg); padding-left: var(--s-8); text-decoration: none; }
.toc a:hover::before { transform: scaleY(1); }
.prose { padding: var(--s-6); max-width: 72ch; }
.clause { padding: var(--s-4) 0; border-bottom: 1px solid var(--ln); scroll-margin-top: var(--s-6); }
.clause:last-child { border-bottom: 0; }
.clause h2 { margin: 0 0 7px; font-size: var(--t-h3); font-weight: 600; display: flex; gap: var(--s-3); align-items: baseline; }
.clause h2 u { text-decoration: none; font-size: 12px; font-weight: 500; color: var(--acc-txt); font-family: var(--mono); letter-spacing: 0; }
.clause p { margin: 0; font-size: var(--t-sm); color: var(--mut); line-height: var(--lh-prose); }
.clause p b { color: var(--fg); font-weight: 500; }
.updated { padding: var(--s-4) var(--s-6); border-bottom: 1px solid var(--ln); font-size: var(--t-xs); color: var(--mut); font-family: var(--mono); }

/* ── payment receipt ────────────────────────────────────────────────────── */
.done {
  padding: var(--s-10) var(--s-6) var(--s-8); text-align: center;
  border-bottom: 1px solid var(--ln); position: relative; overflow: hidden;
  background: radial-gradient(600px circle at 50% 0%, var(--spot), transparent 62%);
}
.tickmark {
  width: 54px; height: 54px; margin: 0 auto var(--s-5);
  border: 1px solid var(--acc); border-radius: var(--rad-large);
  display: grid; place-items: center; color: var(--acc-txt);
  box-shadow: 0 0 40px -12px var(--acc), inset 0 1px 0 var(--edge);
  background: linear-gradient(180deg, var(--sheen), transparent 60%);
  position: relative; z-index: 2;
}
.tickmark .ic { width: 25px; height: 25px; }
[data-seen="1"] .tickmark { animation: pop var(--t-reveal) var(--ease) both; }
@keyframes pop { from { transform: scale(0.86); opacity: 0; } to { transform: none; opacity: 1; } }
.done h1 { margin: 0 0 var(--s-2); font-size: var(--t-h2); }
.done p { margin: 0 auto; color: var(--mut); font-size: var(--t-sm); max-width: 46ch; position: relative; z-index: 2; }

.reveal {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s-3); align-items: center;
  margin: 0 0 var(--s-4); padding: var(--s-4);
  background: var(--inp); border: 1px solid var(--ln); border-radius: var(--rad-soft);
  box-shadow: inset 0 1px 0 var(--edge);
}
@media (max-width: 560px) { .reveal { grid-template-columns: 1fr; } }
.reveal code { font-family: var(--mono); font-size: 15px; letter-spacing: 0.02em; word-break: break-all; }

.next { margin: 0; padding: 0; list-style: none; }
.next li { display: grid; grid-template-columns: auto 1fr; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--ln); align-items: start; }
.next li:last-child { border-bottom: 0; }
.next i {
  font-style: normal; width: 26px; height: 26px; display: grid; place-items: center;
  font-size: 11.5px; font-family: var(--mono); font-variant-numeric: tabular-nums;
  border: 1px solid var(--acc); border-radius: var(--rad-soft); color: var(--acc-txt);
  box-shadow: 0 0 18px -8px var(--acc), inset 0 1px 0 var(--edge);
}
.next em { font-style: normal; display: block; font-size: var(--t-sm); font-weight: 500; margin-bottom: 2px; }
.next small { color: var(--mut); font-size: var(--t-xs); line-height: 1.5; display: block; }

.code {
  font-family: var(--mono); font-size: 13px; line-height: 1.8;
  background: var(--inp); border: 1px solid var(--ln); border-radius: var(--rad-soft);
  box-shadow: inset 0 1px 0 var(--edge);
  padding: var(--s-4); margin: 0 0 var(--s-2);
  overflow-x: auto; white-space: pre; color: var(--mut); max-width: 100%;
}
.code b { color: var(--fg); font-weight: 400; }
.code u { text-decoration: none; color: var(--acc-txt); }
.helpline { margin-top: var(--s-5); font-size: var(--t-sm); color: var(--mut); border-top: 1px solid var(--ln); padding-top: var(--s-4); }

/* The sign-out row. Set apart from the panes above it, because it is the one
   control on this page that ends the session rather than changing something
   inside it. */
.acctfoot { display: flex; justify-content: flex-end; padding: var(--s-4) 0 0; }

/* ── email sign-in ─────────────────────────────────────────────────────────
   Restored 2026-08-01. Below the Google button and visually quieter than it,
   because OAuth is one press and this is a form: leading with the heavier thing
   would make the easy route look like the fallback. */
.emailauth {
  max-width: 22rem; margin: var(--s-6) auto 0; text-align: left;
  display: grid; gap: var(--s-4);
}
.eadiv {
  margin: 0; display: flex; align-items: center; gap: var(--s-3);
  color: var(--mut); font-size: var(--t-label);
  text-transform: uppercase; letter-spacing: var(--track-label);
}
.eadiv::before, .eadiv::after { content: ""; flex: 1; height: 1px; background: var(--ln); }
.emailauth form { display: grid; gap: var(--s-3); }
.emailauth .field { display: grid; gap: 6px; }
.emailauth .field > span { color: var(--mut); font-size: var(--t-xs); }
.emailauth input {
  width: 100%; box-sizing: border-box;
  padding: 10px var(--s-3); border-radius: var(--rad-sharp);
  border: 1px solid var(--ln); background: var(--inp); color: var(--fg);
  font: inherit; font-size: var(--t-sm);
  transition: border-color var(--t-tint) ease, box-shadow var(--t-tint) ease;
}
.emailauth input:focus { border-color: var(--acc); outline: none; box-shadow: 0 0 0 3px var(--spot); }
/* The one-time code is read off a screen and typed back, so it gets the
   monospace treatment the key field has for the same reason. */
.emailauth input[inputmode="numeric"] {
  font-family: var(--mono); letter-spacing: 0.3em; text-align: center; font-size: var(--t-h3);
}
/* A real button, not an anchor to nowhere: these do something on this page. */
.emailauth .linkish {
  appearance: none; background: none; border: 0; padding: 0;
  color: var(--acc-txt); font: inherit; font-size: var(--t-xs);
  cursor: pointer; justify-self: start; text-decoration: underline;
  text-underline-offset: 3px;
}
.emailauth .linkish:hover { color: var(--fg); }
.eamsg { margin: 0; font-size: var(--t-sm); text-align: left; }
.eamsg:empty { display: none; }
.eamsg[data-kind="ok"] { color: var(--ok); }
.eamsg[data-kind="bad"] { color: var(--warn); }
@media (prefers-reduced-motion: reduce) { .emailauth input { transition: none; } }

/* ── the licence key, revealed on request ──────────────────────────────────
   Not in the page payload: the row asks for one key when somebody presses the
   button, so a screenshot of this page is still worth nothing on its own. */
.keyrow .lic-show, .keyrow .lic-copy {
  appearance: none; cursor: pointer; font: inherit; font-size: var(--t-xs);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--rad-pill);
  border: 1px solid var(--ln); background: var(--inp); color: var(--mut);
  transition: color var(--t-tint) ease, border-color var(--t-tint) ease,
              transform var(--t-step) var(--ease);
}
.keyrow .lic-show:hover, .keyrow .lic-copy:hover {
  color: var(--acc-txt); border-color: var(--acc-txt); transform: translateY(-1px);
}
.keyrow .lic-show:active, .keyrow .lic-copy:active { transform: translateY(0); }
.keyrow .lic-show .ic, .keyrow .lic-copy .ic { width: 12px; height: 12px; }
.keyrow .lic-show[data-busy] { opacity: .55; }

/* The reveal itself: height and opacity together, so the key arrives rather
   than appearing. grid-template-rows 0fr to 1fr is a real height transition
   with nothing measured in JavaScript. */
.keyrow .lic-key {
  display: grid; grid-template-rows: 0fr; opacity: 0;
  transition: grid-template-rows var(--t-grow) var(--ease), opacity var(--t-move) var(--ease);
}
.keyrow .lic-key[data-in="1"] { grid-template-rows: 1fr; opacity: 1; }
.keyrow .lic-key > * { min-height: 0; }
.keyrow .lic-keyval {
  overflow: hidden;
  font-family: var(--mono); font-size: var(--t-sm); color: var(--acc-txt);
  letter-spacing: .04em; overflow-wrap: anywhere;
  padding: 6px 0 0;
}
.keyrow .lic-copy { justify-self: start; margin-top: 6px; }
.keyrow .lic-copy[data-done] { color: var(--ok); border-color: var(--ok); }

/* ── what the licence IS, on the line with its name ────────────────────────
 *
 * The row used to say everything in one grey sentence: the type, the deadline
 * and the device state ran together in a `<small>` that a customer scanning six
 * licences read as six identical lines. These are the two facts that tell them
 * apart, so they are tags at the top of the row instead of prose at the bottom.
 */
.lic-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2);
  min-width: 0; margin-bottom: 2px;
}
.lic-head .lic-name { flex: 0 1 auto; }

.lic-tag {
  flex: none; font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--track-label);
  padding: 2px 7px; border-radius: var(--rad-pill);
  border: 1px solid var(--ln); color: var(--mut);
  /* The tags never move. They are labels, and a label that animates is asking
     for attention it does not need. */
}
/* Paid is the accent, because it is the one the customer paid for and the one
   the page is mostly about. Free is stated plainly and all-access gets the
   second accent, so three licences side by side are told apart by colour before
   any word is read. */
/* Border colour comes from the text colour rather than from a mix. color-mix()
   is a colour DECLARED in a stylesheet, and the shell gate refuses those on
   purpose: a colour the contrast gate cannot see is a colour nobody checked.
   currentColor with a border that is mostly transparent gets the same tinted
   edge out of a value that is already in the token file. */
.lic-tag-paid { color: var(--acc-txt); border-color: var(--acc); }
.lic-tag-all { color: var(--acc2, var(--acc-txt)); border-color: var(--acc2, var(--acc)); }
.lic-tag-count { font-weight: 500; letter-spacing: .04em; text-transform: none; }

/* ── the timer, which is the one thing on the row that moves ───────────────
 *
 * Promoted out of the small print. A key with four minutes left should say so
 * where the eye lands rather than at the end of a grey sentence about device
 * binding. Tabular figures so the seconds do not shuffle the row every tick,
 * and a fixed inline-size so a change from 10m to 9m does not reflow the line. */
.lic-clock {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-xs); font-variant-numeric: tabular-nums;
  padding: 2px 9px 2px 7px; border-radius: var(--rad-pill);
  border: 1px solid var(--ln); background: var(--inp); color: var(--mut);
}
.lic-clock > i {
  width: 6px; height: 6px; flex: none; border-radius: var(--rad-pill);
  background: currentColor;
}
/* Running. The dot is the only thing on this page that moves on its own, and it
   moves because the number beside it is genuinely changing every second. */
.lic-clock[data-state="live"] { color: var(--ok); border-color: var(--ok); }
.lic-clock[data-state="live"] > i {
  box-shadow: 0 0 8px -1px var(--ok);
  animation: gh-lic-pulse 2.2s var(--ease) infinite;
}
@keyframes gh-lic-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
/* Lifetime has no deadline to show, so it shows the fact instead of a number,
   and its dot does not pulse: nothing is counting. */
.lic-clock[data-state="lifetime"] { color: var(--acc-txt); border-color: var(--acc); }
.lic-clock[data-state="expired"] { color: var(--warn); border-color: var(--warn); }
/* A full strength border on a 9px pill is a box around the words. These tags
   are read as colour first, so the edge is a hint and the fill carries it. */
.lic-tag-paid, .lic-tag-all, .lic-clock[data-state] { border-width: 1px; }

/* Show key and the reference on one line, so the row has a head, a body and a
   foot rather than four things stacked in a column. */
.lic-foot { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; min-width: 0; margin-top: 6px; }
.lic-foot .lic-ref { min-width: 0; }
.lic-main { min-width: 0; }

/* A licence that is no longer valid still belongs on the page, and should not
   look like one that is. Dimmed rather than removed, because "where did my key
   go" is a worse question than "why is this one grey". */
.keyrow[data-void="1"] .lic-name { color: var(--mut); }
.keyrow[data-void="1"] { opacity: .72; }

/* The countdown reads as a live number rather than as prose, so a glance finds
   it. Tabular figures so the seconds do not shuffle the line every tick. */
.keyrow small[data-until] { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .keyrow .lic-show, .keyrow .lic-copy, .keyrow .lic-key { transition: none; }
  .keyrow .lic-show:hover, .keyrow .lic-copy:hover { transform: none; }
}
