/* base.css — Grave Manners design tokens. Candlelight gothic: leather, vellum, brass, ember. Big type, big targets. */
:root {
  --ink: #0a0a0c; --ink-2: #121317; --ink-3: #1a1b21; --ink-4: #24262e;
  --parchment: #f1e6cc; --parchment-2: #e2d3b0; --mute: #b3a88e; --mute-2: #857b66;
  --brass: #d4a94a; --brass-2: #f3d27c; --brass-3: #8a6a25; --brass-4: #5a4210;
  --ember: #ff9a3c; --ember-2: #ffc98a; --blood: #8f1d24; --blood-2: #c9303a; --blood-3: #ff5c66; --spirit: #7fd8ff; --spirit-2: #c6f0ff; --moss: #4caf7d;
  --ink-on-vellum: #2a2013; --ink-on-vellum-2: #5a4a30;
  --shadow: 0 14px 34px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.45);
  --radius: 10px; --radius-s: 6px;
  --font-display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-deco: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  --font-body: 'EB Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --tap: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --leather: url('../assets/ui/leather.jpg'); --vellum: url('../assets/ui/vellum.jpg'); --brass-tx: url('../assets/ui/brass.jpg');
  --frame: url('../assets/ui/frame-thin.png'); --canvas-back: url('../assets/ui/canvas-back.jpg'); --divider: url('../assets/ui/divider.png');
  --fl: 20.8%; --fr: 21.2%; --ft: 17.1%; --fb: 17.6%; /* frame opening insets, measured from the frame image */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100%; background: var(--ink) var(--leather) center/512px repeat; color: var(--parchment); font-family: var(--font-body); font-size: 19px; line-height: 1.4; overflow-x: hidden; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 30%, rgba(0,0,0,.15), rgba(0,0,0,.72)); z-index: 0; }
