/* Openable windows and the pieces inside them: lists, slots, recipes, quests, forms. */

#windows { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
/* sits a little above centre so the roll button stays visible underneath */
.win { position: absolute; left: 50%; top: calc(50% - 36px); display: flex; flex-direction: column; width: min(940px, calc(100vw - 20px)); height: min(620px, calc(100vh - 130px)); transform: translate(-50%, -50%); pointer-events: auto; animation: win-in .16s ease-out; }
.win.narrow { width: min(620px, calc(100vw - 20px)); }
.win.closing { animation: win-out .12s ease-in forwards; }
@keyframes win-in { from { opacity: 0; transform: translate(-50%, -47%); } }
@keyframes win-out { to { opacity: 0; transform: translate(-50%, -47%); } }

.win-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 16px; background: var(--panel2); border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
.win-head h2 { margin: 0; font: 700 19px var(--head); }
.win-head h2 small { margin-left: 10px; font: 400 13px var(--body); color: var(--dim); }
.x { width: 30px; height: 30px; font-size: 20px; line-height: 1; color: var(--dim); background: none; border: 0; border-radius: var(--r); }
.x:hover { color: #fff; background: #a8403a; }
.win-body { flex: 1; min-height: 0; padding: 14px 16px; overflow: auto; }
.win-foot { padding: 6px 16px; font-size: 12px; color: var(--dim); border-top: 1px solid var(--line2); }

.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.sec { margin: 18px 0 8px; padding-bottom: 4px; font: 700 14px var(--head); border-bottom: 1px solid var(--line2); }
.sec:first-child { margin-top: 0; }
.note { font-size: 13px; line-height: 1.5; color: var(--dim); }
.empty { padding: 30px 10px; text-align: center; color: var(--dim); }
.hist { max-height: 120px; overflow: auto; font-size: 12px; color: var(--dim); }
.callout { margin: 8px 0; padding: 8px 12px; font-size: 13px; line-height: 1.5; background: var(--inset); border-left: 3px solid var(--accent); }
.callout.info { border-left-color: var(--disc); }

/* ---------- list rows (inventory, shops, recipes, leaderboard) ---------- */
.row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; padding: 9px 12px; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r); }
.row .main { flex: 1; min-width: 0; }
.row .main b { font: 600 15px var(--head); }
.row.ann { border-color: var(--accent-low); }
.swatch { flex: none; width: 10px; height: 36px; background: var(--c); border-radius: 2px; }
.ing { display: inline-block; margin: 4px 4px 0 0; padding: 1px 7px; font-size: 12px; background: var(--inset); border: 1px solid var(--line2); border-radius: 2px; }
.ing.ok { color: var(--good); border-color: #3f6e49; }
.ing.no { color: var(--bad); border-color: #7d3d39; }
.bar2 { height: 6px; margin-top: 4px; background: var(--inset); border: 1px solid var(--line2); }
.bar2 i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.bar2.done i { background: var(--good); }
@keyframes brew { to { width: 100%; } }

/* ---------- aura slots ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 8px; }
.card { --r: var(--line); position: relative; padding: 8px 10px; background: var(--panel2); border: 1px solid var(--line2); border-left: 4px solid var(--r); border-radius: var(--r); }
.card:hover { border-color: var(--line); border-left-color: var(--r); }
.card.unseen { background: var(--panel); }
.card.locked { opacity: .55; }
.card.eq { outline: 2px solid var(--accent); outline-offset: -2px; }
.card .nm { display: flex; justify-content: space-between; gap: 6px; font: 600 15px var(--head); }
.card .meta { margin-top: 2px; font-size: 12px; color: var(--dim); }
.card .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.star { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; vertical-align: -2px; }
.star.on { fill: var(--accent); stroke: var(--accent); }

/* ---------- quests and NPC headers ---------- */
.npc-head { display: flex; align-items: center; gap: 12px; margin: 14px 0 8px; }
.npc-head.cur-npc { outline: 2px solid var(--accent); outline-offset: 6px; }
.npc-av { display: grid; place-items: center; width: 46px; height: 46px; font: 700 22px var(--head); color: #fff; border: 2px solid var(--edge); border-radius: var(--r); text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.npc-head .nm { font: 700 17px var(--head); }
.say { margin: 6px 0; padding: 8px 12px; font-size: 14px; line-height: 1.55; background: var(--inset); border-left: 3px solid var(--c, var(--accent)); }
.qrow { margin-bottom: 8px; padding: 9px 12px; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r); }
.qrow.ready { border-left: 4px solid var(--accent); }
.qrow.done { opacity: .6; }
.qrow.locked { opacity: .45; }
.qrow .qhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qrow .qhead b { font: 600 15px var(--head); }
.qrow .acts { margin-top: 6px; }
.qrow .reward { margin-top: 6px; }
.obj { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 13px; }
.obj.done { color: var(--good); }
.riddle-text { font: 600 18px var(--head); color: var(--accent); }
.bullets { margin: 0; padding-left: 18px; }

/* ---------- biomes, stats, settings ---------- */
.biome-card { align-items: flex-start; border-left: 5px solid var(--c); }
.biome-card .nm { font: 700 17px var(--head); color: var(--c); }
.row.tod { border-left: 5px solid var(--c); }
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-table td { padding: 5px 8px; border-bottom: 1px solid var(--line2); }
.stat-table td:last-child { text-align: right; color: var(--accent); font-variant-numeric: tabular-nums; }
.slider { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.slider label { width: 190px; font-size: 14px; }
.slider input[type=range] { flex: 1; }
.slider .val { width: 64px; text-align: right; }
.slider.tick { cursor: pointer; }
.slider.tick label { cursor: pointer; }
.slider .txt { flex: 1; min-width: 0; padding: 5px 8px; background: var(--inset); border: 1px solid var(--line2); border-radius: var(--r); }
.slider .txt:focus { outline: none; border-color: var(--accent); }
.tools.biome-pick .btn { border-left-width: 4px; }

/* scrolling sub-lists inside a window (chat history, rooms) */
.keep-scroll { display: flex; flex-direction: column; gap: 3px; max-height: 56vh; overflow-y: auto; }
.keep-scroll .row { padding: 4px 8px; margin: 0; }
.keep-scroll.short { max-height: 38vh; }

/* ---------- admin ---------- */
.win.admin { border-color: #c9703f; }
.win.admin .win-head { background: #2c1f17; }
.win.admin .win-head h2 { color: #f0a070; }
.admin-warn { margin-bottom: 10px; padding: 6px 10px; font-size: 12px; line-height: 1.5; background: rgba(201, 112, 63, .1); border-left: 3px solid #c9703f; }
.admin-list { max-height: 330px; overflow: auto; border: 1px solid var(--line2); }
.admin-item { display: flex; align-items: center; gap: 8px; padding: 4px 8px; font-size: 13px; border-bottom: 1px solid var(--line2); }
.admin-item:hover { background: var(--panel2); }
.admin-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item .have { width: 80px; text-align: right; color: var(--accent); }

/* ---------- customization tab ---------- */
.look-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; padding: 8px 4px 16px; }
.look-prev { position: relative; flex: none; width: 22px; height: 30px; margin: 40px 56px 6px; transform: scale(2.2); transform-origin: 50% 100%; cursor: pointer; }
.look-prev .fig { filter: none; }
.look-form { flex: 1; min-width: 240px; }
.swatch-in { width: 56px; height: 30px; padding: 2px; background: var(--inset); border: 1px solid var(--line2); border-radius: var(--r); cursor: pointer; }

/* moderation: ban / lock screen, chat row tools, report button on the player board */
.modbox { text-align: left; }
.modbox h2 { color: var(--bad); }
.modbox .kv { margin: 0 0 6px; }
.modbox .warn { margin-top: 12px; color: var(--dim); font-size: 13px; }
.rowtools { float: right; display: inline-flex; gap: 4px; }
.flagged { color: #ff6b6b; }
.tr-board .rw .rep { display: none; margin-left: 6px; padding: 0 5px; font-size: 10px; line-height: 16px; background: transparent; color: var(--dim); border: 1px solid var(--line); cursor: pointer; }
.tr-board .rw:hover .rep, .tr-board .rw .rep:focus { display: inline-block; }
.tr-board .rw .rep:hover { color: var(--ink); border-color: var(--accent); }


/* ---------- Inventory (WebSol chrome, Sol-style layout) ---------- */
.inv-layout { display: flex; gap: 14px; align-items: flex-start; min-height: 0; }
.inv-main { flex: 1; min-width: 0; }
.inv-detail { width: 220px; flex-shrink: 0; padding: 12px; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r); position: sticky; top: 0; }
.inv-preview { display: flex; align-items: center; justify-content: center; height: 120px; margin-bottom: 10px; }
.inv-ico, .inv-ico-wrap { width: 88px; height: 88px; object-fit: contain; image-rendering: auto; }
.inv-ico-fallback { display: inline-block; width: 48px; height: 48px; border-radius: 8px; }
.inv-detail-name { display: block; margin-bottom: 6px; font: 700 15px var(--head); }
.inv-amt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 8px 0; }
.inv-amt input { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; }
.inv-search { width: 100%; margin-bottom: 10px; padding: 8px 10px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); font: 14px var(--body); }
.inv-tiles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.inv-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 96px; padding: 8px 6px; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r); color: var(--ink); cursor: pointer; font: 12px var(--body); }
.inv-tile:hover { border-color: var(--accent-low); }
.inv-tile.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-low); }
.inv-tile.eq { outline: 1px solid var(--good, #6c6); }
.inv-tile .inv-ico, .inv-tile .inv-ico-wrap { width: 48px; height: 48px; }
.inv-tile .inv-ico-fallback { width: 36px; height: 36px; }
.inv-tile-name { text-align: center; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-tile-n { color: var(--dim); font-size: 11px; }
.inv-equipped { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.inv-slot { flex: 1 1 120px; min-width: 0; padding: 6px 8px; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r); font-size: 12px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-slot b { font-weight: 600; }
.inv-gear-grids { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 720px) {
  .inv-layout { flex-direction: column; }
  .inv-detail { width: 100%; position: static; }
}

/* Fischl's gamepasses */
.passgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 10px; }
.pass { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel2); }
.pass .pn { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pass .pd { flex: 1; font-size: 13px; line-height: 1.35; }
.pass .pf { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pass.done { opacity: .7; }
.pass .btn:disabled { filter: grayscale(1); cursor: not-allowed; }
