/* Casting Mania site styles, shared by index.html, terms.html and thanks.html.
   A store page in the game's own night-sky world: dark panels, gold accents, Cinzel headings, Alegreya Sans text. */

:root {
  --night: #0a0b17;
  --panel: #13152a;
  --panel-2: #1b1e38;
  --line: #2c2f52;
  --ink: #efe6cf;
  --muted: #a8a4bd;
  --gold: #e8be6a;
  --gold-hi: #f3d089;
  --gold-dim: #9c7a3a;
  --fire: #ec6a3c;
  --water: #49a2e6;
  --earth: #92c34c;
  --light: #f2d36f;
  --dark: #a274de;
  --warn: #e8a25a;
  --display: "Cinzel", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.55; }
img { max-width: 100%; height: auto; }
p { margin: 0; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-hi); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: 0.03em; margin: 0; text-wrap: balance; }
h2 { font-size: 1.25rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.12em; padding-bottom: 10px; border-bottom: 1px solid var(--line); }

:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }

.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.skip { position: absolute; left: 16px; top: -100px; z-index: 10; background: var(--gold); color: #1a1405; padding: 10px 16px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 8px; }

/* Header */
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 20px; padding-block: 6px; }
.brand { font-family: var(--display); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); text-decoration: none; padding: 8px 0; }
.site-header nav ul { display: flex; flex-wrap: wrap; gap: 0 6px; list-style: none; margin: 0; padding: 0; }
.site-header nav a { display: block; padding: 8px 8px; color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.site-header nav a:hover { color: var(--gold); text-decoration: underline; }
.site-header nav a[aria-current="page"] { color: var(--gold); }

/* Banner and title */
.banner img { display: block; width: 100%; height: clamp(190px, 26vw, 420px); object-fit: cover; object-position: center 40%; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; padding-block: 22px 22px; }
.title-row h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.15; }
.title-row .by { color: var(--muted); margin-top: 2px; }

/* Purchase area */
.buy { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; background: var(--panel); border: 1px solid var(--gold-dim); padding: 14px 18px; }
.buy-info { display: grid; gap: 4px; }
.price { font-family: var(--display); font-weight: 700; font-size: 2.1rem; line-height: 1; color: var(--gold); }
.buy-sub { color: var(--muted); font-size: 0.9rem; }
.buy-action { display: grid; gap: 6px; }
.buy-note { text-align: center; font-size: 0.92rem; color: var(--ink); }
.btn { display: inline-block; text-align: center; text-decoration: none; font-family: var(--display); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 1rem; padding: 13px 30px; min-width: 11.5rem; background: var(--gold); color: #1a1405; border: 2px solid var(--gold); }
.btn:hover { background: var(--gold-hi); border-color: var(--gold-hi); color: #1a1405; }
.btn.is-disabled, .btn[aria-disabled="true"] { background: transparent; border-color: var(--gold-dim); color: var(--muted); cursor: not-allowed; }
.btn.is-disabled:hover, .btn[aria-disabled="true"]:hover { background: transparent; border-color: var(--gold-dim); color: var(--muted); }
button.btn { appearance: none; -webkit-appearance: none; font-family: var(--display); cursor: pointer; line-height: 1.55; }
button.btn:disabled { background: transparent; border-color: var(--gold-dim); color: var(--muted); cursor: progress; }

/* PayPal buttons: the PayPal script draws them inside .paypal-box. The wrapper keeps the same column width as the old Buy button. */
.paypal-box { width: 250px; max-width: 100%; min-height: 48px; }
.paypal-box[aria-busy="true"] { opacity: 0.55; pointer-events: none; }
.buy.is-busy .buy-note { color: var(--muted); }
.buy-msg { max-width: 250px; font-size: 0.92rem; color: #ffe2bd; background: #2a2013; border-left: 3px solid var(--warn); padding: 8px 10px; }
.buy-msg:empty { display: none; }
.gift-link { text-align: center; font-size: 0.85rem; }
.gift-link a { color: var(--muted); }
.gift-link a:hover, .gift-link a:focus-visible { color: var(--gold-hi); }
.buy-msg a { color: var(--gold-hi); }
@media (max-width: 560px) {
  .title-row .buy { width: 100%; }
  .buy-action { flex: 1 1 190px; }
  .buy-action .paypal-box, .buy-msg { width: 100%; max-width: none; }
  .btn { min-width: 0; }
}

/* Screenshots and side panel */
.top { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .top { grid-template-columns: 1fr; } }
.viewer { margin: 0; background: #000; border: 1px solid var(--line); }
.viewer img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.caption { padding: 8px 12px; color: var(--muted); font-size: 0.95rem; background: var(--panel); border-top: 1px solid var(--line); min-height: 3.2em; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 8px; }
.thumbs a { display: block; line-height: 0; border: 2px solid transparent; }
.thumbs img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; opacity: 0.72; transition: opacity 0.15s; }
.thumbs a:hover img, .thumbs a[aria-current="true"] img { opacity: 1; }
.thumbs a[aria-current="true"] { border-color: var(--gold); }
@media (max-width: 500px) { .thumbs { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); } }

.side { display: grid; gap: 16px; background: var(--panel); border: 1px solid var(--line); padding: 16px; }
.side .short { color: var(--ink); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 0.95rem; margin: 0; }
.facts dt { color: var(--muted); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.1em; padding-top: 4px; }
.facts dd { margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tag { font-size: 0.85rem; padding: 3px 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); }

/* Content sections */
main section { padding-top: 42px; display: grid; gap: 16px; }
.cols { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.about { display: grid; gap: 14px; max-width: 68ch; }
.about ul { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; }
.about li::marker { color: var(--gold); }
.box { background: var(--panel); border: 1px solid var(--line); padding: 16px; display: grid; gap: 8px; max-width: 80ch; }
.box .label { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* Elements and monsters */
.elements { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.el { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--c); display: grid; grid-template-rows: auto 1fr; }
.el img, .mon img { width: 100%; height: auto; aspect-ratio: 744 / 472; object-fit: cover; display: block; }
.el h3 { font-size: 1rem; color: var(--c); padding: 10px 12px 2px; }
.el p { padding: 0 12px 12px; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 900px) {
  .elements { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
  .el { grid-template-columns: 40% 1fr; grid-template-rows: none; align-items: stretch; }
  .el img { height: 100%; aspect-ratio: auto; min-height: 110px; }
}
.sub { font-family: var(--body); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-top: 10px; }
.monsters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
@media (max-width: 900px) { .monsters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mon { margin: 0; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--c); }
.mon figcaption { padding: 8px 12px 10px; display: grid; gap: 0; line-height: 1.3; }
.mon .n { font-family: var(--display); font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.mon .e { font-size: 0.85rem; color: var(--c); }

/* System requirements */
.req { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 640px) { .req { grid-template-columns: 1fr; } }
.req h3 { font-family: var(--body); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.req dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 0.95rem; }
.req dt { color: var(--muted); }
.req dd { margin: 0; }
.note { color: var(--muted); font-size: 0.92rem; }

/* FAQ */
.faq { display: grid; gap: 8px; }
.faq details { background: var(--panel); border: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; position: relative; padding: 14px 48px 14px 16px; font-weight: 700; font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--gold); font-size: 1.5rem; line-height: 1; }
.faq details[open] > summary::after { content: "\2212"; }
.faq details[open] > summary { color: var(--gold); }
.faq .answer { padding: 0 16px 16px; display: grid; gap: 10px; }
.faq .answer > * { max-width: 44rem; }
.faq .answer ol, .faq .answer ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }

/* Bottom purchase section */
.get { background: var(--panel); border: 1px solid var(--gold-dim); padding: 22px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px 32px; align-items: center; }
@media (max-width: 860px) { .get { grid-template-columns: 1fr; } }
.get h2 { border: 0; padding: 0; }
.get-text { display: grid; gap: 12px; }
.get ul { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }
.get li::marker { color: var(--gold); }
.get .buy { background: var(--panel-2); justify-content: space-between; }
.get .buy-action { flex: 1 1 190px; }

/* Footer */
.site-footer { margin-top: 56px; border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 0.92rem; }
.site-footer .wrap { padding-block: 24px 32px; display: grid; gap: 6px; }
.site-footer a { color: var(--gold); }

/* Text pages: terms and thanks */
.page-head { padding-block: 36px 14px; display: grid; gap: 12px; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.2; }
.page-head .lede { color: var(--muted); max-width: 40rem; }
.prose { max-width: 40rem; display: grid; gap: 14px; }
.prose h3 { font-size: 1.05rem; color: var(--ink); margin-top: 6px; }
.prose ul, .prose ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.prose ol.steps { padding-left: 0; gap: 12px; }
.prose li::marker { color: var(--gold); }
.template-note { border: 2px solid var(--warn); background: #2a2013; color: #ffe2bd; padding: 14px 16px; font-weight: 700; font-size: 1.1rem; max-width: 40rem; }
.template-note span { display: block; font-weight: 400; font-size: 0.95rem; margin-top: 2px; }
.contact-line { background: var(--panel); border: 1px solid var(--line); padding: 10px 14px; max-width: 40rem; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; }
.toc a { display: inline-block; padding: 6px 0; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 40rem; }
.steps li { counter-increment: step; position: relative; background: var(--panel); border: 1px solid var(--line); padding: 14px 16px 14px 62px; }
.steps li::before { content: counter(step); position: absolute; left: 16px; top: 12px; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--gold-dim); color: var(--gold); font-family: var(--display); font-weight: 700; }
.steps strong { color: var(--ink); }
.prose section { padding-top: 0; }
.prose h2 { margin-top: 10px; }
.prose section > h2 { margin-top: 0; }
.dl-panel, .notice { background: var(--panel); border: 1px solid var(--gold-dim); padding: 18px; display: grid; gap: 12px; }
.dl-panel h2, .notice h2 { border: 0; padding: 0; }
.notice { border-left: 4px solid var(--gold); }
.dl-panel .btn { font-size: 1.1rem; padding: 15px 34px; }
.dl-meta { color: var(--muted); font-size: 0.95rem; }
.txid { font-family: Consolas, "Courier New", monospace; font-size: 1rem; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); padding: 2px 8px; word-break: break-all; user-select: all; }
#state-lost { display: grid; gap: 14px; }
#state-lost[hidden] { display: none; }
.relink { display: grid; gap: 8px; background: var(--panel); border: 1px solid var(--line); padding: 16px; max-width: 30rem; }
.relink label { font-weight: 700; }
.relink input { width: 100%; font: inherit; font-family: Consolas, "Courier New", monospace; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); background: var(--night); border: 1px solid var(--gold-dim); padding: 11px 12px; }
.relink input::placeholder { text-transform: none; letter-spacing: 0; color: var(--muted); }
.relink input:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 2px; }
.relink input:user-invalid { border-color: var(--warn); }
.field-help { color: var(--muted); font-size: 0.92rem; }
.form-msg { color: #ffe2bd; background: #2a2013; border-left: 3px solid var(--warn); padding: 8px 10px; }
.form-msg:empty { display: none; }
.back { padding-top: 28px; }
.back .btn { display: inline-block; }

noscript .buy-note { color: var(--warn); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Licence key box on the thanks page (monospace, easy to select, Copy button). */
.key-panel { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.key-panel h3 { margin: 0; }
.key-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.license-key { font-family: Consolas, "Courier New", monospace; font-size: 1.25rem; letter-spacing: 0.06em; color: var(--ink); background: var(--panel-2); border: 1px solid var(--gold-dim); padding: 10px 14px; word-break: break-all; user-select: all; }
.btn-small { font-size: 1rem; padding: 10px 20px; }
.key-steps { margin: 0; padding-left: 1.3rem; color: var(--muted); }