#app { position: relative; z-index: 1; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; margin: 0; touch-action: manipulation; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--spirit); outline-offset: 3px; border-radius: 6px; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.hidden { display: none !important; }
.ic { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -.2em; fill: currentColor; flex: none; }
.ic.big { width: 30px; height: 30px; }
.caps { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .16em; font-size: 12.5px; font-weight: 600; }
.gold { color: var(--brass-2); }
.gold-text { background: linear-gradient(180deg, #fff1c4 0%, var(--brass-2) 40%, var(--brass) 70%, var(--brass-3) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- buttons: brass, leather, blood ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55em; min-height: var(--tap); padding: 0 26px; border-radius: 8px; font-family: var(--font-display); font-weight: 900; font-size: 17px; letter-spacing: .08em; text-transform: uppercase; user-select: none; transition: transform .12s ease, filter .15s ease; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled] { opacity: .45; filter: grayscale(.5); pointer-events: none; }
.btn-gold { color: #1f1504; background: linear-gradient(180deg, rgba(255,244,205,.75), rgba(255,235,170,.15) 45%, rgba(0,0,0,.12)), var(--brass-tx) center/512px; filter: saturate(1.15) brightness(1.08); box-shadow: inset 0 1px 0 rgba(255,245,210,.8), inset 0 -2px 0 rgba(90,66,16,.7), 0 0 0 1px #5a4210, 0 8px 22px rgba(212,169,74,.28); text-shadow: 0 1px 0 rgba(255,240,190,.6); }
.btn-gold:hover { filter: saturate(1.2) brightness(1.16); }
.btn-leather { color: var(--brass-2); background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.25)), var(--leather) center/512px; box-shadow: inset 0 0 0 1px rgba(212,169,74,.55), inset 0 0 0 3px rgba(10,10,12,.9), inset 0 0 0 4px rgba(212,169,74,.35), 0 6px 16px rgba(0,0,0,.5); }
.btn-leather:hover { filter: brightness(1.15); }
.btn-blood { color: #ffe3e5; background: linear-gradient(180deg, #b3262e, #6f141a); box-shadow: inset 0 1px 0 rgba(255,200,205,.35), 0 0 0 1px #3d0b0f, inset 0 0 0 2px rgba(212,169,74,.35), 0 8px 22px rgba(179,38,46,.35); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.btn-blood:hover { filter: brightness(1.1); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; font-size: 13.5px; padding: 0 16px; }
.icon-btn { width: var(--tap); height: var(--tap); display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--brass-2); background: radial-gradient(circle at 50% 35%, rgba(40,42,52,.9), rgba(10,10,12,.85)); box-shadow: inset 0 0 0 1px rgba(212,169,74,.55), inset 0 0 0 3px rgba(10,10,12,.9), inset 0 0 0 4px rgba(212,169,74,.3), 0 4px 14px rgba(0,0,0,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.icon-btn .ic { width: 24px; height: 24px; }
.icon-btn:hover { filter: brightness(1.2); }
.icon-btn.small { width: 44px; height: 44px; } .icon-btn.small .ic { width: 20px; height: 20px; }

/* ---------- surfaces ---------- */
.plaque { position: relative; background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.3)), var(--leather) center/512px; border-radius: var(--radius); box-shadow: inset 0 0 0 1px rgba(212,169,74,.7), inset 0 0 0 4px rgba(10,10,12,.95), inset 0 0 0 5px rgba(212,169,74,.4), inset 0 0 60px rgba(0,0,0,.45), var(--shadow); }
.plaque::before, .plaque::after { content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid var(--brass); pointer-events: none; opacity: .9; }
.plaque::before { top: 9px; left: 9px; border-right: 0; border-bottom: 0; }
.plaque::after { bottom: 9px; right: 9px; border-left: 0; border-top: 0; }
.vellum { background: var(--vellum) center/512px repeat; color: var(--ink-on-vellum); border-radius: var(--radius-s); box-shadow: inset 0 0 50px rgba(120,90,30,.25), 0 10px 26px rgba(0,0,0,.55), 0 0 0 1px rgba(90,66,16,.5); }
.ornament { display: block; width: min(320px, 70%); margin: 8px auto; opacity: .9; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(212,169,74,.7), transparent); margin: 14px 0; }
.chip { display: inline-flex; align-items: center; gap: .3em; padding: 3px 8px 3px 6px; border-radius: 4px; background: linear-gradient(180deg, #f3e8cf, #e1d0a8); color: var(--ink-on-vellum); font-family: var(--font-body); font-weight: 600; font-size: 14px; line-height: 1.2; white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(90,66,16,.45), 0 1px 2px rgba(0,0,0,.6); }
.chip .ic { width: 15px; height: 15px; color: var(--brass-3); }
.chip.hit { background: linear-gradient(180deg, #e6b9bc, #d09094); color: #4a0d12; text-decoration: line-through; box-shadow: inset 0 0 0 1px rgba(120,20,30,.6); }
.chip.hit .ic { color: #7b1b22; }
.chip.ok { background: linear-gradient(180deg, #cfe6d3, #a8cdb0); color: #103d22; box-shadow: inset 0 0 0 1px rgba(20,90,50,.55); }
.chip.ok .ic { color: #2a7f5a; }
.badge { display: inline-flex; align-items: center; gap: .35em; padding: 4px 11px; border-radius: 999px; background: linear-gradient(180deg, rgba(212,169,74,.28), rgba(212,169,74,.12)); color: var(--brass-2); font-family: var(--font-display); font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; box-shadow: inset 0 0 0 1px rgba(212,169,74,.5); }
.med { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: screen; }

/* ---------- motion ---------- */
@keyframes flicker { 0%,100% { opacity: 1 } 45% { opacity: .84 } 50% { opacity: .95 } 55% { opacity: .8 } 70% { opacity: .98 } }
@keyframes drift { from { transform: translateX(-4%) } to { transform: translateX(4%) } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
@keyframes pop { 0% { transform: scale(.88); opacity: 0 } 60% { transform: scale(1.03); opacity: 1 } 100% { transform: scale(1) } }
@keyframes shake { 0%,100% { transform: translateX(0) } 20% { transform: translateX(-8px) } 40% { transform: translateX(8px) } 60% { transform: translateX(-6px) } 80% { transform: translateX(6px) } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(127,216,255,.55) } 100% { box-shadow: 0 0 0 14px rgba(127,216,255,0) } }
@keyframes lightning { 0%, 100% { opacity: 0 } 5% { opacity: .9 } 8% { opacity: .2 } 12% { opacity: .7 } 20% { opacity: 0 } }
@keyframes flamewave { 0%,100% { transform: scaleY(1) skewX(0) } 30% { transform: scaleY(1.08) skewX(-3deg) } 60% { transform: scaleY(.94) skewX(3deg) } }
@keyframes glow { 0%,100% { filter: drop-shadow(0 0 6px rgba(255,190,80,.5)) } 50% { filter: drop-shadow(0 0 14px rgba(255,190,80,.9)) } }
.rise { animation: rise .45s ease both; }
.pop { animation: pop .35s cubic-bezier(.2,.9,.3,1.2) both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }
