/* Vyrnfall's shared design system: the tokens, type, buttons, fields, tabs, badges, notices and
   surfaces used by the public site, the login page and the player portal. Each surface adds its
   own layout on top of this file (site.css, panel.css); this file is kept identical in both.

   Roles: near-black violet stone for the page; raised surfaces edged with fine iron lines; crimson
   for the one main action of a view (play, sign in, save); amethyst for selection, links, magic
   and values that matter; the supplied artwork carries the atmosphere. */

@font-face { font-family: "Cinzel"; src: url("fonts/cinzel.woff2") format("woff2"); font-weight: 500 800; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/sourcesans3.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  color-scheme: dark;
  /* ---- colour ---- */
  --bg: #0b080f;
  --bg-2: #100b16;
  --surface: #15101c;
  --surface-2: #211627;
  --surface-3: #2c1f36;
  --line: #32263d;
  --line-hi: #4b3a59;
  --metal: #807784;
  --metal-hi: #b3aab8;
  --crimson: #c92345;
  --crimson-hi: #f0445d;
  --crimson-lo: #8c1530;
  --crimson-deep: #4d0c1c;
  --amethyst: #833dce;
  --violet: #b479f2;
  --violet-hi: #dcc6fb;
  --amethyst-deep: #2e1650;
  --ink: #f2edf5;
  --muted: #bdb1c8;
  --ember: #f2c15e;
  --good: #7fcf9a;
  --bad: #ff9a85;
  --warn: #f0b860;
  /* ---- type ---- */
  --font-title: "Cinzel", "Palatino Linotype", Palatino, Georgia, serif;
  --font-text: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --text-xs: 13px; --text-sm: 15px; --text-md: 17px; --text-lg: 20px;
  --h3: 21px; --h2: clamp(26px, 3.2vw, 40px); --h1: clamp(34px, 5vw, 60px);
  /* ---- space, size, shape ---- */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 72px;
  --page: 1200px; --page-narrow: 820px; --gutter: 20px;
  --radius: 8px; --radius-sm: 5px;
  /* ---- depth ---- */
  --edge: inset 0 1px 0 rgb(255 255 255 / 0.05), inset 0 0 0 1px rgb(0 0 0 / 0.4);
  --shadow: 0 18px 44px rgb(0 0 0 / 0.55);
  --glow-crimson: 0 0 28px rgb(201 35 69 / 0.35);
  --glow-violet: 0 0 28px rgb(131 61 206 / 0.35);
  /* ---- motion ---- */
  --fast: 0.12s; --slow: 0.35s; --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  /* A fine grain, drawn once and reused: stone, never a picture file. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .75  0 0 0 0 .62  0 0 0 0 .9  0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");

  /* ---- the names the first design used, pointed at the new palette so every older rule follows ---- */
  --stone-950: var(--bg);
  --stone-900: var(--bg-2);
  --stone-800: var(--surface);
  --stone-700: var(--surface-2);
  --stone-600: var(--surface-3);
  --iron: var(--line);
  --iron-hi: var(--line-hi);
  --bronze: #5d4a6c;
  --bronze-hi: var(--metal-hi);
  --gold: var(--violet);
  --gold-hi: var(--violet-hi);
  --gold-lo: var(--amethyst);
  --gold-ink: #150a22;
  --parchment: var(--surface);
  --parchment-edge: var(--line-hi);
  --parchment-ink: var(--ink);
  --parchment-muted: var(--muted);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg) var(--grain);
  color: var(--ink);
  font: 400 var(--text-md)/1.55 var(--font-text);
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-title); font-weight: 700; line-height: 1.15; letter-spacing: 0.01em; text-wrap: balance; }
p { margin: 0; }
a { color: var(--violet); text-underline-offset: 3px; }
a:hover { color: var(--violet-hi); }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--amethyst); color: #fff; }
.vf-num { font-variant-numeric: tabular-nums lining-nums; }
.vf-muted { color: var(--muted); }
.vf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
kbd { font: 600 0.9em/1 var(--font-mono); padding: 2px 6px; border: 1px solid var(--line-hi); border-radius: 4px; background: var(--bg); color: var(--violet-hi); white-space: nowrap; }

/* ---- identity ---- */
.vf-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.vf-brand img { width: 40px; height: 40px; object-fit: contain; }
.vf-wordmark { font: 700 21px/1 var(--font-title); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); }
.vf-brand:hover .vf-wordmark { color: var(--violet-hi); }

/* ---- icons: one line weight, the text's colour ---- */
.vf-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Pictures taken from the game itself (skill, rank and item icons) keep their pixel grid. */
.vf-sprite { flex: none; object-fit: contain; image-rendering: pixelated; }

/* ---- buttons ---- */
.vf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 18px;
  font: 600 16px/1.2 var(--font-text); text-decoration: none; white-space: nowrap; cursor: pointer;
  color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line-hi); border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06);
  transition: background-color var(--fast), border-color var(--fast), transform 0.08s, box-shadow var(--fast);
}
.vf-btn:hover { background: var(--surface-3); border-color: var(--violet); color: var(--ink); }
.vf-btn:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.5); }
.vf-btn[disabled], .vf-btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
/* The one crimson button: the main action of a view. (Named "gold" by the first design.) */
.vf-btn--gold, .vf-btn--primary {
  color: #fff; font-weight: 700;
  background: linear-gradient(180deg, #dc2f52 0%, var(--crimson) 48%, #a81a38 100%);
  border-color: #6f1026;
  box-shadow: inset 0 1px 0 rgb(255 190 200 / 0.45), inset 0 -2px 0 rgb(60 5 18 / 0.5), 0 1px 0 rgb(0 0 0 / 0.6);
  text-shadow: 0 1px 0 rgb(70 5 20 / 0.7);
}
.vf-btn--gold:hover, .vf-btn--primary:hover { color: #fff; border-color: #6f1026; background: linear-gradient(180deg, #ee4a66 0%, #d62a4d 48%, #b01c3b 100%); }
.vf-btn--gold:active, .vf-btn--primary:active { background: #a81a38; box-shadow: inset 0 2px 5px rgb(50 0 12 / 0.7); }
/* The play button: forged, bevelled, lit from inside. Used only for entering the game. */
.vf-btn--play {
  position: relative; min-height: 58px; padding: 14px 34px;
  font: 700 18px/1 var(--font-title); letter-spacing: 0.08em; text-transform: uppercase; color: #fff;
  background:
    radial-gradient(120% 90% at 50% 0%, rgb(255 140 160 / 0.5) 0%, transparent 60%),
    linear-gradient(180deg, #e2365a 0%, #c11f41 52%, #8f1630 100%);
  border: 1px solid #3d0714; border-radius: 6px;
  box-shadow:
    inset 0 1px 0 rgb(255 205 212 / 0.65), inset 0 -3px 0 rgb(55 4 16 / 0.6), inset 0 0 0 2px rgb(255 255 255 / 0.06),
    0 0 0 1px #a8a0ad, 0 0 0 3px #1a1220, 0 6px 0 #1a1220, 0 14px 26px rgb(0 0 0 / 0.55), var(--glow-crimson);
  text-shadow: 0 2px 0 rgb(70 5 20 / 0.8);
}
.vf-btn--play:hover { color: #fff; border-color: #3d0714; filter: brightness(1.1); background:
    radial-gradient(120% 90% at 50% 0%, rgb(255 160 176 / 0.6) 0%, transparent 60%),
    linear-gradient(180deg, #ee4a6a 0%, #cf2649 52%, #9a1834 100%); }
.vf-btn--play:active { transform: translateY(4px); filter: none; box-shadow:
    inset 0 3px 6px rgb(50 0 12 / 0.75), 0 0 0 1px #a8a0ad, 0 0 0 3px #1a1220, 0 2px 0 #1a1220, 0 4px 10px rgb(0 0 0 / 0.5); }
/* Its companion: the same forged frame in dark iron and amethyst. */
.vf-btn--forged {
  min-height: 58px; padding: 14px 30px;
  font: 700 17px/1 var(--font-title); letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet-hi);
  background: radial-gradient(120% 90% at 50% 0%, rgb(180 121 242 / 0.28) 0%, transparent 60%), linear-gradient(180deg, #2f2040 0%, #1d1428 100%);
  border: 1px solid #0d0812; border-radius: 6px;
  box-shadow: inset 0 1px 0 rgb(220 198 251 / 0.3), inset 0 -3px 0 rgb(0 0 0 / 0.45), 0 0 0 1px #807784, 0 0 0 3px #1a1220, 0 6px 0 #1a1220, 0 14px 26px rgb(0 0 0 / 0.5);
}
.vf-btn--forged:hover { color: #fff; border-color: #0d0812; background: radial-gradient(120% 90% at 50% 0%, rgb(180 121 242 / 0.45) 0%, transparent 60%), linear-gradient(180deg, #3a2850 0%, #231831 100%); }
.vf-btn--forged:active { transform: translateY(4px); box-shadow: inset 0 3px 6px rgb(0 0 0 / 0.7), 0 0 0 1px #807784, 0 0 0 3px #1a1220, 0 2px 0 #1a1220; }
.vf-btn--lg { min-height: 52px; padding: 12px 26px; font-size: 18px; }
.vf-btn--quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.vf-btn--quiet:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
/* Destructive actions: an outline in a warning coral, never the brand crimson, and always a label that says what is removed. */
.vf-btn--danger { color: var(--bad); border-color: #7d4034; background: transparent; }
.vf-btn--danger:hover { background: #3a1d18; border-color: var(--bad); color: #ffc2b5; }
.vf-btn--danger::before { content: "!"; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid currentColor; border-radius: 50%; font: 700 12px/1 var(--font-text); }
.vf-link { background: none; border: 0; padding: 0; font: inherit; color: var(--violet); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.vf-link:hover { color: var(--violet-hi); }

/* ---- surfaces ---- */
/* The everyday panel: raised a step from the page, a fine iron edge. */
.vf-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--edge);
  padding: 20px;
}
/* The framed panel: a metal rim outside a dark gap. For the login form and the pieces that carry identity. */
.vf-frame {
  background: var(--surface);
  border: 1px solid var(--metal);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06), 0 0 0 3px var(--bg), 0 0 0 4px var(--line-hi), var(--shadow);
}
/* The quest board (named "parchment" by the first design): a dark slab lit amethyst from above. */
.vf-parchment {
  background: linear-gradient(180deg, rgb(131 61 206 / 0.13), transparent 130px), var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-hi);
  border-top-color: var(--amethyst);
  border-radius: var(--radius);
  box-shadow: var(--edge);
  padding: 22px;
}
/* A heading rule with a gem at its centre, used between major parts of a page. */
.vf-rule { display: flex; align-items: center; gap: 14px; color: var(--metal); }
.vf-rule::before, .vf-rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-hi)); }
.vf-rule::after { background: linear-gradient(270deg, transparent, var(--line-hi)); }
.vf-gem { width: 10px; height: 10px; flex: none; transform: rotate(45deg); background: linear-gradient(135deg, var(--crimson-hi), var(--amethyst)); box-shadow: 0 0 0 1px #1a1220, 0 0 0 2px var(--metal), 0 0 12px rgb(201 35 69 / 0.6); }

/* ---- small parts ---- */
.vf-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px;
  font: 600 var(--text-xs)/1.5 var(--font-text);
  border: 1px solid var(--line-hi); color: var(--muted); background: var(--bg);
}
.vf-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.vf-tag--good { color: var(--good); border-color: #2f6b47; }
.vf-tag--bad { color: var(--bad); border-color: #7d4034; }
.vf-tag--warn { color: var(--warn); border-color: #7c5a25; }
.vf-tag--gold { color: var(--violet-hi); border-color: var(--amethyst); background: var(--amethyst-deep); }
.vf-tag--crimson { color: #ffc4cd; border-color: var(--crimson); background: var(--crimson-deep); }
.vf-tag--plain::before { display: none; }

.vf-field { display: grid; gap: 6px; font: 600 14px/1.3 var(--font-text); color: var(--muted); }
.vf-input {
  width: 100%; min-height: 48px; padding: 10px 12px;
  font: 400 17px/1.3 var(--font-text); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line-hi); border-radius: var(--radius-sm);
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.55);
}
.vf-input::placeholder { color: #8d8198; }
.vf-input:hover { border-color: var(--metal); }
.vf-input:focus-visible { outline: 2px solid var(--violet-hi); outline-offset: 1px; border-color: var(--amethyst); }
.vf-input[aria-invalid="true"] { border-color: var(--bad); }
select.vf-input { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; }
.vf-error { color: #ffb3a3; font: 600 15px/1.4 var(--font-text); }
.vf-error:empty { display: none; }

/* A notice: information by default; good, warning and bad by modifier. The left edge and the label carry the meaning, not colour alone. */
.vf-notice { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line-hi); border-left: 3px solid var(--violet); border-radius: var(--radius-sm); background: var(--bg-2); color: var(--muted); }
.vf-notice strong { color: var(--ink); }
.vf-notice--good { border-left-color: var(--good); }
.vf-notice--warn { border-left-color: var(--warn); }
.vf-notice--bad { border-left-color: var(--bad); }

/* Tabs: a row of choices where one is selected. */
.vf-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.vf-tab { min-height: 44px; padding: 9px 18px; font: 700 15px/1.2 var(--font-title); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; transition: color var(--fast), border-color var(--fast), background-color var(--fast); }
.vf-tab:hover { color: var(--ink); border-color: var(--line-hi); }
.vf-tab[aria-selected="true"], .vf-tab[aria-pressed="true"], .vf-tab[aria-current] { color: #fff; background: linear-gradient(180deg, #3a2060, var(--amethyst-deep)); border-color: var(--amethyst); box-shadow: inset 0 -2px 0 var(--violet); }

.vf-bar { height: 8px; border-radius: 999px; background: rgb(0 0 0 / 0.5); box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.6); overflow: hidden; }
.vf-bar > span { display: block; height: 100%; width: var(--value, 0%); background: linear-gradient(90deg, var(--amethyst), var(--violet)); border-radius: inherit; transition: width 0.4s ease-out; }
.vf-bar--done > span { background: var(--good); }
.vf-bar--crimson > span { background: linear-gradient(90deg, var(--crimson), var(--crimson-hi)); }

/* A loading line: three gems that pulse in turn. Still when motion is reduced. */
.vf-loading { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); }
.vf-loading::before { content: ""; width: 10px; height: 10px; transform: rotate(45deg); background: var(--violet); box-shadow: 18px -18px 0 var(--crimson-hi), 36px -36px 0 var(--violet); margin-right: 40px; animation: vf-pulse 1.2s ease-in-out infinite; }
@keyframes vf-pulse { 50% { opacity: 0.35; } }

/* A dialog that covers the page: used to enlarge a screenshot. */
.vf-dialog { max-width: min(96vw, 1200px); max-height: 94vh; padding: 0; border: 1px solid var(--metal); border-radius: var(--radius); background: var(--bg); color: var(--ink); box-shadow: var(--shadow); }
.vf-dialog::backdrop { background: rgb(5 3 8 / 0.86); }
.vf-dialog img { max-width: 100%; max-height: calc(94vh - 60px); width: auto; margin-inline: auto; }
.vf-dialog__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .vf-btn, .vf-bar > span, .vf-tab { transition: none; }
  .vf-btn:active, .vf-btn--play:active, .vf-btn--forged:active { transform: none; }
  .vf-loading::before { animation: none; }
}
