/* RuneKeep desktop mockups: shared design layer. Tokens mirror src/constants/theme.ts. */
@font-face { font-family: Archivo; font-weight: 400; src: url(fonts/Archivo_400Regular.ttf); font-display: block; }
@font-face { font-family: Archivo; font-weight: 500; src: url(fonts/Archivo_500Medium.ttf); font-display: block; }
@font-face { font-family: Archivo; font-weight: 600; src: url(fonts/Archivo_600SemiBold.ttf); font-display: block; }
@font-face { font-family: Archivo; font-weight: 700; src: url(fonts/Archivo_700Bold.ttf); font-display: block; }
@font-face { font-family: Archivo; font-weight: 800; src: url(fonts/Archivo_800ExtraBold.ttf); font-display: block; }
@font-face { font-family: Archivo; font-weight: 900; src: url(fonts/Archivo_900Black.ttf); font-display: block; }

:root {
  --ink: #0B0E13; --panel: #0E1116; --panel-lit: #1A1E26; --sheet: #FAF8F2; --parchment: #F4ECDC;
  --ink-text: #14110C; --ink-muted: #5B554C; --red: #C81B18; --gold: #C8923A; --gold-edge: #DAA249;
  --gold-bright: #E0B563; --gold-text: #F9D68D; --bronze: #8A5A12; --ivory: #FDFCF7; --muted: #938E88;
  --hope: #CC8F0F; --hair: rgba(218,162,73,.55); --hair-soft: rgba(218,162,73,.22);
  --midnight: #9E9E82; --grace: #B43675; --ease: cubic-bezier(.16,1,.3,1);
  --bar: 34px;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--ink); color: var(--ivory); font-family: Archivo, sans-serif; font-weight: 500; -webkit-font-smoothing: antialiased; }
body { overflow: hidden; font-variant-numeric: tabular-nums; }
::selection { background: var(--red); color: var(--ivory); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: rgba(218,162,73,.45) transparent; }
img { display: block; user-select: none; -webkit-user-drag: none; }

/* ---------- mockup switcher (outside the product) ---------- */
.mock-bar { position: fixed; inset: 0 0 auto 0; height: var(--bar); z-index: 100; display: flex; align-items: center; gap: 4px; padding: 0 12px;
  background: #06080b; border-bottom: 1px solid var(--hair-soft); font-size: 12px; }
.mock-bar .mb-title { font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-edge); margin-right: 14px; font-size: 11px; }
.mock-bar a { color: var(--muted); text-decoration: none; padding: 6px 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; }
.mock-bar a:hover { color: var(--ivory); }
.mock-bar a[aria-current] { color: var(--ink); background: var(--gold-edge); clip-path: var(--cf-6); }
.mock-bar .mb-note { margin-left: auto; color: var(--muted); font-size: 11px; }
.mock-bar kbd { font: 700 11px Archivo; border: 1px solid var(--hair-soft); padding: 1px 5px; color: var(--gold-text); }
.app { position: fixed; inset: var(--bar) 0 0 0; }

/* ---------- chamfer system ---------- */
:root {
  --cf-4: polygon(4px 0,calc(100% - 4px) 0,100% 4px,100% calc(100% - 4px),calc(100% - 4px) 100%,4px 100%,0 calc(100% - 4px),0 4px);
  --cf-6: polygon(6px 0,calc(100% - 6px) 0,100% 6px,100% calc(100% - 6px),calc(100% - 6px) 100%,6px 100%,0 calc(100% - 6px),0 6px);
  --cf-10: polygon(10px 0,calc(100% - 10px) 0,100% 10px,100% calc(100% - 10px),calc(100% - 10px) 100%,10px 100%,0 calc(100% - 10px),0 10px);
  --cf-16: polygon(16px 0,calc(100% - 16px) 0,100% 16px,100% calc(100% - 16px),calc(100% - 16px) 100%,16px 100%,0 calc(100% - 16px),0 16px);
}
/* .cf = gold hairline chamfer outline around a fill. --c sets the cut, --line the edge, --fill the inside. */
.cf { --c: 10px; --line: var(--gold-edge); --fill: var(--panel); --w: 1.4px; position: relative; isolation: isolate;
  clip-path: polygon(var(--c) 0,calc(100% - var(--c)) 0,100% var(--c),100% calc(100% - var(--c)),calc(100% - var(--c)) 100%,var(--c) 100%,0 calc(100% - var(--c)),0 var(--c));
  background: var(--line); }
.cf::before { content: ''; position: absolute; inset: var(--w); z-index: -1; background: var(--fill);
  --ci: calc(var(--c) - var(--w) * .41);
  clip-path: polygon(var(--ci) 0,calc(100% - var(--ci)) 0,100% var(--ci),100% calc(100% - var(--ci)),calc(100% - var(--ci)) 100%,var(--ci) 100%,0 calc(100% - var(--ci)),0 var(--ci)); }
