/* ui-screens.css - full-screen scenes (title, hub) and framed windows (class pick, armory, vendor, smith, enchant, rest, tome, pause, results, settings, credits). */
#ui-screen { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.screen { position: absolute; inset: 0; display: flex; align-items: safe center; justify-content: center; padding: 1em; pointer-events: auto; background: radial-gradient(ellipse at center, rgba(0, 0, 0, .62), rgba(0, 0, 0, .86)); overflow: auto; }
.screen.bare { padding: 0; background: #0a0806; display: block; overflow: auto; }

/* ---- framed window (real inset frame + dark dialog fill) ---- */
.win { width: min(100%, 46em); max-height: 100%; display: flex; flex-direction: column; margin: auto; background: #0b0907 url("../assets/ui/dialog-dark.png") repeat; border: 8px solid transparent; border-image: url("../assets/ui/inset-9slice.png") 8 / 8px stretch; box-shadow: 0 1em 3em rgba(0, 0, 0, .7); }
.win.wide { width: min(100%, 66em); } .win.narrow-win { width: min(100%, 38em); }
.win-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1em; padding: .8em 1em .6em; border-bottom: 1px solid #3a3020; }
.win-title { margin: 0; font: 700 1.55em/1.1 var(--serif); color: #f6e3a0; letter-spacing: .03em; text-shadow: 0 2px 0 #000; }
.win-sub { margin: .3em 0 0; color: var(--muted); font-size: .92em; }
.win-body { padding: .9em 1em; overflow: auto; min-height: 0; flex: 1; }
.win-actions { display: flex; flex-wrap: wrap; gap: .6em; align-items: center; justify-content: flex-end; padding: .7em 1em .8em; border-top: 1px solid #3a3020; }
.win.won .win-title { color: #9dffb0; } .win.lost .win-title { color: #ff9c8c; }
.warn { margin-right: auto; color: #ffb4a6; }
.sell { margin-right: auto; color: var(--muted); }

/* ---- title ---- */
.title-scene { position: relative; min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 1.5em 1em 1em; gap: 1em; overflow: hidden; }
.title-art, .hub-art { position: absolute; inset: 0; z-index: 0; background: linear-gradient(#0d1424 0%, #221a2b 45%, #3a2a22 100%); }
.title-art::after, .hub-art::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46%; background: url("../assets/backdrops/westfall_far.png") center bottom / auto 100% repeat-x; image-rendering: pixelated; opacity: .95; mask-image: linear-gradient(transparent, #000 35%); -webkit-mask-image: linear-gradient(transparent, #000 35%); }
.title-art::before, .hub-art::before { content: ""; position: absolute; inset: 0; background: url("../assets/backdrops/westfall_sky.png") center top / cover no-repeat; image-rendering: pixelated; opacity: .55; }
.title-box { position: relative; z-index: 1; margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .8em; padding: .5em 1em; }
.eyebrow { margin: 0; font: 700 max(10.5px, .75em) var(--sans); letter-spacing: .3em; text-transform: uppercase; color: #c9a85a; }
.logo { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: .95; font: 700 clamp(2.2em, min(9vw, 11vh), 4.6em) var(--serif); color: #f6e3a0; text-shadow: 0 .04em 0 #000, 0 0 .5em rgba(240, 180, 60, .35); letter-spacing: .02em; }
.logo .of { font-size: .62em; color: #e0c27a; letter-spacing: .12em; margin-top: .08em; }
.tag { margin: 0; max-width: 28em; color: #d9cfb4; font-size: 1.05em; text-shadow: 0 1px 2px #000; }
.menu { display: flex; flex-direction: column; align-items: center; gap: .6em; width: 100%; margin-top: .4em; }
.best { margin: 0; color: #a39a82; font-size: max(10.5px, .85em); }
.title-scene .legal, .hub-scene .legal { position: relative; z-index: 1; padding: .5em .8em; background: rgba(8, 6, 4, .78); border-radius: .3em; color: #b5ad98; align-self: center; }

/* ---- hub ---- */
.hub-scene { position: relative; min-height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 1em; padding: 1.4em 1.2em 1em; overflow: hidden; }
.hub-main { position: relative; z-index: 1; width: min(100%, 52em); margin: auto; }
.hub-head { margin-bottom: 1em; }
.hub-grid { display: grid; grid-template-columns: minmax(0, 17em) minmax(0, 1fr); gap: 1.2em; align-items: start; }
.hub-menu { display: flex; flex-direction: column; gap: .7em; align-items: flex-start; }
.hub-card { padding: 1em; background: rgba(12, 9, 6, .88); border: 8px solid transparent; border-image: url("../assets/ui/inset-9slice.png") 8 / 8px stretch; }
.hub-hero { display: flex; gap: .8em; align-items: center; margin-bottom: .8em; } .hub-hero .cn { font: 700 1.2em var(--serif); display: block; } .hub-hero small { color: var(--muted); }
.marks-row { display: flex; align-items: center; gap: .6em; padding: .5em 0; margin-bottom: .4em; border-bottom: 1px solid #3a3020; font-size: 1.15em; } .marks-row b { font-size: 1.4em; color: #bcdcff; }

/* ---- class pick ---- */
.cls-layout { display: grid; grid-template-columns: minmax(0, 20em) minmax(0, 1fr); gap: 1em; }
.cls-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5em; align-content: start; }
.cls-card { pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .3em; padding: .55em .3em; background: #14100b; border: 2px solid #3a3020; border-radius: .35em; color: var(--ink); font: 700 max(10.5px, .85em) var(--serif); }
.cls-card .cn { color: var(--cc); } .cls-card:hover { border-color: #7a6638; } .cls-card.on { border-color: var(--cc); background: #1e1810; box-shadow: 0 0 .8em color-mix(in srgb, var(--cc) 45%, transparent); }
.cls-detail { min-width: 0; padding: .2em .2em .2em .6em; border-left: 3px solid var(--cc); }
.cls-top { display: flex; gap: .8em; align-items: center; } .cname { margin: 0; font: 700 1.5em var(--serif); color: var(--cc); } .lore { margin: .2em 0 0; color: #d3cab0; font-style: italic; }
.cls-stats { display: flex; flex-wrap: wrap; gap: .4em 1em; margin: .6em 0 0; color: var(--muted); font-size: .88em; }
.start-gear { display: flex; align-items: center; gap: .5em; flex-wrap: wrap; font-weight: 700; }
.lines { display: flex; flex-wrap: wrap; gap: .4em; margin-top: .5em; } .lchip { display: inline-flex; align-items: center; gap: .35em; padding: .15em .6em .15em .15em; background: #17130d; border: 1px solid #3d3322; border-radius: 1em; font-size: max(10.5px, .85em); font-weight: 600; }
.abs { list-style: none; margin: 0; padding: 0; display: grid; gap: .5em; }
.ab { display: flex; gap: .6em; align-items: flex-start; } .ab p { margin: .1em 0 0; color: #cfc6ac; font-size: .88em; } .ab small { color: var(--muted); display: block; } .ab.dim { opacity: .45; }

/* ---- shop / station lists ---- */
.shop-top { display: flex; flex-wrap: wrap; gap: .6em 1.2em; justify-content: space-between; align-items: center; margin-bottom: .7em; } .you { display: inline-flex; gap: .4em; align-items: center; color: var(--muted); } .you b { color: #bcdcff; }
.shop-list, .lp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4em; }
.shop-row, .lp-row { display: flex; align-items: center; gap: .7em; padding: .5em .6em; background: #14100b; border: 1px solid #2f281b; border-radius: .35em; }
.shop-row.owned { opacity: .6; } .shop-row.locked { opacity: .45; } .lp-row.off { opacity: .7; }
.shop-row .info, .lp-row .info { flex: 1; min-width: 0; } .info b { display: block; } .info p { margin: .15em 0 0; color: #cfc6ac; font-size: .88em; } .info small { display: block; color: var(--muted); } .info small.why { color: #e0a090; }
.buy { display: flex; align-items: center; gap: .7em; flex-wrap: wrap; justify-content: flex-end; } .owned { color: var(--good); font-weight: 700; }
.empty { padding: 1.5em; text-align: center; color: var(--muted); list-style: none; }
.lp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14em, 22em); gap: 1em; align-items: start; }
.lp-pane { position: sticky; top: 0; } .enchant-sel { margin-bottom: .7em; }

/* ---- compare prompt ---- */
.cmp { display: flex; flex-wrap: wrap; gap: 1em; justify-content: center; align-items: flex-start; }
.cmp-col { display: flex; flex-direction: column; gap: .6em; align-items: stretch; max-width: 22em; flex: 1 1 15em; } .cmp-col .rbtn { align-self: center; }
.cmp-col.found .tt { box-shadow: 0 0 1em rgba(240, 200, 75, .25); }
.verdict { text-align: center; font-weight: 700; padding: .2em; } .verdict.up { color: var(--good); } .verdict.down { color: var(--bad); }

/* ---- pause ---- */
.pause { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14em, 21em); gap: 1em; align-items: start; }
/* desktop: the whole pause menu fits the screen (owner ruling 11-25: "bring the whole menu up and downsize, not scroll"). The window takes the full height, the body is a size container, the doll shrinks to the body's height and the skills sit beside it. */
.ui:not(.narrow):not(.short) .win.pausewin { height: 100%; } .ui:not(.narrow):not(.short) .pausewin .win-body { container-type: size; overflow: hidden; }
.ui:not(.narrow):not(.short) .pausewin .pause { height: 100%; grid-template-columns: minmax(0, 1fr) minmax(12em, 19em); } .ui:not(.narrow):not(.short) .pausewin .lp-pane { max-height: 100cqh; overflow: auto; }
.ui:not(.narrow):not(.short) .pz-left { display: grid; grid-template-columns: auto minmax(9em, 1fr); gap: 1em; align-items: start; min-height: 0; } .ui:not(.narrow):not(.short) .pz-side { max-height: 100cqh; overflow: auto; } .ui:not(.narrow):not(.short) .pz-side .gslots.two { max-width: 14em; }
.ui:not(.narrow):not(.short) .pausewin .pdoll { width: min(30em, 44cqw, calc((100cqh - 3.2em) * .95)); max-width: none; margin: 0; }
/* phone portrait: same idea, the paper doll takes at most 40% of the body height (never wider than the body) so the skills, supplies and tooltip pane fit under it; the body still scrolls as a safety net if a long supply list does not. */
.ui.narrow:not(.short) .win.pausewin { height: 100%; } .ui.narrow:not(.short) .pausewin .win-body { container-type: size; }
.ui.narrow:not(.short) .pausewin .pdoll { width: min(100cqw, calc(100cqh * .40)); max-width: none; margin: 0 auto .4em; }
.gslots { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5em; } .gslots.two { grid-template-columns: repeat(2, 1fr); max-width: 50%; }
.gslot { pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .25em; padding: .4em .2em; background: #14100b; border: 1px solid #2f281b; border-radius: .35em; color: var(--muted); font-size: max(10.5px, .78em); font-weight: 600; }
.pdoll { aspect-ratio: 348 / 366; position: relative; container-type: inline-size; overflow: hidden; width: 100%; max-width: min(26em, max(14em, calc((100vh - 17em) * .95))); margin: 0 auto .6em; background: #000; }
.pdoll > * { position: absolute; } .pd-frame { display: block; pointer-events: none; } .pd-hero { background-repeat: no-repeat; pointer-events: none; image-rendering: auto; }
.pdslot { padding: 0; border: 0; background: none; cursor: pointer; font-size: 1em; } .pdslot > * { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pdslot .ico { font-size: calc(100cqw / 348 * 44 / 2.7); } .pdslot:hover::after, .pdslot:focus-visible::after { content: ""; position: absolute; inset: 0; background: url("../assets/ui/slot-hover.png") center / 100% 100% no-repeat; pointer-events: none; }
.pdslot:focus-visible { outline: 2px solid #ffd060; outline-offset: 1px; } .pdslot.empty .pd-empty { opacity: .9; }
.gslot:hover { border-color: #7a6638; color: #fff; } .gslot.empty { opacity: .55; }
.cons-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4em; } .cons { display: flex; align-items: center; gap: .6em; } .cons > div { flex: 1; min-width: 0; } .cons small { display: block; color: var(--muted); }

/* ---- results / rest / tome / settings / credits ---- */
.results { display: flex; flex-direction: column; gap: .8em; } .res-top { display: flex; gap: .8em; align-items: center; } .res-top small { display: block; color: var(--muted); text-transform: capitalize; }
.res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 2em; }
.res-marks { display: flex; align-items: center; gap: .7em; flex-wrap: wrap; padding: .6em; background: #101826; border: 1px solid #2c4366; border-radius: .35em; } .res-marks small { display: block; color: var(--muted); }
.res-gear { display: flex; flex-wrap: wrap; gap: .35em; } .results .lines { color: var(--muted); margin: 0; }
.rest { display: flex; flex-direction: column; align-items: center; gap: .8em; text-align: center; padding: .6em 0; }
.tomes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7em; } .tome-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4em; padding: .8em .5em; background: #14100b; border: 1px solid #3a3020; border-radius: .35em; } .tome-card h3 { margin: 0; font: 700 1.1em var(--serif); } .tome-card p { margin: 0; color: var(--muted); font-size: max(10.5px, .85em); } .tome-card .now { color: #f6e3a0; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2em; } .set-col { min-width: 0; }
.set-row { display: flex; align-items: center; gap: .8em; padding: .45em 0; border-bottom: 1px solid rgba(255, 255, 255, .06); } .set-row > span { flex: 1; } .set-row input[type=range] { flex: 1.4; accent-color: #d9a82a; min-width: 6em; pointer-events: auto; } .set-row output { min-width: 3em; text-align: right; color: var(--muted); } .set-row.tg input { width: 1.3em; height: 1.3em; accent-color: #d9a82a; pointer-events: auto; }
.set-row select { pointer-events: auto; background: #14100b; color: var(--ink); border: 1px solid #5a4b2e; border-radius: .3em; padding: .4em; font: inherit; max-width: 55%; }
.controls { display: grid; grid-template-columns: auto 1fr; gap: .35em 1em; margin: 0; } .controls dt { color: var(--muted); } .controls dd { margin: 0; font-weight: 600; }
.credits p { margin: 0 0 .9em; color: #d9cfb4; } .credits .strong { color: #fff3c0; }

/* ---- phones and short screens ---- */
.ui.narrow .screen { padding: .5em; align-items: flex-start; } .ui.short .screen { padding: .3em; align-items: flex-start; } .ui.short .win { max-height: none; margin: 0 auto; }   /* landscape phone: windows start at the top edge and the screen scrolls, nothing is cut off */ .ui.narrow .win { border-width: 6px; }
.ui.narrow .win-title { font-size: 1.3em; } .ui.narrow .hub-grid, .ui.narrow .cls-layout, .ui.narrow .lp, .ui.narrow .pause, .ui.narrow .settings { grid-template-columns: minmax(0, 1fr); }
.ui.narrow .lp-pane { position: static; } .ui.narrow .gslots { grid-template-columns: repeat(4, 1fr); } .ui.narrow .gslots.two { max-width: none; } .ui.narrow .tomes { grid-template-columns: 1fr; }
.ui.narrow .tome-card { flex-direction: row; text-align: left; flex-wrap: wrap; } .ui.narrow .cls-grid { grid-template-columns: repeat(3, 1fr); } .ui.narrow .res-grid { grid-template-columns: 1fr; }
.ui.narrow .rbtn.wide { max-width: none; } .ui.narrow .hub-menu { align-items: stretch; } .ui.narrow .shop-row, .ui.narrow .lp-row { flex-wrap: wrap; } .ui.narrow .buy { width: 100%; justify-content: space-between; }
.ui.narrow .win-body { padding: .7em; } .ui.narrow .cls-detail { border-left: 0; border-top: 3px solid var(--cc); padding: .6em 0 0; }
.ui.narrow .win-actions .rbtn { flex: 1 1 auto; } .ui.narrow .warn, .ui.narrow .sell { flex-basis: 100%; }
