/* Inter (SIL Open Font Licence, css/fonts/Inter-OFL.txt): the same letterforms on Windows, macOS, Linux and Steam Deck */
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-800-normal.woff2") format("woff2"); font-weight: 800 900; font-display: swap; }
:root {
  color-scheme: dark;
  --bg: #12100e; --bg2: #1b1815; --card: #221e1a; --card2: #2a2521; --line: #3a332c;
  --text: #e8e0d2; --dim: #9c9283; --gold: #e6b84a; --red: #d9534f; --green: #6cbf5a; --blue: #5aa5d9; --orange: #e08a3c; --purple: #a883d9;
  --radius: 10px;
}
* { box-sizing: border-box; }
button, input, select, textarea { font-family: inherit; }
small { font-size: max(12px, .85em); } /* readable minimum on every screen */
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: var(--gold); cursor: pointer; text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 17px; margin: 18px 0 8px; color: var(--gold); }
h3 { font-size: 15px; margin: 0 0 8px; } h4 { margin: 0 0 6px; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
p { margin: 6px 0; }
.dim { color: var(--dim); } .small { font-size: 12px; }
#app { display: grid; grid-template-columns: 210px 1fr 340px; grid-template-rows: 52px 1fr; height: 100%; }
#topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: var(--bg2); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 17px; color: var(--gold); cursor: pointer; border-radius: 6px; } .brand:hover { filter: brightness(1.15); } .brand span { color: var(--dim); font-weight: 400; font-size: 13px; margin-left: 4px; }
.tb { font-weight: 600; } .tb.grow { flex: 1; } .hpwrap { width: 180px; }
#tb-gold { color: var(--gold); }
#sidebar { background: var(--bg2); border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; }
#sidebar button { display: flex; justify-content: space-between; width: 100%; background: none; border: 0; color: var(--text); text-align: left; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
#sidebar button:hover { background: var(--card2); } #sidebar button.on { background: var(--card2); color: var(--gold); }
#sidebar .lvl { color: var(--dim); font-variant-numeric: tabular-nums; }
.navhead { font-size: 12px; color: var(--dim); letter-spacing: .1em; margin: 12px 10px 4px; }
#content { overflow-y: auto; padding: 18px 22px; }
#save-status { display:inline-flex; flex:0 1 auto; flex-direction:column; justify-content:center; gap:2px; min-width:0; max-width:220px; color:var(--dim); font-size:11px; line-height:1.2; }
#save-status b { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#save-status[data-tone="ok"] { color:#8fcf88; } #save-status[data-tone="busy"] { color:#e5c56f; } #save-status[data-tone="bad"] { color:#f08d83; }
#save-status-detail { display:block; max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.save-confidence { display:flex; align-items:flex-start; gap:8px; padding:8px 10px; border:1px solid var(--line); border-radius:7px; margin:8px 0; color:var(--dim); }
.save-confidence[data-tone="ok"] { color:#8fcf88; } .save-confidence[data-tone="busy"] { color:#e5c56f; } .save-confidence[data-tone="bad"] { color:#f08d83; }
#right { background: var(--bg2); border-left: 1px solid var(--line); overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; position: relative; }
#right .card { margin: 0; flex-shrink: 0; }
#right > * { flex-shrink: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 10px; }
.card.current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.card.locked { opacity: .55; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed var(--line); } .kv span { color: var(--dim); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; margin-top: 6px; }
.pill { display: inline-block; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-size: 12px; color: var(--dim); vertical-align: middle; }
.pill.act { color: var(--gold); border-color: var(--gold); }
.itag { display: inline-block; background: var(--card2); border-radius: 6px; padding: 1px 6px; font-size: 12px; margin: 1px 0; }
.btn { background: var(--gold); color: #1a1507; border: 0; border-radius: 7px; padding: 7px 13px; font-weight: 700; cursor: pointer; font-size: 13px; }
.btn:hover { filter: brightness(1.1); } .btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.alt { background: var(--card2); color: var(--text); border: 1px solid var(--line); }
.btn.stop { background: var(--red); color: #fff; } .btn.small { padding: 5px 10px; font-size: 12px; }
.mini { background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer; }
.mini.on { border-color: var(--gold); color: var(--gold); }
.bar { position: relative; height: 18px; background: #0d0b09; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.bar.sm { height: 6px; border-radius: 3px; } .bar.big { height: 28px; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); transition: width .1s linear; }
.bar.xp .bar-fill { background: var(--purple); } .bar.hp .bar-fill { background: var(--green); } .bar.hp.mon .bar-fill { background: var(--red); }
.bar-fill.gold { background: var(--gold); } .bar-fill.blue { background: var(--blue); } .bar-fill.red { background: var(--red); } .bar-fill.orange { background: var(--orange); }
.bar-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; text-shadow: 0 1px 2px #000; }
.bar.stunned { border-color: var(--red); }
.focuswin { position: absolute; top: 0; bottom: 0; background: rgba(230,184,74,.35); border-left: 1px solid var(--gold); border-right: 1px solid var(--gold); }
.focusbtn { width: 100%; margin: 6px 0; font-size: 15px; padding: 10px; } .focusbtn.used { opacity: .5; }
.toggle { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
.modetoggle { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; margin: 4px 0 8px 8px; }
.modetoggle button { background: var(--card2); color: var(--dim); border: 0; padding: 6px 12px; cursor: pointer; }
.modetoggle button.on { background: var(--gold); color: #1a1507; font-weight: 700; }
.actions, .mons, .dlist, .shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px; }
.dlist { grid-template-columns: 1fr; }
.ahead { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; } .aicon { font-size: 28px; width: 40px; text-align: center; }
.cost { font-size: 12px; margin: 4px 0; } .cost .ok { color: var(--green); } .cost .lack { color: var(--red); }
.out { margin: 4px 0; } .mastery { display: flex; align-items: center; gap: 6px; margin: 6px 0; font-size: 12px; color: var(--dim); } .mastery .bar { flex: 1; }
.action .btn, .mon .btn, .dung .btn, .shopitem .btn { margin-top: 6px; }
.drops { font-size: 12px; margin: 4px 0; }
.rooms { display: flex; gap: 4px; margin: 6px 0; flex-wrap: wrap; }
.room { width: 30px; height: 30px; display: grid; place-items: center; background: var(--card2); border: 1px solid var(--line); border-radius: 6px; font-size: 16px; }
.room.now { border-color: var(--gold); box-shadow: 0 0 8px var(--gold); } .room.done { opacity: .35; }
.zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }
.zone.here { border-color: var(--green); } .zhead { display: flex; gap: 10px; align-items: center; } .zicon { font-size: 34px; }
.zbody { margin: 8px 0; font-size: 13px; } .zbody div { margin: 2px 0; }
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.slot { background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; cursor: pointer; min-height: 88px; }
.slot .ic { font-size: 26px; } .slot .nm { font-size: 12px; font-weight: 600; } .slot .st { font-size: 12px; color: var(--dim); } .slot .dim { opacity: .5; }
.skillgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 8px; }
.skillcell { background: var(--card2); border-radius: 8px; padding: 8px; cursor: pointer; } .skillcell > div:first-child { display: flex; justify-content: space-between; margin-bottom: 4px; }
.inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.item { background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 4px; text-align: center; cursor: pointer; position: relative; }
.item:hover { border-color: var(--gold); } .item.locked { opacity: .6; }
.item .ic { font-size: 26px; } .item .q { position: absolute; top: 3px; right: 6px; font-size: 12px; color: var(--gold); font-weight: 700; } .item .nm { font-size: 12px; line-height: 1.2; margin-top: 4px; }
.filters { margin-bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.party { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.comp { display: flex; gap: 8px; align-items: center; background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; cursor: pointer; }
.comp.sel { border-color: var(--gold); } .comp.locked { opacity: .5; }
#activity { min-height: 120px; }
.fighters { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin: 8px 0; }
.fighter .fname { font-weight: 600; font-size: 13px; margin-bottom: 4px; } .vs { font-size: 20px; }
.tele { color: var(--red); font-weight: 700; font-size: 12px; animation: blink .4s infinite alternate; }
@keyframes blink { from { opacity: .5 } to { opacity: 1 } }
.splats { display: flex; gap: 4px; flex-wrap: wrap; min-height: 22px; margin: 4px 0; }
.splat { padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.splat.p { background: #2b4a2b; color: #9fe08f; } .splat.p.crit { background: #6b4a10; color: var(--gold); } .splat.m { background: #4a2b2b; color: #ff9c9c; }
.splat.miss { opacity: .5; } .splat.block { background: #2b3a4a; color: #9fd0ff; } .splat.ally { background: #2b3a4a; color: #a4c8ff; } .splat.heal { background: #2b4a3a; color: #8ff0c0; }
.abilities { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 8px 0 4px; }
.ab { position: relative; background: var(--card2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 6px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.ab:hover { border-color: var(--gold); } .ab.cd { opacity: .45; cursor: default; } .ab.up { border-color: var(--blue); box-shadow: 0 0 8px var(--blue); }
.ab .key { position: absolute; top: 2px; left: 5px; font-size: 12px; color: var(--dim); } .ab .ic { font-size: 18px; } .ab .nm { font-size: 12px; } .ab .cdt { font-size: 12px; color: var(--gold); }
.event { background: var(--card2); border: 1px solid var(--gold); border-radius: 8px; padding: 10px; margin: 8px 0; }
.event.mech { border-color: var(--red); } .warn { color: var(--red); font-weight: 700; margin: 0; }
.event.mech.assisted { border-color: #79b8c4; } .event.mech.assisted .warn { color: #a7dce4; } .assist-note { margin: 4px 0 8px; color: #a7dce4; font-size: 12px; } .assist-setting { align-items: flex-start; flex-wrap: wrap; } .assist-setting input { margin-top: 3px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; width: 100%; margin: 4px 0; text-align: left; }
.choice small { font-weight: 400; opacity: .8; }
.mechopts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .mechopts .choice { flex-direction: row; gap: 6px; align-items: center; }
#log { max-height: 320px; overflow-y: auto; font-size: 12px; } .ll { padding: 2px 0; border-bottom: 1px solid #2a2521; color: var(--dim); }
.ll.good { color: var(--green); } .ll.bad { color: #ff9c9c; } .ll.loot { color: var(--gold); }
#feed { max-height: 200px; overflow-y: auto; font-size: 12px; } .fl { color: var(--dim); padding: 2px 0; } .fl.me { color: var(--gold); }
#floaty { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); font-weight: 800; color: var(--gold); pointer-events: none; opacity: 0; font-size: 18px; text-shadow: 0 2px 6px #000; z-index: 5; }
#floaty.pop { animation: pop 1s ease-out forwards; } #floaty.miss { color: var(--red); }
@keyframes pop { 0% { opacity: 1; transform: translate(-50%, 0) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -40px) scale(1); } }
#toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 50; pointer-events: none; align-items: flex-end; }
.toast { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; opacity: 0; transform: translateX(10px); transition: all .3s; font-weight: 600; font-size: 13px; }
.toast.show { opacity: 1; transform: none; } .toast.good { border-color: var(--green); } .toast.bad { border-color: var(--red); }
#modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; z-index: 40; }
#modal.open { display: flex; }
.modalbox { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; width: min(560px, 92vw); position: relative; max-height: 90vh; overflow-y: auto; }
.modalbox .close { position: absolute; top: 10px; right: 10px; } .modalacts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.modalbox textarea { width: 100%; height: 120px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px; font-size: 12px; }
@media (max-width: 1100px) { #app { grid-template-columns: 180px 1fr 300px; } .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { #app { grid-template-columns: 1fr; grid-template-rows: 52px auto 1fr auto; height: auto; } #sidebar { display: flex; flex-wrap: wrap; } #sidebar .navsec { display: flex; flex-wrap: wrap; } #sidebar button { width: auto; } .navhead { width: 100%; } #right { border-left: 0; } }
/* ---- overworld ---- */
.mapwrap { position: relative; display: inline-block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #000; max-width: 100%; }
#map { display: block; cursor: crosshair; image-rendering: pixelated; max-width: 100%; height: auto; }
.maphover { position: absolute; display: none; background: rgba(0,0,0,.8); color: var(--text); font-size: 12px; padding: 3px 8px; border-radius: 6px; pointer-events: none; white-space: nowrap; }
#poipanel { margin-top: 10px; }
.poirow { margin: 6px 0; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.poirow > b { margin-right: 4px; }
.row.left { justify-content: flex-start; }
.rifts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 8px; width: 100%; margin-top: 6px; }
.rift { margin: 0; padding: 10px; }
.affixes { margin: 4px 0; }
.room.elite { border-color: var(--orange); box-shadow: 0 0 6px var(--orange); }
.elite { color: var(--orange); font-weight: 800; }
.floors { display: grid; gap: 6px; margin: 6px 0; }
.floor { background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.floor.now { border-color: var(--gold); }
.talents { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 6px; }
.talent { display: flex; gap: 8px; align-items: flex-start; background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 7px; cursor: pointer; }
.talent:hover { border-color: var(--gold); } .talent.maxed { border-color: var(--green); opacity: .8; } .talent .ic { font-size: 20px; }
.delveacts { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 8px 0; }
.card.boss .bar { margin: 6px 0; }
.card.poi { border-color: var(--gold); }

/* ---- expansion ---- */
.plus { color: var(--gold); font-weight: 800; }
.milestones { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ms { background: var(--card2); border-radius: 6px; padding: 2px 8px; font-size: 12px; } .ms b { color: var(--gold); margin-right: 4px; }
.capes { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; } .mini.dimmed { opacity: .45; }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.achv { display: flex; gap: 8px; align-items: center; margin: 0; opacity: .55; } .achv.got { opacity: 1; border-color: var(--green); } .good { color: var(--green); }
.lb { width: 100%; border-collapse: collapse; } .lb th { text-align: left; color: var(--dim); font-size: 12px; border-bottom: 1px solid var(--line); padding: 4px; } .lb td { padding: 2px 4px; border-bottom: 1px dashed var(--line); vertical-align: middle; } .lb tr.me td { color: var(--gold); font-weight: 700; }
select, input[type=number] { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font-size: 13px; } input[type=number] { width: 90px; }
.splat.fx { background: #3a2b4a; color: #d9b3ff; }

.plots { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.plot { display: flex; flex-direction: column; gap: 6px; } .plot.ready { border-color: var(--green); } .plot .aicon { font-size: 30px; }
.tut li { margin: 6px 0; }
.chat { display: flex; gap: 4px; margin-top: 6px; } .chat input { flex: 1; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 12px; }
input[type=search] { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 12px; }
.loadout { display: inline-flex; gap: 2px; }
.item.r-uncommon { border-color: #4f7a45; } .item.r-rare { border-color: #4a7fb5; } .item.r-epic { border-color: #8e5fc7; } .item.r-legendary { border-color: var(--gold); box-shadow: 0 0 6px rgba(230,184,74,.35); }
/* Rarity remains recognizable without colour: increasingly distinctive border patterns. */
.item.r-uncommon { border-style: dotted; } .item.r-rare { border-style: dashed; } .item.r-epic { border-style: double; } .item.r-legendary { border-style: double; box-shadow: 0 0 6px rgba(230,184,74,.35), inset 0 0 0 1px currentColor; }
#content .character-layout button, #content .character-layout select, #content:has(.character-layout) > h1 button { min-height:44px; }
#content .character-layout input[type="color"] { width:44px; height:44px; padding:3px; }
#content .kv { gap: 8px; } #content .kv > span { flex: 1; min-width: 0; } #content .kv > b { white-space: nowrap; }
@media (max-width: 1100px) { #app { display: flex; flex-direction: column; } #topbar { order: 0; } #sidebar { order: 1; } #content { order: 2; } #right { order: 3; flex-direction: row; flex-wrap: wrap; } #right > .card { flex: 1 1 100%; } #right .card:has(#feed) { display: none; } #right .card:has(#log) { flex-basis: 100%; } #log { max-height: 140px; } }

#hero-name { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 14px; }

/* ---- big map ---- */
.maphead { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; } .maphead h1 { margin: 0; }
#map { cursor: grab; touch-action: none; } #map:active { cursor: grabbing; }
.mapzone { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.6); color: var(--gold); font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 6px; pointer-events: none; }
.worldwrap { position: relative; display: block; width: fit-content; margin: 0 auto; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
#worldmap { display: block; max-width: 100%; max-height: calc(90vh - 190px); width: auto; height: auto; margin: 0 auto; image-rendering: auto; }
.worldwrap { text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--dim); margin-top: 8px; } .legend i { display: inline-block; width: 10px; height: 10px; border: 2px solid; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.modalbox.wide { width: auto; max-width: 96vw; }

/* ---- vector icons & life ---- */
.vi { vertical-align: -0.2em; display: inline-block; } .emo { display: inline-block; line-height: 1; vertical-align: -0.1em; }
#sidebar button .vi { margin-right: 2px; }
.minimap { position: absolute; right: 8px; bottom: 8px; width: 180px; height: 120px; border: 1px solid rgba(255,255,255,.25); border-radius: 6px; background: #000; cursor: pointer; opacity: .9; }
.bar-fill { transition: width .25s ease-out; }
.bar.xp .bar-fill { background: linear-gradient(90deg, #7a5fc0, #a883d9); box-shadow: 0 0 8px rgba(168,131,217,.35) inset; }
.bar.hp .bar-fill { background: linear-gradient(90deg, #4f9d47, #7ad46a); } .bar.hp.mon .bar-fill { background: linear-gradient(90deg, #b8423c, #e35d55); }
.bar.big .bar-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent); animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.splat { animation: splatpop .35s ease-out; } @keyframes splatpop { 0% { transform: scale(1.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.card.current { animation: glow 2.4s ease-in-out infinite; } @keyframes glow { 0%, 100% { box-shadow: 0 0 0 1px var(--gold) inset; } 50% { box-shadow: 0 0 0 1px var(--gold) inset, 0 0 14px rgba(230,184,74,.25); } }
.btn { transition: transform .08s ease, filter .12s ease; } .btn:active { transform: scale(.96); }
.tele { animation: blink .4s infinite alternate, shake .4s infinite; } @keyframes shake { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(2px); } }
.ab.up { animation: guardpulse .8s ease-in-out infinite; } @keyframes guardpulse { 0%, 100% { box-shadow: 0 0 6px var(--blue); } 50% { box-shadow: 0 0 16px var(--blue); } }
.toast { backdrop-filter: blur(4px); }
#topbar { background: linear-gradient(180deg, #211d19, var(--bg2)); }
#sidebar button.on { background: linear-gradient(90deg, rgba(230,184,74,.16), transparent); border-left: 2px solid var(--gold); }
.card { background: linear-gradient(180deg, #241f1b, #211c18); }
.item .ic .vi, .slot .ic .vi, .aicon .vi { filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
@media (prefers-reduced-motion: reduce) { .bar.big .bar-fill::after, .card.current, .tele, .ab.up, .splat { animation: none; } }

.dollwrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; } .dollwrap .slots { flex: 1 1 260px; min-width: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); } .dollwrap .slot { overflow-wrap: anywhere; }
.doll { background: radial-gradient(ellipse at 50% 85%, rgba(230,184,74,.18), transparent 60%), var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: grid; place-items: center; }
.pd.pdmini { vertical-align: middle; margin-right: 2px; }
.nearby { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0; } .nearby .npc { display: inline-flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--dim); }

.chattabs { display: flex; gap: 3px; flex-wrap: wrap; margin-bottom: 6px; }
.ctab { background: var(--card2); color: var(--dim); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 12px; cursor: pointer; position: relative; }
.ctab.on { color: var(--gold); border-color: var(--gold); } .ctab i { font-style: normal; background: var(--red); color: #fff; border-radius: 999px; font-size: 12px; padding: 0 4px; margin-left: 4px; }
.chatlog { max-height: 220px; overflow-y: auto; font-size: 12px; } .fl b { color: #b9c4d6; font-weight: 600; } .fl.me b { color: var(--gold); } .fl.sys { color: var(--dim); font-style: italic; }
.groupbar { margin-bottom: 6px; } .groupbar .itag a { color: var(--red); cursor: pointer; margin-left: 2px; }
.preview .kv { flex-wrap: wrap; }
.grid2 > .card { min-width: 0; }
#content .preview .kv > b { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
#winscription { width: 100%; max-width: 100%; box-sizing: border-box; margin-top: 8px; }
#wname, #winscription { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; width: 100%; box-sizing: border-box; }

.battle { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); display: block; margin: 6px 0; background: #1a1f2e; }
.vi-inline { vertical-align: -0.2em; margin: 0 1px; }
.ico .vi-accent { }

/* ---- audit polish ---- */
.card h3 + .row, .card h3 { margin-top: 10px; } .card > h3:first-child { margin-top: 0; }
.fname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fighter .bar.sm { height: 6px; }
.mrow { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.mrow .mname small { display: block; font-size: 12px; } .mrow .mprice { font-weight: 700; white-space: nowrap; } .mrow .mbtns { display: flex; gap: 3px; }
.quest .bar { height: 10px; margin: 6px 0; }
.plots { margin-top: 10px; }
#sidebar button .vi { width: 20px; height: 20px; }
.item .ic { line-height: 0; margin-bottom: 4px; }
@media (max-width: 800px) {
  #topbar { flex-wrap: wrap; height: auto; padding: 6px 10px; gap: 8px; } .brand { font-size: 15px; } .hpwrap { width: 120px; } .tb.grow { display: none; }
  #sidebar { display: flex; flex-wrap: nowrap; white-space: nowrap; overflow-x: auto; padding: 4px 6px; max-height: none; gap: 2px; } #sidebar .navsec { display: inline-flex; flex-wrap: nowrap; gap: 2px; } #sidebar .navhead { display: none; } #sidebar button { width: auto; padding: 6px 8px; font-size: 12px; } #sidebar .lvl { margin-left: 4px; }
  #right { order: 3; } #content { order: 2; padding: 10px; } .minimap { display: none; }
  #sidebar { scrollbar-width: thin; -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent); }
}

.appear { display: grid; gap: 6px; } .arow { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; } .arow > span { min-width: 92px; color: var(--dim); font-size: 12px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; } .swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--gold); }

/* small icons: a faint light halo keeps dark silhouettes readable on dark cards */
svg.vi[width="14"], svg.vi[width="16"], svg.vi[width="18"] { filter: drop-shadow(0 0 0.8px rgba(255,236,200,.5)); }
.ico .vi-accent { filter: drop-shadow(0 0 1px #000); }

.worldwrap .wmctl { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; }
#worldmap { cursor: grab; max-width: none; max-height: none; }
/* skill action tiles: big art, chips, live progress, readable when locked */
.actions { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.card.action.tile { display: flex; gap: 12px; align-items: stretch; padding: 12px; }
.tileart { position: relative; flex: 0 0 84px; height: 84px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #3a3226, #1a1611 75%); border: 1px solid var(--line); box-shadow: inset 0 2px 6px rgba(0,0,0,.5); }
.tileart .vi { filter: drop-shadow(0 3px 3px rgba(0,0,0,.55)); }
.card.action.current .tileart { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(240,194,90,.25), inset 0 2px 6px rgba(0,0,0,.5); }
.tprog { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 6px; border-radius: 3px; background: rgba(0,0,0,.6); overflow: hidden; }
.tprog-fill { height: 100%; width: 0; background: linear-gradient(90deg, #d9a93a, #f2d27a); }
.lvbadge, .lockbadge { position: absolute; top: -6px; left: -6px; font-size: 12px; font-weight: 800; padding: 2px 6px; border-radius: 8px; background: #2a241c; border: 1px solid var(--line); color: var(--dim); display: inline-flex; gap: 3px; align-items: center; }
.lockbadge { background: #3a1f1c; color: #f0b0a8; border-color: #6a3a34; }
.tbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tname { font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; padding: 2px 7px; border-radius: 10px; background: #221d17; border: 1px solid var(--line); color: var(--dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.xp { color: #cdb6f0; }
.tile .out, .tile .cost { font-size: 12px; margin: 0; }
.tile .out .vi, .tile .cost .vi { width: 20px; height: 20px; }
.bar.mbar { height: 9px; border-radius: 5px; } .bar.mbar .bar-fill { background: linear-gradient(90deg, #3f8f6a, #63c790); }
.tile .btn { margin-top: auto; align-self: flex-start; }
.card.action.tile.locked { opacity: 1; filter: saturate(.35); } .card.action.tile.locked .tileart .vi { opacity: .55; } .card.action.tile.locked .tname { color: var(--dim); }
.bar.xp { height: 22px; }
@media (max-width: 560px) { .tileart { flex-basis: 64px; height: 64px; } .card.action.tile { padding: 10px; gap: 10px; } }
/* notification lane: drops and notes share one place that never covers the page */
#lane { display: flex; flex-direction: column; gap: 5px; }
#lane:empty { display: none; }
/* desktop: a fixed slot for three pop-ups, so the log and chat below never jump when they come and go */
@media (min-width: 801px) { #lane, #lane:empty { display: flex; height: 116px; overflow: hidden; flex: none; } }
.drop { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 10px; background: #1e1913; border: 1px solid #4a3f2e; font-size: 13px; transform: translateY(-6px); opacity: 0; transition: transform .2s ease-out, opacity .2s; }
.drop.show { transform: none; opacity: 1; } .drop.out { opacity: 0; }
.drop.note { display: block; font-weight: 600; line-height: 1.35; } /* a sentence, not a row of flex items */ .drop.note.good { border-color: #4f8a42; } .drop.note.bad { border-color: #8a3a34; }
.drop .dn { color: var(--dim); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop .dq { font-weight: 800; color: #f2d27a; margin-left: auto; padding-left: 6px; }
.drop.bump .dq { animation: dropbump .3s ease-out; } @keyframes dropbump { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
@media (max-width: 800px) { #lane { position: fixed; right: 8px; bottom: 62px; z-index: 72; max-width: 46vw; pointer-events: none; } #lane .drop .dn { max-width: 22vw; } .drop { font-size: 12px; padding: 5px 10px 5px 6px; background: rgba(24,20,15,.95); } }
/* level-up fanfare */
.levelup { text-align: center; padding: 6px 12px 4px; min-width: 280px; }
.lvburst { width: 124px; height: 124px; margin: 4px auto 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(240,194,90,.45), rgba(240,194,90,0) 68%); animation: lvpulse 1.4s ease-out 1; }
@keyframes lvpulse { 0% { transform: scale(.4); opacity: 0; } 55% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
.lvtitle { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.lvnum { font-size: 34px; font-weight: 900; color: #f2d27a; text-shadow: 0 2px 12px rgba(240,194,90,.4); margin-bottom: 8px; }
.lvun { text-align: left; margin: 8px auto 12px; max-width: 320px; display: flex; flex-direction: column; gap: 6px; }
.lvun b { color: var(--green); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.lvitem { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: #221d17; border: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .lvburst, .drop.bump .dq { animation: none; } .drop { transition: none; } }
/* getting-started guide */
.guide { border-color: #8a6f2e; background: linear-gradient(180deg, #2c2416, #1e1912); box-shadow: 0 0 0 1px rgba(240,194,90,.15), 0 6px 18px rgba(0,0,0,.35); }
.guide.hidden, .goals.hidden { display: none; }
.guide .gtop { display: flex; justify-content: space-between; align-items: center; }
.guide .gstep { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #d9b45a; font-weight: 800; }
.guide .gtitle { display: block; font-size: 16px; margin: 4px 0 2px; }
.guide p { margin: 2px 0 8px; font-size: 13px; }
.gdots { display: flex; gap: 5px; margin-bottom: 8px; } .gdots span { width: 18px; height: 5px; border-radius: 3px; background: #3a3226; } .gdots span.d { background: #6fb35a; } .gdots span.c { background: #f2d27a; }
#sidebar button.spot { position: relative; box-shadow: 0 0 0 2px #f2d27a, 0 0 14px rgba(242,210,122,.55); animation: spotpulse 1.4s ease-in-out infinite; border-radius: 8px; }
@keyframes spotpulse { 50% { box-shadow: 0 0 0 2px #f2d27a, 0 0 4px rgba(242,210,122,.2); } }
@media (max-width: 800px) { #content > #guide { position: static; inset: auto; z-index: auto; width: auto; max-width: none; max-height: none; overflow: visible; margin: 0 0 12px; } }
@media (prefers-reduced-motion: reduce) { #sidebar button.spot { animation: none; } }
/* combat: focused encounter + regions */
.card.encounter { display: flex; gap: 16px; align-items: stretch; border-color: #8a3a34; background: linear-gradient(180deg, #2a1a17, #1c1512); }
.encart { position: relative; flex: 0 0 132px; height: 132px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 45%, #4a2a24, #1a1210 75%); border: 1px solid #5a342e; }
.encart .vi { filter: drop-shadow(0 4px 4px rgba(0,0,0,.6)); }
.lvbadge.elite { color: #f2d27a; border-color: #8a6f2e; }
.encbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.enchead b { font-size: 18px; }
.encdrops, .drops { display: flex; flex-wrap: wrap; gap: 6px; }
.edrop { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 6px 2px; border-radius: 8px; background: #221d17; border: 1px solid var(--line); min-width: 44px; }
.edrop small { font-size: 12px; color: var(--dim); } .edrop.sm { min-width: 36px; padding: 3px 4px 1px; }
.encounter .btn { align-self: flex-start; }
.zonehead { display: flex; flex-wrap: wrap; min-width: 0; align-items: center; gap: 8px; padding: 10px 12px; margin: 8px 0 4px; border-radius: 10px; background: #1e1a14; border: 1px solid var(--line); cursor: pointer; user-select: none; }
.zonehead:hover { border-color: #6a5a3e; } .zonehead.open { background: #262017; border-color: #6a5a3e; }
.zonehead .chev { flex: 0 0 12px; color: var(--dim); } .zonehead > b { min-width: 0; overflow-wrap: anywhere; }
.camphead { margin: 10px 0 6px; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.mon .aicon { width: 56px; } .mon .chips { margin-top: 3px; }
@media (max-width: 560px) { .card.encounter { flex-direction: column; } .encart { flex-basis: auto; height: 110px; } }
/* mobile pinned activity bar */
#mobbar { display: none; }
@media (max-width: 800px) {
  #mobbar { display: flex; align-items: center; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 75; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(22,18,14,.97); border-top: 1px solid #4a3f2e; box-shadow: 0 -4px 14px rgba(0,0,0,.45); }
  #mobbar .mbt { flex: 1; min-width: 0; } #mobbar .mbt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; } #mobbar .bar { margin-top: 4px; }
  html, body { height: auto; min-height: 100%; } body { padding-bottom: 64px; } html { scroll-padding-bottom: 64px; } /* auto height so the padding lands after the content, clear of the pinned bar */
  #guide { bottom: 66px; }
}
/* guide minimised to a chip */
.guide.min { padding: 6px 10px; }
.gchip { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; } .gchip b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .gchip .chev { color: var(--dim); }
@media (max-width: 800px) { #guide.min { right: auto; max-width: 50vw; } }
#content .btn.spot { box-shadow: 0 0 0 2px #f2d27a, 0 0 16px rgba(242,210,122,.6); animation: spotpulse 1.4s ease-in-out infinite; }
.drop.lvnote b { color: #f2d27a; }
/* art never below ~22px in content: item tags, unlocks, rooms, quest rewards */
#content .itag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; }
#content .itag svg { width: 22px; height: 22px; }
#content .milestones .ms svg { width: 22px; height: 22px; vertical-align: middle; }
#content .room { width: 34px; height: 34px; } #content .room svg { width: 26px; height: 26px; }
#content .quest .itag svg { width: 24px; height: 24px; }
details.help { margin: 6px 0 0; } details.help summary { cursor: pointer; color: var(--dim); font-size: 12px; list-style: none; display: inline-flex; align-items: center; gap: 4px; } details.help summary::before { content: '?'; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); font-size: 12px; font-weight: 800; } details.help[open] summary { color: var(--text); } details.help p { font-size: 12px; margin: 6px 0 0; }
.skilldesc { margin: 4px 0 8px; }
/* collection log */
.coltabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin: 8px 0; }
.coltab { position: relative; display: flex; flex-direction: column; gap: 4px; align-items: stretch; text-align: left; padding: 10px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.coltab.on { border-color: #8a6f2e; background: #262017; } .coltab span { font-size: 12px; color: var(--dim); }
.coltab .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #f2d27a; box-shadow: 0 0 8px #f2d27a; }
.colsteps { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; margin-top: 10px; }
.colstep { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; padding: 8px; border-radius: 8px; background: #1c1812; border: 1px solid var(--line); font-size: 12px; }
.colstep.ok { border-color: #6a5a2e; } .colstep.claimed { opacity: .6; } .colstep b { font-size: 15px; }
.colgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; margin: 6px 0 10px; }
.coltile { height: 48px; display: grid; place-items: center; border-radius: 8px; background: #17130f; border: 1px solid #2c261e; }
.coltile:not(.got) svg { filter: brightness(0) opacity(.35); }
.coltile.got { background: #211c15; border-color: #4a3f2e; }
/* bounty board */
.card.board { border-color: #6a5a2e; }
.board h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.pill.seals { display: inline-flex; align-items: center; gap: 4px; color: #d8c0f0; }
.bcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-top: 8px; }
.bhead { margin-bottom: 6px; }
.bounty { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border-radius: 10px; background: #1c1812; border: 1px solid var(--line); }
.bounty.ready { border-color: #8a6f2e; box-shadow: 0 0 0 1px rgba(242,210,122,.2); } .bounty.done { opacity: .55; }
.bic { flex: 0 0 48px; height: 48px; display: grid; place-items: center; border-radius: 8px; background: #231d16; }
.bbody { flex: 1; min-width: 0; } .bbody b { display: block; font-size: 13px; } .bbody .bar { margin: 4px 0 2px; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 8px; margin-top: 8px; }
.sitem { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; background: #1c1812; border: 1px solid var(--line); } .sitem > div { flex: 1 1 120px; min-width: 0; overflow-wrap: anywhere; } .sitem > button { margin-left: auto; }
.recs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; } .rec { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: #1c1812; border: 1px solid var(--line); } .rec b { font-size: 16px; }
/* achievement skill tracks */
.tracks { display: flex; flex-direction: column; gap: 4px; }
.trow { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; } .trow:nth-child(odd) { background: #1c1812; }
.tsk { flex: 0 0 170px; display: inline-flex; align-items: center; gap: 6px; }
.medal { display: inline-flex; flex-direction: column; align-items: center; width: 48px; } .medal small { font-size: 12px; color: var(--dim); }
.medal:not(.got) svg { filter: grayscale(1) brightness(.45); } .medal.got small { color: #f2d27a; }
@media (max-width: 560px) { .tsk { flex-basis: 110px; } .medal { width: 40px; } }
.qicon { position: relative; display: inline-block; line-height: 0; } .qicon .qb { position: absolute; right: -4px; bottom: -4px; background: #1b1712; border-radius: 50%; padding: 1px; line-height: 0; box-shadow: 0 0 0 1px #6a5a2e; }
.perk { margin-top: 3px; font-size: 12px; color: #f2d27a; display: flex; align-items: center; gap: 4px; }
.seedsel { background: #1c1812; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; max-width: 100%; }
.plantall { margin: 6px 0 10px; gap: 8px; }
.skf { gap: 6px; margin: 6px 0 10px; flex-wrap: wrap; align-items: center; } .skf .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; } .skf .dim { margin-left: auto; }
.trades { display: grid; gap: 6px; margin: 4px 0 12px; } .trade { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; flex-wrap: wrap; } .trade .row { gap: 4px; }
.goals h4 { margin: 0 0 6px; } .goal { display: flex; gap: 10px; align-items: center; padding: 6px 4px; border-radius: 8px; cursor: pointer; } .goal + .goal { border-top: 1px solid var(--line); } .goal:hover { background: var(--card2); }
.goal .gic { flex: 0 0 30px; display: flex; justify-content: center; } .goal b { display: block; font-size: 13px; } .goal .gk { color: var(--gold); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; } .goal .gain { color: var(--good, #7bd88f); font-size: 12px; }
.diffs { gap: 4px; margin: 6px 0; flex-wrap: wrap; align-items: center; } .diffs .dim { margin-left: 4px; }
.pill.diff1 { border-color: #d98c3a; color: #f0a95a; } .pill.diff2 { border-color: #c05be0; color: #d98af0; }
.modalbox.locked .close { display: none; }
/* title screen */
.titlescreen { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(18,16,14,.55), rgba(10,9,8,.92)); backdrop-filter: blur(3px); }
.titlescreen .tbox { text-align: center; padding: 36px 44px; background: rgba(34,30,26,.92); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.5); max-width: 92vw; }
.titlescreen .tlogo { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 44px; font-weight: 800; color: var(--gold); letter-spacing: .02em; }
.titlescreen .tsub { color: var(--dim); margin: 6px 0 22px; } .titlescreen .tbtns { display: flex; flex-direction: column; gap: 10px; align-items: stretch; min-width: 240px; margin: 0 auto; max-width: 280px; }
.titlescreen .btn.big { font-size: 17px; padding: 12px 18px; } .titlescreen .tsave { color: var(--text); margin: 18px 0 4px; font-size: 13px; } .titlescreen .tver { color: var(--dim); font-size: 12px; margin: 10px 0 0; }
/* colour-blind friendly palette: blue/orange replace green/red */
body.cb { --green: #4aa3ff; --red: #ff9a3c; }
body.cb .bar.hp .bar-fill { background: linear-gradient(90deg, #2f78c4, #5aa9ff); } body.cb .bar.hp.mon .bar-fill { background: linear-gradient(90deg, #c46a1f, #ff9a3c); }
.mini:disabled { opacity: .4; cursor: not-allowed; }
/* keyboard access */
.skiplink { position: absolute; left: 8px; top: -40px; z-index: 1000; background: var(--gold); color: #1b1712; padding: 6px 12px; border-radius: 6px; font-weight: 700; }
.skiplink:focus { top: 8px; } #content:focus { outline: none; } [role="button"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* the minimap scales with the map canvas so a narrow map (large text, small window) stays visible */
.minimap { width: min(180px, 26%); height: auto; aspect-ratio: 3 / 2; }
.danger { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); gap: 10px; align-items: center; } .chatnote { margin: -2px 0 6px; font-size: 12px; }
/* dark scrollbars (desktop app and Chromium browsers; Firefox uses scrollbar-color) */
* { scrollbar-color: #4a4138 transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: #4a4138; border-radius: 6px; border: 2px solid var(--bg2); } ::-webkit-scrollbar-thumb:hover { background: #5d5246; }
.ll.warn { color: #d8b27a; } .lln { color: var(--dim); font-size: 12px; margin-left: 4px; }
.mini.danger-btn { border-color: var(--red); color: #ff9c9c; }
/* players who ask their system for less motion get instant transitions */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
#modal { z-index: 950; } /* above the title screen (credits, confirmations) */
#toasts { z-index: 960; }
.pad-mode :focus { outline: 3px solid var(--gold) !important; outline-offset: 2px; box-shadow: 0 0 0 6px rgba(230,184,74,.25); }
.holdbtn { position: relative; overflow: hidden; margin-top: 6px; } .holdbtn::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.3); transform: scaleX(0); transform-origin: left; }
.holdbtn.holding::after { transform: scaleX(1); transition: transform var(--hold, 1.5s) linear; }
/* danger estimate badges on dungeons and monsters */
.pill.risk.r0 { border-color: #5aa870; color: #8fd6a2; } .pill.risk.r1 { border-color: #d9a53a; color: #f0c46a; } .pill.risk.r2 { border-color: #d0544a; color: #f08a80; }
/* starter chapter card and quest filters */
.card.chapter .csteps { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.cstep { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; border: 1px solid var(--line); color: var(--dim); background: var(--card2); }
.cstep.done { background: var(--gold); border-color: var(--gold); color: #1a1408; }
.cstep.now { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 2px rgba(230, 190, 90, .25); }
.qfilters { gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.qfilters small { opacity: .7; margin-left: 2px; }
/* later systems stay in the sidebar but quiet until your level reaches them */
#sidebar button.later > span:first-child { opacity: .5; }
#sidebar .soon { margin-left: 6px; flex-shrink: 0; align-self: center; white-space: nowrap; font-size: 10px; line-height: 15px; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 0 5px; }
body.cb .pill.risk.r0 { border-color: #4aa3ff; color: #8cc4ff; } body.cb .pill.risk.r2 { border-color: #ff9a3c; color: #ffbd80; }
/* membership */
.mperks { margin: 6px 0 10px; padding-left: 20px; display: grid; gap: 6px; }
.mbanner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-color: var(--gold); background: linear-gradient(90deg, rgba(230,184,74,.12), transparent); }
.mbanner .btn { margin-left: auto; }
#sidebar .mlock { font-style: normal; opacity: .9; }


/* Guide targets retain the artwork's original inline size. */
.guide-target { display:inline-flex; vertical-align:middle; align-items:center; cursor:help; }
.guide-target:focus-visible { outline:2px solid var(--gold); outline-offset:3px; border-radius:3px; }
.wiki-link { display:block; padding:10px; color:var(--gold); border:1px solid var(--line); border-radius:7px; margin:8px 0; }
#navtoggle { display:none; }
@media(max-width:800px) {
  #app { min-width:0; } #topbar { min-width:0; padding:6px; gap:6px; flex-wrap:wrap; height:auto; min-height:52px; }
  #navtoggle { display:block; min-height:44px; }
  #sidebar { display:none; mask-image:none; -webkit-mask-image:none; }
  body.nav-open #sidebar { display:flex; flex-wrap:wrap; white-space:normal; max-height:55vh; overflow:auto; }
  body.nav-open #sidebar .navsec { display:contents; }
  body.nav-open #sidebar button { flex:1 1 145px; min-height:44px; font-size:13px; }
  #sidebar .wiki-link { flex-basis:100%; }
  #content,#right { min-width:0; } .actions { grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); }
  .btn,.mini { min-height:38px; } .battle { width:100%; max-width:100%; }
  .guide-target { scroll-margin:80px; }
}

/* Solo active dungeon floor plan; the auto-run panel keeps its original room strip. */
.solo-crawl { margin: 10px 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--card2); }
.solo-crawl-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.solo-crawl-heading b { display: inline-flex; align-items: center; gap: 6px; }
.solo-crawl-scroll { overflow-x: auto; margin: 10px 0 8px; padding: 2px 2px 8px; }
.solo-crawl-map { display: grid; grid-template-columns: repeat(var(--crawl-cols), minmax(78px, 1fr)); grid-template-rows: repeat(3, 75px); gap: 8px; min-width: max-content; }
.solo-crawl-room { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 78px; padding: 5px; color: var(--text); background: #27231f; border: 1px solid #6a5844; border-radius: 7px; cursor: pointer; }
.solo-crawl-room small { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.solo-crawl-room:disabled { opacity: .62; cursor: default; }
.solo-crawl-room.here { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: #393124; opacity: 1; }
.solo-crawl-room.cleared { border-color: #547b61; }
.solo-crawl-room.elite { border-color: #a56f4d; }
.solo-crawl-room:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.solo-crawl-icon { line-height: 1; }
.solo-crawl-mark { position: absolute; right: 3px; top: 2px; line-height: 1; }
.solo-crawl .row { display: flex; flex-wrap: wrap; gap: 8px; }

/* On narrow screens the starter guide is a real page section, so it cannot
   cover map, combat, or action controls. The rest of the rail follows content. */
@media (max-width: 800px) {
  #right { display: contents; }
  #right > #guide {
    position: static;
    order: 2;
    width: auto;
    max-width: none;
    max-height: none;
    overflow: visible;
    margin: 8px 10px 0;
  }
  #right > #guide.min { width: auto; max-width: none; }
  #content > #guide.min { width:auto; max-width:none; }
  #content { order: 3; }
  #right > :not(#guide) { order: 4; margin: 0 10px 10px; min-width: 0; }
  #right > #lane { margin: 0; }
  #right > #floaty { display: none; }
  .abilities { gap: 7px; }
  .ab { min-height: 48px; min-width: 0; }
}
:where(button, a, input, select, textarea, summary, [tabindex="0"]):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (max-width: 360px) {
  #save-status-detail { display:none; }
  .maphead > .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .maphead > .row > .btn { min-height: 44px; }
  .maphead > .row > .dim { grid-column: 1 / -1; }
}

/* Combat is sized by its rail, which stays narrow on desktop as well as phones. */
#activity { container-type: inline-size; }
#activity .battle { max-width: 480px; margin: 8px auto 12px; }
#activity .fighters {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
#activity .fighters .vs { display: none; }
#activity .fighter {
  min-width: 0;
  padding: 9px;
  border: 1px solid #5d5040;
  border-radius: 9px;
  background: linear-gradient(180deg, #302921, #25211d);
}
#activity .fighter:last-child { border-color: #70443d; background: linear-gradient(180deg, #302420, #251d1b); }
#activity .fighter .fname {
  min-width: 0;
  height: auto;
  min-height: 25px;
  margin-bottom: 6px;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  line-height: 1.25;
}
#activity .fighter .fname svg { vertical-align: middle; }
#activity .fighter .bar { width: 100%; }
#activity .fighter .bar-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#activity .abilities { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
#activity .ab { min-width: 0; min-height: 52px; padding: 6px 3px; }
#activity .ab .nm { text-align: center; line-height: 1.2; overflow-wrap: anywhere; }
#activity > .row:last-child { gap: 8px; }
#activity > .row:last-child .btn { min-height: 44px; flex: 1 1 115px; white-space: normal; }
@container (min-width: 520px) {
  #activity .fighters { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; }
  #activity .fighters .vs { display: block; align-self: center; }
}
@container (max-width: 330px) {
  #activity .abilities { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #activity > .row:last-child .stop { flex-basis: 100%; }
}

/* The small-screen navigation uses the same warm ink and parchment as guide cards. */
@media (max-width: 800px) {
  #navtoggle {
    color: #f2d27a;
    background: linear-gradient(180deg, #3a3024, #29231c);
    border: 1px solid #80693f;
    border-radius: 7px;
    padding-inline: 12px;
  }
  body.nav-open #navtoggle { background: #59452a; box-shadow: inset 0 0 0 1px #b29251; }
  body.nav-open #sidebar {
    gap: 5px;
    padding: 10px;
    background: linear-gradient(180deg, #2c251b, #1c1916);
    border-block: 1px solid #75603d;
    box-shadow: inset 0 1px 0 rgba(240,194,90,.12);
  }
  body.nav-open #sidebar .navhead {
    display: block;
    flex: 1 0 100%;
    margin: 8px 2px 0;
    color: #d9b45a;
  }
  body.nav-open #sidebar button {
    color: var(--text);
    background: #29231d;
    border: 1px solid #504434;
    border-radius: 7px;
    gap: 6px;
  }
  body.nav-open #sidebar button.on {
    color: #f2d27a;
    border-color: #b29251;
    background: #41321f;
  }
}

@media (max-width: 800px) {
  body.nav-open #sidebar button.later > span:first-child { opacity: .8; }
  body.nav-open #sidebar .soon { color: #c8bba6; }
}

/* Progression panels keep the next meaningful choice visible. */
@media (max-width: 800px) {
  #right > #goals { order: 2; width: auto; margin: 8px 10px 0; }
}
#goals .goal.primary, #goals .goal:first-of-type {
  margin: 2px 0 8px;
  padding: 10px;
  background: linear-gradient(180deg, #342a1d, #29221a);
  border: 1px solid #947343;
  border-radius: 9px;
}
#goals .goal.side { padding: 8px 6px; }
#goals .goal:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* Show the cost and result before a long nine-step configuration on narrow panes. */
@media (max-width: 1100px) {
  #content .grid2:has(> .preview) { display: flex; flex-direction: column; }
  #content .grid2:has(> .preview) > .preview { order: -1; }
}
@media (min-width: 1101px) {
  #content .grid2:has(> .preview) > .preview { position: sticky; top: 12px; align-self: start; }
}
/* Requirements remain readable while unavailable content is being previewed. */
#content .card.locked { opacity: 1; border-style: dashed; border-color: #625542; background: #211d18; }
#content .card.locked .dim { color: #b5a994; }

/* The long power comparison needs its full line before the value. */
#content .preview .ahead + .kv { display: block; padding: 8px 0; }
#content .preview .ahead + .kv > span,
#content .preview .ahead + .kv > b { display: block; max-width: 100%; }
#content .preview .ahead + .kv > b { margin-top: 3px; }


/* Expeditions: keep each mission readable and its companion choices easy to tap. */
#content .expedition-missions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  align-items: start;
}
#content .expedition-missions > .card { min-width: 0; }
#content .expedition-missions .ahead > div { min-width: 0; }
#content .expedition-missions .row.left { align-items: stretch; gap: 8px; }
#content .expedition-missions .row.left > button {
  flex: 1 1 150px;
  min-width: 0;
  min-height: 44px;
  white-space: normal;
  text-align: left;
  overflow-wrap: anywhere;
}
#content .expedition-missions .row.left > button:disabled { opacity: 1; color: #b7a88c; background: #2b2621; border-color: #514436; }


#content .expedition-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: linear-gradient(160deg, #253039, #1d252c);
  border-color: #4b6574;
}
#content .expedition-filters label {
  display: grid;
  gap: 5px;
  color: #d8bf8d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
}
#content .expedition-filters select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  color: var(--text);
  background: #191714;
  border: 1px solid #66543e;
  border-radius: 7px;
  padding: 8px 10px;
}
#content .expedition-missions .expedition-choice { flex: 1 1 150px; min-width: 0; }
#content .expedition-missions .expedition-choice > button {
  display: block;
  width: 100%;
  min-height: 44px;
  white-space: normal;
  text-align: left;
  overflow-wrap: anywhere;
}
#content .expedition-missions .expedition-lock {
  display: block;
  margin: 5px 1px 0;
  color: #b8ab94;
  line-height: 1.25;
}
@media (max-width: 1100px) {
  #content .expedition-filters { grid-template-columns: 1fr; gap: 10px; }
  #content .expedition-missions .row.left { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


#goals .goal { flex-wrap: wrap; }
#goals .goal .goal-priority {
  flex: 0 0 100%;
  margin: 0 0 -2px;
  padding-left: 40px;
  color: #c9b28b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}
#goals .goal.primary .goal-priority { color: #e7c56d; }
#goals .goal .gic + div { flex: 1 1 0; min-width: 0; }


#content .expedition-missions .expedition-choice > button:disabled { opacity: 1; color: #b7a88c; background: #2b2621; border-color: #514436; }

.card.board .bcols > div { min-width: 0; }
.card.board .bounty { min-width: 0; }
.card.board .bounty > div { min-width: 0; overflow-wrap: anywhere; }
/* Long resistance summaries must wrap in the narrow character column. */
#content .kv[data-guide="guide:resistances"] { flex-wrap: wrap; }
#content .kv[data-guide="guide:resistances"] > b { white-space: normal; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }


/* Character ledger: distinct reading surfaces for vitals, battle, wards and gear. */
#content .character-layout { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; }
#content .character-layout > .card { min-width: 0; }
#content .character-sheet {
  background: linear-gradient(160deg, #232923, #1d211e 62%, #1b1e1a);
  border-color: #48544a;
  box-shadow: inset 0 1px rgba(226, 232, 207, .06);
}
#content .char-sheet-head { border-bottom: 1px solid #4d594c; padding-bottom: 9px; margin-bottom: 12px; }
#content .char-sheet-head h2 { margin: 2px 0 0; font-size: 19px; line-height: 1.2; color: #f1e7cd; }
#content .char-kicker { color: #a6bc9d; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
#content .char-vitals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 10px; }
#content .char-vital { min-width: 0; padding: 10px 8px; background: #18231d; border: 1px solid #3e5947; border-radius: 8px; }
#content .char-vital.health { background: #1b2b22; border-color: #55765a; }
#content .char-vital span { display: block; color: #c3ceb9; font-size: 11px; line-height: 1.2; }
#content .char-vital strong { display: block; margin-top: 4px; color: #e3efd9; font-size: 20px; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#content .char-vital strong small { color: #bacbb5; font-size: 11px; font-weight: 500; white-space: nowrap; }
#content .char-section { min-width: 0; margin-top: 11px; padding: 11px; border-radius: 9px; border: 1px solid #414740; background: rgba(10, 13, 11, .22); }
#content .char-section h3, #content .char-extras h3 { margin: 0 0 9px; color: #e8dfc8; font-size: 14px; }
#content .char-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
#content .char-fact { min-width: 0; padding: 7px 8px; background: rgba(10, 11, 10, .26); border-left: 2px solid #677765; border-radius: 3px 7px 7px 3px; }
#content .char-fact span { display: block; color: #b5bdaf; font-size: 11px; line-height: 1.3; overflow-wrap: anywhere; }
#content .char-fact b { display: block; color: #f0e9d9; margin-top: 3px; font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#content .char-wards { background: linear-gradient(140deg, #222538, #1b1e2b); border-color: #505577; }
#content .char-wards h3 { color: #d9d9f2; }
#content .ward-grid, #content .stat-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 0; }
#content .ward-chip, #content .stat-chip { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; min-width: 0; padding: 7px 8px; border-radius: 6px; }
#content .ward-chip { background: rgba(7, 9, 22, .45); border: 1px solid #484b68; }
#content .ward-chip.fire { border-left: 3px solid #dd7456; }
#content .ward-chip.frost { border-left: 3px solid #75b9d8; }
#content .ward-chip.poison { border-left: 3px solid #83b977; }
#content .ward-chip.lightning { border-left: 3px solid #d6bd69; }
#content .ward-chip dt, #content .stat-chip dt { color: #c8c8db; font-size: 11px; overflow-wrap: anywhere; }
#content .ward-chip dd, #content .stat-chip dd { margin: 0; color: #f5eef0; font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
#content .char-gear { background: linear-gradient(145deg, #1c2a30, #1a2228); border-color: #43606c; }
#content .char-gear h3 { color: #d2e7ed; }
#content .stat-chip { background: #152127; border: 1px solid #3e5964; }
#content .stat-chip dt { color: #b7cbd0; }
#content .stat-chip dd { color: #e3f2f3; }
#content .char-set-bonus { display: grid; gap: 3px; margin-top: 9px; padding: 9px; border-radius: 6px; background: #293326; border: 1px solid #596447; }
#content .char-set-bonus b { color: #e7daa7; font-size: 12px; }
#content .char-set-bonus span { color: #c7c9ad; font-size: 11px; line-height: 1.35; }
#content .char-extras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
#content .char-extras section { min-width: 0; padding: 10px; border: 1px solid #414740; border-radius: 8px; background: rgba(10, 13, 11, .22); }
#content .char-extras section > div { color: #c8c7b7; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
#content .character-equipment { background: linear-gradient(160deg, #202a2f, #1b2227 58%, #1a2023); border-color: #425966; }
#content .character-equipment > h3:first-child { color: #d9e7ec; border-bottom: 1px solid #425966; padding-bottom: 10px; }
#content .character-equipment .slot { background: #202c34; border-color: #3c535d; }
#content .character-equipment .slot:hover, #content .character-equipment .slot:focus-visible { border-color: #8ab7c7; background: #273842; }
@media (max-width: 1100px) { #content .character-layout { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  #content .char-vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #content .char-vital:last-child { grid-column: 1 / -1; }
  #content .char-extras { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  #content .char-facts { grid-template-columns: 1fr; }
}


/* An index-like sidebar separates places, work and the player journal. */
#sidebar .navgroup { margin: 13px 8px 4px; padding: 5px 2px 3px; border-top: 1px solid #3d3b33; color: #adba9e; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
#sidebar .navgroup:first-child { margin-top: 2px; border-top: 0; }
#sidebar button.on { border-left-color: #e4b658; background: linear-gradient(90deg, #493b24, #30291e 75%, transparent); color: #ffdb7e; }
#sidebar button[aria-current="page"] { box-shadow: inset 0 0 0 1px rgba(232, 190, 97, .18); }
@media (max-width: 800px) {
  body.nav-open #sidebar .navgroup { flex: 1 1 100%; margin: 9px 4px 1px; }
}


/* Workbench brass and expedition slate signal different tasks without changing the game art. */
#content .preview { background: linear-gradient(155deg, #2e2b22, #211f1b 65%); border-color: #716146; box-shadow: inset 0 1px rgba(240, 220, 169, .08); }
#content .preview > h3:first-child { color: #f3dfae; border-bottom: 1px solid #625740; padding-bottom: 8px; }
#content .expedition-missions > .card { background: linear-gradient(160deg, #242c35, #1d232a); border-color: #435665; }
#content .expedition-missions > .card .ahead b { color: #e5e7df; }
#content .expedition-missions > .card .drops { border-color: #465561; }
/* On phones, gains occupy a real row beneath the header rather than covering controls. */
@media(max-width:800px){
 #right > #lane{position:static;order:1;right:auto;bottom:auto;max-width:none;width:calc(100% - 20px);margin:6px 10px 0;pointer-events:auto;z-index:auto}
 #right > #lane:empty{display:none}
 #lane .drop{max-width:100%;border-radius:5px}
 #lane .drop .dn{max-width:none;white-space:normal}
 #lane .reward-receipt{width:100%;background:#253326}
}

/* Keep scaled interfaces in the stacked layout when their effective viewport is narrow. */
body.scaled-narrow #app { display:flex; flex-direction:column; height:auto; }
body.scaled-narrow #topbar { order:0; }
body.scaled-narrow #navtoggle { display:block; min-height:44px; }
body.scaled-narrow #sidebar { order:1; display:none; flex-wrap:wrap; white-space:normal; max-height:55vh; overflow:auto; mask-image:none; -webkit-mask-image:none; }
body.scaled-narrow.nav-open #sidebar { display:flex; }
body.scaled-narrow.nav-open #sidebar .navsec { display:contents; }
body.scaled-narrow.nav-open #sidebar button { flex:1 1 145px; min-height:44px; font-size:13px; }
body.scaled-narrow #sidebar .wiki-link { flex-basis:100%; }
body.scaled-narrow #sidebar button { width:auto; }
body.scaled-narrow .navhead { width:100%; }
body.scaled-narrow #right { order:3; border-left:0; flex-direction:row; flex-wrap:wrap; }
body.scaled-narrow #right > .card { flex:1 1 100%; }
body.scaled-narrow #right .card:has(#feed) { display:none; }
body.scaled-narrow #right .card:has(#log) { flex-basis:100%; }
body.scaled-narrow #log { max-height:140px; }
body.scaled-narrow #content { order:2; }
body.scaled-narrow #right > #guide { order:3; }
body.scaled-narrow #content .character-layout { grid-template-columns:1fr; }
body.scaled-narrow #content .dollwrap .slots { grid-template-columns:repeat(3,minmax(0,1fr)); }


/* Targeted Fourth audit polish: visible mystery silhouettes and clearer economy estimates. */
.coltile { min-height: 76px; height: auto; padding: 5px 3px; grid-template-rows: 50px auto; gap: 2px; overflow: hidden; }
.coltile .colart { display: grid; place-items: center; width: 100%; height: 50px; }
.coltile .colart > * { max-width: 48px; max-height: 48px; }
.coltile.unknown { background: radial-gradient(ellipse at 50% 85%, #3e3328 0, #211c17 65%); border-color: #584832; }
.coltile.unknown .colart svg { filter: brightness(0) saturate(0) opacity(.82) drop-shadow(0 2px 2px #000); }
.coltile .collabel { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: var(--dim); }
.coltile.got .collabel { color: var(--text); }
.empty-slot-art { display: grid; place-items: center; min-height: 46px; color: #bca77c; background: radial-gradient(ellipse, #453d31 0, #2a2521 72%); border: 1px solid #514635; border-radius: 8px; }
.empty-slot-art svg { opacity: .9; filter: drop-shadow(0 2px 2px rgba(0,0,0,.65)); }
.market-sale-preview { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #1b1815; font-size: 12px; }
.market-sale-preview span:last-child { color: var(--gold); }
.seed-catalogue { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); gap: 8px; }
.seed-entry { display: flex; gap: 10px; align-items: center; min-width: 0; margin: 0; }
.seed-entry .seed-detail { display: grid; gap: 2px; min-width: 0; flex: 1; }
.seed-entry .seed-detail > div { font-size: 12px; }
.seed-entry .seed-detail > small { overflow-wrap: anywhere; }
.seed-entry.locked { opacity: .82; }
.expedition-lock { max-width: 360px; }
.token-controls { padding: 8px 10px; background: var(--card); border-radius: 8px; }
.token-head { margin-left: 12px; }
.combat-mode-card > .row > div:first-child { min-width: min(100%, 320px); }
.btn:disabled, .mini:disabled, select:disabled, input:disabled { opacity: .58; filter: grayscale(.65); cursor: not-allowed; }
.btn:disabled:hover, .mini:disabled:hover { filter: grayscale(.65); }
@media (max-width: 560px) {
  .market-sale-preview { display: grid; grid-template-columns: 1fr; gap: 3px; }
  .seed-entry { align-items: flex-start; }
  .coltile { min-height: 68px; grid-template-rows: 44px auto; }
  .coltile .colart { height: 44px; }
}

/* Keep content grids shrinkable at the smallest zoomed mobile CSS viewport. */
.party { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.plots { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.grid2 > * { min-width: 0; }
.mrow { grid-template-columns: 30px minmax(0,1fr) auto; }
.mrow .mbtns { grid-column: 2 / -1; flex-wrap: wrap; }
.grid2 .row.left > select { max-width: 100%; min-width: 0; }
.grid2 .row.left label { display: inline-flex; align-items: center; gap: 4px; }
.grid2 input[type="number"] { width: 84px; max-width: 100%; }
.coltile .collabel { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.15; }
.coltile { grid-template-rows: 50px auto; min-height: 76px; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 560px) { .coltile { grid-template-rows: 44px auto; min-height: 68px; } }
/* advert unit for free players (js/ads.js) */
.adcard { padding: 8px; min-height: 120px; } .adlabel { font-size: 11px; color: var(--dim); margin-bottom: 6px; } .adlabel a { color: var(--gold); }



/* online chat safety controls and form checkboxes */
.linkbtn { background: none; border: 0; padding: 0 2px; color: var(--dim); font: inherit; font-size: 11px; text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--gold); }
.fl .chatact { white-space: nowrap; opacity: .7; } .fl:hover .chatact, .fl:focus-within .chatact { opacity: 1; }
label.check { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: 13px; line-height: 1.35; margin: 6px 0; cursor: pointer; }
label.check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--gold); }
.reasons { display: grid; gap: 2px; margin: 8px 0; }

/* Phones: two top-bar rows. Menu, brand, gold and Save; then health, combat level, place and save status.
   The save detail line only shows when something needs attention. */
@media (max-width: 600px) {
  #topbar { row-gap: 4px; padding: 6px 8px; }
  #topbar::after { content: ''; order: 3; flex-basis: 100%; height: 0; }
  #navtoggle { order: 0; min-height: 40px; padding: 6px 12px; }
  #topbar .brand { order: 1; font-size: 16px; white-space: nowrap; } #topbar .brand > span:not(#brandico) { display: none; }
  #topbar .tb:has(#tb-gold) { order: 1; margin-left: auto; }
  #savebtn { order: 2; min-height: 40px; }
  #topbar .hpwrap, #tb-cl, #tb-loc, #save-status { order: 4; }
  #topbar .hpwrap { width: 96px; flex: 0 0 auto; }
  #tb-cl { white-space: nowrap; }
  #tb-loc { min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #save-status { flex: 0 1 auto; margin-left: auto; max-width: none; overflow: hidden; text-align: right; align-items: flex-end; }
  #save-status b { max-width: 100%; }
  #save-status-detail { display: none; } #save-status[data-tone="bad"] #save-status-detail { display: block; max-width: 100%; }
}