.cf.sheet { --fill: var(--sheet); --line: var(--gold); color: var(--ink-text); }
.cf.red { --line: var(--red); }
.cf.dim { --line: var(--hair); }

.rule { height: 1.4px; background: var(--hair); border: 0; }
.rule-v { width: 1.2px; background: rgba(218,162,73,.45); align-self: stretch; }

/* ---------- type ---------- */
.display { font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; line-height: .92; }
.label { font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; }
.label-ink { color: var(--bronze); }
.muted { color: var(--muted); }
.num { font-weight: 900; font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn { --c: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 16px;
  font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: var(--gold-text); transition: color .15s, transform .15s var(--ease); }
.btn.cf { --fill: var(--ink); }
.btn:hover { color: var(--ivory); }
.btn.cf:hover { --fill: var(--panel-lit); }
.btn:active { transform: scale(.97); }
.btn.primary { color: var(--ivory); clip-path: var(--cf-6); background: var(--red); }
.btn.primary:hover { background: #d8231f; }
.btn svg { width: 16px; height: 16px; flex: none; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; clip-path: var(--cf-4); background: var(--red); color: var(--ivory);
  font-weight: 800; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.chip.gold { background: transparent; color: var(--gold-text); box-shadow: inset 0 0 0 1.2px var(--gold-edge); clip-path: none; }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: square; stroke-linejoin: miter; flex: none; }

/* ---------- cards ---------- */
.card { position: relative; aspect-ratio: 5/7; width: var(--cw, 150px); flex: none; border-radius: 5px; overflow: hidden; background: var(--panel);
  box-shadow: 0 6px 16px rgba(0,0,0,.45); transition: transform .22s var(--ease), box-shadow .22s var(--ease); outline-offset: 3px; }
.card > img { width: 100%; height: 100%; object-fit: cover; }
.card.equipped::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--gold-bright), inset 0 0 0 4px rgba(11,14,19,.35); pointer-events: none; }
.card .fav { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; color: var(--gold-bright); filter: drop-shadow(0 1px 2px #000); }
.card .tok { position: absolute; bottom: 8px; right: 8px; min-width: 22px; height: 22px; padding: 0 5px; display: grid; place-items: center; border-radius: 50%;
  background: #6d4a2a; color: var(--ivory); font: 900 11px Archivo; box-shadow: 0 2px 4px #000, inset 0 0 0 1.5px #a37a4c; }

/* Generated (app-rendered) cards: experiences, gear, notes, class. Sized by container units so they scale with --cw. */
.gcard { container-type: inline-size; width: 100%; height: 100%; display: flex; flex-direction: column; background: var(--sheet); color: var(--ink-text); }
.gcard .gh { position: relative; height: 60cqw; flex: none; display: grid; place-items: center; background: var(--gh, #22303a); }
.gcard .gh svg { width: 26cqw; height: 26cqw; stroke: rgba(253,252,247,.9); fill: none; stroke-width: 1.4; }
.gcard .gh img { height: 52cqw; width: auto; }
.gcard .gtag { position: absolute; bottom: -4.2cqw; left: 50%; transform: translateX(-50%); padding: 1.2cqw 5cqw; background: var(--gt, var(--gh)); color: var(--gold-text);
  font-weight: 800; font-size: 4.2cqw; letter-spacing: .1em; text-transform: uppercase; clip-path: polygon(3cqw 0,calc(100% - 3cqw) 0,100% 50%,calc(100% - 3cqw) 100%,3cqw 100%,0 50%);
  box-shadow: inset 0 0 0 .6cqw var(--gold-bright); white-space: nowrap; border-top: .6cqw solid var(--gold-bright); border-bottom: .6cqw solid var(--gold-bright); }
.gcard .gb { flex: 1; padding: 8cqw 6cqw 4cqw; display: flex; flex-direction: column; gap: 2.2cqw; }
.gcard .gt { font-weight: 900; text-transform: uppercase; font-size: 8.4cqw; line-height: 1; text-align: center; }
.gcard .gt small { font-size: 4.6cqw; color: var(--ink-muted); font-weight: 700; }
.gcard .gx { font-size: 4.6cqw; line-height: 1.32; }
.gcard .gx b { font-weight: 800; }
.gcard .gstat { display: grid; grid-template-columns: auto 1fr; gap: .8cqw 4cqw; font-size: 4.4cqw; }
.gcard .gstat dt { font-weight: 800; text-transform: uppercase; color: var(--bronze); letter-spacing: .06em; }
.gcard .gbonus { margin: auto auto 0; padding: 1.4cqw 4.5cqw; background: var(--red); color: var(--ivory); font-weight: 900; font-size: 6.4cqw; clip-path: var(--cf-4); }
.gcard .gfoot { display: flex; justify-content: space-between; font-size: 3.2cqw; color: var(--ink-muted); padding: 0 5cqw 3cqw; }
.gcard.note { background: var(--parchment); }
.gcard.note .gb { padding-top: 7cqw; }
.gcard.note .gt { text-align: left; font-size: 7cqw; }
.gcard.class .gh { height: 64cqw; }
.gcard .gstat { text-align: left; }
/* portrait crop: show only the illustration band of a 5:7 card */
.crop-art { overflow: hidden; }
.crop-art img { width: 166% !important; height: auto !important; max-width: none; margin-left: -33%; object-fit: initial !important; }

/* ---------- vitals ---------- */
.pips { display: flex; gap: var(--pg, 8px); align-items: center; }
.pip { width: var(--ps, 32px); aspect-ratio: 1; flex: none; padding: 0; transition: transform .18s var(--ease), filter .18s; }
.pip img { width: 100%; height: 100%; object-fit: contain; }
.pip:hover { transform: translateY(-2px) scale(1.06); filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.pip.heart { --ps: 34px; }
.pip.shield { width: 22px; aspect-ratio: 146/182; }
.stress-pip { width: var(--sw, 40px); height: var(--sh, 22px); flex: none; clip-path: var(--cf-4); background: var(--red); position: relative; transition: transform .18s var(--ease); }
.stress-pip::before { content: ''; position: absolute; inset: 1.6px; clip-path: var(--cf-4); background: var(--sheet); }
.stress-pip.on::before { background: var(--red); }
.stress-pip.locked { background: #a29f99; }
.stress-pip.locked::before { background: #a29f99; }
.stress-pip:hover { transform: translateY(-2px); }
.on-ink .stress-pip::before { background: var(--panel); }
.on-ink .stress-pip.on::before { background: var(--red); }
.on-ink .stress-pip.locked, .on-ink .stress-pip.locked::before { background: #2b2e33; }

.trait { position: relative; width: var(--tw, 56px); aspect-ratio: 56.4/129; flex: none; display: flex; flex-direction: column; align-items: center; color: var(--ivory); }
.trait > .tb { position: absolute; inset: 0; width: 100%; height: 100%; }
.trait > .tg { position: relative; width: 92%; margin-top: 2%; }
.trait > .tn { position: relative; font-weight: 800; font-size: calc(var(--tw, 56px) * .2); letter-spacing: .06em; margin-top: 4%; }
.trait > .tv { position: relative; font-weight: 900; font-size: calc(var(--tw, 56px) * .36); line-height: 1; }
.trait > .tv.neg { color: #ff4a3f; }
.trait:hover { filter: brightness(1.12); }

/* ---------- drawer, toast, tooltip ---------- */
.scrim { position: fixed; inset: var(--bar) 0 0 0; background: rgba(5,7,10,.62); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: calc(var(--bar) + 12px); bottom: 12px; right: 12px; width: 420px; z-index: 60; --c: 14px; --fill: var(--panel);
  transform: translateX(110%); transition: transform .26s var(--ease); display: flex; flex-direction: column; padding: 24px; gap: 16px; }
.drawer.open { transform: none; }
.drawer h2 { font-size: 30px; }
.drawer .x { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; display: grid; place-items: center; color: var(--gold-text); }
.opt { --c: 10px; --fill: var(--ink); padding: 14px 16px; text-align: left; display: block; width: 100%; }
.opt:hover { --fill: var(--panel-lit); }
.opt.sel { --line: var(--red); --fill: #1d0f10; }
.opt b { display: block; font-weight: 900; text-transform: uppercase; font-size: 16px; letter-spacing: .02em; color: var(--ivory); }
.opt span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; z-index: 90; padding: 12px 20px; --c: 8px; --fill: var(--panel-lit);
  font-weight: 700; font-size: 13px; transition: opacity .2s, transform .25s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.tip { position: fixed; z-index: 95; pointer-events: none; padding: 7px 10px; background: var(--panel-lit); border: 1px solid var(--hair); font-size: 12px; font-weight: 600;
  color: var(--ivory); opacity: 0; transition: opacity .12s; max-width: 260px; }
.tip.show { opacity: 1; }
.tip kbd, .kbd { font: 800 11px Archivo; color: var(--gold-text); border: 1px solid var(--hair); padding: 1px 4px; margin: 0 1px; }

/* Lightbox reader for a full-res card */
.reader { position: fixed; inset: var(--bar) 0 0 0; z-index: 70; display: grid; place-items: center; background: rgba(5,7,10,.9); opacity: 0; pointer-events: none; transition: opacity .2s; }
.reader.open { opacity: 1; pointer-events: auto; }
.reader .card { --cw: min(480px, 60vh); transform: scale(.94); transition: transform .26s var(--ease); }
.reader.open .card { transform: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; } }
