/* FAHEJDDAS — interface. Dark wood and leather, gilt edges, parchment for anything you read at length. */
@font-face { font-family: 'Cinzel'; src: url('/fonts/cinzel.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Cinzel Decorative'; src: url('/fonts/cinzel-decorative-900.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Alegreya'; src: url('/fonts/alegreya.woff2') format('woff2'); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Alegreya'; src: url('/fonts/alegreya-italic.woff2') format('woff2'); font-weight: 400 900; font-style: italic; font-display: swap; }

:root {
  --bg: #120c0e; --wood: #241619; --wood2: #32201f; --wood3: #45302a; --line: rgba(214, 170, 84, .38); --line2: rgba(214, 170, 84, .16);
  --gold: #d6aa54; --gold-l: #f6dc94; --gold-d: #8a6212; --parch: #f2e7c9; --parch2: #e3d2a8; --parch3: #cdb98a; --ink: #1c1215; --ink2: #4a3a30;
  --red: #8f1f2c; --red-l: #cf4354; --green: #6fcf6f; --green-d: #2f7a3c; --blue: #7cc0ff; --violet: #b99cff; --text: #f0e5cd; --muted: #b5a68b; --dim: #7d6f5c;
  --fh: 'Cinzel', 'Trajan Pro', 'Palatino Linotype', Georgia, serif; --fb: 'Alegreya', 'Palatino Linotype', Georgia, serif; --fd: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  --bar: 58px; --r: 10px; --shadow: 0 10px 34px rgba(0, 0, 0, .6);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 16px/1.42 var(--fb); overflow: hidden; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
#gl, #ov { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ov { pointer-events: none; z-index: 2; }
#app { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
#app > * { pointer-events: auto; }
h1, h2, h3, h4 { font-family: var(--fh); font-weight: 700; margin: 0; letter-spacing: .03em; }
h2 { font-size: 21px; } h3 { font-size: 16px; } h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); }
p { margin: 0 0 .6em; }
button { font: inherit; color: inherit; }
a { color: var(--gold-l); }
b, strong { font-weight: 700; }
.num { font-family: var(--fh); font-weight: 700; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .tiny { font-size: 12px; } .center { text-align: center; } .right { text-align: right; }
.row { display: flex; align-items: center; gap: 10px; } .col { display: flex; flex-direction: column; gap: 10px; } .grow { flex: 1; min-width: 0; } .wrap { flex-wrap: wrap; } .gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap16 { gap: 16px; }
.hide { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: linear-gradient(#7a5a2a, #4a3418); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; } ::-webkit-scrollbar-track { background: rgba(0, 0, 0, .25); border-radius: 6px; }
.scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: #7a5a2a rgba(0, 0, 0, .25); }

/* ---- surfaces */
.panel { position: relative; background: linear-gradient(180deg, rgba(50, 32, 31, .97), rgba(30, 19, 21, .97)); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 230, 170, .09), inset 0 0 0 3px rgba(0, 0, 0, .28), inset 0 0 0 4px var(--line2); }
.panel.pad { padding: 14px 16px; }
.panel.left > header { padding-left: 84px; }
.panel > header, .hd { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line2); background: linear-gradient(180deg, rgba(214, 170, 84, .11), rgba(214, 170, 84, 0)); border-radius: var(--r) var(--r) 0 0; }
.panel > header h2, .hd h2 { font-size: 16px; color: var(--gold-l); text-shadow: 0 1px 0 #000; }
.parch { background: radial-gradient(120% 90% at 50% 0%, #f8efd6, var(--parch) 45%, var(--parch2)); color: var(--ink); border-radius: 8px; border: 1px solid #a48b57; box-shadow: inset 0 0 26px rgba(120, 84, 34, .28), 0 4px 14px rgba(0, 0, 0, .45); }
.parch h2, .parch h3 { color: #4a1620; } .parch h4 { color: #7a5416; } .parch .muted { color: #6b5a48; } .parch a { color: #7a1c28; }
.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); margin: 8px 0; border: 0; }
.parch .rule { background: linear-gradient(90deg, transparent, rgba(110, 78, 30, .55), transparent); }
.orn { display: flex; align-items: center; gap: 10px; color: var(--gold); font-family: var(--fh); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.orn::before, .orn::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line)); } .orn::after { transform: scaleX(-1); }
.parch .orn { color: #7a5416; } .parch .orn::before, .parch .orn::after { background: linear-gradient(90deg, transparent, rgba(110, 78, 30, .6)); }

/* ---- buttons */
.btn { --c1: #5a3d1a; --c2: #3a2710; --edge: var(--gold); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 6px 16px; font-family: var(--fh); font-weight: 700; font-size: 13.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--gold-l); background: linear-gradient(180deg, var(--c1), var(--c2)); border: 1px solid var(--edge); border-radius: 8px; cursor: pointer; text-shadow: 0 1px 0 rgba(0, 0, 0, .7); box-shadow: inset 0 1px 0 rgba(255, 235, 180, .25), inset 0 -2px 0 rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .5); transition: filter .12s, transform .08s, box-shadow .12s; white-space: nowrap; }
.btn:hover { filter: brightness(1.18); box-shadow: inset 0 1px 0 rgba(255, 235, 180, .3), inset 0 -2px 0 rgba(0, 0, 0, .3), 0 2px 14px rgba(214, 170, 84, .35); }
.btn:active { transform: translateY(1px); filter: brightness(.94); }
.btn:disabled, .btn.off { filter: grayscale(.8) brightness(.62); cursor: not-allowed; box-shadow: none; }
.btn.red { --c1: #a8283a; --c2: #6a1420; --edge: #f0b0a0; color: #ffe9d8; } .btn.green { --c1: #3f8a48; --c2: #1f5a2a; --edge: #b8e8a8; color: #eaffdf; } .btn.gold { --c1: #f0c860; --c2: #b98a24; --edge: #fff0b8; color: #2a1a06; text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
.btn.ghost { --c1: rgba(255, 255, 255, .06); --c2: rgba(0, 0, 0, .12); --edge: var(--line); color: var(--text); box-shadow: none; }
.btn.big { min-height: 48px; padding: 8px 28px; font-size: 16px; border-radius: 10px; } .btn.sm { min-height: 28px; padding: 3px 10px; font-size: 11.5px; border-radius: 6px; } .btn.icon { padding: 0; width: 36px; }
.parch .btn.ghost { color: var(--ink); --edge: rgba(90, 60, 20, .5); --c1: rgba(255, 255, 255, .35); --c2: rgba(170, 140, 80, .25); text-shadow: none; }
.coin { display: inline-block; width: 1.05em; height: 1.05em; border-radius: 50%; vertical-align: -.16em; background: radial-gradient(circle at 35% 30%, #fff3b8, #e3b341 45%, #9a6a12); box-shadow: inset 0 0 0 1.5px #7a4f10, 0 1px 2px rgba(0, 0, 0, .5); }
.price { font-family: var(--fh); font-weight: 700; color: var(--gold-l); white-space: nowrap; } .price.no { color: #d08a80; } .parch .price { color: #6a4208; } .parch .price.no { color: #a8281e; }
input[type=text], input[type=password], select { font: 16px var(--fb); color: var(--text); background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; outline: none; user-select: text; -webkit-user-select: text; }
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(214, 170, 84, .25); }
.parch input, .parch select { color: var(--ink); background: rgba(255, 255, 255, .5); border-color: rgba(90, 60, 20, .45); }

/* ---- top bar */
#top { position: absolute; left: 0; right: 0; top: 0; height: var(--bar); display: flex; align-items: center; gap: 14px; padding: 0 14px 0 92px; background: linear-gradient(180deg, rgba(34, 21, 22, .98), rgba(22, 13, 15, .94)); border-bottom: 1px solid var(--gold-d); box-shadow: 0 4px 18px rgba(0, 0, 0, .6), inset 0 -1px 0 rgba(246, 220, 148, .25); z-index: 20; }
#top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -5px; height: 4px; background: linear-gradient(90deg, transparent, rgba(214, 170, 84, .35) 20%, rgba(214, 170, 84, .35) 80%, transparent); pointer-events: none; }
#crest { position: absolute; left: 12px; top: 2px; width: 68px; cursor: pointer; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .65)); transition: transform .2s; transform-origin: 50% 0; z-index: 21; }
#crest:hover { transform: rotate(-3deg) scale(1.04); } #crest canvas, #crest img { width: 100%; display: block; }
.gname { font-family: var(--fh); font-weight: 900; font-size: 17px; color: var(--gold-l); letter-spacing: .04em; line-height: 1.05; text-shadow: 0 2px 0 #000; white-space: nowrap; }
.glevel { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-family: var(--fh); letter-spacing: .08em; text-transform: uppercase; }
.xp { width: 110px; height: 7px; border-radius: 4px; background: rgba(0, 0, 0, .55); box-shadow: inset 0 0 0 1px rgba(214, 170, 84, .35); overflow: hidden; } .xp i { display: block; height: 100%; background: linear-gradient(90deg, #7a5cf0, #c0a4ff); transition: width .5s; }
nav.tabs { display: flex; gap: 6px; margin: 0 auto; align-self: flex-end; }
nav.tabs button { position: relative; min-width: 128px; height: 46px; padding: 0 20px; font-family: var(--fh); font-weight: 700; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); cursor: pointer; background: linear-gradient(180deg, rgba(70, 46, 38, .55), rgba(40, 26, 24, .2)); border: 1px solid var(--line2); border-bottom: 0; border-radius: 12px 12px 0 0; transition: color .15s, background .15s; }
nav.tabs button:hover { color: var(--gold-l); } nav.tabs button.on { color: #2a1806; background: linear-gradient(180deg, #f3d27a, #c9982e); border-color: #fff0b8; text-shadow: 0 1px 0 rgba(255, 255, 255, .45); box-shadow: 0 -2px 16px rgba(214, 170, 84, .35); }
nav.tabs button .pip { position: absolute; right: 8px; top: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red-l); color: #fff; font: 700 11px/18px var(--fh); letter-spacing: 0; box-shadow: 0 0 0 2px #1a1014; }
.purse { display: flex; align-items: center; gap: 7px; padding: 5px 14px 5px 10px; border-radius: 20px; background: rgba(0, 0, 0, .42); box-shadow: inset 0 0 0 1px var(--line); font: 700 17px var(--fh); color: var(--gold-l); } .purse .coin { font-size: 19px; }
.purse.bump { animation: bump .35s; } @keyframes bump { 40% { transform: scale(1.16); filter: brightness(1.4); } }

/* ---- screens */
.screen { position: absolute; left: 0; right: 0; top: var(--bar); bottom: 0; pointer-events: none; }
.screen > * { pointer-events: auto; }
.stage { position: absolute; inset: 0; pointer-events: auto; }
.dock { position: absolute; left: 10px; right: 10px; bottom: 10px; }
.side { position: absolute; top: 10px; bottom: 10px; right: 10px; width: min(470px, 40vw); display: flex; flex-direction: column; }
.side .body, .dock .body { flex: 1; min-height: 0; padding: 12px 14px; }
.subtabs { display: flex; gap: 4px; } .subtabs button { padding: 5px 13px; font: 700 12px var(--fh); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: rgba(0, 0, 0, .25); border: 1px solid var(--line2); border-radius: 6px; cursor: pointer; } .subtabs button.on { color: #2a1806; background: linear-gradient(180deg, #f3d27a, #c9982e); border-color: #fff0b8; } .subtabs button:hover:not(.on) { color: var(--gold-l); }

/* ---- cards */
.cards { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x proximity; }
.card { position: relative; flex: 0 0 auto; width: 158px; padding: 8px 9px 9px; border-radius: 9px; background: linear-gradient(180deg, #3d2926, #261819); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 230, 170, .1), 0 3px 10px rgba(0, 0, 0, .45); cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; scroll-snap-align: start; display: flex; flex-direction: column; gap: 5px; }
.card:hover { transform: translateY(-4px); border-color: var(--gold-l); box-shadow: 0 8px 22px rgba(0, 0, 0, .6), 0 0 18px rgba(214, 170, 84, .25); }
.card.sold { opacity: .35; pointer-events: none; filter: grayscale(.8); } .card.poor .price { color: #d08a80; }
.card .art { height: 104px; border-radius: 6px; background: radial-gradient(90% 90% at 50% 100%, rgba(214, 170, 84, .22), rgba(0, 0, 0, .35)); display: grid; place-items: end center; overflow: hidden; } .card .art img, .card .art canvas { max-height: 122px; margin-bottom: -6px; }
.card .nm { font: 700 13.5px/1.15 var(--fh); color: var(--gold-l); } .card .sub { font-size: 12.5px; color: var(--muted); line-height: 1.2; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; }
.card .lvl, .lvlchip { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; font: 900 12px var(--fh); color: #2a1806; background: linear-gradient(180deg, #f6dc94, #c9982e); box-shadow: 0 0 0 2px #1a1014; }
.card .lvl { position: absolute; left: -6px; top: -6px; }
.rar-common { --rc: #c9c4b8; } .rar-uncommon { --rc: #6fcf6f; } .rar-rare { --rc: #6aa8ff; } .rar-very-rare { --rc: #c08aff; } .rar-legendary { --rc: #ffae3a; } .rar-artifact { --rc: #ff6a5a; }
.item { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line2); border-left: 3px solid var(--rc, var(--line)); cursor: pointer; } .item:hover { background: rgba(214, 170, 84, .1); border-color: var(--line); }
.item .ic, .ic { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 6px; background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px var(--rc, var(--line2)); display: grid; place-items: center; } .ic canvas, .ic img { width: 30px; height: 30px; }
.item .nm { font: 700 13.5px/1.1 var(--fh); color: var(--rc, var(--text)); } .item .sub { font-size: 12.5px; color: var(--muted); line-height: 1.15; }
.parch .item { background: rgba(255, 255, 255, .32); border-color: rgba(110, 78, 30, .3); } .parch .item .nm { color: var(--ink); } .parch .item .sub { color: #6b5a48; } .parch .item:hover { background: rgba(255, 255, 255, .6); }

/* ---- hero bits */
.portrait { position: relative; border-radius: 8px; background: radial-gradient(90% 80% at 50% 100%, rgba(214, 170, 84, .3), rgba(20, 12, 14, .7)); box-shadow: inset 0 0 0 1px var(--line), inset 0 0 0 3px rgba(0, 0, 0, .35); overflow: hidden; display: grid; place-items: end center; } .portrait img, .portrait canvas { display: block; max-width: none; }
.hpbar { height: 9px; border-radius: 5px; background: #2a1c1e; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6); overflow: hidden; position: relative; } .hpbar i { display: block; height: 100%; background: linear-gradient(180deg, #8fec74, #2f9a3c); transition: width .25s; } .hpbar.foe i { background: linear-gradient(180deg, #ff7a66, #b3261e); } .hpbar b { position: absolute; left: 0; bottom: 0; height: 40%; background: rgba(110, 190, 255, .9); }
.stat { text-align: center; padding: 6px 4px 5px; border-radius: 8px; background: rgba(255, 255, 255, .34); border: 1px solid rgba(110, 78, 30, .35); min-width: 54px; } .stat .k { font: 700 10.5px var(--fh); letter-spacing: .12em; text-transform: uppercase; color: #7a5416; } .stat .v { font: 900 20px/1.05 var(--fh); color: var(--ink); } .stat .m { font: 700 12px var(--fh); color: #4a1620; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 10px; font: 700 11px/18px var(--fh); letter-spacing: .06em; text-transform: uppercase; background: rgba(0, 0, 0, .3); color: var(--gold-l); box-shadow: inset 0 0 0 1px var(--line2); white-space: nowrap; } .parch .tag { background: rgba(110, 78, 30, .14); color: #5a3a0c; box-shadow: inset 0 0 0 1px rgba(110, 78, 30, .35); }
.tag.bad { color: #ffb0a0; } .tag.good { color: #b6f0a8; } .tag.sp { color: #c8b6ff; } .parch .tag.bad { color: #a8281e; } .parch .tag.good { color: #2f6a2f; } .parch .tag.sp { color: #5a3a9a; }
.pick { cursor: pointer; padding: 7px 9px; border-radius: 8px; border: 1px solid rgba(110, 78, 30, .32); background: rgba(255, 255, 255, .3); transition: background .12s, border-color .12s, box-shadow .12s; } .pick:hover { background: rgba(255, 255, 255, .6); } .pick.on { border-color: #8f1f2c; background: #fff8e2; box-shadow: 0 0 0 2px rgba(143, 31, 44, .35), inset 0 0 12px rgba(214, 170, 84, .35); } .pick.dis { opacity: .45; pointer-events: none; }
.pick .nm { font: 700 13.5px/1.15 var(--fh); color: #4a1620; } .pick .sub { font-size: 12.5px; line-height: 1.2; color: #5a4a3a; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; } .grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; } .grid6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }

/* ---- bench */
.bench { display: flex; gap: 6px; flex-wrap: wrap; } .slot { position: relative; width: 62px; height: 78px; border-radius: 8px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line2); display: grid; place-items: end center; overflow: hidden; cursor: pointer; transition: box-shadow .12s, transform .12s; }
.slot:hover { box-shadow: inset 0 0 0 1px var(--gold); } .slot.on { box-shadow: inset 0 0 0 2px var(--gold-l), 0 0 14px rgba(214, 170, 84, .4); } .slot.empty { cursor: default; } .slot.empty::after { content: ''; width: 22px; height: 22px; margin-bottom: 26px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line2); }
.slot img { height: 86px; margin-bottom: -6px; pointer-events: none; } .slot .lvlchip { position: absolute; left: 3px; top: 3px; transform: scale(.86); } .slot.over { box-shadow: inset 0 0 0 2px var(--green), 0 0 16px rgba(111, 207, 111, .5); } .slot .dot3 { position: absolute; right: 4px; top: 5px; display: flex; gap: 2px; } .slot .dot3 i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-l); box-shadow: 0 0 0 1px #1a1014; } .slot .dot3 i.o { background: rgba(0, 0, 0, .5); }
.ghost-drag { position: fixed; z-index: 999; pointer-events: none; transform: translate(-50%, -78%); filter: drop-shadow(0 12px 10px rgba(0, 0, 0, .6)); }

/* ---- modal, toast, tooltip */
#modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(8, 4, 6, .72); backdrop-filter: blur(3px); padding: 16px; } #modal[hidden] { display: none; }
.modal-box { width: min(760px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: linear-gradient(180deg, #3a2523, #201416); border: 1px solid var(--gold); border-radius: 12px; box-shadow: 0 30px 80px #000, inset 0 0 0 3px rgba(0, 0, 0, .3), inset 0 0 0 4px var(--line2); animation: pop .18s cubic-bezier(.2, 1.3, .4, 1); } .modal-box.wide { width: min(1080px, 100%); } .modal-box.narrow { width: min(480px, 100%); }
@keyframes pop { from { transform: scale(.94) translateY(10px); opacity: 0; } }
.modal-box > header { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(214, 170, 84, .14), transparent); border-radius: 12px 12px 0 0; } .modal-box > header h2 { flex: 1; color: var(--gold-l); font-size: 19px; }
.modal-box .x { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); cursor: pointer; color: var(--gold-l); } .modal-box .x:hover { background: var(--red); }
.modal-body { padding: 16px; overflow: auto; }
#toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 9px 18px; border-radius: 22px; background: linear-gradient(180deg, #46302a, #2a1a1a); border: 1px solid var(--gold); font: 700 14px var(--fh); letter-spacing: .04em; color: var(--gold-l); box-shadow: var(--shadow); animation: rise .25s; transition: opacity .4s, transform .4s; } .toast.bad { border-color: #f0a090; color: #ffd2c8; background: linear-gradient(180deg, #6a1c26, #3a1014); } .toast.good { border-color: #b8e8a8; color: #e6ffd8; background: linear-gradient(180deg, #2f6a3a, #1a3a22); } .toast.out { opacity: 0; transform: translateY(10px); }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
#tip { position: fixed; z-index: 300; max-width: 340px; padding: 10px 12px; border-radius: 9px; background: linear-gradient(180deg, #2f1f1e, #1a1012); border: 1px solid var(--gold); box-shadow: 0 12px 30px rgba(0, 0, 0, .75); font-size: 14px; line-height: 1.32; pointer-events: none; } #tip[hidden] { display: none; }
#tip h5 { margin: 0 0 3px; font: 700 14.5px var(--fh); color: var(--gold-l); } #tip .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 5px; } #tip .ln { display: flex; justify-content: space-between; gap: 14px; } #tip .ln b { color: var(--gold-l); font-family: var(--fh); } #tip p { margin: 4px 0 0; } #tip em { color: #c8b6ff; }

/* ---- title and onboarding */
.veil { position: absolute; inset: 0; background: radial-gradient(90% 80% at 50% 45%, rgba(18, 10, 12, .3), rgba(10, 5, 7, .88)); pointer-events: none; }
.title { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; text-align: center; }
.logo { font-family: var(--fd); font-weight: 900; line-height: .98; color: #f8e3a4; text-shadow: 0 2px 0 #7a4a10, 0 5px 0 #3a1c08, 0 8px 24px rgba(0, 0, 0, .9), 0 0 60px rgba(240, 170, 70, .35); letter-spacing: .02em; }
.logo small { display: block; font-family: var(--fh); font-weight: 700; font-size: clamp(11px, 1.5vw, 19px); letter-spacing: .34em; color: var(--gold); text-shadow: 0 2px 6px #000; margin: .5em 0; } .logo .l1 { font-size: clamp(28px, 5.6vw, 76px); } .logo .l2 { font-size: clamp(15px, 2.5vw, 34px); color: #f1d9a0; }
.sheet { width: min(1120px, calc(100vw - 24px)); max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.steps { display: flex; gap: 6px; align-items: center; font: 700 12px var(--fh); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); } .steps b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .4); box-shadow: inset 0 0 0 1px var(--line2); margin-right: 6px; } .steps .on { color: var(--gold-l); } .steps .on b { background: var(--gold); color: #2a1806; } .steps i { width: 26px; height: 1px; background: var(--line2); }
.wheel { height: 300px; overflow-y: auto; border-radius: 8px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line2), inset 0 12px 14px -8px #000, inset 0 -12px 14px -8px #000; padding: 6px; scroll-snap-type: y proximity; } .wheel button { display: block; width: 100%; padding: 5px 10px; border: 0; border-radius: 6px; background: none; font: 700 16px var(--fh); letter-spacing: .04em; color: var(--muted); cursor: pointer; text-align: left; scroll-snap-align: center; } .wheel button:hover { color: var(--gold-l); background: rgba(214, 170, 84, .08); } .wheel button.on { color: #2a1806; background: linear-gradient(180deg, #f3d27a, #c9982e); } .wheel button.taken { opacity: .3; text-decoration: line-through; pointer-events: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; } .swatches button { width: 27px; height: 27px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .55); cursor: pointer; box-shadow: inset 0 2px 3px rgba(255, 255, 255, .28), 0 1px 2px rgba(0, 0, 0, .5); transition: transform .1s; } .swatches button:hover { transform: scale(1.15); } .swatches button.on { border-color: #fff; box-shadow: 0 0 0 2px var(--gold), inset 0 2px 3px rgba(255, 255, 255, .28); transform: scale(1.12); }
.opts { display: flex; flex-wrap: wrap; gap: 4px; } .opts button { padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .25); color: var(--muted); font: 600 13px var(--fb); cursor: pointer; } .opts button:hover { color: var(--gold-l); border-color: var(--line); } .opts button.on { color: #2a1806; background: linear-gradient(180deg, #f3d27a, #c9982e); border-color: #fff0b8; font-weight: 700; }
.chargegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; } .chargegrid button { aspect-ratio: 1; border-radius: 7px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .28); cursor: pointer; padding: 3px; display: grid; place-items: center; } .chargegrid button canvas { width: 100%; height: 100%; } .chargegrid button:hover { border-color: var(--gold); } .chargegrid button.on { background: rgba(214, 170, 84, .25); border-color: var(--gold-l); box-shadow: 0 0 10px rgba(214, 170, 84, .4); }
.codebox { font: 700 clamp(15px, 2.1vw, 22px)/1.5 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .06em; padding: 14px 16px; border-radius: 9px; background: #120a0c; border: 1px dashed var(--gold); color: #ffe9a8; text-align: center; user-select: all; -webkit-user-select: all; word-break: break-all; }

/* ---- battle hud */
.inibar { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 5px; padding: 6px 10px; border-radius: 12px; background: rgba(20, 12, 14, .82); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); max-width: calc(100vw - 420px); overflow: hidden; }
.ini { position: relative; width: 44px; height: 50px; border-radius: 7px; background: rgba(0, 0, 0, .4); box-shadow: inset 0 0 0 1.5px #5a8a4a; overflow: hidden; transition: width .2s, height .2s, opacity .3s, filter .3s, margin .2s; flex: 0 0 auto; } .ini.foe { box-shadow: inset 0 0 0 1.5px #a8483e; } .ini img { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); height: 78px; max-width: none; }
.ini.on { width: 56px; height: 62px; box-shadow: inset 0 0 0 2px var(--gold-l), 0 0 16px rgba(246, 220, 148, .6); } .ini.dead { opacity: .28; filter: grayscale(1); width: 30px; } .ini .n { position: absolute; right: 2px; top: 1px; font: 900 11px var(--fh); color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; } .ini .h { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 4px; border-radius: 2px; background: rgba(0, 0, 0, .7); } .ini .h i { display: block; height: 100%; border-radius: 2px; background: #7be36a; } .ini.foe .h i { background: #ff7a66; }
.roundchip { align-self: center; padding: 3px 10px; font: 900 12px var(--fh); letter-spacing: .12em; color: var(--gold-l); text-transform: uppercase; white-space: nowrap; }
.frames { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 8px; } .frame { position: relative; width: 190px; padding: 7px 9px 8px 66px; min-height: 66px; border-radius: 10px; background: rgba(22, 13, 15, .88); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); transition: box-shadow .2s, transform .2s, filter .3s; } .frame.on { box-shadow: inset 0 0 0 2px var(--gold-l), 0 0 20px rgba(246, 220, 148, .45); transform: translateY(-5px); } .frame.dead { filter: grayscale(1) brightness(.6); } .frame.down { box-shadow: inset 0 0 0 2px var(--red-l); }
.frame .pt { position: absolute; left: 6px; bottom: 6px; top: 6px; width: 54px; border-radius: 7px; overflow: hidden; background: radial-gradient(90% 80% at 50% 100%, rgba(214, 170, 84, .3), rgba(0, 0, 0, .5)); } .frame .pt img { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); height: 92px; max-width: none; } .frame .nm { font: 700 13px/1.1 var(--fh); color: var(--gold-l); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .frame .cl { font-size: 11.5px; color: var(--muted); line-height: 1.2; margin-bottom: 3px; } .frame .hpn { font: 700 11px var(--fh); color: var(--text); margin-top: 2px; display: flex; justify-content: space-between; } .frame .res { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; min-height: 8px; } .frame .res i { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 1px #1a1014; } .frame .res i.o { background: rgba(255, 255, 255, .12); } .frame .cond { position: absolute; left: 66px; right: 6px; top: -20px; display: flex; gap: 3px; flex-wrap: nowrap; overflow: hidden; }
.frame .cond span { padding: 0 6px; border-radius: 8px; font: 700 10px/16px var(--fh); background: rgba(20, 12, 14, .9); color: #a8e6ff; box-shadow: inset 0 0 0 1px rgba(168, 230, 255, .4); white-space: nowrap; } .frame .cond span.bad { color: #ff9d8a; box-shadow: inset 0 0 0 1px rgba(255, 157, 138, .45); }
.caption { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); padding: 5px 26px; font: 900 22px var(--fh); letter-spacing: .08em; color: var(--gold-l); text-shadow: 0 2px 0 #000, 0 0 18px rgba(0, 0, 0, .9); background: linear-gradient(90deg, transparent, rgba(20, 12, 14, .82) 18%, rgba(20, 12, 14, .82) 82%, transparent); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .25s; } .caption.show { opacity: 1; animation: capin .3s; } .caption small { display: block; font: 700 11px var(--fh); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: -2px; } .caption.win { font-size: 46px; color: #ffe9a0; } .caption.lose { font-size: 46px; color: #ff8a7a; } .caption.round { font-size: 17px; color: var(--muted); }
@keyframes capin { from { transform: translateX(-50%) scale(1.25); opacity: 0; } }
.log { position: absolute; right: 10px; bottom: 10px; width: min(380px, 30vw); max-height: 44vh; display: flex; flex-direction: column; border-radius: 10px; background: rgba(22, 13, 15, .86); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); } .log.min .lines { display: none; } .log .lines { overflow-y: auto; padding: 6px 10px 8px; font-size: 13.5px; line-height: 1.3; display: flex; flex-direction: column; gap: 3px; } .log .lines div { padding-left: 8px; border-left: 2px solid var(--line2); color: #d8ccb4; } .log .lines .hit, .log .lines .dmg { border-color: #c96a4a; } .log .lines .miss { border-color: #6a6a78; color: #a8a096; } .log .lines .cast { border-color: var(--violet); } .log .lines .heal, .log .lines .good, .log .lines .save { border-color: var(--green); } .log .lines .die, .log .lines .down, .log .lines .bad, .log .lines .fail { border-color: var(--red-l); } .log .lines .round { border: 0; padding: 4px 0 0; font: 700 11px var(--fh); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.log b.ally { color: #a8e89a; } .log b.foe { color: #ff9d8a; } .log b.sp { color: #c8b6ff; } .log b.crit { color: #ffd84a; } .log .roll { display: inline-block; min-width: 20px; text-align: center; padding: 0 4px; border-radius: 4px; background: var(--parch); color: var(--ink); font: 900 12px var(--fh); } .log .hp { color: var(--dim); font-size: 12px; }
.dt-fire { color: #ff9a4a; } .dt-cold { color: #9fe0ff; } .dt-lightning { color: #fff07a; } .dt-radiant { color: #fff3b8; } .dt-necrotic { color: #c49bff; } .dt-force { color: #ea9cff; } .dt-psychic { color: #ff8ad6; } .dt-poison { color: #a9e85a; } .dt-acid { color: #d2f64a; } .dt-thunder { color: #b4dcff; }
.ctrl { position: absolute; right: 10px; top: 8px; display: flex; gap: 6px; }
.fade { position: fixed; inset: 0; z-index: 90; background: #080406; opacity: 0; pointer-events: none; transition: opacity .35s; display: grid; place-items: center; font: 700 20px var(--fh); letter-spacing: .2em; color: var(--gold); text-transform: uppercase; } .fade.on { opacity: 1; pointer-events: auto; }

/* ---- dungeon */
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.lvlcard { position: relative; padding: 11px 12px 12px; border-radius: 10px; cursor: pointer; background: linear-gradient(160deg, var(--tc, #3d2926), #1c1214 78%); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 230, 170, .1), 0 3px 10px rgba(0, 0, 0, .45); transition: transform .12s, box-shadow .12s, border-color .12s; min-height: 132px; display: flex; flex-direction: column; gap: 4px; } .lvlcard:hover { transform: translateY(-3px); border-color: var(--gold-l); } .lvlcard.on { border-color: var(--gold-l); box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(214, 170, 84, .45); } .lvlcard.locked { filter: grayscale(.9) brightness(.55); pointer-events: none; } .lvlcard .n { font: 900 30px/1 var(--fh); color: var(--gold-l); text-shadow: 0 2px 0 #000; } .lvlcard .t { font: 700 14.5px/1.15 var(--fh); } .lvlcard .mons { display: flex; margin-top: auto; height: 54px; align-items: flex-end; } .lvlcard .mons img { height: 62px; margin-right: -14px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .6)); } .lvlcard .done { position: absolute; right: 9px; top: 9px; }
.path { display: flex; align-items: center; justify-content: center; gap: 0; } .path .rm { position: relative; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 40% 30%, #4a3430, #1c1214); box-shadow: inset 0 0 0 2px var(--line), 0 4px 10px rgba(0, 0, 0, .6); font: 900 20px var(--fh); color: var(--muted); } .path .rm.done { box-shadow: inset 0 0 0 2px var(--green); color: var(--green); } .path .rm.now { box-shadow: inset 0 0 0 3px var(--gold-l), 0 0 22px rgba(246, 220, 148, .6); color: var(--gold-l); animation: pulse 1.6s infinite; } .path .rm.boss { width: 76px; height: 76px; } .path .ln { width: 46px; height: 4px; background: var(--line2); } .path .ln.done { background: var(--green); } .path .ln.rest::after { content: 'rest'; display: block; text-align: center; font: 700 10px var(--fh); letter-spacing: .12em; text-transform: uppercase; color: var(--blue); transform: translateY(-17px); }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 3px var(--gold-l), 0 0 34px rgba(246, 220, 148, .9); } }
.loot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ---- boot */
#boot { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; background: #0c0608; transition: opacity .5s; } #boot.gone { opacity: 0; pointer-events: none; } #boot .d { width: 64px; height: 64px; animation: spin 1.6s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } #boot p { font: 700 13px var(--fh); letter-spacing: .3em; color: var(--gold); text-transform: uppercase; margin-top: 14px; text-align: center; }

/* ---- screen frames that the narrow layout rearranges */
.pt-side { top: calc(var(--bar) + 10px); width: min(600px, 46vw); }
.pt-bench { position: absolute; left: 10px; bottom: 10px; padding: 8px 12px; max-width: calc(54vw - 30px); }
.dg-left { position: absolute; left: 10px; top: calc(var(--bar) + 10px); bottom: 10px; width: min(400px, 34vw); display: flex; flex-direction: column; }
.dg-dock { position: absolute; left: calc(min(400px, 34vw) + 20px); right: 10px; bottom: 10px; }
.dg-top { position: absolute; left: calc(min(400px, 34vw) + 20px); right: 10px; top: calc(var(--bar) + 14px); display: flex; justify-content: center; pointer-events: none; }
@media (max-width: 760px) {
  #top { padding: 0 6px 0 56px; gap: 6px; } #crest { width: 42px; left: 7px; } #top > div:nth-child(2) { display: none; }
  nav.tabs { margin: 0; flex: 1; gap: 3px; } nav.tabs button { flex: 1; min-width: 0; padding: 0 2px; font-size: 10.5px; letter-spacing: 0; height: 36px; border-radius: 9px 9px 0 0; overflow: hidden; }
  .purse { font-size: 13.5px; padding: 4px 9px 4px 6px; } #top .btn.icon { width: 30px; min-height: 30px; }
  .dock { left: 6px; right: 6px; bottom: 6px; } .card { width: 142px; } .hd { padding: 7px 9px; gap: 6px; flex-wrap: wrap; } .subtabs button { padding: 5px 8px; font-size: 11px; }
  .pt-side { left: 6px; right: 6px; width: auto; top: 47vh; bottom: 6px; } .pt-bench { left: 6px; right: 6px; max-width: none; bottom: auto; top: calc(47vh - 96px); padding: 5px 8px; }
  .pt-bench .row { margin-bottom: 3px !important; } .pt-bench .row .muted { display: none; } .bench { flex-wrap: nowrap; overflow-x: auto; } .slot { width: 46px; height: 58px; flex: 0 0 auto; } .slot img { height: 66px; }
  .grid6 { grid-template-columns: repeat(3, 1fr); } .grid3 { grid-template-columns: 1fr 1fr; }
  .dg-left { left: 6px; right: 6px; width: auto; bottom: auto; height: 25vh; } .dg-left > header { padding-left: 58px; } .dg-dock { left: 6px; right: 6px; bottom: 6px; } .dg-top { left: 6px; right: 6px; top: calc(var(--bar) + 25vh + 12px); }
  .dg-dock h2 { font-size: 18px !important; } .dg-dock .btn.big { min-height: 40px; padding: 6px 16px; font-size: 14px; } .dg-dock p { display: none; }
  .levels, .dg-left .col { gap: 5px; } .lvlcard { min-height: 0; padding: 7px 9px; } .lvlcard .mons { display: none; } .lvlcard .n { font-size: 22px; }
  .path .rm { width: 38px; height: 38px; font-size: 14px; } .path .rm.boss { width: 46px; height: 46px; } .path .ln { width: 16px; } .path .ln.rest::after { font-size: 8px; transform: translateY(-13px); } .path.panel { padding: 6px 10px !important; }
  .modal-body { padding: 10px; } .sheet .body > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; } .wheel { height: 200px; }
  .ini { width: 34px; height: 40px; } .ini img { height: 60px; } .ini.on { width: 42px; height: 48px; } .roundchip { font-size: 10px; padding: 2px 5px; } .ctrl { top: 96px; right: 6px; }
}
@media (max-width: 900px) {
  :root { --bar: 50px; } nav.tabs button { min-width: 0; padding: 0 12px; font-size: 12.5px; height: 40px; } .gname { font-size: 14px; } .xp { width: 60px; } #top { padding-left: 70px; gap: 8px; } #crest { width: 50px; }
  .side { left: 8px; right: 8px; width: auto; top: auto; height: 56vh; } .frames { left: 6px; right: 6px; gap: 5px; } .frame { width: auto; flex: 1; padding-left: 8px; min-height: 52px; } .frame .pt { display: none; } .frame .cond { left: 6px; } .log { display: none; } .inibar { max-width: calc(100vw - 16px); top: 44px; } .caption { top: 110px; font-size: 17px; }
}
