/* FATE: Destiny site. One stylesheet, no framework, no fonts or images from other hosts. Colours come from tokens.css
   (generated from art/brand/tokens.json). Look: the launcher. A day-sky backdrop, papyrus cards in the carved frame
   (9-slice, 96 px slices of card.webp), gold pill buttons (3-slice, 36 px of button.png, grey when disabled) and the
   layered FATE + silver DESTINY logo with its purple halo. CSP forbids inline styles, so every look is a class here. */

:root {
  color-scheme: dark;
  --ink-dark: #2b1b0a;
  --ink-red: #7a1010;
  --ptr: url("/img/f05-cursor.png") 3 2, auto;
  --ptr-hand: url("/img/f05-cursor-select.png") 3 2, pointer;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: #2a2038; cursor: var(--ptr); }
a, .btn { cursor: var(--ptr-hand); }
body { margin: 0; min-height: 100vh; color: var(--ink-dark); font: 400 16px/1.5 Georgia, "Times New Roman", serif; -webkit-text-size-adjust: 100%; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: #5a4a66 url("/img/bg.webp") 30% 20% / cover no-repeat; }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(20,12,30,.10), rgba(20,12,30,.45)); }
img { max-width: 100%; height: auto; }
h1, h2 { margin: 0 0 10px; font-weight: 700; line-height: 1.15; color: var(--ink-dark); }
h1 { font-size: 30px; }
h2 { font-size: 21px; margin-top: 22px; }
.card > h2:first-child { margin-top: 0; }
p { margin: 0 0 12px; }
a { color: #6a1b9a; }
a:hover { color: #3f0f60; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 10; padding: 8px 12px; background: #000; color: var(--gold-300); }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--gold-300); outline-offset: 2px; }

.page { max-width: 760px; margin: 0 auto; padding: 12px 12px 28px; }

/* masthead: logo with its purple halo, then the gold buttons */
.masthead { text-align: center; }
.brand { display: inline-block; width: min(340px, 78vw); filter: drop-shadow(0 0 14px rgba(157,124,240,.7)) drop-shadow(0 3px 4px rgba(0,0,0,.6)); }
.brand img { display: block; width: 100%; }
.nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; margin: 6px 0 18px; }

/* gold pill: 3-slice button.png (36 px ends). The grey twin is the disabled look. */
.btn { display: inline-block; min-width: 120px; height: 48px; padding: 0 4px; line-height: 44px; text-align: center; text-decoration: none; white-space: nowrap;
  color: var(--ink-dark); font: 700 16px/44px Georgia, "Times New Roman", serif;
  border-style: solid; border-width: 0 36px; border-image: url("/img/button.png") 0 36 fill / 0 36px / 0 stretch;
  text-shadow: 0 1px 0 rgba(255,240,170,.7); }
.btn:hover { color: #000; filter: brightness(1.12); }
.btn--big { font-size: 20px; min-width: 220px; height: 56px; line-height: 52px; }
.btn--off, .btn--off:hover { color: #d9d2c4; filter: none; text-shadow: 0 1px 0 #000; border-image-source: url("/img/button-dim.png"); cursor: var(--ptr); }
.btn:active { transform: translateY(1px); }

/* papyrus card: 9-slice card.webp (96 px slices, drawn at 40 px so the carved frame stays slim) */
.card { margin: 0 0 22px; padding: 14px 14px;
  border-style: solid; border-width: 40px; border-image: url("/img/card.webp") 96 fill / 40px / 0 stretch; }
.card .lead { font-size: 18px; }
.cta { text-align: center; margin: 18px 0 8px; }
.note { text-align: center; font-size: 14px; color: #5a4020; }
.dates { margin: 0 0 12px; }
.dates div { margin: 0 0 10px; }
.dates dt { font-weight: 700; color: var(--ink-red); }
.dates dd { margin: 0; }
.list { margin: 0 0 12px; padding: 0 0 0 20px; list-style: disc; }
.list li { margin: 0 0 6px; }
.post .meta { font-size: 14px; color: #5a4020; margin-bottom: 10px; }
.lost { font-size: 72px; line-height: 1; margin: 0 0 8px; color: var(--ink-red); font-weight: 700; }

/* account forms (register, sign in): inputs sit in black inlaid slots like the game's text boxes */
.form label { display: block; margin: 12px 0 4px; font-weight: 700; }
.form input { display: block; width: 100%; max-width: 360px; padding: 8px 10px; font: 400 16px/1.3 Georgia, serif; color: #f1e6c8;
  background: linear-gradient(#171310, #070605); border: 2px solid #8a6a2b; border-radius: 4px; box-shadow: inset 0 3px 8px rgba(0,0,0,.8); }
.form input:focus-visible { border-color: var(--gold-300); }
.form .hint { margin: 4px 0 0; font-size: 13px; color: #5a4020; }
.form button.btn { background: none; border-top: 0; border-bottom: 0; cursor: var(--ptr-hand); font-family: Georgia, serif; }
.form button.btn:disabled { filter: grayscale(1) brightness(.8); cursor: var(--ptr); }
button.btn { background: none; border-top: 0; border-bottom: 0; cursor: var(--ptr-hand); }
.msg { margin: 12px 0; padding: 8px 10px; border-radius: 4px; font-weight: 700; }
.msg--ok { background: rgba(60,110,40,.18); border: 1px solid #3d6d28; color: #254a14; }
.msg--bad { background: rgba(140,20,20,.15); border: 1px solid #8a1a1a; color: #6a0e0e; }

/* leaderboard: the podium stands each hero in a black inlaid slot like the character screen, then a ranking table */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.note--left { text-align: left; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 14px 0 6px; padding: 0; list-style: none; }
.hero { flex: 1 1 0; max-width: 200px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero--1 { max-width: 230px; }
.hero__rank { font: 700 28px/1 Georgia, serif; color: var(--ink-red); text-shadow: 0 1px 0 rgba(255,240,170,.7); margin-bottom: 4px; }
.hero--1 .hero__rank { font-size: 36px; }
.hero__slot { display: block; width: 100%; background: linear-gradient(#171310, #070605); border: 2px solid #8a6a2b; border-radius: 6px;
  box-shadow: inset 0 0 0 1px #000, inset 0 8px 18px rgba(0,0,0,.8); }
.hero--1 .hero__slot { border-color: #d6ac4b; }
.hero__slot img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 100%; }
.hero__name { margin-top: 6px; font-size: 18px; }
.hero__lv { font-size: 14px; color: var(--ink-red); font-weight: 700; }
.hero__gear { font-size: 13px; line-height: 1.3; color: #5a4020; }
.rank { width: 100%; border-collapse: collapse; font-size: 15px; }
.rank th { text-align: left; padding: 4px 6px; border-bottom: 2px solid #8a6a2b; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-red); }
.rank td { padding: 4px 6px; border-bottom: 1px solid rgba(90,64,32,.35); vertical-align: middle; }
.rank .n { width: 2em; text-align: right; font-weight: 700; }
.rank .num { width: 2.5em; text-align: right; }
.rank .who { display: flex; align-items: center; gap: 8px; }
.rank .who img { flex: none; width: 48px; height: 96px; background: linear-gradient(#171310, #070605); border: 1px solid #8a6a2b; border-radius: 4px; }

.foot { padding: 10px 6px 0; text-align: center; font-size: 13px; color: #f1e6ff; text-shadow: 0 1px 3px #000, 0 0 8px #000; }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--gold-300); }

@media (max-width: 560px) {
  body { font-size: 15px; }
  body::before { background-image: url("/img/bg-s.webp"); background-position: 30% 10%; }
  h1 { font-size: 25px; }
  .card { border-width: 30px; border-image-width: 30px; padding: 6px 4px; }
  .btn--big { min-width: 180px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: filter .12s; }
}
